Merge branch 'master' of https://eng-git.canterbury.ac.nz/seng302-2017/team-7 into controllerSplit

# Conflicts:
#	racevisionGame/src/main/java/visualiser/Controllers/HostGameController.java
#	racevisionGame/src/main/java/visualiser/Controllers/RaceViewController.java
#	racevisionGame/src/main/java/visualiser/Controllers/StartController.java
#	racevisionGame/src/main/java/visualiser/Controllers/hostgame.fxml
#	racevisionGame/src/main/java/visualiser/Controllers/lobbyHosting.fxml
#	racevisionGame/src/main/java/visualiser/Controllers/main.fxml
#	racevisionGame/src/main/java/visualiser/Controllers/raceView.fxml
This commit is contained in:
Jessica Syder
2017-09-11 20:19:10 +12:00
parent 108643b59d
commit 669a303e9b
11 changed files with 174 additions and 138 deletions
@@ -7,7 +7,6 @@ import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.concurrent.Task;
import javafx.concurrent.Worker;
import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.geometry.Pos;
import javafx.geometry.Rectangle2D;
@@ -24,20 +23,19 @@ import javafx.scene.paint.Color;
import javafx.stage.Screen;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import javafx.stage.WindowEvent;
import javafx.util.Duration;
import mock.app.Event;
public class App extends Application {
private static Stage stage;
public static Event game;
public static Boolean dayMode = true;
private Pane splashLayout;
private ProgressBar loadProgress;
private Label progressText;
private static final int SPLASH_WIDTH = 676;
private static final int SPLASH_HEIGHT = 227;
/**
* Entry point for running the programme
* @param args for starting the programme
@@ -73,7 +71,7 @@ public class App extends Application {
/**
* Method that sets up and displays the splash screen
* @param stage the inital stage
* @param stage the initial stage
* @throws Exception if something wrong with title screen.
*/
public void start(Stage stage) throws Exception {
@@ -81,7 +79,7 @@ public class App extends Application {
@Override
protected ObservableList<String> call() throws InterruptedException {
ObservableList<String> addedFilling =
FXCollections.<String>observableArrayList();
FXCollections.observableArrayList();
ObservableList<String> burgerFilling =
FXCollections.observableArrayList(
"Buns", "Patties", "Lettuce", "Onions", "Tomato",
@@ -124,7 +122,11 @@ public class App extends Application {
return App.stage;
}
public void loadTitleScreen() throws Exception {
/**
* Loads the title screen for the first time on app start.
* @throws Exception if there is a problem with a resource loaded
*/
private void loadTitleScreen() throws Exception {
stage = new Stage();
FXMLLoader loader = new FXMLLoader(getClass().getResource
("/visualiser/scenes/title.fxml"));
@@ -135,11 +137,9 @@ public class App extends Application {
stage.getIcons().add(new Image(getClass().getClassLoader().getResourceAsStream("images/SailIcon.png")));
stage.setScene(scene);
stage.show();
stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
@Override public void handle(WindowEvent event) {
Platform.exit();
System.exit(0);
}
stage.setOnCloseRequest(event -> {
Platform.exit();
System.exit(0);
});
}