Package java.awt.geom

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


        final Area a = new Area(chartEntity.getArea());
        if (buggyDrawArea)
        {
          a.transform(AffineTransform.getTranslateInstance(dataArea.getX(), dataArea.getY()));
        }
        a.intersect(new Area(dataArea));
        graphics2D.draw(a);
      }
      else
      {
        graphics2D.draw(chartEntity.getArea());
View Full Code Here


    {
      a.transform(AffineTransform.getTranslateInstance(dataArea.getX(), dataArea.getY()));
    }
    if (dataArea.isEmpty() == false)
    {
      a.intersect(new Area(dataArea));
    }
    final PathIterator pathIterator = a.getPathIterator(null, 2);
    final FloatList floats = new FloatList(100);
    final float[] coords = new float[6];
    while (pathIterator.isDone() == false)
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

                        // Depending on the performance cost, we might
                        // want to make it permanent.

                        if (precise) {
                            Area clone = (Area) area.clone();
                            clone.intersect(new Area(omgShape));
                            if (!clone.isEmpty()) {
                                outsideFilter = false;
                            }
                        } else {
                            outsideFilter = false;
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);
  }

  /**
   * This initialises the stream by saving the current graphics state, and
View Full Code Here

              Area newArea = getArea((float [][])ev.getNewValue());
              for (Room room : home.getRooms()) {
                if (room != ev.getSource()) {
                  Area roomAreaIntersectionWithOldArea = getArea(room.getPoints());
                  Area roomAreaIntersectionWithNewArea = new Area(roomAreaIntersectionWithOldArea);
                  roomAreaIntersectionWithNewArea.intersect(newArea);                 
                  if (!roomAreaIntersectionWithNewArea.isEmpty()) {
                    updateObjects(Arrays.asList(new Room [] {room}));
                  } else {
                    roomAreaIntersectionWithOldArea.intersect(oldArea);
                    if (!roomAreaIntersectionWithOldArea.isEmpty()) {
View Full Code Here

    for (HomePieceOfFurniture piece : getVisibleDoorsAndWindows(this.home.getFurniture())) {
      if (piece.getElevation() < maxWallHeight) {
        Shape pieceShape = getShape(piece.getPoints());
        Area pieceArea = new Area(pieceShape);
        Area intersectionArea = new Area(wallShape);
        intersectionArea.intersect(pieceArea);
        if (!intersectionArea.isEmpty()) {
          windowIntersections.add(new DoorOrWindowArea(intersectionArea, Arrays.asList(new HomePieceOfFurniture [] {piece})));
          // Remove from wall area the piece shape
          wallArea.subtract(pieceArea);
        }
View Full Code Here

        for (DoorOrWindowArea otherWindowIntersection : windowIntersections) {         
          if (windowIntersection.getArea().isEmpty()) {
            break;
          } else if (otherWindowIndex > windowIndex) { // Avoid search twice the intersection between two items
            Area windowsIntersectionArea = new Area(otherWindowIntersection.getArea());
            windowsIntersectionArea.intersect(windowIntersection.getArea());
            if (!windowsIntersectionArea.isEmpty()) {
              // Remove intersection from wall area             
              otherWindowIntersection.getArea().subtract(windowsIntersectionArea);             
              windowIntersection.getArea().subtract(windowsIntersectionArea);
              // Create a new area for the intersection
View Full Code Here

            }
            if (intersectionCount == 2
                && doorPoints.length == 4) {
              // Find the intersection of the door with home walls
              Area wallsDoorIntersection = new Area(getWallsArea());
              wallsDoorIntersection.intersect(new Area(getPath(doorPoints)));
              // Reduce the size of intersection to its half
              float [][] intersectionPoints = getPathPoints(getPath(wallsDoorIntersection), false);
              Shape halfDoorPath = null;
              if (intersectionPoints.length == 4) {
                float epsilon = 0.05f;
View Full Code Here

            Area a3 = new Area((p3));

            // uniao a1, a2 e a3
            Area a123 = new Area(a1);
            a123.intersect(a2);
            a123.intersect(a3);
            MyArea ma123 = new MyArea(a123, cores[0] + cores[1] + cores[2]);
            ma123.calculateArea("a123");

            // uniao a1 e a2
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.