List of usage examples for java.awt Polygon getPathIterator
public PathIterator getPathIterator(AffineTransform at)
From source file:Main.java
private static ArrayList<Double> getCoords(Polygon p) { ArrayList<Double> vals = new ArrayList<Double>(); for (PathIterator iter = p.getPathIterator(null); !iter.isDone();) { double[] coords = new double[2]; iter.currentSegment(coords);/*from w ww. ja va 2s. com*/ vals.add(coords[0]); vals.add(coords[1]); iter.next(); } return vals; }