Added the loader and the controler voter submit panel

voting-station-gui
Vladimir ELazar Tokarev 2016-06-18 18:19:38 +03:00
parent b8001163b7
commit f813c11edd
3 changed files with 36 additions and 2 deletions

View File

@ -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();

View File

@ -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;
}
}

View File

@ -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);
}
}