Java examples for 2D Graphics:Path
get Closed Path Length
//package com.java2s; import java.awt.geom.*; public class Main { private static final AffineTransform identity = new AffineTransform(); public static int getClosedPathLength(GeneralPath generalPath) { int c = 0; PathIterator p = generalPath.getPathIterator(identity); while (!p.isDone()) { c++;// www . ja v a 2 s . c o m p.next(); } if (c > 0) // for closed paths c--; return c; } }