/** * Adds the subpaths to this path. * * @param subpaths {@link java.util.List} of subpaths to be added to this path. */ public void addSubpaths(List<? extends Subpath> subpaths) { if (subpaths.size() > 0) { for (Subpath subpath : subpaths) { this.subpaths.add(new Subpath(subpath)); } currentPoint = this.subpaths.get(subpaths.size() - 1).getLastPoint(); } }
/** * Begins a new subpath by moving the current point to coordinates <CODE>(x, y)</CODE>. * @param x x-coordinate of the new point * @param y y-coordinate of the new point */ public void moveTo(float x, float y) { currentPoint = new Point(x, y); Subpath lastSubpath = subpaths.size() > 0 ? subpaths.get(subpaths.size() - 1) : null; if (lastSubpath != null && lastSubpath.isSinglePointOpen()) { lastSubpath.setStartPoint(currentPoint); } else { subpaths.add(new Subpath(currentPoint)); } }
private Subpath transformSubpath(Subpath subpath, Matrix newCtm) { Subpath newSubpath = new Subpath(); newSubpath.setClosed(subpath.isClosed()); for (IShape segment : subpath.getSegments()) { IShape transformedSegment = transformSegment(segment, newCtm); newSubpath.addSegment(transformedSegment); } return newSubpath; }