diff --git a/voting-station-gui/src/polling_station_dashboard/search/addVoter/java/AddVoterLoader.java b/voting-station-gui/src/polling_station_dashboard/search/addVoter/java/AddVoterLoader.java index e5cc69f..1be3b32 100644 --- a/voting-station-gui/src/polling_station_dashboard/search/addVoter/java/AddVoterLoader.java +++ b/voting-station-gui/src/polling_station_dashboard/search/addVoter/java/AddVoterLoader.java @@ -13,14 +13,14 @@ import java.io.IOException; */ public class AddVoterLoader { - private static final String POLLING_STATION_DASHBOARD_FXML_PATH = "../fxml/submit_voter.fxml"; + private static final String ADD_VOTER_FXML_PATH = "../fxml/submit_voter.fxml"; private Stage currentStage; public AddVoterLoader (Stage primaryStage) throws IOException { currentStage = primaryStage; - FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(POLLING_STATION_DASHBOARD_FXML_PATH)); + FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(ADD_VOTER_FXML_PATH)); Parent root = fxmlLoader.load(); AddVoterController controller = fxmlLoader.getController(); diff --git a/voting-station-gui/src/polling_station_dashboard/search/submitVoter/java/SubmitVoterController.java b/voting-station-gui/src/polling_station_dashboard/search/submitVoter/java/SubmitVoterController.java index 29c3c80..fc32190 100644 --- a/voting-station-gui/src/polling_station_dashboard/search/submitVoter/java/SubmitVoterController.java +++ b/voting-station-gui/src/polling_station_dashboard/search/submitVoter/java/SubmitVoterController.java @@ -1,7 +1,17 @@ package polling_station_dashboard.search.submitVoter.java; +import javafx.stage.Stage; + /** * Created by Vladimir Eliezer Tokarev on 18/06/2016. + * SubmitVoterController controls the behavior of the submit panel which gives the ability + * to change the ability of vote to a voter */ public class SubmitVoterController { + private Stage currentStage; + + public void SetStage(Stage primaryStage) + { + this.currentStage = primaryStage; + } } diff --git a/voting-station-gui/src/polling_station_dashboard/search/submitVoter/java/SubmitVoterLoader.java b/voting-station-gui/src/polling_station_dashboard/search/submitVoter/java/SubmitVoterLoader.java index eb003aa..4b810d0 100644 --- a/voting-station-gui/src/polling_station_dashboard/search/submitVoter/java/SubmitVoterLoader.java +++ b/voting-station-gui/src/polling_station_dashboard/search/submitVoter/java/SubmitVoterLoader.java @@ -1,7 +1,31 @@ package polling_station_dashboard.search.submitVoter.java; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.layout.Pane; +import javafx.stage.Stage; + +import java.io.IOException; + /** * Created by Vladimir Eliezer Tokarev on 18/06/2016. + * SubmitVoterLoader Loads the submit voter fxml */ public class SubmitVoterLoader { + + private static final String SUBMIT_VOTER_FXML_PATH = "../fxml/submit_voter.fxml"; + + private Stage currentStage; + + public SubmitVoterLoader (Stage primaryStage) throws IOException + { + currentStage = primaryStage; + FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(SUBMIT_VOTER_FXML_PATH)); + Parent root = fxmlLoader.load(); + SubmitVoterController controller = fxmlLoader.getController(); + + Pane addEditPane = (Pane)currentStage.getScene().lookup("#AddEditPane"); + addEditPane.getChildren().add(root); + controller.SetStage(primaryStage); + } }