focus(true);  int poly= OS.OpenPoly(); OS.MoveTo((short)pointArray[0], (short)pointArray[1]); for (int i= 2; i < pointArray.length; i+= 2) OS.LineTo((short)pointArray[i], (short)pointArray[i+1]); OS.ClosePoly();  installForeColor(data.background); OS.PaintPoly(poly); unfocus(true);  OS.KillPoly(poly);
int poly= 0; try { if (focus(true, null)) { poly= OS.OpenPoly(); OS.MoveTo((short)pointArray[0], (short)pointArray[1]); for (int i= 2; i < pointArray.length; i+= 2) OS.LineTo((short)pointArray[i], (short)pointArray[i+1]); OS.ClosePoly();  installForeColor(data.background); OS.PaintPoly(poly); } } finally { unfocus(true); } if (poly != 0) OS.KillPoly(poly);
public void fillPolygon(int[] pointArray) {	if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);	if (pointArray == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);	/* AW	short[] xPoints = new short[pointArray.length];	for (int i = 0; i<pointArray.length;i++) {		xPoints[i] = (short) pointArray[i];	}	int xDisplay = data.display;	XGCValues values = new XGCValues ();	OS.XGetGCValues (xDisplay, handle, OS.GCForeground | OS.GCBackground, values);	OS.XSetForeground (xDisplay, handle, values.background);	OS.XFillPolygon(xDisplay, data.drawable, handle,xPoints, xPoints.length / 2, OS.Complex, OS.CoordModeOrigin);	OS.XSetForeground (xDisplay, handle, values.foreground);	*/		focus(true);	int poly= OS.OpenPoly();	OS.MoveTo((short)pointArray[0], (short)pointArray[1]);	for (int i= 2; i < pointArray.length; i+= 2)		OS.LineTo((short)pointArray[i], (short)pointArray[i+1]);	OS.ClosePoly();		installForeColor(data.background);	OS.PaintPoly(poly);	unfocus(true);		OS.KillPoly(poly);}