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();
}