+ @SetPropertyValue("flowlength")
+ public void setFlowLength(double l) {
+ // Not allowed, if not at the end of a run
+ if (getNext() != null)
+ throw new IllegalStateException("Cannot edit length of a connected component");
+
+ double length = getFlowLength();
+ Point3d p1 = new Point3d(), p2 = new Point3d();
+ controlPoint.getControlPointEnds(p1, p2);
+ Vector3d dir = new Vector3d();
+ dir.sub(p2, p1);
+ dir.normalize();
+ dir.scale((l - length)/2);
+ Vector3d pos = new Vector3d(getPosition());
+ pos.add(dir);
+ setPosition(pos);
+ }