private ArrayList makeShapes ( Iterator featList ) { Shape shape ; ArrayList shapeList = new ArrayList ( ) ; ProjectionImpl dataProject = getDataProjection ( ) ; if ( Debug . isSet ( "GisFeature/MapDraw" ) ) { System . out . println ( "GisFeature/MapDraw: makeShapes with " + displayProject ) ; } /* if (Debug.isSet("bug.drawShapes")) { int count =0; // make each GisPart a seperate shape for debugging feats:while (featList.hasNext()) { AbstractGisFeature feature = (AbstractGisFeature) featList.next(); java.util.Iterator pi = feature.getGisParts(); while (pi.hasNext()) { GisPart gp = (GisPart) pi.next(); int np = gp.getNumPoints(); GeneralPath path = new GeneralPath(GeneralPath.WIND_EVEN_ODD, np); double[] xx = gp.getX(); double[] yy = gp.getY(); path.moveTo((float) xx[0], (float) yy[0]); if (count == 63) System.out.println("moveTo x ="+xx[0]+" y= "+yy[0]); for(int i = 1; i < np; i++) { path.lineTo((float) xx[i], (float) yy[i]); if (count == 63) System.out.println("lineTo x ="+xx[i]+" y= "+yy[i]); } shapeList.add(path); if (count == 63) break feats; count++; } } System.out.println("bug.drawShapes: #shapes =" +shapeList.size()); return shapeList; } */ while ( featList . hasNext ( ) ) { AbstractGisFeature feature = ( AbstractGisFeature ) featList . next ( ) ; if ( dataProject . isLatLon ( ) ) // always got to run it through if its lat/lon shape = feature . getProjectedShape ( displayProject ) ; else if ( dataProject == displayProject ) shape = feature . getShape ( ) ; else shape = feature . getProjectedShape ( dataProject , displayProject ) ; shapeList . add ( shape ) ; } return shapeList ; }
make an ArrayList of Shapes from the given featureList and current display Projection