-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindowController.java
62 lines (50 loc) · 1.65 KB
/
MainWindowController.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import javafx.stage.Stage;
public class MainWindowController
{
private static MainWindowScene outputScene = null;
public static void setScene(MainWindowScene outputScene)
{
MainWindowController.outputScene = outputScene;
}
public static void goToMainScreen(Airport ap) {
outputScene = new MainWindowScene(ap);
Launcher.setScene(outputScene);
}
public static void goToRunwayScreen(Airport ap) {
InputScreenController.goToRunwayScreen(ap);
}
public static void goToCreateScreen() {
InputScreenController.goToLoadCreateWindowScene();
}
public static void addOutputText(String string) {
if (outputScene == null) {
System.err.println("Attempted to add output text to null window");
return;
}
outputScene.addOutputText(string);
}
public static void addActivityText(String string) {
if (outputScene == null) {
System.err.println("Attempted to add activity text to null window");
return;
}
outputScene.addActivityText(string);
}
public static void clearOutput() {
if (outputScene == null) {
System.err.println("Attempted to clear output text of a null window");
return;
}
outputScene.clearOutput();
}
public static void clearActivity() {
if (outputScene == null) {
System.err.println("Attempted to clear activity text of a null window");
return;
}
outputScene.clearActivity();
}
public static Stage getAppStage() {
return InputScreenController.getAppStage();
}
}