1 import java.awt.geom.Area;
2 import java.util.ArrayList;
12 private double primaryAngle;
18 private ArrayList<GridCell> cells;
25 cells =
new ArrayList<GridCell>();
26 this.primaryAngle = primaryAngle;
27 minX = Integer.MAX_VALUE;
28 minY = Integer.MAX_VALUE;
29 maxX = Integer.MIN_VALUE;
30 maxY = Integer.MIN_VALUE;
48 if(cell.
getX() < minX)
50 if(cell.
getY() < minY)
107 area.add(
new Area(c.bounds()));
110 return area.contains(node.
getX(), node.
getY());
118 return new Node((minX+maxX)/2, (minY+maxY)/2);
128 double diff = c.getPrimaryAngle() - primaryAngle;
130 diffSum = diffSum + 180-diff;
132 diffSum = diffSum - 180-diff;
134 diffSum = diffSum + diff;
136 primaryAngle = primaryAngle + (diffSum/cells.size());