Package java.awt.geom

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


    {
        if(getDeviceclip() != null)
        {
            Area area = new Area(getClip());
            if(shape != null)
                area.intersect(new Area(shape));
            shape = area;
        }
        setClip(shape);
    }
View Full Code Here


        if (clip == null || s == null) {
            return false;
        }
        Area as = new Area(s);
        Area imclip = new Area(clip);
        imclip.intersect(as);
        return !imclip.equals(as);
    }

    /**
     * Establishes a clipping region
View Full Code Here

            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

     * @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

    s = getTransform().createTransformedShape(s);
    final Area area = new Area(s);
    final Shape clip = getClip();
    if (clip != null)
    {
      area.intersect(new Area(clip));
    }
    return area.intersects(rect.x, rect.y, rect.width, rect.height);
  }

  /**
 
View Full Code Here

    }
    s = transform.createTransformedShape(s);
    final Area area = new Area(s);
    if (clip != null)
    {
      area.intersect(clip);
    }
    return area.intersects(rect.x, rect.y, rect.width, rect.height);
  }

  /**
 
View Full Code Here

    {
        if(getDeviceclip() != null)
        {
            Area area = new Area(getClip());
            if(shape != null)
                area.intersect(new Area(shape));
            shape = area;
        }
        setClip(shape);
    }
View Full Code Here

   */
  public void test(TestHarness harness)     
  {
    Area area = new Area();
    area.add(new Area(new Rectangle2D.Double(-1.0, -1.0, 2.0, 2.0)));
    area.intersect(new Area(new Rectangle2D.Double(0.0, 0.0, 2.0, 2.0)));
    harness.check(!area.contains(-1.0, -1.0))// check 1
    harness.check(!area.contains(-1.0, 0.0));   // check 2
    harness.check(!area.contains(-1.0, 1.0));   // check 3
    harness.check(!area.contains(-1.0, 2.0));   // check 4
    harness.check(!area.contains(0.0, -1.0));   // check 5
View Full Code Here

    harness.check(!area.contains(2.0, 2.0));    // check 17
 
    boolean pass = false;
    try
    {
      area.intersect(null);
    }
    catch (NullPointerException e)
    {
      pass = true;
    }
View Full Code Here

            // transform the bbox
            PDRectangle bbox = form.getBBox().transform(transform);

            // clip the bbox to prevent giant bboxes from consuming all memory
            Area clip = (Area)getGraphicsState().getCurrentClippingPath().clone();
            clip.intersect(new Area(bbox.toGeneralPath()));
            Rectangle2D clipRect = clip.getBounds2D();
            this.bbox = new PDRectangle((float)clipRect.getX(), (float)clipRect.getY(),
                                        (float)clipRect.getWidth(), (float)clipRect.getHeight());

            // apply the underlying Graphics2D device's DPI transform
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.