| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -187,7 +187,7 @@ public void run() { | |||
| 187 | 187 | msg = "This item is not compatible with this version of Processing"; | |
| 188 | 188 | } else if (cause instanceof UnsupportedClassVersionError) { | |
| 189 | 189 | msg = "This item needs to be recompiled for Java " + | |
| 190 | - PApplet.javaVersionShort; | ||
| 190 | + PApplet.javaPlatform; | ||
| 191 | 191 | } | |
| 192 | 192 | } | |
| 193 | 193 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,11 +44,11 @@ | |||
| 44 | 44 | ||
| 45 | 45 | ||
| 46 | 46 | ||
| 47 | + | ||
| 47 | 48 | // used by loadImage() functions | |
| 48 | 49 | import javax.imageio.ImageIO; | |
| 49 | 50 | import javax.swing.ImageIcon; | |
| 50 | 51 | import javax.swing.JFileChooser; | |
| 51 | - | ||
| 52 | 52 | import javax.swing.JOptionPane; | |
| 53 | 53 | // used by desktopFile() method | |
| 54 | 54 | import javax.swing.filechooser.FileSystemView; | |
@@ -109,12 +109,22 @@ public class PApplet implements PConstants { | |||
| 109 | 109 | static public final String javaVersionName = | |
| 110 | 110 | System.getProperty("java.version"); | |
| 111 | 111 | ||
| 112 | - /** Short name of Java version, i.e. 1.8. */ | ||
| 113 | - static public final String javaVersionShort = | ||
| 114 | - //javaVersionName.substring(0, 3); | ||
| 115 | - javaVersionName.substring(0, javaVersionName.indexOf(".", 2)); | ||
| 116 | - // can't use this one, it's 1.8.0 and breaks things | ||
| 117 | - //javaVersionName.substring(0, javaVersionName.indexOf("_")); | ||
| 112 | + // /** Short name of Java version, i.e. 1.8. */ | ||
| 113 | + // static public final String javaVersionShort = | ||
| 114 | + // //javaVersionName.substring(0, 3); | ||
| 115 | + // javaVersionName.substring(0, javaVersionName.indexOf(".", 2)); | ||
| 116 | + // // can't use this one, it's 1.8.0 and breaks things | ||
| 117 | + // //javaVersionName.substring(0, javaVersionName.indexOf("_")); | ||
| 118 | + | ||
| 119 | + static public final int javaPlatform = | ||
| 120 | + PApplet.parseInt(PApplet.split(javaVersionName, '.')[1]); | ||
| 121 | + // static { | ||
| 122 | + // try { | ||
| 123 | + // javaPlatform = PApplet.split(javaVersionName, '.')[1]; | ||
| 124 | + // } catch (Exception e) { | ||
| 125 | + // javaPlatform = "8"; // set a default in case | ||
| 126 | + // } | ||
| 127 | + // } | ||
| 118 | 128 | ||
| 119 | 129 | /** | |
| 120 | 130 | * Version of Java that's in use, whether 1.1 or 1.3 or whatever, | |
@@ -127,9 +137,17 @@ public class PApplet implements PConstants { | |||
| 127 | 137 | * (i.e. 1.40000001). This could just be a double, but since Processing | |
| 128 | 138 | * only uses floats, it's safer as a float because specifying a double | |
| 129 | 139 | * (with this narrow case especially) with the preprocessor is awkward. | |
| 140 | + * <p> | ||
| 141 | + * @deprecated Java 10 is around the corner. Use javaPlatform when you need | ||
| 142 | + * a number for comparisons, i.e. "if (javaPlatform >= 7)". | ||
| 130 | 143 | */ | |
| 144 | + @Deprecated | ||
| 131 | 145 | public static final float javaVersion = | |
| 132 | - new Float(javaVersionShort).floatValue(); | ||
| 146 | + new Float(javaVersionName.substring(0, 3)); | ||
| 147 | + // public static final float javaVersion = | ||
| 148 | + // new Float(javaVersionName.substring(0, javaVersionName.indexOf(".", 2))).floatValue(); | ||
| 149 | + // // Making this a String in 3.0, in anticipation of Java 10 | ||
| 150 | + // public static final String javaVersion = "1." + javaPlatform; | ||
| 133 | 151 | ||
| 134 | 152 | /** | |
| 135 | 153 | * Current platform in use, one of the | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,6 +5,8 @@ X https://github.com/processing/processing/issues/3347 | |||
| 5 | 5 | X show warning when display spanning is turned off with fullScreen(SPAN) | |
| 6 | 6 | X defaults read com.apple.spaces spans-displays | |
| 7 | 7 | X https://github.com/processing/processing/issues/3381 | |
| 8 | + _ note that full screen and present are now different | ||
| 9 | + _ on Export to Application, this has an impact | ||
| 8 | 10 | ||
| 9 | 11 | cleaning | |
| 10 | 12 | o possible addition for 'implementation' variable | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -825,21 +825,19 @@ public void paintComponent(Graphics g) { | |||
| 825 | 825 | platformName = "Linux (" + Base.getNativeBits() + "-bit)"; | |
| 826 | 826 | } | |
| 827 | 827 | ||
| 828 | - final String javaPlatform = | ||
| 829 | - PApplet.split(System.getProperty("java.version"), '.')[1]; | ||
| 830 | 828 | boolean embed = Preferences.getBoolean("export.application.embed_java"); | |
| 831 | 829 | final String embedWarning = | |
| 832 | 830 | "<html><div width=\"" + divWidth + "\"><font size=\"2\">" + | |
| 833 | 831 | // "<html><body><font size=2>" + | |
| 834 | 832 | "Embedding Java will make the " + platformName + " application " + | |
| 835 | 833 | "larger, but it will be far more likely to work. " + | |
| 836 | 834 | "Users on other platforms will need to " + | |
| 837 | - "<a href=\"\">install Java " + PApplet.javaVersionShort + "</a>."; | ||
| 835 | + "<a href=\"\">install Java " + PApplet.javaPlatform + "</a>."; | ||
| 838 | 836 | final String nopeWarning = | |
| 839 | 837 | "<html><div width=\"" + divWidth + "\"><font size=\"2\">" + | |
| 840 | 838 | // "<html><body><font size=2>" + | |
| 841 | 839 | "Users on all platforms will have to install the latest " + | |
| 842 | - "version of Java " + javaPlatform + | ||
| 840 | + "version of Java " + PApplet.javaPlatform + | ||
| 843 | 841 | " from <a href=\"\">http://java.com/download</a>. " + | |
| 844 | 842 | "<br/> "; | |
| 845 | 843 | //"from <a href=\"http://java.com/download\">java.com/download</a>."; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments