Skip to content

Commit 5b88aa5

Browse files
author
monkstone
committed
update to include sketchbook_path samples/configRP5/configRP5.pde
1 parent 06eb25e commit 5b88aa5

2 files changed

Lines changed: 31 additions & 122 deletions

File tree

samples/configRP5/configRP5.pde

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
import java.io.File;
22

3-
Button enter, nojruby;
3+
Button enter, nojruby, winver;
44
String processingRoot = "enter your processing root here"; // edit this line in the sketch
55
String done = "Done";
66
String OS = System.getProperty("os.name").toLowerCase();
7-
String home, suggestion, separator, root;
7+
String home, suggestion, separator, root, sketchbookPath;
88
PFont font;
9-
float rectX, rectX2, rectY; // Position of buttons
9+
float rectX, rectX2, rectX3, rectY; // Position of buttons
1010
float rectHeight = 30; // height of rect
1111
float rectWidth = 90; // width of rect
12-
int rectColor, rectColor2;
13-
int rectHighlight, rectHighlight2;
12+
int rectColor, rectColor2, rectColor3;
13+
int rectHighlight, rectHighlight2, rectHighlight3;
1414
int currentColor;
15-
int selectedColor;
15+
int selectedColor, selectedColor2, selectedColor3;
1616
boolean acceptOver = false;
1717
boolean noJruby = false;
1818
boolean selected = false;
19+
boolean eightOne = false;
1920
String jruby = "true";
2021
// The JSON object
2122
JSONObject json;
@@ -30,19 +31,31 @@ void setup() {
3031
font = createFont("Helvetica", 18);
3132
if (OS.contains("mac")) {
3233
suggestion = "/Applications/Processing.app/Contents/Resources/Java";
34+
sketchbookPath = home + separator + "Documents/Processing/sketchbook";
35+
} else if (OS.contains("windows")) {
36+
sketchbookPath = (eightOne) ? home + separator + "Documents" + separator +"sketchbook" :
37+
home + separator + "My Documents" + separator +"sketchbook";
38+
suggestion = home + separator + "processing-2.2.1";
3339
} else {
40+
sketchbookPath = home + separator + "sketchbook";
3441
suggestion = home + separator + "processing-2.2.1";
3542
}
3643
rectColor = color(140);
3744
rectColor2 = color(140);
45+
rectColor3 = color(140);
3846
rectHighlight = color(100);
3947
rectHighlight2 = color(100);
48+
rectHighlight3 = color(100);
4049
selectedColor = color(0);
50+
selectedColor2 = color(0);
51+
selectedColor3 = color(0);
4152
rectX = rectWidth + 20;
4253
rectX2 = rectWidth + 150;
54+
rectX3 = rectWidth + 300;
4355
rectY = height * 0.8 - rectHeight / 4;
4456
enter = new Button(rectX2, rectY, rectWidth, rectHeight, "enter");
4557
nojruby = new Button(rectX, rectY, rectWidth, rectHeight, "nojruby");
58+
winver = new Button(rectX3, rectY, rectWidth, rectHeight, "Win 8.1+");
4659
}
4760

4861
void draw() {
@@ -62,9 +75,11 @@ void draw() {
6275
if (acceptOver) {
6376
enter.draw(rectHighlight);
6477
nojruby.draw(rectHighlight2);
78+
winver.draw(rectHighlight3);
6579
} else {
6680
enter.draw(rectColor);
6781
nojruby.draw(rectColor2);
82+
winver.draw(rectColor3);
6883
}
6984
}
7085

@@ -73,6 +88,7 @@ void writeRoot() {
7388
rectHighlight = selectedColor;
7489
json.setString("PROCESSING_ROOT", processingRoot);
7590
json.setString("JRUBY", jruby);
91+
json.setString("sketchbook_path", sketchbookPath);
7692
json.setInt("X_OFF", floor(displayWidth * 0.1));
7793
json.setInt("Y_OFF", floor(displayHeight * 0.1));
7894

@@ -106,17 +122,21 @@ void update(float x, float y) {
106122
}
107123

108124

125+
109126
void mouseClicked() {
110127
update(mouseX, mouseY);
111128
if (acceptOver) {
112129
rectColor = selectedColor;
113130
rectHighlight = selectedColor;
114131
writeRoot();
115-
}
116-
if (noJruby) {
117-
rectColor2 = selectedColor;
118-
rectHighlight2 = selectedColor;
132+
} else if (noJruby) {
133+
rectColor2 = selectedColor2;
134+
rectHighlight2 = selectedColor2;
119135
jruby = "false";
136+
} else if (!eightOne) {
137+
rectColor3 = selectedColor3;
138+
rectHighlight3 = selectedColor3;
139+
eightOne = true;
120140
}
121141
}
122142

@@ -145,3 +165,4 @@ class Button {
145165
&& mouseY >= y && mouseY <= y + h);
146166
}
147167
}
168+

samples/external_library/java_processing/proscene/camera_customization.rb~

Lines changed: 0 additions & 112 deletions
This file was deleted.

0 commit comments

Comments
 (0)