package main.ballot_summary; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.stage.Stage; import main.TwoWayNode; import main.select_candidate_by_picture.SelectCandidateByPictureController; import java.io.IOException; /** * Created by Vladimir Eliezer Tokarev on 8/27/2016. * BallotSummaryLoader creates starlight channel section object and sets its controller */ public class BallotSummaryLoader { private static final String BALLOT_SUMMARY_FXML_PATH = "ballot_summary.fxml"; private Stage currentStage; private FXMLLoader fxmlLoader; public BallotSummaryLoader(Stage primaryStage) throws IOException { fxmlLoader = new FXMLLoader(getClass().getResource(BALLOT_SUMMARY_FXML_PATH)); currentStage = primaryStage; } /** * Creates welcome splash parent node and sets it to the controller * @return TwoWayNode * @throws IOException */ public TwoWayNode GetBallotSummary() throws IOException { Parent selectCandidateName = fxmlLoader.load(); BallotSummaryController controller = fxmlLoader.getController(); // set the controller to be functional TwoWayNode controller.SetParent(selectCandidateName); controller.SetStage(currentStage); return controller; } }