Package java.awt

Examples of java.awt.Rectangle.intersection()


              }
            }

            // calculate clipping intersection between global clip border and current cell rectangle
            Shape oldClip = grp.getClip();
            rec = rec.intersection((Rectangle)oldClip);

            // Paint the cell
            if (rec.width > 0 || rec.height > 0) {
              grp.setClip(rec);
              grp.translate(x, y);
View Full Code Here


    final int spaceOnX = Math.max(s.width - f.width, 0);
    final int spaceOnY = Math.max(s.height - f.height, 0);
    final int x = (int) (horizontalPercent * spaceOnX) + s.x;
    final int y = (int) (verticalPercent * spaceOnY) + s.y;
    frame.setBounds(x, y, f.width, f.height);
    frame.setBounds(s.intersection(frame.getBounds()));
  }

  /**
   * Positions the specified frame at a random location on the screen while ensuring that the entire frame is visible
   * (provided that the frame is smaller than the screen).
View Full Code Here

    // Paint background over the area between the selected tab and the
    // content area
    int selected = tabPane.getSelectedIndex();
    Rectangle r = getTabBounds(selected, calcRect);
    r = r.intersection(new Rectangle(x, y, width, height));
    // Find out the border width
    int bwidth = style.getBorder().getBorderInsets(tabPane).left;
    StyleUtil.fillBackground(style, g, r.x + bwidth, r.y,
        r.width - 2 * bwidth, r.height);
  }
View Full Code Here

                                              layout.getMinY(source),
                                              layout.getWidth(source),
                                              layout.getHeight(source));

            // Check for empty intersection.
            if(dstRect.intersection(sourceRect).isEmpty()) {
                throw new IllegalArgumentException(
                    JaiI18N.getString("AreaOpImage0"));
            }
        }
View Full Code Here

  // The default dest image area is the same as the source
  // image area.  However, when an ImageLayout hint is set,
  // this might be not true.  So the destRect should be the
  // intersection of the provided rectangle, the destination
  // bounds and the source bounds.
  destRect = destRect.intersection(s.getBounds());
        Rectangle srcRect = new Rectangle(destRect);
        srcRect.x -= getLeftPadding();
        srcRect.width += getLeftPadding() + getRightPadding();
        srcRect.y -= getTopPadding();
        srcRect.height += getTopPadding() + getBottomPadding();
View Full Code Here

        Rectangle imageBounds = getBounds();
        Rectangle tileBounds = new Rectangle(xmin, ymin,
                 getTileWidth(),
                 getTileHeight());
        tileBounds = tileBounds.intersection(imageBounds);

        Raster tile = getTile(i, j);

        Rectangle realTileBounds = new Rectangle(tile.getMinX(),
                     tile.getMinY(),
View Full Code Here

    public RandomIterFallback(RenderedImage im, Rectangle bounds) {
        this.im = im;

        Rectangle imBounds = new Rectangle(im.getMinX(), im.getMinY(),
                                           im.getWidth(), im.getHeight());
        this.boundsRect = imBounds.intersection(bounds);
        this.sampleModel = im.getSampleModel();

        int x = boundsRect.x;
        int y = boundsRect.y;
        int width = boundsRect.width;
View Full Code Here

            sampleModel, new Point(orgX, orgY));

        Rectangle rect = new Rectangle(orgX, orgY,
                                       sampleModel.getWidth(),
                                       sampleModel.getHeight());
        rect = rect.intersection(getBounds());

        int numBands = sampleModel.getNumBands();
        int p[] = new int[numBands];

        for (int y = rect.y; y < (rect.y + rect.height); y++) {
View Full Code Here

            sampleModel, new Point(orgX, orgY));

        Rectangle rect = new Rectangle(orgX, orgY,
                                       sampleModel.getWidth(),
                                       sampleModel.getHeight());
        rect = rect.intersection(getBounds());

        int numBands = sampleModel.getNumBands();
        int p[] = new int[numBands];

        for (int y = rect.y; y < (rect.y + rect.height); y++) {
View Full Code Here

            sampleModel, new Point(orgX, orgY));

        Rectangle rect = new Rectangle(orgX, orgY,
                                       sampleModel.getWidth(),
                                       sampleModel.getHeight());
        rect = rect.intersection(getBounds());

        int numBands = sampleModel.getNumBands();
        int p[] = new int[numBands];

        for (int y = rect.y; y < (rect.y + rect.height); y++) {
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.