diff --git a/voting-station-gui/src/polling_station_dashboard/fxml/polling_station_dashboard.fxml b/voting-station-gui/src/polling_station_dashboard/fxml/polling_station_dashboard.fxml index afcb1af..a8d60d0 100644 --- a/voting-station-gui/src/polling_station_dashboard/fxml/polling_station_dashboard.fxml +++ b/voting-station-gui/src/polling_station_dashboard/fxml/polling_station_dashboard.fxml @@ -7,7 +7,7 @@ - + diff --git a/voting-station-gui/src/polling_station_dashboard/java/PollingStationDashboardController.java b/voting-station-gui/src/polling_station_dashboard/java/PollingStationDashboardController.java index 705ae8d..967ac3e 100644 --- a/voting-station-gui/src/polling_station_dashboard/java/PollingStationDashboardController.java +++ b/voting-station-gui/src/polling_station_dashboard/java/PollingStationDashboardController.java @@ -1,7 +1,16 @@ package polling_station_dashboard.java; +import javafx.stage.Stage; + /** * Created by Vladimir Eliezer Tokarev on 28/05/2016. */ public class PollingStationDashboardController { + + private Stage currentStage; + + public void SetStage(Stage primaryStage) + { + this.currentStage = primaryStage; + } } diff --git a/voting-station-gui/src/polling_station_dashboard/java/PollingStationDashboardLoader.java b/voting-station-gui/src/polling_station_dashboard/java/PollingStationDashboardLoader.java index 98e967e..f1b0a1a 100644 --- a/voting-station-gui/src/polling_station_dashboard/java/PollingStationDashboardLoader.java +++ b/voting-station-gui/src/polling_station_dashboard/java/PollingStationDashboardLoader.java @@ -1,7 +1,35 @@ package polling_station_dashboard.java; +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. + * Created by Vladimir Eliezer Tokarev on 28/05/2016 + * This class loads the polling station fxml */ public class PollingStationDashboardLoader { + + private static final String POLLING_STATION_DASHBOARD_FXML_PATH = "../fxml/polling_station_dashboard.fxml"; + + private Stage currentStage; + + public PollingStationDashboardLoader (Stage primaryStage) throws IOException + { + currentStage = primaryStage; + FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(POLLING_STATION_DASHBOARD_FXML_PATH)); + Parent root = fxmlLoader.load(); + PollingStationDashboardController controller = fxmlLoader.getController(); + + currentStage.setTitle("Polling Station Dashboard"); + currentStage.setScene(new Scene(root, 850, 615)); + currentStage.show(); + + + System.out.println("heyeyeye"); + controller.SetStage(currentStage); + } } diff --git a/voting-station-gui/src/set_up_complete/fxml/set_up_complete.fxml b/voting-station-gui/src/set_up_complete/fxml/set_up_complete.fxml index 13c6331..6c60ed5 100644 --- a/voting-station-gui/src/set_up_complete/fxml/set_up_complete.fxml +++ b/voting-station-gui/src/set_up_complete/fxml/set_up_complete.fxml @@ -101,7 +101,7 @@
-
diff --git a/voting-station-gui/src/set_up_complete/java/SetUpCompleteController.java b/voting-station-gui/src/set_up_complete/java/SetUpCompleteController.java index e45fcf5..78729bb 100644 --- a/voting-station-gui/src/set_up_complete/java/SetUpCompleteController.java +++ b/voting-station-gui/src/set_up_complete/java/SetUpCompleteController.java @@ -1,6 +1,10 @@ package set_up_complete.java; +import javafx.fxml.FXML; import javafx.stage.Stage; +import polling_station_dashboard.java.PollingStationDashboardLoader; + +import java.io.IOException; /** * Created by Vladimir Eliezer Tokarev on 28/05/2016. @@ -15,4 +19,8 @@ public class SetUpCompleteController { this.currentStage = primaryStage; } + @FXML + private void GoToPollingStationDashboard() throws IOException { + new PollingStationDashboardLoader(this.currentStage); + } } diff --git a/voting-station-gui/src/set_up_complete/java/SetUpCompleteLoader.java b/voting-station-gui/src/set_up_complete/java/SetUpCompleteLoader.java index 08dc27a..d291d39 100644 --- a/voting-station-gui/src/set_up_complete/java/SetUpCompleteLoader.java +++ b/voting-station-gui/src/set_up_complete/java/SetUpCompleteLoader.java @@ -4,7 +4,6 @@ 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; @@ -13,20 +12,21 @@ import java.io.IOException; * SetUpCompleteLoader represent the end state of subscription to bulletin board */ public class SetUpCompleteLoader { - private static final String SET_UP_COMPLETE_PATH = "../fxml/set_up_complete.fxml"; + private static final String SET_UP_COMPLETE_FXML_PATH = "../fxml/set_up_complete.fxml"; private Stage currentStage; public SetUpCompleteLoader (Stage primaryStage) throws IOException { currentStage = primaryStage; - FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(SET_UP_COMPLETE_PATH)); + FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(SET_UP_COMPLETE_FXML_PATH)); Parent root = fxmlLoader.load(); SetUpCompleteController controller = fxmlLoader.getController(); - controller.SetStage(currentStage); currentStage.setTitle("Set Up Complete"); currentStage.setScene(new Scene(root, 560, 310)); currentStage.show(); + + controller.SetStage(currentStage); } }