-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgui_backup.txt
136 lines (111 loc) · 4.5 KB
/
gui_backup.txt
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/* =========================================================
* ==== 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!
* =========================================================
*/
synchronized public void win_draw1(GWinApplet appc, GWinData data) { //_CODE_:window1:827611:
appc.background(230);
} //_CODE_:window1:827611:
public void startPause(GButton source, GEvent event) { //_CODE_:button_startPause:777700:
println("button1 - GButton >> GEvent." + event + " @ " + millis());
if( event == GEvent.CLICKED){
println("clicked");
playNow = ! playNow;
}
} //_CODE_:button_startPause:777700:
public void lastFrame(GButton source, GEvent event) { //_CODE_:button_lastFrame:985331:
println("button_lastFrame - GButton >> GEvent." + event + " @ " + millis());
i--;
nodes[i].visited = false;
} //_CODE_:button_lastFrame:985331:
public void nextFrame(GButton source, GEvent event) { //_CODE_:button_nextFrame:332148:
println("button_nextFrame - GButton >> GEvent." + event + " @ " + millis());
nodes[i].visited = true;
i++;
} //_CODE_:button_nextFrame:332148:
public void restart(GButton source, GEvent event) { //_CODE_:button_restart:541058:
println("button_restart - GButton >> GEvent." + event + " @ " + millis());
setup();
/*
for(int ii = 0; ii<i; ii++){
nodes[ii].visited = false;
}*/
playNow = false;
i=0;
} //_CODE_:button_restart:541058:
public void dropList_drawParents(GDropList source, GEvent event) { //_CODE_:drawParents:883009:
println("drawParents - GDropList >> GEvent." + event + " @ " + millis());
if(source.getSelectedIndex() == 0){
drawTwoParents = true;
}else{
drawTwoParents = false;
}
} //_CODE_:drawParents:883009:
public void dropList_drawCartesian(GDropList source, GEvent event) { //_CODE_:drawCartesian:883010:
println("drawCartesian - GDropList >> GEvent." + event + " @ " + millis());
if(source.getSelectedIndex() == 0){
displaySpiral = true;
}else{
displaySpiral = false;
}
} //_CODE_:drawCartesian:883010:
// Create all the GUI controls.
// autogenerated do not edit
public void createGUI(){
G4P.messagesEnabled(false);
G4P.setGlobalColorScheme(GCScheme.BLUE_SCHEME);
G4P.setCursor(ARROW);
if(frame != null)
frame.setTitle("Sketch Window");
window1 = new GWindow(this, "Window title", 0, 0, 250, 150, false, JAVA2D);
window1.addDrawHandler(this, "win_draw1");
button_startPause = new GButton(window1.papplet, 50, 110, 80, 30);
button_startPause.setText("Start/Pause");
button_startPause.addEventHandler(this, "startPause");
button_lastFrame = new GButton(window1.papplet, 10, 110, 30, 30);
button_lastFrame.setText("<");
button_lastFrame.addEventHandler(this, "lastFrame");
button_nextFrame = new GButton(window1.papplet, 140, 110, 30, 30);
button_nextFrame.setText(">");
button_nextFrame.addEventHandler(this, "nextFrame");
button_restart = new GButton(window1.papplet, 180, 110, 50, 30);
button_restart.setText("Restart");
button_restart.addEventHandler(this, "restart");
drawParents = new GDropList(window1.papplet, 30, 20, 120, 60, 2);
if(drawTwoParents == true){
drawParents.setItems(loadStrings("list_883009"), 0);
}else{
drawParents.setItems(loadStrings("list_883009"), 1);
}
drawParents.setLocalColorScheme(GCScheme.CYAN_SCHEME);
drawParents.addEventHandler(this, "dropList_drawParents");
label1 = new GLabel(window1.papplet, 10, 80, 80, 20);
label1.setText("Play Control");
label1.setOpaque(false);
drawCartesian = new GDropList(window1.papplet, 30, 50, 120, 60, 2);
if(displaySpiral == false){
drawCartesian.setItems(loadStrings("list_883010"), 1);
}else{
drawCartesian.setItems(loadStrings("list_883010"), 0);
}
drawCartesian.setLocalColorScheme(GCScheme.CYAN_SCHEME);
drawCartesian.addEventHandler(this, "dropList_drawCartesian");
}
// Variable declarations
// autogenerated do not edit
GWindow window1;
GButton button_startPause;
GButton button_lastFrame;
GButton button_nextFrame;
GButton button_restart;
GDropList drawParents;
GDropList drawCartesian;
GLabel label1;