Initializes a new SVG object from the given XML object.
(XML svg)
| 118 | * Initializes a new SVG object from the given XML object. |
| 119 | */ |
| 120 | public PShapeSVG(XML svg) { |
| 121 | this(null, svg, true); |
| 122 | |
| 123 | if (!svg.getName().equals("svg")) { |
| 124 | if (svg.getName().toLowerCase().equals("html")) { |
| 125 | // Common case is that files aren't downloaded properly |
| 126 | throw new RuntimeException("This appears to be a web page, not an SVG file."); |
| 127 | } else { |
| 128 | throw new RuntimeException("The root node is not <svg>, it's <" + svg.getName() + ">"); |
| 129 | } |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | |
| 134 | protected PShapeSVG(PShapeSVG parent, XML properties, boolean parseKids) { |
nothing calls this directly
no test coverage detected