Package java.awt.geom

Examples of java.awt.geom.Area.intersect()


     * @return true if the clip shape needed to be updated
     */
    public boolean updateClip(Shape cl) {
        if (getGraph().getClip() != null) {
            Area newClip = new Area(getGraph().getClip());
            newClip.intersect(new Area(cl));
            getGraph().setClip(new GeneralPath(newClip));
        } else {
            getGraph().setClip(cl);
        }
        return true; // TODO only update if necessary
View Full Code Here


     * @return true if the clip shape needed to be updated
     */
    public boolean updateClip(Shape cl) {
        if (getGraph().getClip() != null) {
            Area newClip = new Area(getGraph().getClip());
            newClip.intersect(new Area(cl));
            getGraph().setClip(new GeneralPath(newClip));
        } else {
            getGraph().setClip(cl);
        }
        return true; // TODO only update if necessary
View Full Code Here

     * @param cl the new clip in the current state
     */
    public void setClip(Shape cl) {
        if (getData().clip != null) {
            Area newClip = new Area(getData().clip);
            newClip.intersect(new Area(cl));
            getData().clip = new GeneralPath(newClip);
        } else {
            getData().clip = cl;
        }
    }
View Full Code Here

        if (s != null)
            s = transform.createTransformedShape(s);

        if (clip != null) {
            Area newClip = new Area(clip);
            newClip.intersect(new Area(s));
            clip = new GeneralPath(newClip);
        } else {
            clip = s;
        }
    }
View Full Code Here

            s = stroke.createStrokedShape(s);
        }
        s = transform.createTransformedShape(s);
        Area area = new Area(s);
        if (clip != null)
            area.intersect(clip);
        return area.intersects(rect.x, rect.y, rect.width, rect.height);
    }
   
    /**
     * @see Graphics2D#getDeviceConfiguration()
View Full Code Here

                    if(clip == null) {
                        clip = new Rectangle(0,0,width,height);
                    }
                    Area area = new Area(clip);
                    Insets insets = getInsets();
                    area.intersect(new Area(new Rectangle(insets.left, insets.top, width - insets.left - insets.right, height - insets.top - insets.bottom)));
                   
                    if (verticalRepeat && horizontalRepeat) {
                        area.intersect(new Area(new Rectangle(0, 0, width, height)));
                        g.setClip(area);
                    } else if (verticalRepeat) {
View Full Code Here

                    Area area = new Area(clip);
                    Insets insets = getInsets();
                    area.intersect(new Area(new Rectangle(insets.left, insets.top, width - insets.left - insets.right, height - insets.top - insets.bottom)));
                   
                    if (verticalRepeat && horizontalRepeat) {
                        area.intersect(new Area(new Rectangle(0, 0, width, height)));
                        g.setClip(area);
                    } else if (verticalRepeat) {
                        area.intersect(new Area(new Rectangle(rect.x, 0, rect.width, height)));
                        g.setClip(area);
                    } else {
View Full Code Here

                   
                    if (verticalRepeat && horizontalRepeat) {
                        area.intersect(new Area(new Rectangle(0, 0, width, height)));
                        g.setClip(area);
                    } else if (verticalRepeat) {
                        area.intersect(new Area(new Rectangle(rect.x, 0, rect.width, height)));
                        g.setClip(area);
                    } else {
                        area.intersect(new Area(new Rectangle(0, rect.y, width, rect.height)));
                        g.setClip(area);
                    }
View Full Code Here

                        g.setClip(area);
                    } else if (verticalRepeat) {
                        area.intersect(new Area(new Rectangle(rect.x, 0, rect.width, height)));
                        g.setClip(area);
                    } else {
                        area.intersect(new Area(new Rectangle(0, rect.y, width, rect.height)));
                        g.setClip(area);
                    }
                   
                    TexturePaint tp = new TexturePaint(img, rect);
                    g.setPaint(tp);
View Full Code Here

        Shape oldClip = g.getClip();
        Area area = new Area(new Rectangle(0,0,width,height));
        if(oldClip != null) {
            area = new Area(oldClip);
        }
        area.intersect(new Area(new Rectangle(0,0,width,height)));
        g.setClip(area);
        //g.setClip(oldClip.intersection(new Rectangle(0,0,width,height)));
        Paint p = getPaint();
        if (p == null) {
            if(component instanceof JComponent) {
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.