diff --git a/javafx-sg-prism/src/com/sun/javafx/sg/prism/NGPath.java b/javafx-sg-prism/src/com/sun/javafx/sg/prism/NGPath.java --- a/javafx-sg-prism/src/com/sun/javafx/sg/prism/NGPath.java +++ b/javafx-sg-prism/src/com/sun/javafx/sg/prism/NGPath.java @@ -18,6 +18,8 @@ } public void update() { + System.out.println("NGPath ===>"); + NGSVGPath.dumpPath(p); geomChanged(); } diff --git a/javafx-sg-prism/src/com/sun/javafx/sg/prism/NGSVGPath.java b/javafx-sg-prism/src/com/sun/javafx/sg/prism/NGSVGPath.java --- a/javafx-sg-prism/src/com/sun/javafx/sg/prism/NGSVGPath.java +++ b/javafx-sg-prism/src/com/sun/javafx/sg/prism/NGSVGPath.java @@ -1,5 +1,6 @@ package com.sun.javafx.sg.prism; +import com.sun.javafx.geom.PathIterator; import com.sun.javafx.geom.Shape; import com.sun.javafx.sg.PGSVGPath; @@ -13,9 +14,46 @@ public void setContent(Object content) { path = (Shape)content; + System.out.println("NGSVGPath ===>"); + dumpPath(path); geomChanged(); } + static void dumpPath(Shape shape) { + PathIterator pi = shape.getPathIterator(null); + float[] coords = new float[6]; + while (pi.isDone() == false) { + int seg = pi.currentSegment(coords); + switch (seg) { + case PathIterator.SEG_MOVETO: + System.out.println("MOVETO: " + coords[0] + " " + coords[1]); + break; + + case PathIterator.SEG_LINETO: + System.out.println("LINETO: " + coords[0] + " " + coords[1]); + break; + + case PathIterator.SEG_QUADTO: + System.out.println("QUADTO: " + coords[0] + " " + coords[1] + " " + coords[2] + " " + coords[3]); + break; + + case PathIterator.SEG_CUBICTO: + System.out.println("CUBICTO: " + coords[0] + " " + coords[1] + " " + + coords[2] + " " + coords[3] + " " + + coords[4] + " " + coords[5]); + break; + + case PathIterator.SEG_CLOSE: + System.out.println("CLOSE"); + break; + + default: + throw new InternalError("Unsupported path segment type"); + } + pi.next(); + } + } + public Object getGeometry() { return path; }