Skip to content

Commit ef7bdc3

Browse files
committed
Compatibility adjustments
1 parent 005ef42 commit ef7bdc3

File tree

30 files changed

+618
-649
lines changed

30 files changed

+618
-649
lines changed

02_M/M_1_5_02_TOOL/GUI.pde

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ void setupGUI(){
2424
controlP5.setColorActive(activeColor);
2525
controlP5.setColorBackground(color(170));
2626
controlP5.setColorForeground(color(50));
27-
controlP5.setColorLabel(color(50));
28-
controlP5.setColorValue(color(255));
27+
controlP5.setColorCaptionLabel(color(50));
28+
controlP5.setColorValueLabel(color(255));
2929

3030
ControlGroup ctrl = controlP5.addGroup("menu",15,25,35);
3131
ctrl.setColorLabel(color(255));
@@ -55,21 +55,17 @@ void setupGUI(){
5555

5656
for (int i = 0; i < si; i++) {
5757
sliders[i].setGroup(ctrl);
58-
sliders[i].captionLabel().toUpperCase(true);
59-
sliders[i].captionLabel().style().padding(4,3,3,3);
60-
sliders[i].captionLabel().style().marginTop = -4;
61-
sliders[i].captionLabel().style().marginLeft = 0;
62-
sliders[i].captionLabel().style().marginRight = -14;
63-
sliders[i].captionLabel().setColorBackground(0x99ffffff);
58+
sliders[i].getCaptionLabel().toUpperCase(true);
59+
sliders[i].getCaptionLabel().getStyle().padding(4,3,3,3);
60+
sliders[i].getCaptionLabel().getStyle().marginTop = -4;
61+
sliders[i].getCaptionLabel().getStyle().marginLeft = 0;
62+
sliders[i].getCaptionLabel().getStyle().marginRight = -14;
63+
sliders[i].getCaptionLabel().setColorBackground(0x99ffffff);
6464
}
6565

6666
}
6767

6868
void drawGUI(){
6969
controlP5.show();
7070
controlP5.draw();
71-
}
72-
73-
74-
75-
71+
}

02_M/M_1_5_02_TOOL/M_1_5_02_TOOL.pde

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ void draw(){
7676

7777
void keyReleased(){
7878
if(key=='m' || key=='M') {
79-
showGUI = controlP5.group("menu").isOpen();
79+
showGUI = controlP5.getGroup("menu").isOpen();
8080
showGUI = !showGUI;
8181
}
82-
if (showGUI) controlP5.group("menu").open();
83-
else controlP5.group("menu").close();
82+
if (showGUI) controlP5.getGroup("menu").open();
83+
else controlP5.getGroup("menu").close();
8484

8585
if (key == '1') drawMode = 1;
8686
if (key == '2') drawMode = 2;
@@ -96,12 +96,4 @@ void keyReleased(){
9696

9797
String timestamp() {
9898
return String.format("%1$ty%1$tm%1$td_%1$tH%1$tM%1$tS", Calendar.getInstance());
99-
}
100-
101-
102-
103-
104-
105-
106-
107-
99+
}

02_M/M_1_5_03_TOOL/GUI.pde

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ void setupGUI(){
2424
controlP5.setColorActive(activeColor);
2525
controlP5.setColorBackground(color(170));
2626
controlP5.setColorForeground(color(50));
27-
controlP5.setColorLabel(color(50));
28-
controlP5.setColorValue(color(255));
27+
controlP5.setColorCaptionLabel(color(50));
28+
controlP5.setColorValueLabel(color(255));
2929

3030
ControlGroup ctrl = controlP5.addGroup("menu",15,25,35);
3131
ctrl.setColorLabel(color(255));
@@ -59,12 +59,12 @@ void setupGUI(){
5959
for (int i = 0; i < si; i++) {
6060
sliders[i].setGroup(ctrl);
6161
sliders[i].setId(i);
62-
sliders[i].captionLabel().toUpperCase(true);
63-
sliders[i].captionLabel().style().padding(4,3,3,3);
64-
sliders[i].captionLabel().style().marginTop = -4;
65-
sliders[i].captionLabel().style().marginLeft = 0;
66-
sliders[i].captionLabel().style().marginRight = -14;
67-
sliders[i].captionLabel().setColorBackground(0x99ffffff);
62+
sliders[i].getCaptionLabel().toUpperCase(true);
63+
sliders[i].getCaptionLabel().getStyle().padding(4,3,3,3);
64+
sliders[i].getCaptionLabel().getStyle().marginTop = -4;
65+
sliders[i].getCaptionLabel().getStyle().marginLeft = 0;
66+
sliders[i].getCaptionLabel().getStyle().marginRight = -14;
67+
sliders[i].getCaptionLabel().setColorBackground(0x99ffffff);
6868
}
6969

7070
}
@@ -76,10 +76,10 @@ void drawGUI(){
7676

7777
// called on every change of the gui
7878
void controlEvent(ControlEvent theEvent) {
79-
//println("got a control event from controller with id "+theEvent.controller().id());
79+
//println("got a control event from controller with id "+theEvent.getController().getId());
8080
// noiseSticking changed -> set new values
8181
if(theEvent.isController()) {
82-
if (theEvent.controller().id() == 3) {
82+
if (theEvent.getController().getId() == 3) {
8383
for(int i=0; i<agentsCount; i++) agents[i].setNoiseZRange(noiseZRange);
8484
}
8585
}

02_M/M_1_5_03_TOOL/M_1_5_03_TOOL.pde

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ void draw(){
7272

7373
void keyReleased(){
7474
if (key=='m' || key=='M') {
75-
showGUI = controlP5.group("menu").isOpen();
75+
showGUI = controlP5.getGroup("menu").isOpen();
7676
showGUI = !showGUI;
7777
}
78-
if (showGUI) controlP5.group("menu").open();
79-
else controlP5.group("menu").close();
78+
if (showGUI) controlP5.getGroup("menu").open();
79+
else controlP5.getGroup("menu").close();
8080

8181
if (key == '1') drawMode = 1;
8282
if (key == '2') drawMode = 2;

02_M/M_1_5_04_TOOL/GUI.pde

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ void setupGUI(){
2424
controlP5.setColorActive(activeColor);
2525
controlP5.setColorBackground(color(170));
2626
controlP5.setColorForeground(color(50));
27-
controlP5.setColorLabel(color(50));
28-
controlP5.setColorValue(color(255));
27+
controlP5.setColorCaptionLabel(color(50));
28+
controlP5.setColorValueLabel(color(255));
2929

3030
ControlGroup ctrl = controlP5.addGroup("menu",15,25,35);
3131
ctrl.setColorLabel(color(255));
@@ -63,21 +63,21 @@ void setupGUI(){
6363
for (int i = 0; i < si; i++) {
6464
sliders[i].setGroup(ctrl);
6565
sliders[i].setId(i);
66-
sliders[i].captionLabel().toUpperCase(true);
67-
sliders[i].captionLabel().style().padding(4,3,3,3);
68-
sliders[i].captionLabel().style().marginTop = -4;
69-
sliders[i].captionLabel().style().marginLeft = 0;
70-
sliders[i].captionLabel().style().marginRight = -14;
71-
sliders[i].captionLabel().setColorBackground(0x99ffffff);
66+
sliders[i].getCaptionLabel().toUpperCase(true);
67+
sliders[i].getCaptionLabel().getStyle().padding(4,3,3,3);
68+
sliders[i].getCaptionLabel().getStyle().marginTop = -4;
69+
sliders[i].getCaptionLabel().getStyle().marginLeft = 0;
70+
sliders[i].getCaptionLabel().getStyle().marginRight = -14;
71+
sliders[i].getCaptionLabel().setColorBackground(0x99ffffff);
7272
}
7373

7474
for (int i = 0; i < ri; i++) {
7575
ranges[i].setGroup(ctrl);
7676
ranges[i].setId(i);
77-
ranges[i].captionLabel().toUpperCase(true);
78-
ranges[i].captionLabel().style().padding(4,3,3,3);
79-
ranges[i].captionLabel().style().marginTop = -4;
80-
ranges[i].captionLabel().setColorBackground(0x99ffffff);
77+
ranges[i].getCaptionLabel().toUpperCase(true);
78+
ranges[i].getCaptionLabel().getStyle().padding(4,3,3,3);
79+
ranges[i].getCaptionLabel().getStyle().marginTop = -4;
80+
ranges[i].getCaptionLabel().setColorBackground(0x99ffffff);
8181
}
8282
}
8383

@@ -88,26 +88,17 @@ void drawGUI(){
8888

8989
// called on every change of the gui
9090
void controlEvent(ControlEvent theEvent) {
91-
//println("got a control event from controller with id "+theEvent.controller().id());
91+
//println("got a control event from controller with id "+theEvent.getController().getId());
9292
// noiseSticking changed -> set new values
9393

9494
if(theEvent.isController()) {
95-
if (theEvent.controller().name().equals("noiseStickingRange")) {
95+
if (theEvent.getController().getName().equals("noiseStickingRange")) {
9696
for(int i=0; i<agentsCount; i++) agents[i].setNoiseSticking(noiseStickingRange);
9797
}
98-
else if(theEvent.controller().name().equals("agentWidthRange")) {
99-
float[] f = theEvent.controller().arrayValue();
98+
else if(theEvent.getController().getName().equals("agentWidthRange")) {
99+
float[] f = theEvent.getController().getArrayValue();
100100
agentWidthMin = f[0];
101101
agentWidthMax = f[1];
102102
}
103103
}
104-
}
105-
106-
107-
108-
109-
110-
111-
112-
113-
104+
}

02_M/M_1_5_04_TOOL/M_1_5_04_TOOL.pde

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ void draw() {
7373

7474
void keyReleased(){
7575
if (key=='m' || key=='M') {
76-
showGUI = controlP5.group("menu").isOpen();
76+
showGUI = controlP5.getGroup("menu").isOpen();
7777
showGUI = !showGUI;
7878
}
79-
if (showGUI) controlP5.group("menu").open();
80-
else controlP5.group("menu").close();
79+
if (showGUI) controlP5.getGroup("menu").open();
80+
else controlP5.getGroup("menu").close();
8181

8282
if (key == '1') drawMode = 1;
8383
if (key == '2') drawMode = 2;

02_M/M_1_6_01_TOOL/GUI.pde

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ void setupGUI(){
2424
controlP5.setColorActive(activeColor);
2525
controlP5.setColorBackground(color(170));
2626
controlP5.setColorForeground(color(50));
27-
controlP5.setColorLabel(color(50));
28-
controlP5.setColorValue(color(255));
27+
controlP5.setColorCaptionLabel(color(50));
28+
controlP5.setColorValueLabel(color(255));
2929

3030
ControlGroup ctrl = controlP5.addGroup("menu",15,25,35);
3131
ctrl.setColorLabel(color(255));
@@ -55,12 +55,12 @@ void setupGUI(){
5555
for (int i = 0; i < si; i++) {
5656
sliders[i].setGroup(ctrl);
5757
sliders[i].setId(i);
58-
sliders[i].captionLabel().toUpperCase(true);
59-
sliders[i].captionLabel().style().padding(4,3,3,3);
60-
sliders[i].captionLabel().style().marginTop = -4;
61-
sliders[i].captionLabel().style().marginLeft = 0;
62-
sliders[i].captionLabel().style().marginRight = -14;
63-
sliders[i].captionLabel().setColorBackground(0x99ffffff);
58+
sliders[i].getCaptionLabel().toUpperCase(true);
59+
sliders[i].getCaptionLabel().getStyle().padding(4,3,3,3);
60+
sliders[i].getCaptionLabel().getStyle().marginTop = -4;
61+
sliders[i].getCaptionLabel().getStyle().marginLeft = 0;
62+
sliders[i].getCaptionLabel().getStyle().marginRight = -14;
63+
sliders[i].getCaptionLabel().setColorBackground(0x99ffffff);
6464
}
6565
}
6666

@@ -72,7 +72,7 @@ void drawGUI(){
7272

7373
// called on every change of the gui
7474
//void controlEvent(ControlEvent theControlEvent) {
75-
// println("got a control event from controller with id "+theEvent.controller().id());
75+
// println("got a control event from controller with id "+theEvent.getController().getId());
7676
//}
7777

7878

02_M/M_1_6_01_TOOL/M_1_6_01_TOOL.pde

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ void keyReleased() {
135135
if (key=='s' || key=='S') saveFrame(timestamp()+".png");
136136
if (key=='f' || key=='F') freeze = !freeze;
137137
if (key=='m' || key=='M') {
138-
showGUI = controlP5.group("menu").isOpen();
138+
showGUI = controlP5.getGroup("menu").isOpen();
139139
showGUI = !showGUI;
140140
}
141141
if (key=='p' || key=='P') tiler.init(timestamp()+".png", qualityFactor);
@@ -145,8 +145,8 @@ void keyReleased() {
145145
noiseSeed(newNoiseSeed);
146146
}
147147

148-
if (showGUI) controlP5.group("menu").open();
149-
else controlP5.group("menu").close();
148+
if (showGUI) controlP5.getGroup("menu").open();
149+
else controlP5.getGroup("menu").close();
150150
}
151151

152152
void mousePressed() {

02_M/M_1_6_02_TOOL/GUI.pde

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ void setupGUI() {
2424
controlP5.setColorActive(activeColor);
2525
controlP5.setColorBackground(color(170));
2626
controlP5.setColorForeground(color(50));
27-
controlP5.setColorLabel(color(50));
28-
controlP5.setColorValue(color(255));
27+
controlP5.setColorCaptionLabel(color(50));
28+
controlP5.setColorValueLabel(color(255));
2929

3030
ControlGroup ctrl = controlP5.addGroup("menu", 15, 25, 35);
3131
ctrl.setColorLabel(color(255));
@@ -55,22 +55,22 @@ void setupGUI() {
5555
for (int i = 0; i < si; i++) {
5656
sliders[i].setGroup(ctrl);
5757
sliders[i].setId(i);
58-
sliders[i].captionLabel().toUpperCase(true);
59-
sliders[i].captionLabel().style().padding(4,3,3,3);
60-
//sliders[i].captionLabel().style().padding(4, 0, 1, 3);
61-
sliders[i].captionLabel().style().marginTop = -4;
62-
sliders[i].captionLabel().style().marginLeft = 0;
63-
sliders[i].captionLabel().style().marginRight = -14;
64-
sliders[i].captionLabel().setColorBackground(0x99ffffff);
58+
sliders[i].getCaptionLabel().toUpperCase(true);
59+
sliders[i].getCaptionLabel().getStyle().padding(4,3,3,3);
60+
//sliders[i].getCaptionLabel().getStyle().padding(4, 0, 1, 3);
61+
sliders[i].getCaptionLabel().getStyle().marginTop = -4;
62+
sliders[i].getCaptionLabel().getStyle().marginLeft = 0;
63+
sliders[i].getCaptionLabel().getStyle().marginRight = -14;
64+
sliders[i].getCaptionLabel().setColorBackground(0x99ffffff);
6565
}
6666

6767
for (int i = 0; i < ri; i++) {
6868
ranges[i].setGroup(ctrl);
6969
ranges[i].setId(i);
70-
ranges[i].captionLabel().toUpperCase(true);
71-
ranges[i].captionLabel().style().padding(4,3,3,3);
72-
ranges[i].captionLabel().style().marginTop = -4;
73-
ranges[i].captionLabel().setColorBackground(0x99ffffff);
70+
ranges[i].getCaptionLabel().toUpperCase(true);
71+
ranges[i].getCaptionLabel().getStyle().padding(4,3,3,3);
72+
ranges[i].getCaptionLabel().getStyle().marginTop = -4;
73+
ranges[i].getCaptionLabel().setColorBackground(0x99ffffff);
7474
}
7575
}
7676

@@ -82,23 +82,13 @@ void drawGUI() {
8282

8383
// called on every change of the gui
8484
void controlEvent(ControlEvent theControlEvent) {
85-
//println("got a control event from controller with id "+theEvent.controller().id());
85+
//println("got a control event from controller with id "+theEvent.getController().getId());
8686

8787
if (theControlEvent.isController()) {
88-
if (theControlEvent.controller().name().equals("strokeWidthRange")) {
89-
float[] f = theControlEvent.controller().arrayValue();
88+
if (theControlEvent.getController().getName().equals("strokeWidthRange")) {
89+
float[] f = theControlEvent.getController().getArrayValue();
9090
minStroke = f[0];
9191
maxStroke = f[1];
9292
}
9393
}
94-
}
95-
96-
97-
98-
99-
100-
101-
102-
103-
104-
94+
}

02_M/M_1_6_02_TOOL/M_1_6_02_TOOL.pde

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void keyReleased() {
138138
if (key == '1') drawMode = 1;
139139
if (key == '2') drawMode = 2;
140140
if (key=='m' || key=='M') {
141-
showGUI = controlP5.group("menu").isOpen();
141+
showGUI = controlP5.getGroup("menu").isOpen();
142142
showGUI = !showGUI;
143143
}
144144
if (key=='p' || key=='P') tiler.init(timestamp()+".png",qualityFactor);
@@ -148,8 +148,8 @@ void keyReleased() {
148148
noiseSeed(newNoiseSeed);
149149
}
150150

151-
if (showGUI) controlP5.group("menu").open();
152-
else controlP5.group("menu").close();
151+
if (showGUI) controlP5.getGroup("menu").open();
152+
else controlP5.getGroup("menu").close();
153153
}
154154

155155
void mousePressed(){

0 commit comments

Comments
 (0)