protected Shape createShape(int[] xPoints,int[] yPoints,int nPoints,boolean close,boolean biased){
  float offset=biased ? (float)bias : 0.0f;
  GeneralPath path=new GeneralPath(GeneralPath.WIND_EVEN_ODD);
  if (nPoints > 0) {
    path.moveTo(xPoints[0] + offset,yPoints[0] + offset);
    int lastX=xPoints[0];
    int lastY=yPoints[0];
    if (close && (Math.abs(xPoints[nPoints - 1] - lastX) < 1) && (Math.abs(yPoints[nPoints - 1] - lastY) < 1)) {
      nPoints--;
    }
    for (int i=1; i < nPoints; i++) {
      if ((Math.abs(xPoints[i] - lastX) > 1) || (Math.abs(yPoints[i] - lastY) > 1)) {
        path.lineTo(xPoints[i] + offset,yPoints[i] + offset);
        lastX=xPoints[i];
        lastY=yPoints[i];
      }
    }
    if (close)     path.closePath();
  }
  return path;
}

protected Shape createShape ( int [ ] xPoints , int [ ] yPoints , int nPoints , boolean close , boolean biased ) { float offset = biased ? ( float ) bias : 0.0f ; GeneralPath path = new GeneralPath ( GeneralPath . WIND_EVEN_ODD ) ; if ( nPoints > 0 ) { path . moveTo ( xPoints [ 0 ] + offset , yPoints [ 0 ] + offset ) ; int lastX = xPoints [ 0 ] ; int lastY = yPoints [ 0 ] ; if ( close && ( Math . abs ( xPoints [ nPoints - 1 ] - lastX ) < 1 ) && ( Math . abs ( yPoints [ nPoints - 1 ] - lastY ) < 1 ) ) { nPoints -- ; } for ( int i = 1 ; i < nPoints ; i ++ ) { if ( ( Math . abs ( xPoints [ i ] - lastX ) > 1 ) || ( Math . abs ( yPoints [ i ] - lastY ) > 1 ) ) { path . lineTo ( xPoints [ i ] + offset , yPoints [ i ] + offset ) ; lastX = xPoints [ i ] ; lastY = yPoints [ i ] ; } } if ( close ) path . closePath ( ) ; } return path ; }
creates a polyline / polygon shape from a set of points . needs a bias !
