/** * Appends the specified coordinates to this <code>Polyline2D</code>. * <p> * If an operation that calculates the bounding box of this * <code>Polyline2D</code> has already been performed, such as * <code>getBounds</code> or <code>contains</code>, then this * method updates the bounding box. * @param x the specified x coordinate * @param y the specified y coordinate * @see java.awt.Polygon#getBounds * @see java.awt.Polygon#contains(double,double) */ 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>Polyline2D</code>. * <p> * If an operation that calculates the bounding box of this * <code>Polyline2D</code> has already been performed, such as * <code>getBounds</code> or <code>contains</code>, then this * method updates the bounding box. * @param x the specified x coordinate * @param y the specified y coordinate * @see java.awt.Polygon#getBounds * @see java.awt.Polygon#contains(double,double) */ 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>Polyline2D</code>. * <p> * If an operation that calculates the bounding box of this * <code>Polyline2D</code> has already been performed, such as * <code>getBounds</code> or <code>contains</code>, then this * method updates the bounding box. * @param x the specified x coordinate * @param y the specified y coordinate * @see java.awt.Polygon#getBounds * @see java.awt.Polygon#contains(double,double) */ 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); }