Package java.awt.geom

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


                Area currentZoneArea = new Area(TopologyUtils.convertToAWT(selectedZone.getPojo().getShape()));
                for (Room r : currEnv.getRooms()) {
                    if (!r.equals(selectedZone)) {
                        Shape testZoneShape = TopologyUtils.convertToAWT(r.getPojo().getShape());
                        Area testArea = new Area(testZoneShape);
                        testArea.intersect(currentZoneArea);
                        if (!testArea.isEmpty()) {
                            currHandle.move(originalHandleLocation.getX(), originalHandleLocation.getY());
                            removeIndicators();
                            addIndicator(TopologyUtils.convertToAWT(selectedZone.getPojo().getShape()));
                            break;
View Full Code Here


                        Area currentZoneArea = new Area(TopologyUtils.convertToAWT(selectedZone.getPojo().getShape()));
                        for (Room r : currEnv.getRooms()) {
                            if (!r.equals(selectedZone)) {
                                Shape testZoneShape = TopologyUtils.convertToAWT(r.getPojo().getShape());
                                Area testArea = new Area(testZoneShape);
                                testArea.intersect(currentZoneArea);
                                if (!testArea.isEmpty()) {
                                    addIndicator(testZoneShape, new Color(255, 0, 0, 50));
                                }
                            }
                        }
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

            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

            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(getDeviceclip() != null)
        {
            Area area = new Area(getClip());
            if(shape != null)
                area.intersect(new Area(shape));
            shape = area;
        }
        setClip(shape);
    }
View Full Code Here

      g2d.setPaint(gp);
      g2d.fill(tjpath);

      //drawing remaining job triangle
      a = new Area(tjpath);
      a.intersect(new Area(jR));
      gp = new GradientPaint(x, y, col1, x + w, y, col2, false);
      g2d.setPaint(gp);
      g2d.fill(a);
      g2d.setPaint(Color.BLACK);
      g2d.draw(tjpath);
View Full Code Here

  }

  @Override
  public boolean isIntersecting(Shape searchArea) {
    Area intersecting = new Area(searchArea);
    intersecting.intersect(new Area(basicShape.translated(getPosition()
        .getX(), getPosition().getY())));
    return !intersecting.isEmpty();
  }

  /**
 
View Full Code Here

    for (Polygon poly : game.getScene().getSolids()) //for each solid object
    {
      final Area area = new Area();
      area.add(new Area(rect));
      area.intersect(new Area(poly)); //check if there is a collision

      if (!area.isEmpty()) // if isEmpty is false there is a collision
      {
        collision = true;
                wallCollision();
View Full Code Here

    {
      if(obj.isCheckcollision())
      {
        final Area area = new Area();
        area.add(new Area(rect));
        area.intersect(new Area(obj.getRectangle()));

        if (!area.isEmpty() && this != obj) // if area is empty, and the obj is not isself. (Self-collision)
        {
          collision(obj); //report collision to self, with the object that hit it.
          obj.collision(this); //report collision to object that got hit with itself.
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.