Application.java (1094B) download
1package nl.isygameclient;
2
3import javafx.stage.Stage;
4import nl.isygameclient.util.StageHandler;
5
6/**
7 * This class is the start of the javafx application.
8 * It holds the main function that launches this class.
9 * As well as the start function that handles the application initialization.
10 *
11 * @author Niels Jager
12 * @author Arend Koens
13 * @author Johs Mulder
14 * @author Friedel Schön
15 */
16public class Application extends javafx.application.Application {
17
18
19 public static void main(String[] args) {
20 launch();
21 }
22
23 /**
24 * The start preforms the initialization of the stage.
25 * @param stage a javafx stage.
26 */
27 @Override
28 public void start(Stage stage) {
29 StageHandler stageHandler = StageHandler.get();
30 stageHandler.loadStages();
31
32
33 String stageName = "GameSelector";
34 stageHandler.changeSceneOfStage(stageName, "views/game_selector/GameSelector.fxml");
35
36 stageHandler.focusStage(stageName);
37
38 stageHandler.getStage(stageName).setOnCloseRequest((e) -> {
39 stageHandler.saveStages();
40 });
41 }
42}