-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMonitor.java
More file actions
98 lines (66 loc) · 2.21 KB
/
Copy pathMonitor.java
File metadata and controls
98 lines (66 loc) · 2.21 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
package wf.util;
import java.io.IOException;
import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
import wf.Main;
import wf.view.MonitorController;
public class Monitor {
private MonitorController monitorController = new MonitorController();
private AnchorPane monitor_ap = new AnchorPane();
private FXMLLoader loader = new FXMLLoader();
private Stage monitor_st = new Stage();
private static final Monitor INSTANCE = new Monitor();
//private final static DataHandler dataHandler = DataHandler.getInstance();
public Monitor() {
try {
loader.setLocation(Main.class.getResource("view/Monitor.fxml"));
monitor_ap = ((AnchorPane) loader.load());
// Show the scene containing the root layout.
final Scene file_sc = new Scene(monitor_ap);
file_sc.getStylesheets().clear();
file_sc.getStylesheets().add(Main.class.getResource("/wf/view/application.css").toExternalForm());
monitor_st.setScene(file_sc);
monitor_st.setResizable(false);
monitor_st.initModality(Modality.APPLICATION_MODAL);
monitor_st.setOnCloseRequest(new EventHandler<WindowEvent>() {
@Override
public void handle(WindowEvent event) {
event.consume();
}
});
setStage(monitor_st);
} catch (IOException e) {
e.printStackTrace();
}
}
private void setStage(Stage stage) {
this.monitor_st = stage;
}
public Stage getStage() {
return monitor_st;
}
public void showStage() {
monitorController = loader.<MonitorController>getController();
monitorController.setChannel();
monitorController.initSlider();
/*
//Look for the number of waveforms
//Needs to check among channels with data
for(int i = 0; i < 4; i++) {
dataHandler.getMapValues().get(i).size();
if(dataHandler.getMapValues().get(i).size() > 0) {
monitorController.initSlider(dataHandler.getMapValues().get(i).size());
break;
}
} */
monitor_st.showAndWait();
}
public static Monitor getInstance() {
return INSTANCE;
}
}