-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainController.java
More file actions
175 lines (133 loc) · 5.16 KB
/
Copy pathMainController.java
File metadata and controls
175 lines (133 loc) · 5.16 KB
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
package wf.view;
import javafx.application.Platform;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.Separator;
import javafx.scene.control.TextArea;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.HBox;
import wf.util.About;
import wf.util.Calculate;
import wf.util.DataHistoHandler;
import wf.util.File;
import wf.util.Graphs;
import wf.util.Monitor;
import wf.util.Process;
import wf.util.Table;
public class MainController {
@FXML private AnchorPane main_ap;
@FXML private AnchorPane anchorPaneTop_ap;
@FXML private AnchorPane anchorPaneBot_ap;
@FXML private Button monitor_bt;
@FXML private Button process_bt;
@FXML private Button services_bt;
@FXML private Button calculate_bt;
@FXML private Button table_bt;
@FXML private Button graphs_bt;
@FXML private Button about_bt;
@FXML private Button exit_bt;
@FXML private HBox main_hb;
@FXML private Label title_lb;
@FXML private Label info_lb;
@FXML private Separator hSeparatorNorth;
@FXML private Separator hSeparatorSouth;
@FXML private Separator hSeparator;
@FXML private TextArea info_ta;
private final About about = About.getInstance();
private final Calculate calculate = Calculate.getInstance();
private final File file = File.getInstance();
private final Monitor monitor = Monitor.getInstance();
private final Process process = Process.getInstance();
private final Table table = Table.getInstance();
private final Graphs graphs = Graphs.getInstance();
private static DataHistoHandler dataHistoHandler = DataHistoHandler.getInstance();
@FXML
public void initialize() {
monitor_bt.disableProperty().bind((dataHistoHandler.getDataLoaded().isEqualTo(0))
.or(dataHistoHandler.getDataProcessed().isEqualTo(0)));
calculate_bt.disableProperty().bind((dataHistoHandler.getDataLoaded().isEqualTo(0))
.or(dataHistoHandler.getDataProcessed().isEqualTo(0)));
process_bt.disableProperty().bind(dataHistoHandler.getDataLoaded().isEqualTo(0));
table_bt.disableProperty().bind((dataHistoHandler.getDataLoaded().isEqualTo(0))
.or(dataHistoHandler.getDataProcessed().isEqualTo(0))
.or(dataHistoHandler.getDataCalculated().isEqualTo(0)));
graphs_bt.disableProperty().bind((dataHistoHandler.getDataLoaded().isEqualTo(0))
.or(dataHistoHandler.getDataProcessed().isEqualTo(0))
.or(dataHistoHandler.getDataCalculated().isEqualTo(0)));
//display_bt.disableProperty().bind((Bindings.isEmpty(data_handler.getData())));
info_ta.setEditable(false);
title_lb.setText("Waveform Analyzer V. 1.0");
initStyle();
monitor_bt.setText("Monitor");
process_bt.setText("Process");
services_bt.setText("File");
calculate_bt.setText("Calculate");
table_bt.setText("Table");
graphs_bt.setText("Graphs");
about_bt.setText("About");
exit_bt.setText("Exit");
//updateTextArea(dt.getDateAndTime() + " - Welcome to Device Configurator 1.0!");
}
@FXML
private void handleMonitor_bt() {
monitor.showStage();
}
@FXML
private void handleProcess_bt() {
process.showStage();
}
@FXML
private void handleCalculate_bt() {
calculate.showStage();
}
@FXML
private void handleTable_bt() {
table.showStage();
}
@FXML
private void handleGraphs_bt() {
graphs.showStage();
}
@FXML
private void handleServices_bt() {
file.showStage();
//fh.setNumberDevices(data_handler.getData().size());
//fh.showDialog();
}
@FXML
private void handleAbout_bt() {
about.showStage();
}
@FXML
private void handleExit_bt() {
exitApplication();
}
private void initStyle() {
// main_ap.setStyle(" -fx-background-color: #ebeced;");
//main_hb.setStyle(" -fx-background-color: #b5bcc6;");
main_hb.setStyle(" -fx-background-color: FloralWhite;");
monitor_bt.setId("button_bevel-grey");
process_bt.setId("button_bevel-grey");
services_bt.setId("button_bevel-grey");
calculate_bt.setId("button_bevel-grey");
table_bt.setId("button_bevel-grey");
graphs_bt.setId("button_bevel-grey");
about_bt.setId("button_bevel-grey");
exit_bt.setId("button_bevel-grey");
title_lb.setId("appTitle");
info_lb.setId("appTitle");
anchorPaneTop_ap.setId("topLayoutContainer");
anchorPaneBot_ap.setId("bottomLayoutContainer");
hSeparatorNorth.setStyle("-fx-border-style: solid; -fx-border-width: 0.1px;");
hSeparatorSouth.setStyle("-fx-border-style: solid; -fx-border-width: 0.1px;");
//hSeparator.setStyle("-fx-border-width: 1px;" + " -fx-background-color: #b5bcc6;");
}
public void updateTextArea(String msg) {
info_ta.appendText(msg);
}
private void exitApplication() {
Platform.exit();
System.exit(0);
}
}