Removed unnsessery panels
parent
c5dcb9f06e
commit
555783d30c
BIN
VotersBallot.png
BIN
VotersBallot.png
Binary file not shown.
Before Width: | Height: | Size: 985 B After Width: | Height: | Size: 954 B |
|
@ -5,7 +5,6 @@ import meerkat.voting.gui.configuration.VotingBoothConfiguration;
|
||||||
import meerkat.voting.gui.panels.ballot_summary.BallotSummaryLoader;
|
import meerkat.voting.gui.panels.ballot_summary.BallotSummaryLoader;
|
||||||
import meerkat.voting.gui.panels.cast_or_audit.CastOrAuditLoader;
|
import meerkat.voting.gui.panels.cast_or_audit.CastOrAuditLoader;
|
||||||
import meerkat.voting.gui.panels.select_candidate_by_picture.SelectCandidateByPictureLoader;
|
import meerkat.voting.gui.panels.select_candidate_by_picture.SelectCandidateByPictureLoader;
|
||||||
import meerkat.voting.gui.panels.select_candidate_name.SelectCandidateNameLoader;
|
|
||||||
import meerkat.voting.gui.panels.straight_channel_section.StraightChannelSectionLoader;
|
import meerkat.voting.gui.panels.straight_channel_section.StraightChannelSectionLoader;
|
||||||
import meerkat.voting.gui.panels.thank_for_audditing.ThankForAuditingLoader;
|
import meerkat.voting.gui.panels.thank_for_audditing.ThankForAuditingLoader;
|
||||||
import meerkat.voting.gui.panels.vote_have_been_cast.VoteHaveBeenCastLoader;
|
import meerkat.voting.gui.panels.vote_have_been_cast.VoteHaveBeenCastLoader;
|
||||||
|
@ -60,18 +59,19 @@ public class ChainBuilder {
|
||||||
welcomeSplashController.SetNext(straightChannelSectionController);
|
welcomeSplashController.SetNext(straightChannelSectionController);
|
||||||
straightChannelSectionController.SetPrevious(welcomeSplashController);
|
straightChannelSectionController.SetPrevious(welcomeSplashController);
|
||||||
|
|
||||||
SelectCandidateNameLoader selectCandidateNameLoader = new SelectCandidateNameLoader(primaryStage, configuration);
|
// SelectCandidateNameLoader selectCandidateNameLoader = new SelectCandidateNameLoader(primaryStage, configuration);
|
||||||
TwoWayNode selectCandidateNameController = selectCandidateNameLoader.GetSelectCandidateName();
|
// TwoWayNode selectCandidateNameController = selectCandidateNameLoader.GetSelectCandidateName();
|
||||||
selectCandidateNameController.SetVotersBallot(votersBallot);
|
// selectCandidateNameController.SetVotersBallot(votersBallot);
|
||||||
selectCandidateNameController.SetPrevious(straightChannelSectionController);
|
// selectCandidateNameController.SetPrevious(straightChannelSectionController);
|
||||||
straightChannelSectionController.SetNext(selectCandidateNameController);
|
|
||||||
|
|
||||||
SelectCandidateByPictureLoader selectCandidateByPictureLoader =
|
SelectCandidateByPictureLoader selectCandidateByPictureLoader =
|
||||||
new SelectCandidateByPictureLoader(primaryStage,configuration);
|
new SelectCandidateByPictureLoader(primaryStage,configuration);
|
||||||
TwoWayNode selectCandidateByPictureController = selectCandidateByPictureLoader.GetSelectCandidateByPicture();
|
TwoWayNode selectCandidateByPictureController = selectCandidateByPictureLoader.GetSelectCandidateByPicture();
|
||||||
selectCandidateByPictureController.SetVotersBallot(votersBallot);
|
selectCandidateByPictureController.SetVotersBallot(votersBallot);
|
||||||
selectCandidateByPictureController.SetPrevious(selectCandidateNameController);
|
selectCandidateByPictureController.SetPrevious(straightChannelSectionController);
|
||||||
selectCandidateNameController.SetNext(selectCandidateByPictureController);
|
// selectCandidateNameController.SetNext(selectCandidateByPictureController);
|
||||||
|
straightChannelSectionController.SetNext(selectCandidateByPictureController);
|
||||||
|
|
||||||
BallotSummaryLoader ballotSummaryLoader = new BallotSummaryLoader(primaryStage, configuration);
|
BallotSummaryLoader ballotSummaryLoader = new BallotSummaryLoader(primaryStage, configuration);
|
||||||
TwoWayNode ballotSummaryController = ballotSummaryLoader.GetBallotSummary();
|
TwoWayNode ballotSummaryController = ballotSummaryLoader.GetBallotSummary();
|
||||||
|
@ -105,7 +105,7 @@ public class ChainBuilder {
|
||||||
Map<String, TwoWayNode> nameToTwoWayNodeMap = new HashMap<>();
|
Map<String, TwoWayNode> nameToTwoWayNodeMap = new HashMap<>();
|
||||||
nameToTwoWayNodeMap.put("welcomeSplashController", welcomeSplashController);
|
nameToTwoWayNodeMap.put("welcomeSplashController", welcomeSplashController);
|
||||||
nameToTwoWayNodeMap.put("straightChannelSectionController", straightChannelSectionController);
|
nameToTwoWayNodeMap.put("straightChannelSectionController", straightChannelSectionController);
|
||||||
nameToTwoWayNodeMap.put("selectCandidateNameController", selectCandidateNameController);
|
//nameToTwoWayNodeMap.put("selectCandidateNameController", selectCandidateNameController);
|
||||||
nameToTwoWayNodeMap.put("selectCandidateByPictureController", selectCandidateByPictureController);
|
nameToTwoWayNodeMap.put("selectCandidateByPictureController", selectCandidateByPictureController);
|
||||||
nameToTwoWayNodeMap.put("ballotSummaryController", ballotSummaryController);
|
nameToTwoWayNodeMap.put("ballotSummaryController", ballotSummaryController);
|
||||||
nameToTwoWayNodeMap.put("voteHaveBeenCastController", voteHaveBeenCastController);
|
nameToTwoWayNodeMap.put("voteHaveBeenCastController", voteHaveBeenCastController);
|
||||||
|
|
|
@ -17,6 +17,15 @@ public class VotersBallot {
|
||||||
public String VotersNameSelection;
|
public String VotersNameSelection;
|
||||||
public BallotQuestionUIElementOuterClass.UIAnswer VotersImageSelection;
|
public BallotQuestionUIElementOuterClass.UIAnswer VotersImageSelection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the name of the candidate the voter choose
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String GetCandidateName(){
|
||||||
|
String[] name = this.VotersImageSelection.getDescription().split(" ");
|
||||||
|
return name[0] + " " + name[1];
|
||||||
|
}
|
||||||
|
|
||||||
public String toString(){
|
public String toString(){
|
||||||
return this.VotersNameSelection +"---"+ this.VoterChannel.get(0) + "" + this.VoterChannel.get(1) +
|
return this.VotersNameSelection +"---"+ this.VoterChannel.get(0) + "" + this.VoterChannel.get(1) +
|
||||||
this.VoterChannel.get(2) + "" + this.VoterChannel.get(3);
|
this.VoterChannel.get(2) + "" + this.VoterChannel.get(3);
|
||||||
|
|
|
@ -39,20 +39,35 @@ class VotersChoicesAdder {
|
||||||
this.logger.debug("Created voters choises adder.");
|
this.logger.debug("Created voters choises adder.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds all of the voters choises to the right panel
|
* Adds all of the voters choises to the right panel
|
||||||
*/
|
*/
|
||||||
void ShowVotersChoices() throws IOException {
|
void ShowVotersChoices() throws IOException {
|
||||||
this.RemoveAllAnswers();
|
this.RemoveAllAnswers();
|
||||||
this.addAnswer(this.getChannelChoice(this.votersBallot.VoterChannel));
|
this.addAnswer(this.getChannelChoice(this.votersBallot.VoterChannel));
|
||||||
this.addAnswer(this.getNameChoice(this.votersBallot.VotersNameSelection));
|
this.addAnswer(this.getNameChoice(this.votersBallot.GetCandidateName()));
|
||||||
this.addAnswer(this.getImageChoice(this.votersBallot.VotersImageSelection.getAnswer()));
|
this.addAnswer(this.getImageChoice(this.votersBallot.VotersImageSelection.getAnswer()));
|
||||||
|
this.addAnswer(this.getImageDescription(this.votersBallot.VotersImageSelection.getDescription()));
|
||||||
Label error = new Label();
|
Label error = new Label();
|
||||||
error.setPrefSize(250,30);
|
error.setPrefSize(250,30);
|
||||||
this.addAnswer(error);
|
this.addAnswer(error);
|
||||||
this.logger.debug("Add all the choises of the voter to the represent grid pane.");
|
this.logger.debug("Add all the choises of the voter to the represent grid pane.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates label and puts it into borderpane (the label contains desctiption of the cadidate image)
|
||||||
|
* @param description the descriptiom of candidate image
|
||||||
|
* @return borderPane which contains the label
|
||||||
|
*/
|
||||||
|
private BorderPane getImageDescription(String description) {
|
||||||
|
BorderPane borderPane = new BorderPane();
|
||||||
|
Label descriptionLabel = new Label(description);
|
||||||
|
borderPane.setCenter(descriptionLabel);
|
||||||
|
return borderPane;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove all previous binaryDatas from the container
|
* Remove all previous binaryDatas from the container
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -137,11 +137,11 @@
|
||||||
<RowConstraints maxHeight="198.0" minHeight="10.0" prefHeight="198.0" vgrow="SOMETIMES" />
|
<RowConstraints maxHeight="198.0" minHeight="10.0" prefHeight="198.0" vgrow="SOMETIMES" />
|
||||||
</rowConstraints>
|
</rowConstraints>
|
||||||
<children>
|
<children>
|
||||||
<ScrollPane prefHeight="300.0" prefWidth="507.0" GridPane.rowIndex="1">
|
<ScrollPane prefHeight="444.0" prefWidth="521.0" GridPane.rowIndex="1">
|
||||||
<content>
|
<content>
|
||||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="200.0" prefWidth="500.0">
|
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="372.0" prefWidth="500.0">
|
||||||
<children>
|
<children>
|
||||||
<GridPane fx:id="VotersChoices" prefHeight="200.0" prefWidth="500.0">
|
<GridPane fx:id="VotersChoices" prefHeight="390.0" prefWidth="500.0">
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||||
</columnConstraints>
|
</columnConstraints>
|
||||||
|
|
Loading…
Reference in New Issue