/** * Draws a closed polygon defined by * arrays of <i>x</i> and <i>y</i> coordinates. * Each pair of (<i>x</i>, <i>y</i>) coordinates defines a point. * <p> * This method Draws the polygon defined by <code>nPoint</code> line * segments, where the first <code>nPoint - 1</code> * line segments are line segments from * <code>(xPoints[i - 1], yPoints[i - 1])</code> * to <code>(xPoints[i], yPoints[i])</code>, for * 1 ≤ <i>i</i> ≤ <code>nPoints</code>. * The figure is automatically closed by Drawing a line connecting * the point to the first point, if those points are different. * @param xPoints a an array of <code>x</code> coordinates. * @param yPoints a an array of <code>y</code> coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#FillPolygon(int[],int[],int) * @see java.awt.Graphics#drawPolyline */ public void DrawPolygon(int[] xPoints, int[] yPoints, int nPoints){ java.awt.Polygon polygon = new java.awt.Polygon(xPoints, yPoints, nPoints); Draw(polygon); }
public override void fillPolygon(java.awt.Polygon polygon) { fillPolygon(polygon.xpoints, polygon.ypoints, polygon.npoints); }
/** * Fills a closed polygon defined by * arrays of <i>x</i> and <i>y</i> coordinates. * <p> * This method Draws the polygon defined by <code>nPoint</code> line * segments, where the first <code>nPoint - 1</code> * line segments are line segments from * <code>(xPoints[i - 1], yPoints[i - 1])</code> * to <code>(xPoints[i], yPoints[i])</code>, for * 1 ≤ <i>i</i> ≤ <code>nPoints</code>. * The figure is automatically closed by Drawing a line connecting * the point to the first point, if those points are different. * <p> * The area inside the polygon is defined using an * even-odd fill rule, also known as the alternating rule. * @param xPoints a an array of <code>x</code> coordinates. * @param yPoints a an array of <code>y</code> coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#drawPolygon(int[], int[], int) */ public void FillPolygon(int[] xPoints, int[] yPoints, int nPoints){ java.awt.Polygon polygon = new java.awt.Polygon(xPoints, yPoints, nPoints); Fill(polygon); }
public override void drawPolygon(java.awt.Polygon polygon) { drawPolygon(polygon.xpoints, polygon.ypoints, polygon.npoints); }