-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLauncher.java
45 lines (32 loc) · 1.11 KB
/
Launcher.java
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
import java.util.ArrayList;
import java.util.List;
import javafx.application.Application;
import javafx.geometry.Rectangle2D;
import javafx.stage.Screen;
import javafx.stage.Stage;
public class Launcher extends Application {
private static Stage stage;
private MainController control;
public static void main(String[] args) {
launch(args);
}
public void start(Stage stage) throws Exception {
stage.setTitle("Airport Display");
stage.setResizable(false);
stage.setMaximized(true);
Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
stage.setX(primaryScreenBounds.getMinX());
stage.setY(primaryScreenBounds.getMinY());
stage.setWidth(primaryScreenBounds.getWidth());
stage.setHeight(primaryScreenBounds.getHeight());
this.stage = stage;
control = new MainController(this);
stage.show();
}
public static void setScene(WindowScene scene) {
stage.setScene(scene.getScene());
}
public static Stage getStage() {
return stage;
}
}