clean up sync of constructor and load methods

This commit is contained in:
benfry
2012-12-17 14:42:54 +00:00
parent 1d8afa9838
commit ded24adc69
4 changed files with 14 additions and 11 deletions
@@ -1076,7 +1076,7 @@ public class PGraphicsAndroid2D extends PGraphics {
PShapeSVG svg = null;
if (extension.equals("svg")) {
svg = new PShapeSVG(parent, filename);
svg = new PShapeSVG(parent.loadXML(filename));
} else if (extension.equals("svgz")) {
try {
@@ -151,14 +151,14 @@ public class PShapeSVG extends PShape {
String fillName; // id of another object
/**
* Initializes a new SVG Object with the given filename.
*/
public PShapeSVG(PApplet parent, String filename) {
// this will grab the root document, starting <svg ...>
// the xml version and initial comments are ignored
this(parent.loadXML(filename));
}
// /**
// * Initializes a new SVG Object with the given filename.
// */
// public PShapeSVG(PApplet parent, String filename) {
// // this will grab the root document, starting <svg ...>
// // the xml version and initial comments are ignored
// this(parent.loadXML(filename));
// }
/**
@@ -206,7 +206,7 @@ public class PShapeSVG extends PShape {
}
public PShapeSVG(PShapeSVG parent, XML properties, boolean parseKids) {
protected PShapeSVG(PShapeSVG parent, XML properties, boolean parseKids) {
// Need to set this so that findChild() works.
// Otherwise 'parent' is null until addChild() is called later.
this.parent = parent;
@@ -248,7 +248,7 @@ public class PGraphics2D extends PGraphicsOpenGL {
PShapeSVG svg = null;
if (extension.equals("svg")) {
svg = new PShapeSVG(pg.parent, filename);
svg = new PShapeSVG(pg.parent.loadXML(filename));
} else if (extension.equals("svgz")) {
try {
+3
View File
@@ -106,6 +106,9 @@ _ and how it should be handled with hash/dict
_ right now using hasKey().. in JSONObject
_ add 'gz' as one of the loadXxx() options
_ helps .svgz case from being weird, also generally dealing w/ compressed data
_ image caches not being properly disposed (weak references broken?)
_ http://code.google.com/p/processing/issues/detail?id=1353