g.fillTriangle(xPoints[a], yPoints[a], xPoints[b], yPoints[b], xPoints[c], yPoints[c]);
g.fillTriangle(xPoints[a], yPoints[a], xPoints[b], yPoints[b], xPoints[c], yPoints[c]);  fillTriangle(xPoints[a], yPoints[a], xPoints[b], yPoints[b], xPoints[c], yPoints[c], g );
	public final static void fillPolygon( int[] xPoints, int[] yPoints, int color, Graphics g ) {		//#if polish.blackberry && polish.usePolishGui			Object o = g; // this cast is needed, otherwise the compiler will complain			              // that javax.microedition.lcdui.Graphics can never be casted			              // to de.enough.polish.blackberry.ui.Graphics.			//#if polish.useDefaultPackage				//# net.rim.device.api.ui.Graphics graphics = g.g;				//# graphics.setColor(color);		  		//# graphics.drawFilledPath( xPoints, yPoints, null, null);			//#else				if ( o instanceof de.enough.polish.blackberry.ui.Graphics) {					net.rim.device.api.ui.Graphics graphics = ((de.enough.polish.blackberry.ui.Graphics) o).g;					graphics.setColor(color);					graphics.drawFilledPath( xPoints, yPoints, null, null);				}							//#endif		//#elif polish.api.nokia-ui			DirectGraphics dg = DirectUtils.getDirectGraphics(g);			if ((color & 0xFF000000) == 0) {				color |= 0xFF000000;			}			dg.fillPolygon(xPoints, 0, yPoints, 0, xPoints.length, color );		//#else			// ... use default mechanism by simple triangulation of the polygon. Holes within the polygon are not supported.			// This code is based on JMicroPolygon: http://sourceforge.net/projects/jmicropolygon			while (xPoints.length > 2) {				// a, b & c represents a candidate triangle to draw.				// a is the left-most point of the polygon				int a = indexOfLeast(xPoints);				// b is the point after a				int b = (a + 1) % xPoints.length;				// c is the point before a				int c = (a > 0) ? a - 1 : xPoints.length - 1;				// The value leastInternalIndex holds the index of the left-most				// polygon point found within the candidate triangle, if any.				int leastInternalIndex = -1;				boolean leastInternalSet = false;				// If only 3 points in polygon, skip the tests				if (xPoints.length > 3) {					// Check if any of the other points are within the candidate triangle					for (int i=0; i<xPoints.length; i++) {						if (i != a && i != b && i != c) {							if (withinBounds(xPoints[i], yPoints[i],											xPoints[a], yPoints[a],											xPoints[b], yPoints[b],											xPoints[c], yPoints[c])) 							{								// Is this point the left-most point within the candidate triangle?								if (!leastInternalSet || xPoints[i] < xPoints[leastInternalIndex]) 								{									leastInternalIndex = i;									leastInternalSet = true;								}							}						}					}				}				// No internal points found, fill the triangle, and reservoir-dog the polygon				if (!leastInternalSet) {					g.setColor( color );					g.fillTriangle(xPoints[a], yPoints[a], xPoints[b], yPoints[b], xPoints[c], yPoints[c]);					int[][] trimmed = trimEar(xPoints, yPoints, a);					xPoints = trimmed[0];					yPoints = trimmed[1];					// Internal points found, split the polygon into two, using the line between					// "a" (left-most point of the polygon) and leastInternalIndex (left-most					// polygon-point within the candidate triangle) and recurse with each new polygon				} else {					int[][][] split = split(xPoints, yPoints, a, leastInternalIndex);					int[][] poly1 = split[0];					int[][] poly2 = split[1];					fillPolygon( poly1[0], poly1[1], color, g );					fillPolygon( poly2[0], poly2[1], color, g );					break;				}			}		//#endif	}