Package java.awt.geom

Examples of java.awt.geom.Rectangle2D.intersects()


        Shape clip = getClip();
        Rectangle2D usrClipBounds, usrBounds;
        usrBounds = shape.getBounds2D();
        if (clip != null) {
            usrClipBounds  = clip.getBounds2D();
            if (!usrClipBounds.intersects(usrBounds)) {
                return true;
            }
            Rectangle2D.intersect(usrBounds, usrClipBounds, usrBounds);
        }
        double usrX = usrBounds.getX();
View Full Code Here


        Shape clip = getClip();
        Rectangle2D usrClipBounds, usrBounds;
        usrBounds = shape.getBounds2D();
        if (clip != null) {
            usrClipBounds  = clip.getBounds2D();
            if (!usrClipBounds.intersects(usrBounds)) {
                return true;
            }
            Rectangle2D.intersect(usrBounds, usrClipBounds, usrBounds);
        }
        double usrX = usrBounds.getX();
View Full Code Here

      }
      final double x = Math.min(lastCoords[0], nextCoords[0]) - 1;
      final double y = Math.min(lastCoords[1], nextCoords[1]) - 1;
      final double w = Math.abs(lastCoords[0] - nextCoords[0]) + 2;
      final double h = Math.abs(lastCoords[1] - nextCoords[1]) + 2;
      if (rec.intersects(x, y, w, h)) {
        return true;
      }
      lastCoords = nextCoords;
    }
    return false;
View Full Code Here

     * @return true if the rectangle intersects, false otherwise
     */
    public boolean intersects(Rectangle2D r, GraphicsNodeRenderContext rc) {
        Rectangle2D b = getBounds(rc);
        if (b != null) {
            return (b.intersects(r) &&
                    paintedArea != null &&
                    paintedArea.intersects(r));
        }
        return false;
    }
View Full Code Here

        if (aoi == null)
            aoiR = getBounds2D();
        else {
            aoiR = aoi.getBounds2D();
            Rectangle2D bounds2d = getBounds2D();
            if (bounds2d.intersects(aoiR) == false)
                return null;
               
            Rectangle2D.intersect(aoiR, bounds2d, aoiR);
        }
View Full Code Here

        Rectangle2D arect = aoi.getBounds2D();
       
        // System.out.println("Rects Src:" + srect +
        //                    "My: " + rect +
        //                    "AOI: " + arect);
        if (arect.intersects(rect) == false)
            return null;
        Rectangle2D.intersect(arect, rect, arect);

        RenderedImage ri = null;
        if (arect.intersects(srect) == true) {
View Full Code Here

        if (arect.intersects(rect) == false)
            return null;
        Rectangle2D.intersect(arect, rect, arect);

        RenderedImage ri = null;
        if (arect.intersects(srect) == true) {
            Rectangle2D.intersect(srect, arect, srect);
           
            RenderContext srcRC = new RenderContext(usr2dev, srect, rh);
            ri = src.createRendering(srcRC);
View Full Code Here

        // We only depend on our source for stuff that is inside
        // our bounds and his bounds (remember our bounds may be
        // tighter than his in one or both directions).
        Rectangle2D srect = getSource().getBounds2D();
        if (srect.intersects(outputRgn) == false)
            return new Rectangle2D.Float();
        Rectangle2D.intersect(srect, outputRgn, srect);

        Rectangle2D bounds = getBounds2D();
        if (srect.intersects(bounds) == false)
View Full Code Here

        // our bounds...
        Rectangle2D srect = (Rectangle2D)outputRgn.clone();
        Rectangle2D bounds = getBounds2D();

        // Return empty rect if they don't intersect.
        if (bounds.intersects(srect) == false)
            return new Rectangle2D.Float();
           
        Rectangle2D.intersect(srect, bounds, srect);
        return srect;
    }
View Full Code Here

          // bounds.
        Rectangle2D drect = (Rectangle2D)inputRgn.clone();
        Rectangle2D bounds = getBounds2D();

        // Return empty rect if they don't intersect.
        if (bounds.intersects(drect) == false)
            return new Rectangle2D.Float();

        Rectangle2D.intersect(drect, bounds, drect);
        return drect;
    }
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.