Package java.awt

Examples of java.awt.Rectangle.intersects()


          if ((i + 1) < blockArr.length) {
            maxY = blockArr[i + 1].mStartY;
          } else {
            maxY = height;
          }
          if (!clipBounds.intersects(0, minY, width, maxY - minY)) {
            // this piece is not visible at all
            continue;
          }

          // Get the image of this time block
View Full Code Here


      GraphicsEnvironment ge;
      ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
      for (GraphicsDevice gd : ge.getScreenDevices()) {
        for (GraphicsConfiguration gc : gd.getConfigurations()) {
          Rectangle gcBounds = gc.getBounds();
          if (gcBounds.intersects(desired)) {
            Rectangle inter = gcBounds.intersection(desired);
            int size = inter.width * inter.height;
            if (size > gcBestSize) {
              gcBestSize = size;
              int x2 = Math.max(gcBounds.x, Math.min(inter.x,
View Full Code Here

        int h = (int) (p2.getY() - p1.getY());
        int w = (int) (p2.getX() - p1.getX());

        Rectangle mapRect = new Rectangle((int) p1.getX(), (int) p1.getY(), w, h);

        return mapRect.intersects(shape.getBounds());
    }

    public void setBaseScale(float bs) {
        baseScale = bs;
    }
View Full Code Here

        h = (int) Math.abs(p2.getY() - p1.getY());
        w = (int) Math.abs(p2.getX() - p1.getX());

        Rectangle mapRect = new Rectangle((int) p1.getX(), (int) p1.getY(), w, h);

        return mapRect.intersects(imageRect);
    }

}
View Full Code Here

   * @return <code>true</code> if the area overlaps.
   */
  public boolean intersects(final Rectangle2D area) {
    final Rectangle2D zone = new Rectangle(x, y, getWidth(), getHeight());

    return zone.intersects(area);
  }

  /**
   * Populate a zone based on it's map content.
   *
 
View Full Code Here

        }

        PlanarImage source = getSource(0);

        Rectangle srcRect = mapDestRect(destRect, 0);
        if (!srcRect.intersects(source.getBounds())) {
            if (setBackground) {
                ImageUtil.fillBackground(dest, destRect, backgroundValues);
            }
            return dest;  // outside of source bounds
        }
View Full Code Here

                } else {
                    if(extender == null && !srcBounds.contains(srcRect)) {
                        // Clip to source bounds.
                        srcRect = srcBounds.intersection(srcRect);
                    }
                    if(!srcRect.intersects(srcBounds)) {
                        // Outside of source bounds.
                        if (setBackground) {
                            ImageUtil.fillBackground(dest, destRect,
                                                     backgroundValues);
                        }
View Full Code Here

            }

            return dest;

        } else if (srcUnderBounds.contains(destRect) &&
                   !srcOverBounds.intersects(destRect)) {
            /* Tile is entirely inside sourceUnder. */
            sources[0] = srcUnder.getData(destRect);
            computeRect(sources, dest, destRect);

            // Recycle the source tile
View Full Code Here

                if (sameTileGrid) {
                    // Tile grids are aligned so the tile indices correspond
                    // to pixels at the same locations in source and destination
                    srcTile = getSource(0).getTile(tileX, tileY);
                }
                else if (dstRect.intersects(src.getBounds())) {
                    // Tile grids are not aligned but the destination rectangle
                    // intersects the source bounds so get the data using
                    // the destination rectangle
                    srcTile = src.getData(dstRect);
                }
View Full Code Here

        }

        // Check which rectangles intersect
        for (final RenderElement re : allElements) {
            final Rectangle geometry = re.getGeometry(CoordinatesType.DOCUMENT_BASED);
            if (geometry.intersects(r)) {
                rval.add(re);
            }
        }

        // In case we have no intersections and we're magnetic
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.