(final String[] args,
final PApplet constructedSketch)
| 9888 | // through to the PDE. There are other ways around that, no doubt, but I'm |
| 9889 | // also suspecting that these "not showing up" bugs might be EDT issues. |
| 9890 | static public void runSketch(final String[] args, |
| 9891 | final PApplet constructedSketch) { |
| 9892 | Thread.setDefaultUncaughtExceptionHandler((t, e) -> { |
| 9893 | e.printStackTrace(); |
| 9894 | uncaughtThrowable = e; |
| 9895 | }); |
| 9896 | |
| 9897 | // This doesn't work, need to mess with Info.plist instead |
| 9898 | /* |
| 9899 | // In an exported application, add the Contents/Java folder to the |
| 9900 | // java.library.path, so that native libraries work properly. |
| 9901 | // Without this, the library path is only set to Contents/MacOS |
| 9902 | // where the launcher binary lives. |
| 9903 | if (platform == MACOSX) { |
| 9904 | URL coreJarURL = |
| 9905 | PApplet.class.getProtectionDomain().getCodeSource().getLocation(); |
| 9906 | // The jarPath from above will/may be URL encoded (%20 for spaces) |
| 9907 | String coreJarPath = urlDecode(coreJarURL.getPath()); |
| 9908 | if (coreJarPath.endsWith("/Contents/Java/core.jar")) { |
| 9909 | // remove the /core.jar part from the end |
| 9910 | String javaPath = coreJarPath.substring(0, coreJarPath.length() - 9); |
| 9911 | String libraryPath = System.getProperty("java.library.path"); |
| 9912 | libraryPath += File.pathSeparator + javaPath; |
| 9913 | System.setProperty("java.library.path", libraryPath); |
| 9914 | } |
| 9915 | } |
| 9916 | */ |
| 9917 | |
| 9918 | // So that the system proxy setting are used by default |
| 9919 | System.setProperty("java.net.useSystemProxies", "true"); |
| 9920 | |
| 9921 | if (args.length < 1) { |
| 9922 | System.err.println("Usage: PApplet [options] <class name> [sketch args]"); |
| 9923 | System.err.println("See the Javadoc for PApplet for an explanation."); |
| 9924 | System.exit(1); |
| 9925 | } |
| 9926 | |
| 9927 | boolean external = false; |
| 9928 | int[] location = null; |
| 9929 | int[] editorLocation = null; |
| 9930 | |
| 9931 | String name = null; |
| 9932 | int windowColor = 0; |
| 9933 | int stopColor = 0xff808080; |
| 9934 | boolean hideStop = false; |
| 9935 | |
| 9936 | int displayNum = -1; // use default |
| 9937 | boolean present = false; |
| 9938 | boolean fullScreen = false; |
| 9939 | float uiScale = 0; |
| 9940 | |
| 9941 | String param, value; |
| 9942 | String folder = calcSketchPath(); |
| 9943 | |
| 9944 | int argIndex = 0; |
| 9945 | label: |
| 9946 | while (argIndex < args.length) { |
| 9947 | int equals = args[argIndex].indexOf('='); |
no test coverage detected