-
Notifications
You must be signed in to change notification settings - Fork 2
/
gui.pde
121 lines (109 loc) · 4.68 KB
/
gui.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/* =========================================================
* ==== WARNING ===
* =========================================================
* The code in this tab has been generated from the GUI form
* designer and care should be taken when editing this file.
* Only add/edit code inside the event handlers i.e. only
* use lines between the matching comment tags. e.g.
void myBtnEvents(GButton button) { //_CODE_:button1:12356:
// It is safe to enter your event code here
} //_CODE_:button1:12356:
* Do not rename this tab!
* =========================================================
*/
public void resetHit(GImageButton source, GEvent event) { //_CODE_:resetButton:623085:
setup();
} //_CODE_:resetButton:623085:
public void pauseHit(GImageButton source, GEvent event) { //_CODE_:pauseButton:677062:
pause = !pause;
} //_CODE_:pauseButton:677062:
public void evalListClicked(GDropList source, GEvent event) { //_CODE_:evalList:764184:
setEvaluator();
underlay = mapHeat();
birbs.reset();
} //_CODE_:evalList:764184:
public void speedChange(GCustomSlider source, GEvent event) { //_CODE_:speedSlider:810070:
SPEED_LIMIT = source.getValueI();
} //_CODE_:speedSlider:810070:
public void inertiaChange(GCustomSlider source, GEvent event) { //_CODE_:inertiaSlide:427060:
INERTIA = source.getValueI();
} //_CODE_:inertiaSlide:427060:
public void constantChange(GSlider2D source, GEvent event) { //_CODE_:socCogAdj:776689:
COG_CONST = source.getValueXF();
SOC_CONST = source.getValueYF();
} //_CODE_:socCogAdj:776689:
// Create all the GUI controls.
// autogenerated do not edit
public void createGUI(){
G4P.messagesEnabled(false);
G4P.setGlobalColorScheme(GCScheme.BLUE_SCHEME);
G4P.setMouseOverEnabled(false);
surface.setTitle("Sketch Window");
inertiaLabel = new GLabel(this, 920, 70, 80, 20);
inertiaLabel.setTextAlign(GAlign.CENTER, GAlign.MIDDLE);
inertiaLabel.setText("Inertia");
inertiaLabel.setOpaque(true);
speedLabel = new GLabel(this, 835, 70, 80, 20);
speedLabel.setTextAlign(GAlign.CENTER, GAlign.MIDDLE);
speedLabel.setText("Speed");
speedLabel.setOpaque(true);
resetButton = new GImageButton(this, 870, 430, 100, 100, new String[] { "reset.png", "reset.png", "reset.png" } );
resetButton.addEventHandler(this, "resetHit");
pauseButton = new GImageButton(this, 870, 540, 100, 100, new String[] { "play-pause.png", "play-pause.png", "play-pause.png" } );
pauseButton.addEventHandler(this, "pauseHit");
evalList = new GDropList(this, 834, 33, 154, 168, 5, 30);
evalList.setItems(loadStrings("list_764184"), 0);
evalList.setLocalColorScheme(GCScheme.GREEN_SCHEME);
evalList.addEventHandler(this, "evalListClicked");
speedSlider = new GCustomSlider(this, 908, 100, 200, 60, "grey_blue");
speedSlider.setShowValue(true);
speedSlider.setShowLimits(true);
speedSlider.setTextOrientation(G4P.ORIENT_RIGHT);
speedSlider.setRotation(PI/2, GControlMode.CORNER);
speedSlider.setLimits(25.0, 25.0, 1.0);
speedSlider.setNbrTicks(25);
speedSlider.setStickToTicks(true);
speedSlider.setShowTicks(true);
speedSlider.setNumberFormat(G4P.DECIMAL, 1);
speedSlider.setOpaque(true);
speedSlider.addEventHandler(this, "speedChange");
inertiaSlide = new GCustomSlider(this, 989, 100, 200, 60, "grey_blue");
inertiaSlide.setShowValue(true);
inertiaSlide.setShowLimits(true);
inertiaSlide.setRotation(PI/2, GControlMode.CORNER);
inertiaSlide.setLimits(30.0, 30.0, 1.0);
inertiaSlide.setNbrTicks(30);
inertiaSlide.setStickToTicks(true);
inertiaSlide.setShowTicks(true);
inertiaSlide.setNumberFormat(G4P.DECIMAL, 1);
inertiaSlide.setOpaque(true);
inertiaSlide.addEventHandler(this, "inertiaChange");
socCogAdj = new GSlider2D(this, 14, 112, 125, 125);
socCogAdj.setLimitsX(1.0, 0.0, 10.0);
socCogAdj.setLimitsY(1.0, 0.0, 10.0);
socCogAdj.setNumberFormat(G4P.DECIMAL, 1);
socCogAdj.setOpaque(true);
socCogAdj.addEventHandler(this, "constantChange");
label1 = new GLabel(this, 28, 246, 80, 20);
label1.setTextAlign(GAlign.CENTER, GAlign.MIDDLE);
label1.setText("X - Cognitive");
label1.setTextBold();
label1.setOpaque(true);
label2 = new GLabel(this, 149, 166, 80, 20);
label2.setTextAlign(GAlign.CENTER, GAlign.MIDDLE);
label2.setText("Y - Social");
label2.setTextBold();
label2.setOpaque(true);
}
// Variable declarations
// autogenerated do not edit
GLabel inertiaLabel;
GLabel speedLabel;
GImageButton resetButton;
GImageButton pauseButton;
GDropList evalList;
GCustomSlider speedSlider;
GCustomSlider inertiaSlide;
GSlider2D socCogAdj;
GLabel label1;
GLabel label2;