mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
get core loading properly on Windows, change displays to be numbered at 0
This commit is contained in:
+2
-14
@@ -105,29 +105,17 @@
|
||||
<fail if="windows" unless="java_tools_found"
|
||||
message="The JAVA_HOME variable must be set to the location of a full JDK. For instance, on Windows, this might be c:\jdk1.6.0_19." />
|
||||
|
||||
<javac target="1.5"
|
||||
<javac target="1.6"
|
||||
destdir="bin"
|
||||
excludes="**/tools/format/**"
|
||||
encoding="UTF-8"
|
||||
includeAntRuntime="false"
|
||||
classpath="../core/core.jar; ${env.JAVA_HOME}/lib/tools.jar; lib/ant.jar; lib/ant-launcher.jar; lib/antlr.jar; lib/apple.jar; lib/ecj.jar; lib/jna.jar"
|
||||
classpath="../core/library/core.jar; ${env.JAVA_HOME}/lib/tools.jar; lib/ant.jar; lib/ant-launcher.jar; lib/antlr.jar; lib/apple.jar; lib/ecj.jar; lib/jna.jar"
|
||||
debug="on"
|
||||
>
|
||||
<src path="src" />
|
||||
<src path="generated" />
|
||||
</javac>
|
||||
<!--
|
||||
<javac target="1.5"
|
||||
srcdir="../android/tool/src"
|
||||
destdir="bin"
|
||||
encoding="UTF-8"
|
||||
includeAntRuntime="false"
|
||||
classpath="../core/core.jar; ${env.JAVA_HOME}/lib/tools.jar; lib/ant.jar; lib/ant-launcher.jar; lib/antlr.jar; lib/apple.jar; lib/ecj.jar; lib/jna.jar"
|
||||
/>
|
||||
<copy todir="bin/processing/app/tools/android/data">
|
||||
<fileset dir="../android/tool/src/processing/app/tools/android/data/" />
|
||||
</copy>
|
||||
-->
|
||||
</target>
|
||||
|
||||
<target name="build" depends="compile" description="Build PDE">
|
||||
|
||||
@@ -278,11 +278,11 @@ public class Preferences {
|
||||
fontSizeField.setText(String.valueOf(editorFont.getSize()));
|
||||
top += d.height + GUI_BETWEEN;
|
||||
|
||||
|
||||
// [ ] Use smooth text in editor window
|
||||
|
||||
// [ ] Use smooth text in editor window
|
||||
|
||||
editorAntialiasBox =
|
||||
new JCheckBox("Use smooth text in editor window " +
|
||||
new JCheckBox("Use smooth text in editor window " +
|
||||
"(requires restart of Processing)");
|
||||
pain.add(editorAntialiasBox);
|
||||
d = editorAntialiasBox.getPreferredSize();
|
||||
@@ -291,7 +291,7 @@ public class Preferences {
|
||||
right = Math.max(right, left + d.width);
|
||||
top += d.height + GUI_BETWEEN;
|
||||
|
||||
|
||||
|
||||
// [ ] Increase maximum available memory to [______] MB
|
||||
|
||||
Container memoryBox = Box.createHorizontalBox();
|
||||
@@ -348,8 +348,8 @@ public class Preferences {
|
||||
checkUpdatesBox.setBounds(left, top, d.width + 10, d.height);
|
||||
right = Math.max(right, left + d.width);
|
||||
top += d.height + GUI_BETWEEN;
|
||||
|
||||
|
||||
|
||||
|
||||
// Run sketches on display [ 1 ]
|
||||
|
||||
Container displayBox = Box.createHorizontalBox();
|
||||
@@ -357,7 +357,7 @@ public class Preferences {
|
||||
final String tip = "<html>" +
|
||||
"Sets the display where sketches are initially placed.<br>" +
|
||||
"As usual, if the sketch window is moved, it will re-open<br>" +
|
||||
"at the same location, however when running in present<br>" +
|
||||
"at the same location, however when running in present<br>" +
|
||||
"(full screen) mode, this display will always be used.";
|
||||
displayLabel.setToolTipText(tip);
|
||||
displayBox.add(displayLabel);
|
||||
@@ -381,10 +381,10 @@ public class Preferences {
|
||||
right = Math.max(right, left + d.width);
|
||||
top += d.height + GUI_BETWEEN;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Launch programs as [ ] 32-bit [ ] 64-bit (Mac OS X only)
|
||||
|
||||
|
||||
if (Base.isMacOS()) {
|
||||
box = Box.createHorizontalBox();
|
||||
label = new JLabel("Launch programs in ");
|
||||
@@ -393,17 +393,17 @@ public class Preferences {
|
||||
box.add(bitsThirtyTwoButton);
|
||||
bitsSixtyFourButton = new JRadioButton("64-bit mode");
|
||||
box.add(bitsSixtyFourButton);
|
||||
|
||||
|
||||
ButtonGroup bg = new ButtonGroup();
|
||||
bg.add(bitsThirtyTwoButton);
|
||||
bg.add(bitsSixtyFourButton);
|
||||
|
||||
|
||||
pain.add(box);
|
||||
d = box.getPreferredSize();
|
||||
box.setBounds(left, top, d.width, d.height);
|
||||
top += d.height + GUI_BETWEEN;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// More preferences are in the ...
|
||||
|
||||
@@ -543,7 +543,7 @@ public class Preferences {
|
||||
*/
|
||||
protected void applyFrame() {
|
||||
setBoolean("editor.antialias", editorAntialiasBox.isSelected());
|
||||
|
||||
|
||||
// put each of the settings into the table
|
||||
setBoolean("export.applet.separate_jar_files",
|
||||
exportSeparateBox.isSelected());
|
||||
@@ -571,7 +571,7 @@ public class Preferences {
|
||||
displayIndex = d;
|
||||
}
|
||||
}
|
||||
setInteger("run.display", displayIndex + 1);
|
||||
setInteger("run.display", displayIndex);
|
||||
|
||||
setBoolean("run.options.memory", memoryOverrideBox.isSelected());
|
||||
int memoryMin = Preferences.getInteger("run.options.memory.initial");
|
||||
@@ -656,13 +656,13 @@ public class Preferences {
|
||||
setSelected(getBoolean("update.check"));
|
||||
|
||||
updateDisplayList();
|
||||
int displayNum = getInteger("run.display") - 1;
|
||||
int displayNum = getInteger("run.display");
|
||||
// System.out.println("display is " + displayNum + ", d count is " + displayCount);
|
||||
if (displayNum >= 0 && displayNum < displayCount) {
|
||||
// System.out.println("setting num to " + displayNum);
|
||||
displaySelectionBox.setSelectedIndex(displayNum);
|
||||
}
|
||||
|
||||
|
||||
memoryOverrideBox.
|
||||
setSelected(getBoolean("run.options.memory"));
|
||||
memoryField.
|
||||
@@ -681,7 +681,7 @@ public class Preferences {
|
||||
bitsThirtyTwoButton.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (autoAssociateBox != null) {
|
||||
autoAssociateBox.
|
||||
setSelected(getBoolean("platform.auto_file_type_associations"));
|
||||
@@ -697,7 +697,7 @@ public class Preferences {
|
||||
// displaySelectionBox.removeAll();
|
||||
String[] items = new String[displayCount];
|
||||
for (int i = 0; i < displayCount; i++) {
|
||||
items[i] = String.valueOf(i + 1);
|
||||
items[i] = String.valueOf(i);
|
||||
// displaySelectionBox.add(String.valueOf(i + 1));
|
||||
}
|
||||
// PApplet.println(items);
|
||||
@@ -706,13 +706,13 @@ public class Preferences {
|
||||
}
|
||||
|
||||
|
||||
// Workaround for Apple bullsh*t caused by their not releasing a 32-bit
|
||||
// Workaround for Apple bullsh*t caused by their not releasing a 32-bit
|
||||
// version of Java for Mac OS X 10.5.
|
||||
// static public String checkBits() {
|
||||
// String bits = Preferences.get("run.options.bits");
|
||||
// if (bits == null) {
|
||||
// if (System.getProperty("os.version").startsWith("10.5")) {
|
||||
// bits = "64";
|
||||
// bits = "64";
|
||||
// } else {
|
||||
// bits = "32";
|
||||
// }
|
||||
@@ -720,8 +720,8 @@ public class Preferences {
|
||||
// }
|
||||
// return bits;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
// .................................................................
|
||||
|
||||
|
||||
@@ -800,8 +800,8 @@ public class Preferences {
|
||||
static public void set(String attribute, String value) {
|
||||
table.put(attribute, value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static public void unset(String attribute) {
|
||||
table.remove(attribute);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class JavaMode extends Mode {
|
||||
// found in the sketchbook)
|
||||
// static public String librariesClassPath;
|
||||
|
||||
|
||||
|
||||
public Editor createEditor(Base base, String path, EditorState state) {
|
||||
return new JavaEditor(base, path, state, this);
|
||||
}
|
||||
@@ -60,7 +60,7 @@ public class JavaMode extends Mode {
|
||||
Base.showError("Problem loading keywords",
|
||||
"Could not load keywords.txt, please re-install Processing.", e);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
item = newJMenuItem("Export", 'E');
|
||||
if (editor != null) {
|
||||
@@ -116,7 +116,7 @@ public class JavaMode extends Mode {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getTitle() {
|
||||
return "Standard";
|
||||
}
|
||||
@@ -126,50 +126,50 @@ public class JavaMode extends Mode {
|
||||
// return new Toolbar(editor);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// public Formatter createFormatter() {
|
||||
// return new AutoFormat();
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
// public Editor createEditor(Base ibase, String path, int[] location) {
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
|
||||
public File[] getExampleCategoryFolders() {
|
||||
// Basics, Topics, OpenGL, Books
|
||||
return new File[] {
|
||||
return new File[] {
|
||||
new File(examplesFolder, "Basics"),
|
||||
new File(examplesFolder, "Topics"),
|
||||
new File(examplesFolder, "OpenGL"),
|
||||
new File(examplesFolder, "Books")
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getDefaultExtension() {
|
||||
return "pde";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public String[] getExtensions() {
|
||||
return new String[] { "pde", "java" };
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String[] getIgnorable() {
|
||||
return new String[] {
|
||||
return new String[] {
|
||||
"applet",
|
||||
"application.macosx",
|
||||
"application.windows",
|
||||
"application.linux"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public Library getCoreLibrary() {
|
||||
if (coreLibrary == null) {
|
||||
File coreFolder = Base.getContentFile("core");
|
||||
@@ -177,11 +177,11 @@ public class JavaMode extends Mode {
|
||||
}
|
||||
return coreLibrary;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
|
||||
|
||||
public Runner handleRun(Sketch sketch, RunnerListener listener) throws SketchException {
|
||||
JavaBuild build = new JavaBuild(sketch);
|
||||
String appletClassName = build.build(false);
|
||||
@@ -208,7 +208,7 @@ public class JavaMode extends Mode {
|
||||
runtime.launch(true);
|
||||
}
|
||||
}).start();
|
||||
return runtime;
|
||||
return runtime;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -220,14 +220,14 @@ public class JavaMode extends Mode {
|
||||
// runtime = null; // will this help?
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
// public boolean handleExportApplet(Sketch sketch) throws SketchException, IOException {
|
||||
// JavaBuild build = new JavaBuild(sketch);
|
||||
// return build.exportApplet();
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
public boolean handleExportApplication(Sketch sketch) throws SketchException, IOException {
|
||||
JavaBuild build = new JavaBuild(sketch);
|
||||
return build.exportApplication();
|
||||
|
||||
@@ -220,8 +220,8 @@ public class Runner implements MessageConsumer {
|
||||
} else {
|
||||
params.add("processing.core.PApplet");
|
||||
|
||||
// get the stored device index (starts at 1)
|
||||
int runDisplay = Preferences.getInteger("run.display") - 1;
|
||||
// get the stored device index (starts at 0)
|
||||
int runDisplay = Preferences.getInteger("run.display");
|
||||
|
||||
// If there was a saved location (this guy has been run more than once)
|
||||
// then the location will be set to the last position of the sketch window.
|
||||
|
||||
+13
-1
@@ -463,6 +463,12 @@
|
||||
<fileset dir="shared" includes="modes/**" />
|
||||
<fileset file="shared/revisions.txt" />
|
||||
</copy>
|
||||
|
||||
<!--
|
||||
<copy todir="linux/work/lib">
|
||||
<fileset dir=".." includes="core/library/**" />
|
||||
</copy>
|
||||
-->
|
||||
|
||||
<copy todir="linux/work/lib" flatten="true">
|
||||
<fileset refid="runtime.jars" />
|
||||
@@ -573,7 +579,13 @@ http://www.gnu.org/software/tar/manual/html_section/transform.html
|
||||
<fileset dir="shared" includes="modes/**" />
|
||||
<fileset file="shared/revisions.txt" />
|
||||
</copy>
|
||||
|
||||
|
||||
<!--
|
||||
<copy todir="windows/work/lib">
|
||||
<fileset dir=".." includes="core/library/**" />
|
||||
</copy>
|
||||
-->
|
||||
|
||||
<antcall target="assemble">
|
||||
<param name="target.path" value="windows/work" />
|
||||
</antcall>
|
||||
|
||||
@@ -88,6 +88,9 @@ CLASSPATH="$CLASSPATH"${CLASSPATH:+:}"$JDKCP"
|
||||
for LIB in "$APPDIR"/lib/*.jar; do
|
||||
CLASSPATH="$CLASSPATH"${CLASSPATH:+:}"$LIB"
|
||||
done
|
||||
for LIB in "$APPDIR"/core/library/*.jar; do
|
||||
CLASSPATH="$CLASSPATH"${CLASSPATH:+:}"$LIB"
|
||||
done
|
||||
export CLASSPATH
|
||||
log CLASSPATH
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ run.options.bits.macosx = 32
|
||||
# Index of the display to use for running sketches (starts at 1).
|
||||
# Kept this 1-indexed because older vesions of Processing were setting
|
||||
# the preference even before it was being used.
|
||||
run.display = 1
|
||||
run.display = 0
|
||||
|
||||
# set internally
|
||||
#run.window.bgcolor=
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<classPath>
|
||||
<mainClass>processing.app.Base</mainClass>
|
||||
<cp>lib/pde.jar</cp>
|
||||
<cp>lib/core.jar</cp>
|
||||
<cp>core/library/core.jar</cp>
|
||||
<cp>lib/jna.jar</cp>
|
||||
<cp>lib/ecj.jar</cp>
|
||||
<cp>lib/antlr.jar</cp>
|
||||
|
||||
@@ -655,9 +655,9 @@ public class PApplet extends Applet
|
||||
* ( end auto-generated )
|
||||
* @webref environment
|
||||
*/
|
||||
@Deprecated
|
||||
@Deprecated
|
||||
public boolean online = false;
|
||||
// This is deprecated because it's poorly named (and even more poorly
|
||||
// This is deprecated because it's poorly named (and even more poorly
|
||||
// understood). Further, we'll probably be removing applets soon, in which
|
||||
// case this won't work at all. If you want this feature, you can check
|
||||
// whether getAppletContext() returns null.
|
||||
@@ -945,7 +945,7 @@ public class PApplet extends Applet
|
||||
// new Exception().printStackTrace(System.out);
|
||||
|
||||
paused = false; // unpause the thread
|
||||
|
||||
|
||||
resume();
|
||||
resumeMethods.handle();
|
||||
|
||||
@@ -1827,7 +1827,7 @@ public class PApplet extends Applet
|
||||
if (!online) {
|
||||
start();
|
||||
}
|
||||
|
||||
|
||||
while ((Thread.currentThread() == thread) && !finished) {
|
||||
if (paused) {
|
||||
debug("PApplet.run() paused, calling object wait...");
|
||||
@@ -2197,17 +2197,17 @@ public class PApplet extends Applet
|
||||
comp.removeKeyListener(this);
|
||||
comp.removeFocusListener(this);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Call to remove, then add, listeners to a component.
|
||||
* Avoids issues with double-adding.
|
||||
|
||||
/**
|
||||
* Call to remove, then add, listeners to a component.
|
||||
* Avoids issues with double-adding.
|
||||
*/
|
||||
public void updateListeners(Component comp) {
|
||||
removeListeners(comp);
|
||||
addListeners(comp);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -5296,7 +5296,7 @@ public class PApplet extends Applet
|
||||
return new XML(file);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Table loadTable(String filename) {
|
||||
return new Table(this, filename);
|
||||
}
|
||||
@@ -6682,10 +6682,10 @@ public class PApplet extends Applet
|
||||
if (question != -1) {
|
||||
extension = extension.substring(0, question);
|
||||
}
|
||||
|
||||
|
||||
return extension;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -9156,6 +9156,9 @@ public class PApplet extends Applet
|
||||
} else {
|
||||
System.err.println("Display " + value + " does not exist, " +
|
||||
"using the default display instead.");
|
||||
for (int i = 0; i < devices.length; i++) {
|
||||
System.err.println(i + " is " + devices[i]);
|
||||
}
|
||||
}
|
||||
|
||||
} else if (param.equals(ARGS_BGCOLOR)) {
|
||||
|
||||
Reference in New Issue
Block a user