MCPcopy Index your code
hub / github.com/benfry/processing4 / PApplet

Class PApplet

core/src/processing/core/PApplet.java:84–15204  ·  view source on GitHub ↗

Base class for all sketches that use processing.core. The Window Size and Full Screen page on the Wiki has useful information about sizing, multiple displays, full screen, etc. Processing uses active m

Source from the content-addressed store, hash-verified

82 * than working around legacy Java code.
83 */
84@SuppressWarnings({"unused", "FinalStaticMethod", "ManualMinMaxCalculation"})
85public class PApplet implements PConstants {
86//public class PApplet extends PSketch { // possible in the next alpha
87 /** Full name of the Java version (i.e. 1.5.0_11). */
88 static public final String javaVersionName =
89 System.getProperty("java.version");
90
91 static public final int javaPlatform;
92 static {
93 String version = javaVersionName;
94 if (javaVersionName.startsWith("1.")) {
95 version = version.substring(2);
96 javaPlatform = parseInt(version.substring(0, version.indexOf('.')));
97 } else {
98 // Remove -xxx and .yyy from java.version (@see JEP-223)
99 javaPlatform = parseInt(version.replaceAll("-.*","").replaceAll("\\..*",""));
100 }
101 }
102
103 /**
104 * Do not use; javaPlatform or javaVersionName are better options.
105 * For instance, javaPlatform is useful when you need a number for
106 * comparison, i.e. "if (javaPlatform >= 9)".
107 */
108 @Deprecated
109 public static final float javaVersion = 1 + javaPlatform / 10f;
110
111 /**
112 * Current platform in use, one of the PConstants WINDOWS, MACOS, LINUX or OTHER.
113 */
114 static public int platform;
115
116 static {
117 final String name = System.getProperty("os.name");
118
119 if (name.contains("Mac")) {
120 platform = MACOS;
121
122 } else if (name.contains("Windows")) {
123 platform = WINDOWS;
124
125 } else if (name.equals("Linux")) { // true for the ibm vm
126 platform = LINUX;
127
128 } else {
129 platform = OTHER;
130 }
131 }
132
133 /**
134 * Whether to use native (AWT) dialogs for selectInput and selectOutput.
135 * The native dialogs on some platforms can be ugly, buggy, or missing
136 * features. For 3.3.5, this defaults to true on all platforms.
137 */
138 static public boolean useNativeSelect = true;
139
140 /** The PGraphics renderer associated with this PApplet */
141 public PGraphics g;

Callers

nothing calls this directly

Calls 4

parseIntMethod · 0.95
replaceAllMethod · 0.45
containsMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected