예제 #1
0
  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();
  }
예제 #2
0
 /** Removes the Point2D.Double at the specified index. */
 protected void removeAllNodes() {
   path.clear();
 }