/** * Appends the specified coordinates to this <code>Polygon2D</code>. * @param x the specified x coordinate * @param y the specified y coordinate */ public void addPoint(float x, float y) { if (npoints == xpoints.length) { float[] tmp; tmp = new float[npoints * 2]; System.arraycopy(xpoints, 0, tmp, 0, npoints); xpoints = tmp; tmp = new float[npoints * 2]; System.arraycopy(ypoints, 0, tmp, 0, npoints); ypoints = tmp; } xpoints[npoints] = x; ypoints[npoints] = y; npoints++; updatePath(x, y); }
/** * Appends the specified coordinates to this <code>Polygon2D</code>. * @param x the specified x coordinate * @param y the specified y coordinate */ public void addPoint(float x, float y) { if (npoints == xpoints.length) { float[] tmp; tmp = new float[npoints * 2]; System.arraycopy(xpoints, 0, tmp, 0, npoints); xpoints = tmp; tmp = new float[npoints * 2]; System.arraycopy(ypoints, 0, tmp, 0, npoints); ypoints = tmp; } xpoints[npoints] = x; ypoints[npoints] = y; npoints++; updatePath(x, y); }
/** * Appends the specified coordinates to this <code>Polygon2D</code>. * @param x the specified x coordinate * @param y the specified y coordinate */ public void addPoint(float x, float y) { if (npoints == xpoints.length) { float[] tmp; tmp = new float[npoints * 2]; System.arraycopy(xpoints, 0, tmp, 0, npoints); xpoints = tmp; tmp = new float[npoints * 2]; System.arraycopy(ypoints, 0, tmp, 0, npoints); ypoints = tmp; } xpoints[npoints] = x; ypoints[npoints] = y; npoints++; updatePath(x, y); }