| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -48,6 +48,7 @@ public class Commander implements RunnerListener { | |||
| 48 | 48 | static final String forceArg = "--force"; | |
| 49 | 49 | static final String outputArg = "--output="; | |
| 50 | 50 | static final String exportApplicationArg = "--export"; | |
| 51 | + static final String noJavaArg = "--export"; | ||
| 51 | 52 | static final String platformArg = "--platform="; | |
| 52 | 53 | static final String bitsArg = "--bits="; | |
| 53 | 54 | // static final String preferencesArg = "--preferences="; | |
@@ -109,6 +110,7 @@ public Commander(String[] args) { | |||
| 109 | 110 | int platform = PApplet.platform; // default to this platform | |
| 110 | 111 | int platformBits = 0; | |
| 111 | 112 | int task = HELP; | |
| 113 | + boolean embedJava = true; | ||
| 112 | 114 | ||
| 113 | 115 | // Turns out the output goes as MacRoman or something else useless. | |
| 114 | 116 | // http://code.google.com/p/processing/issues/detail?id=1418 | |
@@ -145,6 +147,9 @@ public Commander(String[] args) { | |||
| 145 | 147 | ||
| 146 | 148 | } else if (arg.equals(exportApplicationArg)) { | |
| 147 | 149 | task = EXPORT; | |
| 150 | + | ||
| 151 | + } else if (arg.equals(noJavaArg)) { | ||
| 152 | + embedJava = false; | ||
| 148 | 153 | ||
| 149 | 154 | } else if (arg.startsWith(platformArg)) { | |
| 150 | 155 | complainAndQuit("The --platform option has been removed from Processing 2.1.", false); | |
@@ -156,7 +161,7 @@ public Commander(String[] args) { | |||
| 156 | 161 | // } | |
| 157 | 162 | ||
| 158 | 163 | } else if (arg.startsWith(bitsArg)) { | |
| 159 | - complainAndQuit("The --platform option has been removed from Processing 2.1.", false); | ||
| 164 | + complainAndQuit("The --bits option has been removed from Processing 2.1.", false); | ||
| 160 | 165 | // String bitsStr = arg.substring(bitsArg.length()); | |
| 161 | 166 | // if (bitsStr.equals("32")) { | |
| 162 | 167 | // platformBits = 32; | |
@@ -279,7 +284,7 @@ public Commander(String[] args) { | |||
| 279 | 284 | Library.hasMultipleArch(platform, build.getImportedLibraries())) { | |
| 280 | 285 | complainAndQuit("This sketch can be exported for 32- or 64-bit, please specify one.", true); | |
| 281 | 286 | } | |
| 282 | - success = build.exportApplication(outputFolder, platform, platformBits); | ||
| 287 | + success = build.exportApplication(outputFolder, platform, platformBits, embedJava); | ||
| 283 | 288 | } | |
| 284 | 289 | } | |
| 285 | 290 | } | |
@@ -369,6 +374,7 @@ static void printCommandLine(PrintStream out) { | |||
| 369 | 374 | out.println("--present Preprocess, compile, and run a sketch full screen."); | |
| 370 | 375 | out.println(); | |
| 371 | 376 | out.println("--export Export an application."); | |
| 377 | + out.println("--no-java Do not embed Java. Use at your own risk!"); | ||
| 372 | 378 | // out.println("--platform Specify the platform (export to application only)."); | |
| 373 | 379 | // out.println(" Should be one of 'windows', 'macosx', or 'linux'."); | |
| 374 | 380 | // out.println("--bits Must be specified if libraries are used that are"); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1118,23 +1118,24 @@ protected boolean exportApplication() throws IOException, SketchException { | |||
| 1118 | 1118 | ||
| 1119 | 1119 | File folder = null; | |
| 1120 | 1120 | String platformName = Base.getPlatformName(); | |
| 1121 | + boolean embedJava = Preferences.getBoolean("export.application.embed_java"); | ||
| 1121 | 1122 | if (Library.hasMultipleArch(PApplet.platform, importedLibraries)) { | |
| 1122 | 1123 | if (Base.getNativeBits() == 32) { | |
| 1123 | 1124 | // export the 32-bit version | |
| 1124 | 1125 | folder = new File(sketch.getFolder(), "application." + platformName + "32"); | |
| 1125 | - if (!exportApplication(folder, PApplet.platform, 32)) { | ||
| 1126 | + if (!exportApplication(folder, PApplet.platform, 32, embedJava)) { | ||
| 1126 | 1127 | return false; | |
| 1127 | 1128 | } | |
| 1128 | 1129 | } else if (Base.getNativeBits() == 64) { | |
| 1129 | 1130 | // export the 64-bit version | |
| 1130 | 1131 | folder = new File(sketch.getFolder(), "application." + platformName + "64"); | |
| 1131 | - if (!exportApplication(folder, PApplet.platform, 64)) { | ||
| 1132 | + if (!exportApplication(folder, PApplet.platform, 64, embedJava)) { | ||
| 1132 | 1133 | return false; | |
| 1133 | 1134 | } | |
| 1134 | 1135 | } | |
| 1135 | 1136 | } else { // just make a single one for this platform | |
| 1136 | 1137 | folder = new File(sketch.getFolder(), "application." + platformName); | |
| 1137 | - if (!exportApplication(folder, PApplet.platform, 0)) { | ||
| 1138 | + if (!exportApplication(folder, PApplet.platform, 0, embedJava)) { | ||
| 1138 | 1139 | return false; | |
| 1139 | 1140 | } | |
| 1140 | 1141 | } | |
@@ -1147,7 +1148,8 @@ protected boolean exportApplication() throws IOException, SketchException { | |||
| 1147 | 1148 | */ | |
| 1148 | 1149 | protected boolean exportApplication(File destFolder, | |
| 1149 | 1150 | int exportPlatform, | |
| 1150 | - int exportBits) throws IOException, SketchException { | ||
| 1151 | + int exportBits, | ||
| 1152 | + boolean embedJava) throws IOException, SketchException { | ||
| 1151 | 1153 | // TODO this should probably be a dialog box instead of a warning | |
| 1152 | 1154 | // on the terminal. And the message should be written better than this. | |
| 1153 | 1155 | // http://code.google.com/p/processing/issues/detail?id=884 | |
@@ -1178,13 +1180,18 @@ protected boolean exportApplication(File destFolder, | |||
| 1178 | 1180 | /// on macosx, need to copy .app skeleton since that's | |
| 1179 | 1181 | /// also where the jar files will be placed | |
| 1180 | 1182 | File dotAppFolder = null; | |
| 1181 | - String jdkFolderName = null; | ||
| 1183 | + // String jdkFolderName = null; | ||
| 1184 | + String jvmRuntime = ""; | ||
| 1182 | 1185 | if (exportPlatform == PConstants.MACOSX) { | |
| 1183 | 1186 | dotAppFolder = new File(destFolder, sketch.getName() + ".app"); | |
| 1184 | 1187 | ||
| 1185 | 1188 | File contentsOrig = new File(Base.getJavaHome(), "../../../../.."); | |
| 1186 | - File jdkFolder = new File(Base.getJavaHome(), "../../.."); | ||
| 1187 | - jdkFolderName = jdkFolder.getCanonicalFile().getName(); | ||
| 1189 | + | ||
| 1190 | + if (embedJava) { | ||
| 1191 | + File jdkFolder = new File(Base.getJavaHome(), "../../.."); | ||
| 1192 | + String jdkFolderName = jdkFolder.getCanonicalFile().getName(); | ||
| 1193 | + jvmRuntime = "<key>JVMRuntime</key>\n <string>" + jdkFolderName + "</string>"; | ||
| 1194 | + } | ||
| 1188 | 1195 | ||
| 1189 | 1196 | // File dotAppSkeleton = mode.getContentFile("application/template.app"); | |
| 1190 | 1197 | // Base.copyDir(dotAppSkeleton, dotAppFolder); | |
@@ -1209,8 +1216,10 @@ protected boolean exportApplication(File destFolder, | |||
| 1209 | 1216 | writer.close(); | |
| 1210 | 1217 | ||
| 1211 | 1218 | // Use faster(?) native copy here (also to do sym links) | |
| 1212 | - Base.copyDirNative(new File(contentsOrig, "PlugIns"), | ||
| 1213 | - new File(contentsFolder, "PlugIns")); | ||
| 1219 | + if (embedJava) { | ||
| 1220 | + Base.copyDirNative(new File(contentsOrig, "PlugIns"), | ||
| 1221 | + new File(contentsFolder, "PlugIns")); | ||
| 1222 | + } | ||
| 1214 | 1223 | ||
| 1215 | 1224 | File resourcesFolder = new File(contentsFolder, "Resources"); | |
| 1216 | 1225 | Base.copyDir(new File(contentsOrig, "Resources/en.lproj"), | |
@@ -1243,10 +1252,14 @@ protected boolean exportApplication(File destFolder, | |||
| 1243 | 1252 | } | |
| 1244 | 1253 | */ | |
| 1245 | 1254 | } else if (exportPlatform == PConstants.LINUX) { | |
| 1246 | - Base.copyDirNative(Base.getJavaHome(), new File(destFolder, "java")); | ||
| 1255 | + if (embedJava) { | ||
| 1256 | + Base.copyDirNative(Base.getJavaHome(), new File(destFolder, "java")); | ||
| 1257 | + } | ||
| 1247 | 1258 | ||
| 1248 | 1259 | } else if (exportPlatform == PConstants.WINDOWS) { | |
| 1249 | - Base.copyDir(Base.getJavaHome(), new File(destFolder, "java")); | ||
| 1260 | + if (embedJava) { | ||
| 1261 | + Base.copyDir(Base.getJavaHome(), new File(destFolder, "java")); | ||
| 1262 | + } | ||
| 1250 | 1263 | } | |
| 1251 | 1264 | ||
| 1252 | 1265 | ||
@@ -1480,9 +1493,9 @@ protected boolean exportApplication(File destFolder, | |||
| 1480 | 1493 | if (lines[i].indexOf("@@") != -1) { | |
| 1481 | 1494 | StringBuffer sb = new StringBuffer(lines[i]); | |
| 1482 | 1495 | int index = 0; | |
| 1483 | - while ((index = sb.indexOf("@@jdk_folder@@")) != -1) { | ||
| 1484 | - sb.replace(index, index + "@@jdk_folder@@".length(), | ||
| 1485 | - jdkFolderName); | ||
| 1496 | + while ((index = sb.indexOf("@@jvm_runtime@@")) != -1) { | ||
| 1497 | + sb.replace(index, index + "@@jvm_runtime@@".length(), | ||
| 1498 | + jvmRuntime); | ||
| 1486 | 1499 | } | |
| 1487 | 1500 | while ((index = sb.indexOf("@@jvm_options_list@@")) != -1) { | |
| 1488 | 1501 | sb.replace(index, index + "@@jvm_options_list@@".length(), | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -266,7 +266,9 @@ protected boolean exportApplicationPrompt() throws IOException, SketchException | |||
| 266 | 266 | label2.setAlignmentX(Component.LEFT_ALIGNMENT); | |
| 267 | 267 | panel.add(label1); | |
| 268 | 268 | panel.add(label2); | |
| 269 | - int wide = label1.getPreferredSize().width; | ||
| 269 | + // The longer line is different between Windows and OS X. | ||
| 270 | + int wide = Math.max(label1.getPreferredSize().width, | ||
| 271 | + label2.getPreferredSize().width); | ||
| 270 | 272 | panel.add(Box.createVerticalStrut(12)); | |
| 271 | 273 | ||
| 272 | 274 | /* | |
@@ -312,6 +314,9 @@ public void itemStateChanged(ItemEvent e) { | |||
| 312 | 314 | panel.add(platformPanel); | |
| 313 | 315 | */ | |
| 314 | 316 | ||
| 317 | + //int indent = new JCheckBox().getPreferredSize().width; | ||
| 318 | + int indent = 0; | ||
| 319 | + | ||
| 315 | 320 | final JCheckBox showStopButton = new JCheckBox("Show a Stop button"); | |
| 316 | 321 | showStopButton.setSelected(Preferences.getBoolean("export.application.stop")); | |
| 317 | 322 | showStopButton.addItemListener(new ItemListener() { | |
@@ -320,7 +325,7 @@ public void itemStateChanged(ItemEvent e) { | |||
| 320 | 325 | } | |
| 321 | 326 | }); | |
| 322 | 327 | showStopButton.setEnabled(Preferences.getBoolean("export.application.fullscreen")); | |
| 323 | - showStopButton.setBorder(new EmptyBorder(3, 13, 6, 13)); | ||
| 328 | + showStopButton.setBorder(new EmptyBorder(3, 13 + indent, 6, 13)); | ||
| 324 | 329 | ||
| 325 | 330 | final JCheckBox fullScreenButton = new JCheckBox("Full Screen (Present mode)"); | |
| 326 | 331 | fullScreenButton.setSelected(Preferences.getBoolean("export.application.fullscreen")); | |
@@ -333,10 +338,33 @@ public void itemStateChanged(ItemEvent e) { | |||
| 333 | 338 | }); | |
| 334 | 339 | fullScreenButton.setBorder(new EmptyBorder(3, 13, 3, 13)); | |
| 335 | 340 | ||
| 341 | + boolean embed = Preferences.getBoolean("export.application.embed_java"); | ||
| 342 | + final String embedWarning = "Embedding Java makes larger applications"; | ||
| 343 | + final String nopeWarning = "Users will have to install the latest Java 7"; | ||
| 344 | + final JLabel warningLabel = new JLabel(embed ? embedWarning : nopeWarning); | ||
| 345 | + warningLabel.setBorder(new EmptyBorder(3, 13 + indent, 3, 13)); | ||
| 346 | + | ||
| 347 | + final JCheckBox embedJavaButton = new JCheckBox("Embed Java"); | ||
| 348 | + embedJavaButton.setSelected(embed); | ||
| 349 | + embedJavaButton.addItemListener(new ItemListener() { | ||
| 350 | + public void itemStateChanged(ItemEvent e) { | ||
| 351 | + boolean selected = embedJavaButton.isSelected(); | ||
| 352 | + Preferences.setBoolean("export.application.embed_java", selected); | ||
| 353 | + if (selected) { | ||
| 354 | + warningLabel.setText(embedWarning); | ||
| 355 | + } else { | ||
| 356 | + warningLabel.setText(nopeWarning); | ||
| 357 | + } | ||
| 358 | + } | ||
| 359 | + }); | ||
| 360 | + embedJavaButton.setBorder(new EmptyBorder(3, 13, 3, 13)); | ||
| 361 | + | ||
| 336 | 362 | JPanel optionPanel = new JPanel(); | |
| 337 | 363 | optionPanel.setLayout(new BoxLayout(optionPanel, BoxLayout.Y_AXIS)); | |
| 338 | 364 | optionPanel.add(fullScreenButton); | |
| 339 | 365 | optionPanel.add(showStopButton); | |
| 366 | + optionPanel.add(embedJavaButton); | ||
| 367 | + optionPanel.add(warningLabel); | ||
| 340 | 368 | optionPanel.setBorder(new TitledBorder("Options")); | |
| 341 | 369 | // wide = Math.max(wide, platformPanel.getPreferredSize().width); | |
| 342 | 370 | optionPanel.setAlignmentX(Component.LEFT_ALIGNMENT); | |
@@ -351,7 +379,7 @@ public void itemStateChanged(ItemEvent e) { | |||
| 351 | 379 | // good = new Dimension(wide, platformPanel.getPreferredSize().height); | |
| 352 | 380 | // platformPanel.setMaximumSize(good); | |
| 353 | 381 | good = new Dimension(wide, optionPanel.getPreferredSize().height); | |
| 354 | - optionPanel.setMaximumSize(good); | ||
| 382 | + // optionPanel.setMaximumSize(good); | ||
| 355 | 383 | ||
| 356 | 384 | String[] options = { "Export", "Cancel" }; | |
| 357 | 385 | final JOptionPane optionPane = new JOptionPane(panel, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,11 @@ | |||
| 1 | 1 | 0223 core | |
| 2 | 2 | ||
| 3 | + opengl | ||
| 4 | + X Using sketchQuality() does not work properly with P3D, OPENGL, P2D | ||
| 5 | + X https://github.com/processing/processing/pull/2157 | ||
| 6 | + X Fix crashes when the sketch window is resized | ||
| 7 | + X https://github.com/processing/processing/issues/1880 | ||
| 8 | + X https://github.com/processing/processing/pull/2156 | ||
| 3 | 9 | ||
| 4 | 10 | high | |
| 5 | 11 | _ Sort out blending differences with P2D/P3D | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,8 +32,7 @@ | |||
| 32 | 32 | <string>Created with Processing</string> | |
| 33 | 33 | <!-- End of the set that can be customized --> | |
| 34 | 34 | ||
| 35 | - <key>JVMRuntime</key> | ||
| 36 | - <string>@@jdk_folder@@</string> | ||
| 35 | + @@jvm_runtime@@ | ||
| 37 | 36 | ||
| 38 | 37 | <key>JVMMainClassName</key> | |
| 39 | 38 | <string>@@sketch@@</string> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,10 +1,11 @@ | |||
| 1 | 1 | 0223 pde | |
| 2 | - _ reset font smoothing for everyone to its default by changing the pref | ||
| 2 | + X reset font smoothing for everyone to its default by changing the pref | ||
| 3 | 3 | # To reset everyone's default, replaced editor.antialias with editor.smooth | |
| 4 | 4 | # for 2.1. Fonts are unusably gross on OS X (and Linux) w/o smoothing and | |
| 5 | 5 | # the Oracle JVM, and many longtime users have anti-aliasing turned off. | |
| 6 | 6 | X https://github.com/processing/processing/issues/2164 | |
| 7 | 7 | X https://github.com/processing/processing/issues/2160 | |
| 8 | + X Add option to not embed the Java runtime (saves space, but breakage) | ||
| 8 | 9 | ||
| 9 | 10 | _ emacs style errors in commander aren't quite right | |
| 10 | 11 | _ https://github.com/processing/processing/issues/2158 | |
| Back | FazBrowse Home | New Git URL |
0 commit comments