/
gui.pde
84 lines (73 loc) · 3.05 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
/* =========================================================
* ==== 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 typeCbx_clickEvt(GDropList source, GEvent event) { //_CODE_:typeCbx:342525:
sinePlotChckbx.setEnabled(typeCbx.getSelectedIndex() == 0 ? true : false );
} //_CODE_:typeCbx:342525:
public void checkbox1_clicked1(GCheckbox source, GEvent event) { //_CODE_:sinePlotChckbx:934500:
if(source.isSelected()){
amplifier = 5f;
}else{
amplifier = 1f;
}
} //_CODE_:sinePlotChckbx:934500:
public void windowTypeCbx_click1(GDropList source, GEvent event) { //_CODE_:windowTypCbx:878703:
Field[] fs = FFT.class.getFields();
for(Field f : fs){
if(f.getName().contains(windowTypCbx.getSelectedText())){
try{
fftLin.window((WindowFunction)f.get(null));
}catch(IllegalAccessException e){
e.printStackTrace();
}
}
}
} //_CODE_:windowTypCbx:878703:
public void workPanel_Click(GPanel source, GEvent event) { //_CODE_:workPanel:787303:
//println("panel1 - GPanel >> GEvent." + event + " @ " + millis());
} //_CODE_:workPanel:787303:
// Create all the GUI controls.
// autogenerated do not edit
public void createGUI(){
G4P.messagesEnabled(true);
G4P.setGlobalColorScheme(GCScheme.BLUE_SCHEME);
G4P.setCursor(ARROW);
surface.setTitle("Natalie");
typeCbx = new GDropList(this, 419, 76, 192, 80, 3);
typeCbx.setItems(loadStrings("list_342525"), 0);
typeCbx.setLocalColorScheme(GCScheme.CYAN_SCHEME);
typeCbx.addEventHandler(this, "typeCbx_clickEvt");
sinePlotChckbx = new GCheckbox(this, 422, 38, 135, 23);
sinePlotChckbx.setIconAlign(GAlign.LEFT, GAlign.MIDDLE);
sinePlotChckbx.setText("Standard spectrum plot");
sinePlotChckbx.setLocalColorScheme(GCScheme.CYAN_SCHEME);
sinePlotChckbx.setOpaque(false);
sinePlotChckbx.addEventHandler(this, "checkbox1_clicked1");
sinePlotChckbx.setSelected(true);
windowTypCbx = new GDropList(this, 422, 167, 132, 80, 3);
windowTypCbx.setItems(loadStrings("list_878703"), 0);
windowTypCbx.setLocalColorScheme(GCScheme.CYAN_SCHEME);
windowTypCbx.addEventHandler(this, "windowTypeCbx_click1");
workPanel = new GPanel(this, 365, 0, 334, 180, "Control panel");
workPanel.setCollapsible(false);
workPanel.setText("Control panel");
workPanel.setLocalColorScheme(GCScheme.CYAN_SCHEME);
workPanel.setOpaque(false);
workPanel.addEventHandler(this, "workPanel_Click");
}
// Variable declarations
// autogenerated do not edit
GDropList typeCbx;
GCheckbox sinePlotChckbx;
GDropList windowTypCbx;
GPanel workPanel;