diff --git a/voting-station-gui/src/polling_station_dashboard/polling_station_dashboard.fxml b/voting-station-gui/src/polling_station_dashboard/polling_station_dashboard.fxml index d92993b..71ff492 100644 --- a/voting-station-gui/src/polling_station_dashboard/polling_station_dashboard.fxml +++ b/voting-station-gui/src/polling_station_dashboard/polling_station_dashboard.fxml @@ -1,5 +1,7 @@ + + diff --git a/voting-station-gui/src/set_up_complete/SetUpCompleteController.java b/voting-station-gui/src/set_up_complete/SetUpCompleteController.java new file mode 100644 index 0000000..f5c54b1 --- /dev/null +++ b/voting-station-gui/src/set_up_complete/SetUpCompleteController.java @@ -0,0 +1,8 @@ +package set_up_complete; + +/** + * Created by Vladimir Eliezer Tokarev on 28/05/2016. + */ +public class SetUpCompleteController { + +} diff --git a/voting-station-gui/src/set_up_complete/set_up_complete.fxml b/voting-station-gui/src/set_up_complete/set_up_complete.fxml index 48d8d02..6b0fce6 100644 --- a/voting-station-gui/src/set_up_complete/set_up_complete.fxml +++ b/voting-station-gui/src/set_up_complete/set_up_complete.fxml @@ -1,5 +1,7 @@ + + diff --git a/voting-station-gui/src/splash_screen_on_boot/fxml/spalsh_screen_on_boot.fxml b/voting-station-gui/src/splash_screen_on_boot/fxml/spalsh_screen_on_boot.fxml index 856be2f..d9362d6 100644 --- a/voting-station-gui/src/splash_screen_on_boot/fxml/spalsh_screen_on_boot.fxml +++ b/voting-station-gui/src/splash_screen_on_boot/fxml/spalsh_screen_on_boot.fxml @@ -1,5 +1,7 @@ + + diff --git a/voting-station-gui/src/splash_screen_on_boot/java/SplashScreenOnBootController.java b/voting-station-gui/src/splash_screen_on_boot/java/SplashScreenOnBootController.java index e96fbb8..464f7dd 100644 --- a/voting-station-gui/src/splash_screen_on_boot/java/SplashScreenOnBootController.java +++ b/voting-station-gui/src/splash_screen_on_boot/java/SplashScreenOnBootController.java @@ -1,12 +1,11 @@ package splash_screen_on_boot.java; import javafx.concurrent.Task; -import javafx.concurrent.WorkerStateEvent; -import javafx.event.EventHandler; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; +import uploading_to_bulletin_board.java.UploadingToBulletinBoardController; import java.io.IOException; @@ -14,15 +13,19 @@ import java.io.IOException; * SplashScreenOnBootController starts the entry point into meerkat it displays the loading */ public class SplashScreenOnBootController { + private static final String SPALSH_SCREEN_ON_BOOT_FXML_PATH = "../fxml/spalsh_screen_on_boot.fxml"; private static final int TWO_SECONDS_TIMEOUT_IN_MILLISECONDS = 2000; - protected Parent SplashScreenOnBootRoot; + /** The primary stage which displays data, should pass it to next controller **/ + private Stage currentStage; + public SplashScreenOnBootController(Stage primaryStage) throws IOException { - SplashScreenOnBootRoot = FXMLLoader.load(getClass().getResource(SPALSH_SCREEN_ON_BOOT_FXML_PATH)); - primaryStage.setScene(new Scene(SplashScreenOnBootRoot, 565, 365)); + Parent splashScreenOnBootRoot = FXMLLoader.load(getClass().getResource(SPALSH_SCREEN_ON_BOOT_FXML_PATH)); + currentStage = primaryStage; + currentStage.setScene(new Scene(splashScreenOnBootRoot, 565, 365)); IntroSleep(); } @@ -35,28 +38,29 @@ public class SplashScreenOnBootController { Task sleeper = new Task() { @Override protected Void call() throws Exception { - try { - Thread.sleep(TWO_SECONDS_TIMEOUT_IN_MILLISECONDS); - } catch (InterruptedException e) { - } + Thread.sleep(TWO_SECONDS_TIMEOUT_IN_MILLISECONDS); return null; } }; - sleeper.setOnSucceeded(event -> StartUploadingToBulletinBoard()); + sleeper.setOnSucceeded(event -> { + try { + StartUploadingToBulletinBoard(); + } catch (IOException e) { + System.out.println("Could not create new uploading to bulletin board scene!"); + } + }); new Thread(sleeper).start(); } /** * Creates instance of uploading to bulletin board and set it as the scene */ - private void StartUploadingToBulletinBoard() - { - + private void StartUploadingToBulletinBoard() throws IOException { + new UploadingToBulletinBoardController(currentStage); } /** - * Needed for normal output fllow + * Needed for normal output flow */ public SplashScreenOnBootController(){} - } diff --git a/voting-station-gui/src/uploading_to_bulletin_board/uploading_to_bulletin_board.fxml b/voting-station-gui/src/uploading_to_bulletin_board/fxml/uploading_to_bulletin_board.fxml similarity index 98% rename from voting-station-gui/src/uploading_to_bulletin_board/uploading_to_bulletin_board.fxml rename to voting-station-gui/src/uploading_to_bulletin_board/fxml/uploading_to_bulletin_board.fxml index d1cee9c..afa87e8 100644 --- a/voting-station-gui/src/uploading_to_bulletin_board/uploading_to_bulletin_board.fxml +++ b/voting-station-gui/src/uploading_to_bulletin_board/fxml/uploading_to_bulletin_board.fxml @@ -1,5 +1,7 @@ + + @@ -132,7 +134,7 @@ - + diff --git a/voting-station-gui/src/uploading_to_bulletin_board/java/UploadingToBulletinBoardController.java b/voting-station-gui/src/uploading_to_bulletin_board/java/UploadingToBulletinBoardController.java new file mode 100644 index 0000000..880dd3d --- /dev/null +++ b/voting-station-gui/src/uploading_to_bulletin_board/java/UploadingToBulletinBoardController.java @@ -0,0 +1,36 @@ +package uploading_to_bulletin_board.java; + +import javafx.fxml.FXML; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.stage.Stage; + +import java.io.IOException; + +/** + * Created by Vladimir Eliezer Tokarev on 28/05/2016. + */ +public class UploadingToBulletinBoardController { + private static final String UPLOADING_TO_BULLETIN_BOARD_FXM_PATH = "../fxml/uploading_to_bulletin_board.fxml"; + + protected Parent UploadToBulletinBoardRoot; + + public UploadingToBulletinBoardController(Stage primaryStage) throws IOException + { + UploadToBulletinBoardRoot = FXMLLoader.load(getClass().getResource(UPLOADING_TO_BULLETIN_BOARD_FXM_PATH)); + primaryStage.setScene(new Scene(UploadToBulletinBoardRoot, 565, 365)); + primaryStage.show(); + } + + + /** + * Method called when the override button had been clicked/pressed + */ + @FXML + private void Override() + { + + } + +}