/** * Return a copy of the path backing this path node. * * @return a copy of the path backing this path node */ public final Path2D getPath() { return (Path2D) path.clone(); }
/** * Return a copy of the path backing this path node. * * @return a copy of the path backing this path node */ public final Path2D getPath() { return (Path2D) path.clone(); }
protected Path2D getShape() { return (Path2D)poly.clone(); } }
/** * Create a new path node with the specified path. * * @param path path */ private PPath(final Path2D path) { this.path = (Path2D) path.clone(); updateBoundsFromShape(); }
/** * Create a new path node with the specified path. * * @param path path */ private PPath(final Path2D path) { this.path = (Path2D) path.clone(); updateBoundsFromShape(); }
/** * Create a new path node with the specified path and stroke. * * @param path path * @param stroke stroke */ private PPath(final Path2D path, final Stroke stroke) { this.path = (Path2D) path.clone(); setStroke(stroke); }
/** * Create a new path node with the specified path and stroke. * * @param path path * @param stroke stroke */ private PPath(final Path2D path, final Stroke stroke) { this.path = (Path2D) path.clone(); setStroke(stroke); }
public void setLocShape(BodyLocation loc, Path2D path) { Objects.requireNonNull(loc); if(null != path) { locShapes.put(loc, (Path2D) path.clone()); } else { locShapes.remove(loc); } invalidate(); }
@Override public void draw(HwmfGraphics ctx) { Path2D shape = getShape(); // shape.closePath(); Path2D p = (Path2D)shape.clone(); p.setWindingRule(getWindingRule(ctx)); ctx.fill(p); }
@Override public void draw(HwmfGraphics ctx) { Path2D shape = getShape(); Path2D p = (Path2D)shape.clone(); p.setWindingRule(getWindingRule(ctx)); ctx.draw(p); } }
/** * Add a point to this path node by moving to the specified coordinates * specified in double precision. * * @param x x coordinate * @param y y coordinate */ public final void moveTo(final double x, final double y) { Path2D oldPath = (Path2D) path.clone(); path.moveTo(x, y); updateBoundsFromShape(); firePropertyChange(-1, "path", oldPath, getPath()); }
/** * Reset the geometry for this path node to empty. */ public final void reset() { Path2D oldPath = (Path2D) path.clone(); path.reset(); updateBoundsFromShape(); firePropertyChange(-1, "path", oldPath, getPath()); }
/** * Reset the geometry for this path node to empty. */ public final void reset() { Path2D oldPath = (Path2D) path.clone(); path.reset(); updateBoundsFromShape(); firePropertyChange(-1, "path", oldPath, getPath()); }
/** * Close the current subpath by drawing a straight line back to the coordinates * of the last <code>moveTo</code>. If the path is already closed then this method * has no effect. */ public final void closePath() { Path2D oldPath = (Path2D) path.clone(); path.closePath(); updateBoundsFromShape(); firePropertyChange(-1, "path", oldPath, getPath()); }
/** * Close the current subpath by drawing a straight line back to the coordinates * of the last <code>moveTo</code>. If the path is already closed then this method * has no effect. */ public final void closePath() { Path2D oldPath = (Path2D) path.clone(); path.closePath(); updateBoundsFromShape(); firePropertyChange(-1, "path", oldPath, getPath()); }
/** * Add a point to this path node by drawing a straight line from the * current coordinates to the new specified coordinates specified in double precision. * * @param x x coordinate * @param y y coordinate */ public final void lineTo(final double x, final double y) { Path2D oldPath = (Path2D) path.clone(); path.lineTo(x, y); updateBoundsFromShape(); firePropertyChange(-1, "path", oldPath, getPath()); }
/** * Add a point to this path node by moving to the specified coordinates * specified in double precision. * * @param x x coordinate * @param y y coordinate */ public final void moveTo(final double x, final double y) { Path2D oldPath = (Path2D) path.clone(); path.moveTo(x, y); updateBoundsFromShape(); firePropertyChange(-1, "path", oldPath, getPath()); }
/** * Add a point to this path node by drawing a straight line from the * current coordinates to the new specified coordinates specified in double precision. * * @param x x coordinate * @param y y coordinate */ public final void lineTo(final double x, final double y) { Path2D oldPath = (Path2D) path.clone(); path.lineTo(x, y); updateBoundsFromShape(); firePropertyChange(-1, "path", oldPath, getPath()); }
/** * Add a curved segment, defined by two new points, to this path node by * drawing a Quadratic curve that intersects both the current coordinates and * the specified coordinates <code>(x2,y2)</code>, using the specified point * <code>(x1,y1)</code> as a quadratic parametric control point. All coordinates * are specified in double precision. * * @param x1 x coordinate of the quadratic control point * @param y1 y coordinate of the quadratic control point * @param x2 x coordinate of the final end point * @param y2 y coordinate of the final end point */ public final void quadTo(final double x1, final double y1, final double x2, final double y2) { Path2D oldPath = (Path2D) path.clone(); path.quadTo(x1, y1, x2, y2); updateBoundsFromShape(); firePropertyChange(-1, "path", oldPath, getPath()); }
/** * Add a curved segment, defined by two new points, to this path node by * drawing a Quadratic curve that intersects both the current coordinates and * the specified coordinates <code>(x2,y2)</code>, using the specified point * <code>(x1,y1)</code> as a quadratic parametric control point. All coordinates * are specified in double precision. * * @param x1 x coordinate of the quadratic control point * @param y1 y coordinate of the quadratic control point * @param x2 x coordinate of the final end point * @param y2 y coordinate of the final end point */ public final void quadTo(final double x1, final double y1, final double x2, final double y2) { Path2D oldPath = (Path2D) path.clone(); path.quadTo(x1, y1, x2, y2); updateBoundsFromShape(); firePropertyChange(-1, "path", oldPath, getPath()); }