Added the loader and the controler voter submit panel
parent
b8001163b7
commit
f813c11edd
|
@ -13,14 +13,14 @@ import java.io.IOException;
|
||||||
*/
|
*/
|
||||||
public class AddVoterLoader {
|
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;
|
private Stage currentStage;
|
||||||
|
|
||||||
public AddVoterLoader (Stage primaryStage) throws IOException
|
public AddVoterLoader (Stage primaryStage) throws IOException
|
||||||
{
|
{
|
||||||
currentStage = primaryStage;
|
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();
|
Parent root = fxmlLoader.load();
|
||||||
AddVoterController controller = fxmlLoader.getController();
|
AddVoterController controller = fxmlLoader.getController();
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,17 @@
|
||||||
package polling_station_dashboard.search.submitVoter.java;
|
package polling_station_dashboard.search.submitVoter.java;
|
||||||
|
|
||||||
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Vladimir Eliezer Tokarev on 18/06/2016.
|
* 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 {
|
public class SubmitVoterController {
|
||||||
|
private Stage currentStage;
|
||||||
|
|
||||||
|
public void SetStage(Stage primaryStage)
|
||||||
|
{
|
||||||
|
this.currentStage = primaryStage;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,31 @@
|
||||||
package polling_station_dashboard.search.submitVoter.java;
|
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.
|
* Created by Vladimir Eliezer Tokarev on 18/06/2016.
|
||||||
|
* SubmitVoterLoader Loads the submit voter fxml
|
||||||
*/
|
*/
|
||||||
public class SubmitVoterLoader {
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue