From 43af4b016d73aa2639bdb5645c2ed38999b1b94b Mon Sep 17 00:00:00 2001 From: Vladimir Eliezer Tokarev Date: Sat, 2 Jul 2016 17:12:43 +0300 Subject: [PATCH] Implemented lodge appeal loader and controller --- .../lodgeAppeal/LodgeAppealController.java | 9 +++++++ .../lodgeAppeal/LodgeAppealLoader.java | 26 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/polling-station-gui/src/main/java/polling_station_dashboard/search/submitVoter/lodgeAppeal/LodgeAppealController.java b/polling-station-gui/src/main/java/polling_station_dashboard/search/submitVoter/lodgeAppeal/LodgeAppealController.java index 8f48e98..60a4b23 100644 --- a/polling-station-gui/src/main/java/polling_station_dashboard/search/submitVoter/lodgeAppeal/LodgeAppealController.java +++ b/polling-station-gui/src/main/java/polling_station_dashboard/search/submitVoter/lodgeAppeal/LodgeAppealController.java @@ -1,7 +1,16 @@ package polling_station_dashboard.search.submitVoter.lodgeAppeal; +import javafx.stage.Stage; + /** * Created by dasha on 7/2/2016. + * Contros the behavior od the lodge appeal panel */ public class LodgeAppealController { + private Stage currentStage; + + public void SetStage(Stage primaryStage) + { + this.currentStage = primaryStage; + } } diff --git a/polling-station-gui/src/main/java/polling_station_dashboard/search/submitVoter/lodgeAppeal/LodgeAppealLoader.java b/polling-station-gui/src/main/java/polling_station_dashboard/search/submitVoter/lodgeAppeal/LodgeAppealLoader.java index a0f88ff..e03002c 100644 --- a/polling-station-gui/src/main/java/polling_station_dashboard/search/submitVoter/lodgeAppeal/LodgeAppealLoader.java +++ b/polling-station-gui/src/main/java/polling_station_dashboard/search/submitVoter/lodgeAppeal/LodgeAppealLoader.java @@ -1,7 +1,33 @@ package polling_station_dashboard.search.submitVoter.lodgeAppeal; +import javafx.fxml.FXMLLoader; +import javafx.scene.layout.GridPane; +import javafx.stage.Stage; +import polling_station_dashboard.settings.settingsController; + +import java.io.IOException; + /** * Created by dasha on 7/2/2016. + * Loads the lodge appeal fxml file */ public class LodgeAppealLoader { + private static final String LODGE_APPEAL_PATH = "/view/dashboard/lodge_appeal.fxml"; + + private Stage currentStage; + private FXMLLoader fxmlLoader; + + public LodgeAppealLoader(Stage primaryStage) throws IOException + { + currentStage = primaryStage; + fxmlLoader = new FXMLLoader(getClass().getResource(LODGE_APPEAL_PATH)); + } + + public GridPane GetSettingsInstance() throws IOException { + GridPane settings = fxmlLoader.load(); + LodgeAppealController controller = fxmlLoader.getController(); + controller.SetStage(currentStage); + + return settings; + } }