Added Vote have been cast into flow

android-scanner
Vladimir Eliezer Tokarev 2016-08-27 17:06:35 +03:00
parent 38f1624071
commit dda2d3e55b
18 changed files with 83 additions and 16 deletions

View File

@ -51,7 +51,7 @@
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" />
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="2">
<right>
<Button mnemonicParsing="false" text="Cast Vote" BorderPane.alignment="CENTER">
<Button mnemonicParsing="false" onMousePressed="#GetToVoteHaveBeenCast" text="Cast Vote" BorderPane.alignment="CENTER">
<font>
<Font size="16.0" />
</font>

View File

@ -8,7 +8,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.vote_have_been_cast.VoteHaveBeenCastController">
<children>
<GridPane>
<children>
@ -208,7 +208,7 @@
<left>
<ImageView BorderPane.alignment="CENTER">
<image>
<Image url="@../../../../voting-station-gui/out/production/voting-station-gui/pictures/paperFold.png" />
<Image url="@../pics/paperFold.png" />
</image>
</ImageView>
</left>
@ -217,7 +217,7 @@
<center>
<ImageView BorderPane.alignment="CENTER">
<image>
<Image url="@../../../../voting-station-gui/out/production/voting-station-gui/pictures/stickPaper.png" />
<Image url="@../pics/stickPaper.png" />
</image>
</ImageView>
</center>
@ -226,7 +226,7 @@
<center>
<ImageView fitHeight="69.0" fitWidth="66.0" BorderPane.alignment="CENTER">
<image>
<Image url="@../../../../voting-station-gui/out/production/voting-station-gui/pictures/walkingMan.png" />
<Image url="@../pics/walkingMan.png" />
</image>
</ImageView>
</center>

View File

@ -7,6 +7,8 @@ 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;
import main.vote_have_been_cast.VoteHaveBeenCastController;
import main.vote_have_been_cast.VoteHaveBeenCastLoader;
import main.welcome_splash.WelcomeSplashLoader;
import java.io.IOException;
@ -68,6 +70,10 @@ public class ChainBuilder {
TwoWayNode castOrAuditController = castOrAuditLoader.GetCastOrAudit();
ballotSummaryController.SetNext(castOrAuditController);
VoteHaveBeenCastLoader voteHaveBeenCastLoader = new VoteHaveBeenCastLoader(primaryStage);
TwoWayNode voteHaveBeenCastController = voteHaveBeenCastLoader.GetVoteHaveBeenCast();
castOrAuditController.SetNext(voteHaveBeenCastController);
/**
* all other two way nodes initialized
*/

View File

@ -30,11 +30,11 @@ public class BallotSummaryLoader {
* @throws IOException
*/
public TwoWayNode GetBallotSummary() throws IOException {
Parent selectCandidateName = fxmlLoader.load();
Parent ballotSummary = fxmlLoader.load();
BallotSummaryController controller = fxmlLoader.getController();
// set the controller to be functional TwoWayNode
controller.SetParent(selectCandidateName);
controller.SetParent(ballotSummary);
controller.SetStage(currentStage);
return controller;

View File

@ -1,5 +1,7 @@
package main.cast_or_audit;
import javafx.fxml.FXML;
import javafx.scene.input.MouseEvent;
import main.TwoWayNode;
/**
@ -7,4 +9,11 @@ import main.TwoWayNode;
* CastOrAuditController handle the behavior of cast or audit screen
*/
public class CastOrAuditController extends TwoWayNode {
@FXML
private void GetToVoteHaveBeenCast(MouseEvent mousePressed) {
this.currentStage.close();
this.currentStage.setScene(this.next);
this.currentStage.show();
}
}

View File

@ -30,11 +30,11 @@ public class CastOrAuditLoader {
* @throws IOException
*/
public TwoWayNode GetCastOrAudit() throws IOException {
Parent selectCandidateName = fxmlLoader.load();
Parent castOrAudit = fxmlLoader.load();
CastOrAuditController controller = fxmlLoader.getController();
// set the controller to be functional TwoWayNode
controller.SetParent(selectCandidateName);
controller.SetParent(castOrAudit);
controller.SetStage(currentStage);
return controller;

View File

@ -51,7 +51,7 @@
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" />
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="2">
<right>
<Button mnemonicParsing="false" text="Cast Vote" BorderPane.alignment="CENTER">
<Button mnemonicParsing="false" onMousePressed="#GetToVoteHaveBeenCast" text="Cast Vote" BorderPane.alignment="CENTER">
<font>
<Font size="16.0" />
</font>

View File

@ -31,11 +31,11 @@ public class SelectCandidateByPictureLoader {
* @throws IOException
*/
public TwoWayNode GetSelectCandidateByPicture() throws IOException {
Parent selectCandidateName = fxmlLoader.load();
Parent selectByPicture = fxmlLoader.load();
SelectCandidateByPictureController controller = fxmlLoader.getController();
// set the controller to be functional TwoWayNode
controller.SetParent(selectCandidateName);
controller.SetParent(selectByPicture);
controller.SetStage(currentStage);
return controller;

View File

@ -0,0 +1,10 @@
package main.vote_have_been_cast;
import main.TwoWayNode;
/**
* Created by Vladimir Eliezer Tokarev on 8/27/2016.
* VoteHaveBeenCastController is in charge of handle the vote that have been casted
*/
public class VoteHaveBeenCastController extends TwoWayNode {
}

View File

@ -0,0 +1,42 @@
package main.vote_have_been_cast;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.stage.Stage;
import main.TwoWayNode;
import main.cast_or_audit.CastOrAuditController;
import java.io.IOException;
/**
* Created by Vladimir Eliezer Tokarev on 8/27/2016.
* VoteHaveBeenCastLoader laods the screen that in charge of handling the voting end
*/
public class VoteHaveBeenCastLoader {
private static final String VOTE_HAVE_BEEN_CAST_FXML_PATH = "vote_have_been_cast.fxml";
private Stage currentStage;
private FXMLLoader fxmlLoader;
public VoteHaveBeenCastLoader(Stage primaryStage) throws IOException
{
fxmlLoader = new FXMLLoader(getClass().getResource(VOTE_HAVE_BEEN_CAST_FXML_PATH));
currentStage = primaryStage;
}
/**
* Creates welcome splash parent node and sets it to the controller
* @return TwoWayNode
* @throws IOException
*/
public TwoWayNode GetVoteHaveBeenCast() throws IOException {
Parent voteHaveBeenCast = fxmlLoader.load();
VoteHaveBeenCastController controller = fxmlLoader.getController();
// set the controller to be functional TwoWayNode
controller.SetParent(voteHaveBeenCast);
controller.SetStage(currentStage);
return controller;
}
}

View File

@ -8,7 +8,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.vote_have_been_cast.VoteHaveBeenCastController">
<children>
<GridPane>
<children>
@ -208,7 +208,7 @@
<left>
<ImageView BorderPane.alignment="CENTER">
<image>
<Image url="@../../../../voting-station-gui/out/production/voting-station-gui/pictures/paperFold.png" />
<Image url="@../pics/paperFold.png" />
</image>
</ImageView>
</left>
@ -217,7 +217,7 @@
<center>
<ImageView BorderPane.alignment="CENTER">
<image>
<Image url="@../../../../voting-station-gui/out/production/voting-station-gui/pictures/stickPaper.png" />
<Image url="@../pics/stickPaper.png" />
</image>
</ImageView>
</center>
@ -226,7 +226,7 @@
<center>
<ImageView fitHeight="69.0" fitWidth="66.0" BorderPane.alignment="CENTER">
<image>
<Image url="@../../../../voting-station-gui/out/production/voting-station-gui/pictures/walkingMan.png" />
<Image url="@../pics/walkingMan.png" />
</image>
</ImageView>
</center>