Skip to content

Commit 20c2859

Browse files
committed
get core loading properly on Windows, change displays to be numbered at 0
1 parent 72ce6b6 commit 20c2859

File tree

9 files changed

+85
-79
lines changed

9 files changed

+85
-79
lines changed

app/build.xml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -105,29 +105,17 @@
105105
<fail if="windows" unless="java_tools_found"
106106
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." />
107107

108-
<javac target="1.5"
108+
<javac target="1.6"
109109
destdir="bin"
110110
excludes="**/tools/format/**"
111111
encoding="UTF-8"
112112
includeAntRuntime="false"
113-
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"
113+
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"
114114
debug="on"
115115
>
116116
<src path="src" />
117117
<src path="generated" />
118118
</javac>
119-
<!--
120-
<javac target="1.5"
121-
srcdir="../android/tool/src"
122-
destdir="bin"
123-
encoding="UTF-8"
124-
includeAntRuntime="false"
125-
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"
126-
/>
127-
<copy todir="bin/processing/app/tools/android/data">
128-
<fileset dir="../android/tool/src/processing/app/tools/android/data/" />
129-
</copy>
130-
-->
131119
</target>
132120

133121
<target name="build" depends="compile" description="Build PDE">

app/src/processing/app/Preferences.java

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -278,11 +278,11 @@ public void actionPerformed(ActionEvent e) {
278278
fontSizeField.setText(String.valueOf(editorFont.getSize()));
279279
top += d.height + GUI_BETWEEN;
280280

281-
282-
// [ ] Use smooth text in editor window
281+
282+
// [ ] Use smooth text in editor window
283283

284284
editorAntialiasBox =
285-
new JCheckBox("Use smooth text in editor window " +
285+
new JCheckBox("Use smooth text in editor window " +
286286
"(requires restart of Processing)");
287287
pain.add(editorAntialiasBox);
288288
d = editorAntialiasBox.getPreferredSize();
@@ -291,7 +291,7 @@ public void actionPerformed(ActionEvent e) {
291291
right = Math.max(right, left + d.width);
292292
top += d.height + GUI_BETWEEN;
293293

294-
294+
295295
// [ ] Increase maximum available memory to [______] MB
296296

297297
Container memoryBox = Box.createHorizontalBox();
@@ -348,16 +348,16 @@ public void actionPerformed(ActionEvent e) {
348348
checkUpdatesBox.setBounds(left, top, d.width + 10, d.height);
349349
right = Math.max(right, left + d.width);
350350
top += d.height + GUI_BETWEEN;
351-
352-
351+
352+
353353
// Run sketches on display [ 1 ]
354354

355355
Container displayBox = Box.createHorizontalBox();
356356
JLabel displayLabel = new JLabel("Run sketches on display ");
357357
final String tip = "<html>" +
358358
"Sets the display where sketches are initially placed.<br>" +
359359
"As usual, if the sketch window is moved, it will re-open<br>" +
360-
"at the same location, however when running in present<br>" +
360+
"at the same location, however when running in present<br>" +
361361
"(full screen) mode, this display will always be used.";
362362
displayLabel.setToolTipText(tip);
363363
displayBox.add(displayLabel);
@@ -381,10 +381,10 @@ public void actionPerformed(ActionEvent e) {
381381
right = Math.max(right, left + d.width);
382382
top += d.height + GUI_BETWEEN;
383383
}
384-
385-
384+
385+
386386
// Launch programs as [ ] 32-bit [ ] 64-bit (Mac OS X only)
387-
387+
388388
if (Base.isMacOS()) {
389389
box = Box.createHorizontalBox();
390390
label = new JLabel("Launch programs in ");
@@ -393,17 +393,17 @@ public void actionPerformed(ActionEvent e) {
393393
box.add(bitsThirtyTwoButton);
394394
bitsSixtyFourButton = new JRadioButton("64-bit mode");
395395
box.add(bitsSixtyFourButton);
396-
396+
397397
ButtonGroup bg = new ButtonGroup();
398398
bg.add(bitsThirtyTwoButton);
399399
bg.add(bitsSixtyFourButton);
400-
400+
401401
pain.add(box);
402402
d = box.getPreferredSize();
403403
box.setBounds(left, top, d.width, d.height);
404404
top += d.height + GUI_BETWEEN;
405405
}
406-
406+
407407

408408
// More preferences are in the ...
409409

@@ -543,7 +543,7 @@ protected void disposeFrame() {
543543
*/
544544
protected void applyFrame() {
545545
setBoolean("editor.antialias", editorAntialiasBox.isSelected());
546-
546+
547547
// put each of the settings into the table
548548
setBoolean("export.applet.separate_jar_files",
549549
exportSeparateBox.isSelected());
@@ -571,7 +571,7 @@ protected void applyFrame() {
571571
displayIndex = d;
572572
}
573573
}
574-
setInteger("run.display", displayIndex + 1);
574+
setInteger("run.display", displayIndex);
575575

576576
setBoolean("run.options.memory", memoryOverrideBox.isSelected());
577577
int memoryMin = Preferences.getInteger("run.options.memory.initial");
@@ -656,13 +656,13 @@ protected void showFrame(Editor editor) {
656656
setSelected(getBoolean("update.check"));
657657

658658
updateDisplayList();
659-
int displayNum = getInteger("run.display") - 1;
659+
int displayNum = getInteger("run.display");
660660
// System.out.println("display is " + displayNum + ", d count is " + displayCount);
661661
if (displayNum >= 0 && displayNum < displayCount) {
662662
// System.out.println("setting num to " + displayNum);
663663
displaySelectionBox.setSelectedIndex(displayNum);
664664
}
665-
665+
666666
memoryOverrideBox.
667667
setSelected(getBoolean("run.options.memory"));
668668
memoryField.
@@ -681,7 +681,7 @@ protected void showFrame(Editor editor) {
681681
bitsThirtyTwoButton.setEnabled(false);
682682
}
683683
}
684-
684+
685685
if (autoAssociateBox != null) {
686686
autoAssociateBox.
687687
setSelected(getBoolean("platform.auto_file_type_associations"));
@@ -697,7 +697,7 @@ void updateDisplayList() {
697697
// displaySelectionBox.removeAll();
698698
String[] items = new String[displayCount];
699699
for (int i = 0; i < displayCount; i++) {
700-
items[i] = String.valueOf(i + 1);
700+
items[i] = String.valueOf(i);
701701
// displaySelectionBox.add(String.valueOf(i + 1));
702702
}
703703
// PApplet.println(items);
@@ -706,22 +706,22 @@ void updateDisplayList() {
706706
}
707707

708708

709-
// Workaround for Apple bullsh*t caused by their not releasing a 32-bit
709+
// Workaround for Apple bullsh*t caused by their not releasing a 32-bit
710710
// version of Java for Mac OS X 10.5.
711711
// static public String checkBits() {
712712
// String bits = Preferences.get("run.options.bits");
713713
// if (bits == null) {
714714
// if (System.getProperty("os.version").startsWith("10.5")) {
715-
// bits = "64";
715+
// bits = "64";
716716
// } else {
717717
// bits = "32";
718718
// }
719719
// Preferences.set("run.options.bits", bits);
720720
// }
721721
// return bits;
722722
// }
723-
724-
723+
724+
725725
// .................................................................
726726

727727

@@ -800,8 +800,8 @@ static public String getDefault(String attribute) {
800800
static public void set(String attribute, String value) {
801801
table.put(attribute, value);
802802
}
803-
804-
803+
804+
805805
static public void unset(String attribute) {
806806
table.remove(attribute);
807807
}

app/src/processing/mode/java/JavaMode.java

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class JavaMode extends Mode {
4545
// found in the sketchbook)
4646
// static public String librariesClassPath;
4747

48-
48+
4949
public Editor createEditor(Base base, String path, EditorState state) {
5050
return new JavaEditor(base, path, state, this);
5151
}
@@ -60,7 +60,7 @@ public JavaMode(Base base, File folder) {
6060
Base.showError("Problem loading keywords",
6161
"Could not load keywords.txt, please re-install Processing.", e);
6262
}
63-
63+
6464
/*
6565
item = newJMenuItem("Export", 'E');
6666
if (editor != null) {
@@ -116,7 +116,7 @@ protected void loadKeywords() throws IOException {
116116
}
117117
}
118118

119-
119+
120120
public String getTitle() {
121121
return "Standard";
122122
}
@@ -126,62 +126,62 @@ public String getTitle() {
126126
// return new Toolbar(editor);
127127
// }
128128

129-
129+
130130
// public Formatter createFormatter() {
131131
// return new AutoFormat();
132132
// }
133-
134-
133+
134+
135135
// public Editor createEditor(Base ibase, String path, int[] location) {
136136
// }
137-
137+
138138

139139
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
140140

141141

142142
public File[] getExampleCategoryFolders() {
143143
// Basics, Topics, OpenGL, Books
144-
return new File[] {
144+
return new File[] {
145145
new File(examplesFolder, "Basics"),
146146
new File(examplesFolder, "Topics"),
147147
new File(examplesFolder, "OpenGL"),
148148
new File(examplesFolder, "Books")
149149
};
150150
}
151-
151+
152152

153153
public String getDefaultExtension() {
154154
return "pde";
155155
}
156-
157-
156+
157+
158158
public String[] getExtensions() {
159159
return new String[] { "pde", "java" };
160160
}
161161

162-
162+
163163
public String[] getIgnorable() {
164-
return new String[] {
164+
return new String[] {
165165
"applet",
166166
"application.macosx",
167167
"application.windows",
168168
"application.linux"
169169
};
170170
}
171-
172-
171+
172+
173173
public Library getCoreLibrary() {
174174
if (coreLibrary == null) {
175175
File coreFolder = Base.getContentFile("core");
176176
coreLibrary = new Library(coreFolder, null);
177177
}
178178
return coreLibrary;
179179
}
180-
181-
180+
181+
182182
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
183183

184-
184+
185185
public Runner handleRun(Sketch sketch, RunnerListener listener) throws SketchException {
186186
JavaBuild build = new JavaBuild(sketch);
187187
String appletClassName = build.build(false);
@@ -208,7 +208,7 @@ public void run() {
208208
runtime.launch(true);
209209
}
210210
}).start();
211-
return runtime;
211+
return runtime;
212212
}
213213
return null;
214214
}
@@ -220,14 +220,14 @@ public void run() {
220220
// runtime = null; // will this help?
221221
// }
222222
// }
223-
224-
223+
224+
225225
// public boolean handleExportApplet(Sketch sketch) throws SketchException, IOException {
226226
// JavaBuild build = new JavaBuild(sketch);
227227
// return build.exportApplet();
228228
// }
229-
230-
229+
230+
231231
public boolean handleExportApplication(Sketch sketch) throws SketchException, IOException {
232232
JavaBuild build = new JavaBuild(sketch);
233233
return build.exportApplication();

app/src/processing/mode/java/runner/Runner.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ protected String[] getSketchParams() {
220220
} else {
221221
params.add("processing.core.PApplet");
222222

223-
// get the stored device index (starts at 1)
224-
int runDisplay = Preferences.getInteger("run.display") - 1;
223+
// get the stored device index (starts at 0)
224+
int runDisplay = Preferences.getInteger("run.display");
225225

226226
// If there was a saved location (this guy has been run more than once)
227227
// then the location will be set to the last position of the sketch window.

build/build.xml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,12 @@
463463
<fileset dir="shared" includes="modes/**" />
464464
<fileset file="shared/revisions.txt" />
465465
</copy>
466+
467+
<!--
468+
<copy todir="linux/work/lib">
469+
<fileset dir=".." includes="core/library/**" />
470+
</copy>
471+
-->
466472

467473
<copy todir="linux/work/lib" flatten="true">
468474
<fileset refid="runtime.jars" />
@@ -573,7 +579,13 @@ http://www.gnu.org/software/tar/manual/html_section/transform.html
573579
<fileset dir="shared" includes="modes/**" />
574580
<fileset file="shared/revisions.txt" />
575581
</copy>
576-
582+
583+
<!--
584+
<copy todir="windows/work/lib">
585+
<fileset dir=".." includes="core/library/**" />
586+
</copy>
587+
-->
588+
577589
<antcall target="assemble">
578590
<param name="target.path" value="windows/work" />
579591
</antcall>

build/linux/processing

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ CLASSPATH="$CLASSPATH"${CLASSPATH:+:}"$JDKCP"
8888
for LIB in "$APPDIR"/lib/*.jar; do
8989
CLASSPATH="$CLASSPATH"${CLASSPATH:+:}"$LIB"
9090
done
91+
for LIB in "$APPDIR"/core/library/*.jar; do
92+
CLASSPATH="$CLASSPATH"${CLASSPATH:+:}"$LIB"
93+
done
9194
export CLASSPATH
9295
log CLASSPATH
9396

build/shared/lib/preferences.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ run.options.bits.macosx = 32
178178
# Index of the display to use for running sketches (starts at 1).
179179
# Kept this 1-indexed because older vesions of Processing were setting
180180
# the preference even before it was being used.
181-
run.display = 1
181+
run.display = 0
182182

183183
# set internally
184184
#run.window.bgcolor=

0 commit comments

Comments
 (0)