setNeedToRegenerate(true); isGeometryClosed();
    public boolean generate(Projection proj) {	int i, j, npts;	shape = null;	if (proj == null) {	    Debug.message("omgraphic", "OMPoly: null projection in generate!");	    return false;	}	switch (renderType) {	case RENDERTYPE_XY:	    if (xs == null) {		Debug.message("omgraphic", "OMPoly x/y rendertype null coordinates");		return false;	    }	    // Need to keep these around for the LabeledOMPoly	    xpoints = new int[1][0]; xpoints[0] = xs;	    ypoints = new int[1][0]; ypoints[0] = ys;	    if (doShapes) {		setNeedToRegenerate(false);		createShape();	    }	    break;	case RENDERTYPE_OFFSET:	    if (xs == null) {		Debug.message("omgraphic", "OMPoly offset rendertype null coordinates");		return false;	    }	    npts = xs.length;	    int[] _x = new int[npts];	    int[] _y = new int[npts];	    // forward project the radian point	    Point origin = proj.forward(		lat, lon, new Point(0,0), true);//radians	    if (coordMode == COORDMODE_ORIGIN) {		for (i = 0; i < npts; i++) {		    _x[i] = xs[i] + origin.x;		    _y[i] = ys[i] + origin.y;		}	    } else { // CModePrevious offset deltas		_x[0] = xs[0] + origin.x;		_y[0] = ys[0] + origin.y;		for (i=1; i<npts; i++) {		    _x[i] = xs[i] + _x[i-1];		    _y[i] = ys[i] + _y[i-1];		}	    }	    // Need to keep these around for the LabeledOMPoly	    xpoints = new int[1][0]; xpoints[0] = _x;	    ypoints = new int[1][0]; ypoints[0] = _y;	    if (doShapes) {		setNeedToRegenerate(false);		createShape();	    }	    break;	case RENDERTYPE_LATLON:	    ArrayList vector = null;	    // polygon/polyline project the polygon/polyline.	    // Vertices should already be in radians.	    vector = proj.forwardPoly(rawllpts, lineType, nsegs, isPolygon);	    int size = vector.size();	    if (!doShapes) {		xpoints = new int[(int)(size/2)][0];		ypoints = new int[xpoints.length][0];	    }	    // We could call create shape, but this is more efficient.	    for (i=0, j=0; i<size; i+=2, j++) {		if (doShapes) {		    GeneralPath gp = createShape((int[])vector.get(i), 						 (int[])vector.get(i+1),						 isPolygon);		    if (shape == null) {			shape = gp;		    } else {			((GeneralPath)shape).append(gp, false);		    }		} else {		    xpoints[j] = (int[])vector.get(i);		    ypoints[j] = (int[])vector.get(i+1);		}	    }	    break;	case RENDERTYPE_UNKNOWN:	    Debug.error("OMPoly.generate: invalid RenderType");	    return false;	}	setNeedToRegenerate(false);	return true;    }