public static GeneralPath createShape(float[] xpoints,float[] ypoints,int startIndex,int length,boolean isPolygon){
  if (xpoints == null || ypoints == null) {
    return null;
  }
  if (startIndex < 0) {
    startIndex=0;
  }
  if (length > xpoints.length - startIndex) {
    length=xpoints.length - startIndex - 1;
  }
  GeneralPath path=new GeneralPath(GeneralPath.WIND_EVEN_ODD,length);
  if (length > startIndex) {
    path.moveTo(xpoints[startIndex],ypoints[startIndex]);
    for (int j=startIndex + 1; j < length; j++) {
      path.lineTo(xpoints[j],ypoints[j]);
    }
    if (isPolygon) {
      path.closePath();
    }
  }
  return path;
}

public static GeneralPath createShape ( float [ ] xpoints , float [ ] ypoints , int startIndex , int length , boolean isPolygon ) { if ( xpoints == null || ypoints == null ) { return null ; } if ( startIndex < 0 ) { startIndex = 0 ; } if ( length > xpoints . length - startIndex ) { length = xpoints . length - startIndex - 1 ; } GeneralPath path = new GeneralPath ( GeneralPath . WIND_EVEN_ODD , length ) ; if ( length > startIndex ) { path . moveTo ( xpoints [ startIndex ] , ypoints [ startIndex ] ) ; for ( int j = startIndex + 1 ; j < length ; j ++ ) { path . lineTo ( xpoints [ j ] , ypoints [ j ] ) ; } if ( isPolygon ) { path . closePath ( ) ; } } return path ; }
create a shape object given an array of x points and y points . the x points a y points should be projected . this method is used by subclasses that get projected coordinates out of the projection classes , and they need to build a shape object from those coordinates .
