Package java.awt

Examples of java.awt.Rectangle.grow()


    }

    @Override
    protected Rectangle calculateClientArea() {
        Rectangle result = new Rectangle(clientArea);
        result.grow(10, 10);
        return result;
    }
}
View Full Code Here


        MathTransform w2g = coverage.getGridGeometry().getCRSToGrid2D(PixelOrientation.UPPER_LEFT);
        // ROI in raster space
        ROI roi = new ROIGeometry(JTS.transform(geom, w2g));
        // Approximate bounds by expanding them by one (coordinates are taken with a 0.5 offset)
        Rectangle rect = roi.getBounds();
        rect.grow(1, 1);
        // No data value to use
        double nodata = CoverageUtilities.getBackgroundValues(coverage)[0];

        // Cycle on the image Bounds in order to search if No Data are present
        RenderedImage img = coverage.getRenderedImage();
View Full Code Here

      // LATER: Fix repaint region to be smaller
      if (repaint)
      {
        old = old.union(finderBounds);
        old.grow(3, 3);
        repaint(old);
      }
    }
  }
View Full Code Here

    if (isVisible())
    {
      // Updates the bounds of the component to draw the subhandlers
      if (handleBounds != null)
      {
        handleBounds.grow(1, 1);
        setBounds(handleBounds);
      }
      else
      {
        setBounds(graphComponent.getViewport().getVisibleRect());
View Full Code Here

  public void mark()
  {
    if (markedState != null)
    {
      Rectangle bounds = markedState.getRectangle();
      bounds.grow(3, 3);
      bounds.width += 1;
      bounds.height += 1;
      setBounds(bounds);

      if (getParent() == null)
View Full Code Here

        if (active && Main.pref.getBoolean("draw.data.downloaded_area", true) && !data.dataSources.isEmpty()) {
            // initialize area with current viewport
            Rectangle b = mv.getBounds();
            // on some platforms viewport bounds seem to be offset from the left,
            // over-grow it just to be sure
            b.grow(100, 100);
            Area a = new Area(b);

            // now successively subtract downloaded areas
            for (Bounds bounds : data.getDataSourceBounds()) {
                if (bounds.isCollapsed()) {
View Full Code Here

     * @param p2 Second point of the way segment.
     * @param showDirection <code>true</code> if segment direction should be indicated
     */
    protected void drawSegment(GeneralPath path, Point p1, Point p2, boolean showDirection) {
        Rectangle bounds = g.getClipBounds();
        bounds.grow(100, 100);                  // avoid arrow heads at the border
        LineClip clip = new LineClip(p1, p2, bounds);
        if (clip.execute()) {
            p1 = clip.getP1();
            p2 = clip.getP2();
            path.moveTo(p1.x, p1.y);
View Full Code Here

        GeneralPath onewayArrows = showOneway ? new GeneralPath() : null;
        GeneralPath onewayArrowsCasing = showOneway ? new GeneralPath() : null;
        Rectangle bounds = g.getClipBounds();
        if (bounds != null) {
            // avoid arrow heads at the border
            bounds.grow(100, 100);
        }

        double wayLength = 0;
        Point lastPoint = null;
        boolean initialMoveToNeeded = true;
View Full Code Here

        } else {
            b = BorderFactory.createBevelBorder(BevelBorder.RAISED);
        }
        Insets inset = b.getBorderInsets(mv);
        Rectangle r = new Rectangle(buttonRectangle);
        r.grow((inset.top+inset.bottom)/2, (inset.left+inset.right)/2);
        b.paintBorder(mv, g, r.x, r.y, r.width, r.height);

        String labelText = getText();
        if ((labelText != null) && showTextOrIcon && Main.pref.getBoolean("marker.buttonlabels", true)) {
            g.drawString(labelText, screen.x+4, screen.y+2);
View Full Code Here

        // Determine if mouse was clicked between column heads
        Rectangle headerRect = table.getTableHeader().getHeaderRect(vColIndex);
        if (vColIndex == 0) {
            headerRect.width -= 3;    // Hard-coded constant
        } else {
            headerRect.grow(-3, 0);   // Hard-coded constant
        }
        if (!headerRect.contains(evt.getX(), evt.getY())) {
            // Mouse was clicked between column heads
            // vColIndex is the column head closest to the click
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.