Package java.awt

Examples of java.awt.Rectangle.intersection()


        // Increment dimensions (fix for 4643583).
        sourceRect.width += (int)invScaleX;
        sourceRect.height += (int)invScaleY;

        // Clamp rectangle to source bounds (fix for 4696977).
        return sourceRect.intersection(getSourceImage(0).getBounds());
    }

    /**
     * Subsample (and condense) the given rectangle by the specified scale.
     * The sources are cobbled.
View Full Code Here


        //
        // determine the source rectangle needed to compute the destRect
        //
        Rectangle srcRect = mapDestRect(destRect, 0);
        if (extender == null) {
            srcRect = srcRect.intersection(srcimg);
        } else {
            srcRect = srcRect.intersection(padimg);
        }

        if (srcRect.width <= 0 || srcRect.height <= 0) {
View Full Code Here

        //
        Rectangle srcRect = mapDestRect(destRect, 0);
        if (extender == null) {
            srcRect = srcRect.intersection(srcimg);
        } else {
            srcRect = srcRect.intersection(padimg);
        }

        if (srcRect.width <= 0 || srcRect.height <= 0) {
            // destRect backward mapped outside the source
      if (setBackground) {
View Full Code Here

        RenderedImage srci = (RenderedImage)sources.get(0);
        Rectangle destBounds = new Rectangle(srci.getMinX(),  srci.getMinY(),
                                             srci.getWidth(), srci.getHeight());                                            
        for ( int i = 0; i < numSources; i++ ) {
            srci = (RenderedImage)sources.get(i);
            destBounds = destBounds.intersection(new Rectangle(srci.getMinX(), srci.getMinY(),
                                                 srci.getWidth(), srci.getHeight()));

            int typei = srci.getSampleModel().getTransferType();

            // NOTE: this depends on JDK ordering
View Full Code Here

              if (rectList == null) {
                    return; // ROI does not intersect with Raster boundary.
              }  
          ListIterator iterator = rectList.listIterator(0);
          if (iterator.hasNext())
                  rect = rect.intersection((Rectangle)iterator.next());
            }          
                   
            // Find the actual ROI based on start and period.
            rect.x = startPosition(rect.x, xStart, xPeriod);
            rect.y = startPosition(rect.y, yStart, yPeriod);
View Full Code Here

      final int y = baseY + (int) (verticalPercent * p.height);

      // make sure the dialog fits completely on the screen...
      final Rectangle s = parent.getGraphicsConfiguration().getBounds();
      final Rectangle r = new Rectangle(x, y, d.width, d.height);
      dialog.setBounds(r.intersection(s));
    }

    /**
     * Creates a panel that contains a table based on the specified table model.
     *
 
View Full Code Here

        // Compute the intersection of the translated sources with the
        // destination bounds.
        Rectangle destBounds = getBounds();
        bounds = new Rectangle[4];
        for (int i = 0; i < 4; i++) {
            bounds[i] = destBounds.intersection(images[i].getBounds());
        }
    }
               
    /**
     * Computes a tile of the destination by copying the data which
View Full Code Here

        Rectangle imRect = new Rectangle(im.getMinX(), im.getMinY(),
                                         im.getWidth(), im.getHeight());

        // Return if the source image does not overlap this image.
        if((imRect = imRect.intersection(getBounds())).isEmpty()) {
            return;
        }

        // Unset buffer sharing flag.
        areBuffersShared = false;
View Full Code Here

            for (int i = txMin; i <= txMax; i++) {
                WritableRaster t;
                if ((t = tiles[i - minTileX][j - minTileY]) != null
                    && !isTileLocked(i, j)) {
                    Rectangle tileRect = getTileRect(i, j);
                    tileRect = tileRect.intersection(imRect);
                    if(!tileRect.isEmpty()) {
                        overlayPixels(t, im, tileRect);
                    }
                }
            }
View Full Code Here

        // Return if there is not a common intersection among this
        // image and the source image and the region of interest.
        Rectangle overlap = imRect.intersection(roi.getBounds());
        if(overlap.isEmpty() ||
           (overlap = overlap.intersection(getBounds())).isEmpty()) {
            return;
        }

        // Unset buffer sharing flag.
        areBuffersShared = false;
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.