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
| 121 | * than working around legacy Java code. |
| 122 | */ |
| 123 | public class PApplet implements PConstants { |
| 124 | /** Full name of the Java version (i.e. 1.5.0_11). */ |
| 125 | static public final String javaVersionName = |
| 126 | System.getProperty("java.version"); |
| 127 | |
| 128 | static public final int javaPlatform; |
| 129 | static { |
| 130 | String version = javaVersionName; |
| 131 | if (javaVersionName.startsWith("1.")) { |
| 132 | version = version.substring(2); |
| 133 | javaPlatform = parseInt(version.substring(0, version.indexOf('.'))); |
| 134 | } else { |
| 135 | // Remove -xxx and .yyy from java.version (@see JEP-223) |
| 136 | javaPlatform = parseInt(version.replaceAll("-.*","").replaceAll("\\..*","")); |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | /** |
| 141 | * Do not use; javaPlatform or javaVersionName are better options. |
| 142 | * For instance, javaPlatform is useful when you need a number for |
| 143 | * comparison, i.e. "if (javaPlatform >= 9)". |
| 144 | */ |
| 145 | @Deprecated |
| 146 | public static final float javaVersion = 1 + javaPlatform / 10f; |
| 147 | |
| 148 | /** |
| 149 | * Current platform in use, one of the |
| 150 | * PConstants WINDOWS, MACOSX, MACOS9, LINUX or OTHER. |
| 151 | */ |
| 152 | static public int platform; |
| 153 | |
| 154 | static { |
| 155 | String osname = System.getProperty("os.name"); |
| 156 | |
| 157 | if (osname.indexOf("Mac") != -1) { |
| 158 | platform = MACOSX; |
| 159 | |
| 160 | } else if (osname.indexOf("Windows") != -1) { |
| 161 | platform = WINDOWS; |
| 162 | |
| 163 | } else if (osname.equals("Linux")) { // true for the ibm vm |
| 164 | platform = LINUX; |
| 165 | |
| 166 | } else { |
| 167 | platform = OTHER; |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | /** |
| 172 | * Whether to use native (AWT) dialogs for selectInput and selectOutput. |
| 173 | * The native dialogs on some platforms can be ugly, buggy, or missing |
| 174 | * features. For 3.3.5, this defaults to true on all platforms. |
| 175 | */ |
| 176 | static public boolean useNativeSelect = true; |
| 177 | |
| 178 | /** The PGraphics renderer associated with this PApplet */ |
| 179 | public PGraphics g; |
| 180 |
nothing calls this directly
no test coverage detected