public static void describeShapeDetail(Shape shape,double flattening){
  PathIterator pi2=shape.getPathIterator(null);
  FlatteningPathIterator pi=new FlatteningPathIterator(pi2,flattening);
  double[] coords=new double[6];
  int pointCount=0;
  Debug.output(" -- start describeShapeDetail with flattening[" + flattening + "]");
  while (!pi.isDone()) {
    int type=pi.currentSegment(coords);
    Debug.output(" Shape point [" + type + "] ("+ (pointCount++)+ ") "+ coords[0]+ ", "+ coords[1]);
    pi.next();
  }
  Debug.output(" -- end (" + pointCount + ")");
}

public static void describeShapeDetail ( Shape shape , double flattening ) { PathIterator pi2 = shape . getPathIterator ( null ) ; FlatteningPathIterator pi = new FlatteningPathIterator ( pi2 , flattening ) ; double [ ] coords = new double [ 6 ] ; int pointCount = 0 ; Debug . output ( " -- start describeShapeDetail with flattening[" + flattening + "]" ) ; while ( ! pi . isDone ( ) ) { int type = pi . currentSegment ( coords ) ; Debug . output ( " Shape point [" + type + "] (" + ( pointCount ++ ) + ") " + coords [ 0 ] + ", " + coords [ 1 ] ) ; pi . next ( ) ; } Debug . output ( " -- end (" + pointCount + ")" ) ; }
utility method that iterates over a shape object and prints out the points . the flattening is used for a flatteningpathiterator , controlling the scope of the path traversal .
