mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
add createXML()
This commit is contained in:
@@ -4151,6 +4151,16 @@ public class PApplet extends Activity implements PConstants, Runnable {
|
||||
// DATA I/O
|
||||
|
||||
|
||||
public XML createXML(String name) {
|
||||
try {
|
||||
return new XML(name);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @webref input:files
|
||||
* @param filename name of a file in the data folder or a URL.
|
||||
|
||||
@@ -1371,9 +1371,9 @@ public class PApplet extends Applet
|
||||
// This will crash with OpenGL, so quit anyway
|
||||
if (g instanceof PGraphicsOpenGL) {
|
||||
PGraphics.showWarning("Stopping the sketch because this code will " +
|
||||
"not work correctly with OpenGL.");
|
||||
"not work correctly with OpenGL.");
|
||||
throw new RuntimeException("This sketch uses a library that " +
|
||||
"needs to be updated for Processing 2.0.");
|
||||
"needs to be updated for Processing 2.0.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5813,6 +5813,16 @@ public class PApplet extends Applet
|
||||
// DATA I/O
|
||||
|
||||
|
||||
public XML createXML(String name) {
|
||||
try {
|
||||
return new XML(name);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @webref input:files
|
||||
* @param filename name of a file in the data folder or a URL.
|
||||
|
||||
Reference in New Issue
Block a user