Package java.awt

Examples of java.awt.Rectangle.grow()


  public void invalidate()
  {
    if (listener() != null)
    {
      Rectangle r = displayBox();
      r.grow(Handle.HANDLESIZE + HANDLE_DISTANCE, Handle.HANDLESIZE + HANDLE_DISTANCE);
      listener().figureInvalidated(new FigureChangeEvent(this, r));
    }
  }

  public Vector handles()
View Full Code Here


  {
    willChange();

    // Adjust the display box to the new size
    Rectangle box = presentationFigure.displayBox();
    box.grow((w - box.width) / 2, (h - box.height) / 2);
    presentationFigure.displayBox(box);

    Rectangle iconRect = null;
    if (iconFigure != null)
    {
View Full Code Here

      if (resize)
      {
        int iconSize = Math.min(w, h);
        iconRect = new Rectangle(box.x + box.width / 2 - iconSize / 2, box.y + box.height / 2 - iconSize / 2, iconSize, iconSize);
        iconRect.grow(- iconSize / 6, - iconSize / 6);
      }
      else
      {
        Image image = ((SimpleImageFigure) iconFigure).getImage();
        int iw = image.getWidth(null);
View Full Code Here

    Rectangle textRect = null;
    if (fixedTitleFigure != null)
    {
      // Make the title text rectangle slightly smaller than the presentation figure
      textRect = new Rectangle(box);
      textRect.grow(- 5, - 5);
      fixedTitleFigure.displayBox(textRect);
    }

    positionOverlayFigure(box, iconRect, textRect);
View Full Code Here

    Rectangle r = box;

    if (frameDistance > 0 || frameCount > 1)
    {
      r = new Rectangle(r);
      r.grow(-frameDistance * frameCount, -frameDistance * frameCount);
    }

    g.fillRect(r.x, r.y, r.width, r.height);
  }

View Full Code Here

    {
      r = new Rectangle(r);

      for (int i = 1; i < frameCount; ++i)
      {
        r.grow(-frameDistance, -frameDistance);

        g.drawRect(r.x, r.y, r.width - 1, r.height - 1);
      }
    }
  }
View Full Code Here

  {
    double xRectCenter = rect.getWidth() / 2;
    double yRectCenter = rect.getHeight() / 2;

    Rectangle db = displayBox();
    db.grow(-1, -1);
    double xBoxCenter = db.getWidth() / 2;
    double yBoxCenter = db.getHeight() / 2;

    // This tedious if/else if construction determines in which
    // section of the rectangle we are
View Full Code Here

    else
    {
      r = new Rectangle();
    }

    r.grow(1, 1);

    return r;
  }

  //////////////////////////////////////////////////
View Full Code Here

      rect.y += (int) Math.round(Math.cos(alpha) * bobRadius) - (BOB_CIRCLE_SIZE / 2);

      bobEntries[i].setLocationOnGlassPanel(rect);

      Rectangle invalid = new Rectangle(rect);
      invalid.grow(10, 10);
      invalidateRect.add(invalid);
    }

    // Ensure that the bob box is entirely visible on the screen
    int xDiff = 0;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.