Package java.awt

Examples of java.awt.Rectangle.grow()


                    return new Dimension(w, fontMetrics.getHeight() + MARGIN*2);
                }
            }, Direction.LEFTRIGHT);

            Rectangle area = layout.calcDrawingArea();
            area.grow(4,4); // give it a bit of margin
            BufferedImage image = new BufferedImage(area.width, area.height, BufferedImage.TYPE_INT_RGB );
            Graphics2D g2 = image.createGraphics();
            g2.setTransform(AffineTransform.getTranslateInstance(-area.x,-area.y));
            g2.setPaint(Color.WHITE);
            g2.fill(area);
View Full Code Here


    {
      // make sure the token is visible in the scroll window
      Rectangle start = m_editor.modelToView( token.start );
      Rectangle end = m_editor.modelToView( token.end );
      final Rectangle show = start.union( end );
      show.grow( start.width*10, start.height*6 );
      SwingUtilities.invokeLater( new Runnable( )
      {
        @Override
        public void run( )
        {
View Full Code Here

    {
      // Get the bounding rectangle
      Rectangle rect = new Rectangle(firstFigure.displayBox());

      // Enlarge by 100 pixel to prevent it from hanging in the corners
      rect.grow(50, 50);

      workspaceView.scrollRectToVisible(rect);

      return true;
    }
View Full Code Here

        nf.setSize(newX, newY);
      }
      else
      {
        Rectangle db = getAffectedFigure().displayBox();
        db.grow((newX - db.width) / 2, (newY - db.height) / 2);
        getAffectedFigure().displayBox(db);
      }
    }
  }
View Full Code Here

    Rectangle rect = new Rectangle(figure.displayBox());

    // Enlarge by 100 pixel to prevent it from hanging in the corners
    if (addEnlargement)
    {
      rect.grow(50, 50);
    }

    scrollRectToVisible(rect);
  }
View Full Code Here

    Rectangle r = ellipseBox();

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

    g.fillOval(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.drawOval(r.x, r.y, r.width - 1, r.height - 1);
      }
    }
  }
View Full Code Here

    {
      r = new Rectangle(r);

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

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

   * The display box equals the bounds of the spline enlarged by 30 pixels vertically and horizontally.
   */
  public Rectangle displayBox()
  {
    Rectangle r = getSplineBounds();
    r.grow(30, 30);
    return r;
  }

  public void basicDisplayBox(Point origin, Point corner)
  {
View Full Code Here

   */
  public int findSegment(int x, int y)
  {
    // quick'n'dirty check...
    Rectangle bounds = displayBox();
    bounds.grow(4, 4);
    if (!bounds.contains(x, y))
    {
      return -1;
    }

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.