Added the cast or audit into the flow

android-scanner
Vladimir Eliezer Tokarev 2016-08-27 16:56:53 +03:00
parent b687782f5c
commit 38f1624071
18 changed files with 76 additions and 11 deletions

View File

@ -41,7 +41,7 @@
<children>
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="2">
<right>
<Button mnemonicParsing="false" prefHeight="39.0" prefWidth="128.0" text="Next" BorderPane.alignment="CENTER">
<Button mnemonicParsing="false" onMousePressed="#GetToCastOrAudit" prefHeight="39.0" prefWidth="128.0" text="Next" BorderPane.alignment="CENTER">
<font>
<Font size="18.0" />
</font>

View File

@ -7,7 +7,7 @@
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="main.cast_or_audit.CastOrAuditController">
<children>
<GridPane>
<children>

View File

@ -3,6 +3,7 @@ package main;
import javafx.scene.Scene;
import javafx.stage.Stage;
import main.ballot_summary.BallotSummaryLoader;
import main.cast_or_audit.CastOrAuditLoader;
import main.select_candidate_by_picture.SelectCandidateByPictureLoader;
import main.select_candidate_name.SelectCandidateNameLoader;
import main.straight_channel_section.StraightChannelSectionLoader;
@ -63,6 +64,10 @@ public class ChainBuilder {
ballotSummaryController.SetPrevious(selectCandidateByPictureController);
selectCandidateByPictureController.SetNext(ballotSummaryController);
CastOrAuditLoader castOrAuditLoader = new CastOrAuditLoader(primaryStage);
TwoWayNode castOrAuditController = castOrAuditLoader.GetCastOrAudit();
ballotSummaryController.SetNext(castOrAuditController);
/**
* all other two way nodes initialized
*/

View File

@ -6,7 +6,7 @@ import main.TwoWayNode;
/**
* Created by Vladimir Eliezer Tokarev on 8/27/2016.
* BallotSummaryController handle the behavior of welcome splash class
* BallotSummaryController handle the behavior of ballot summary screen
*/
public class BallotSummaryController extends TwoWayNode {
@FXML
@ -15,4 +15,11 @@ public class BallotSummaryController extends TwoWayNode {
this.currentStage.setScene(this.previous);
this.currentStage.show();
}
@FXML
private void GetToCastOrAudit(MouseEvent mousePressed){
this.currentStage.close();
this.currentStage.setScene(this.next);
this.currentStage.show();
}
}

View File

@ -10,7 +10,7 @@ import java.io.IOException;
/**
* Created by Vladimir Eliezer Tokarev on 8/27/2016.
* BallotSummaryLoader creates starlight channel section object and sets its controller
* BallotSummaryLoader gives the option to whatch summary of voter actions
*/
public class BallotSummaryLoader {
private static final String BALLOT_SUMMARY_FXML_PATH = "ballot_summary.fxml";

View File

@ -41,7 +41,7 @@
<children>
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="2">
<right>
<Button mnemonicParsing="false" prefHeight="39.0" prefWidth="128.0" text="Next" BorderPane.alignment="CENTER">
<Button mnemonicParsing="false" onMousePressed="#GetToCastOrAudit" prefHeight="39.0" prefWidth="128.0" text="Next" BorderPane.alignment="CENTER">
<font>
<Font size="18.0" />
</font>

View File

@ -0,0 +1,10 @@
package main.cast_or_audit;
import main.TwoWayNode;
/**
* Created by Vladimir Eliezer Tokarev on 8/27/2016.
* CastOrAuditController handle the behavior of cast or audit screen
*/
public class CastOrAuditController extends TwoWayNode {
}

View File

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

View File

@ -7,7 +7,7 @@
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="main.cast_or_audit.CastOrAuditController">
<children>
<GridPane>
<children>

View File

@ -6,7 +6,7 @@ import main.TwoWayNode;
/**
* Created by Vladimir Eliezer Tokarev on 8/27/2016.
* SelectCandidateNameController handle the behavior of welcome splash class
* SelectCandidateNameController handle the behavior of select by picture screen
*/
public class SelectCandidateByPictureController extends TwoWayNode {

View File

@ -10,7 +10,7 @@ import java.io.IOException;
/**
* Created by Vladimir Eliezer Tokarev on 8/27/2016.
* SelectCandidateByPictureLoader creates starlight channel section object and sets its controller
* SelectCandidateByPictureLoader creates the pannel which gives the option to choose by picture
*/
public class SelectCandidateByPictureLoader {

View File

@ -7,7 +7,7 @@ import main.TwoWayNode;
/**
* Created by Vladimir Eliezer Tokarev on 8/27/2016.
* SelectCandidateNameController handle the behavior of welcome splash class
* SelectCandidateNameController handle the behavior of select by name screen
*/
public class SelectCandidateNameController extends TwoWayNode {
@FXML

View File

@ -8,7 +8,7 @@ import java.io.IOException;
/**
* Created by Vladimir Eliezer Tokarev on 8/27/2016.
* SelectCandidateNameLoader creates starlight channel section object and sets its controller
* SelectCandidateNameLoader creates the option to choose by name
*/
public class SelectCandidateNameLoader {
private static final String SELECT_CANDIDATE_NAME_FXML_PATH = "select_candidate_name.fxml";

View File

@ -9,7 +9,7 @@ import main.TwoWayNode;
/**
* Created by Vladimir Eliezer Tokarev on 8/27/2016.
* StraightChannelSectionController handle the behavior of welcome splash class
* StraightChannelSectionController handle the behavior of select channel section screen
*/
public class StraightChannelSectionController extends TwoWayNode {