/** * Sets winding rule for filling the bezier path. * @param newValue Must be Path2D.Double.WIND_EVEN_ODD or Path2D.Double.WIND_NON_ZERO. */ public void setWindingRule(int newValue) { if (newValue != windingRule) { invalidatePath(); int oldValue = windingRule; this.windingRule = newValue; } }
public void setClosed(boolean newValue) { if (isClosed != newValue) { isClosed = newValue; invalidatePath(); } }
/** * Transforms the BezierPath. * @param tx the transformation. */ public void transform(AffineTransform tx) { Point2D.Double p = new Point2D.Double(); for (Node cp : this) { for (int i = 0; i < 3; i++) { p.x = cp.x[i]; p.y = cp.y[i]; tx.transform(p, p); cp.x[i] = p.x; cp.y[i] = p.y; } } invalidatePath(); }
@Override protected void validate() { super.validate(); path.invalidatePath(); cappedPath = null; }
@Override public void invalidate() { super.invalidate(); path.invalidatePath(); cappedPath = null; }
t1.setTo(v1); t2.setTo(v2); tempPath.invalidatePath(); if (tempPath.outlineContains(find, tolerance)) { return i; t1.setTo(v1); t2.setTo(v2); tempPath.invalidatePath(); if (tempPath.outlineContains(find, tolerance)) { return size() - 1;
t1.setTo(v1); t2.setTo(v2); tempPath.invalidatePath(); if (tempPath.outlineContains(find, flatness)) { relativeLen += Geom.length(v1.x[0], v1.y[0], find.x, find.y); t1.setTo(v1); t2.setTo(v2); tempPath.invalidatePath(); if (tempPath.outlineContains(find, flatness)) { relativeLen += Geom.length(v1.x[0], v1.y[0], find.x, find.y);
protected void readPoints(DOMInput in) throws IOException { path.clear(); in.openElement("points"); setClosed(in.getAttribute("closed", false)); for (int i = 0, n = in.getElementCount("p"); i < n; i++) { in.openElement("p", i); BezierPath.Node node = new BezierPath.Node( in.getAttribute("mask", 0), in.getAttribute("x", 0d), in.getAttribute("y", 0d), in.getAttribute("c1x", in.getAttribute("x", 0d)), in.getAttribute("c1y", in.getAttribute("y", 0d)), in.getAttribute("c2x", in.getAttribute("x", 0d)), in.getAttribute("c2y", in.getAttribute("y", 0d))); node.keepColinear = in.getAttribute("colinear", true); path.add(node); path.invalidatePath(); in.closeElement(); } in.closeElement(); } }
cappedPath.set(cappedPath.size() - 1, 0, Geom.cap(pp, p0.getControlPoint(0), -Math.min(radius, lineLength))); cappedPath.invalidatePath();