-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInputScreenController.java
63 lines (49 loc) · 1.66 KB
/
InputScreenController.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
63
import javafx.stage.Stage;
import javax.xml.bind.JAXBException;
import java.io.FileNotFoundException;
import java.util.List;
import java.util.ArrayList;
public class InputScreenController
{
private static LoadCreateWindowScene loadCreateWindowScene = null;
private static RunwayWindowScene runwayWindowScene = null;
public static void goToRunwayScreen(Airport ap) {
if (runwayWindowScene == null)
runwayWindowScene = new RunwayWindowScene(ap);
runwayWindowScene.setAirport(ap);
Launcher.setScene(runwayWindowScene);
}
public static void goToLoadCreateWindowScene() {
if (loadCreateWindowScene == null)
loadCreateWindowScene = new LoadCreateWindowScene();
Launcher.setScene(loadCreateWindowScene);
}
public static void goToMainScene(Airport ap) {
MainWindowController.goToMainScreen(ap);
}
public static Stage getAppStage() {
return MainController.getAppStage();
}
public static Airport initialiseAirport(int RESA, int StripEnd, int BlastAllowance, int MinSlope)
{
return new Airport(RESA, StripEnd, BlastAllowance, MinSlope);
}
public static Runway initRunway(int bearing, RunwayData left, RunwayData right)
{
return new Runway(bearing, left, right);
}
public static RunwayData initRunwayData(int threshold, int TORA, int stopway, int clearway)
{
return new RunwayData(threshold, TORA, stopway, clearway);
}
public static Airport addRunwaysToAirport(Airport airport, List<Runway> runways) throws Exception
{
for (Runway run : runways) {
airport.addRunway(run);
}
return airport;
}
public static Runway importRunway(String filePath) throws JAXBException, FileNotFoundException {
return XMLLoader.importRunway(filePath);
}
}