Removed unnsessery panels

android-scanner
VladimirEliTokarev 2016-10-29 23:06:28 +03:00
parent c5dcb9f06e
commit 555783d30c
5 changed files with 37 additions and 13 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 985 B

After

Width:  |  Height:  |  Size: 954 B

View File

@ -5,7 +5,6 @@ import meerkat.voting.gui.configuration.VotingBoothConfiguration;
import meerkat.voting.gui.panels.ballot_summary.BallotSummaryLoader;
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_name.SelectCandidateNameLoader;
import meerkat.voting.gui.panels.straight_channel_section.StraightChannelSectionLoader;
import meerkat.voting.gui.panels.thank_for_audditing.ThankForAuditingLoader;
import meerkat.voting.gui.panels.vote_have_been_cast.VoteHaveBeenCastLoader;
@ -60,18 +59,19 @@ public class ChainBuilder {
welcomeSplashController.SetNext(straightChannelSectionController);
straightChannelSectionController.SetPrevious(welcomeSplashController);
SelectCandidateNameLoader selectCandidateNameLoader = new SelectCandidateNameLoader(primaryStage, configuration);
TwoWayNode selectCandidateNameController = selectCandidateNameLoader.GetSelectCandidateName();
selectCandidateNameController.SetVotersBallot(votersBallot);
selectCandidateNameController.SetPrevious(straightChannelSectionController);
straightChannelSectionController.SetNext(selectCandidateNameController);
// SelectCandidateNameLoader selectCandidateNameLoader = new SelectCandidateNameLoader(primaryStage, configuration);
// TwoWayNode selectCandidateNameController = selectCandidateNameLoader.GetSelectCandidateName();
// selectCandidateNameController.SetVotersBallot(votersBallot);
// selectCandidateNameController.SetPrevious(straightChannelSectionController);
SelectCandidateByPictureLoader selectCandidateByPictureLoader =
new SelectCandidateByPictureLoader(primaryStage,configuration);
TwoWayNode selectCandidateByPictureController = selectCandidateByPictureLoader.GetSelectCandidateByPicture();
selectCandidateByPictureController.SetVotersBallot(votersBallot);
selectCandidateByPictureController.SetPrevious(selectCandidateNameController);
selectCandidateNameController.SetNext(selectCandidateByPictureController);
selectCandidateByPictureController.SetPrevious(straightChannelSectionController);
// selectCandidateNameController.SetNext(selectCandidateByPictureController);
straightChannelSectionController.SetNext(selectCandidateByPictureController);
BallotSummaryLoader ballotSummaryLoader = new BallotSummaryLoader(primaryStage, configuration);
TwoWayNode ballotSummaryController = ballotSummaryLoader.GetBallotSummary();
@ -105,7 +105,7 @@ public class ChainBuilder {
Map<String, TwoWayNode> nameToTwoWayNodeMap = new HashMap<>();
nameToTwoWayNodeMap.put("welcomeSplashController", welcomeSplashController);
nameToTwoWayNodeMap.put("straightChannelSectionController", straightChannelSectionController);
nameToTwoWayNodeMap.put("selectCandidateNameController", selectCandidateNameController);
//nameToTwoWayNodeMap.put("selectCandidateNameController", selectCandidateNameController);
nameToTwoWayNodeMap.put("selectCandidateByPictureController", selectCandidateByPictureController);
nameToTwoWayNodeMap.put("ballotSummaryController", ballotSummaryController);
nameToTwoWayNodeMap.put("voteHaveBeenCastController", voteHaveBeenCastController);

View File

@ -17,6 +17,15 @@ public class VotersBallot {
public String VotersNameSelection;
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(){
return this.VotersNameSelection +"---"+ this.VoterChannel.get(0) + "" + this.VoterChannel.get(1) +
this.VoterChannel.get(2) + "" + this.VoterChannel.get(3);

View File

@ -39,20 +39,35 @@ class VotersChoicesAdder {
this.logger.debug("Created voters choises adder.");
}
/**
* Adds all of the voters choises to the right panel
*/
void ShowVotersChoices() throws IOException {
this.RemoveAllAnswers();
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.getImageDescription(this.votersBallot.VotersImageSelection.getDescription()));
Label error = new Label();
error.setPrefSize(250,30);
this.addAnswer(error);
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
*/

View File

@ -137,11 +137,11 @@
<RowConstraints maxHeight="198.0" minHeight="10.0" prefHeight="198.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<ScrollPane prefHeight="300.0" prefWidth="507.0" GridPane.rowIndex="1">
<ScrollPane prefHeight="444.0" prefWidth="521.0" GridPane.rowIndex="1">
<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>
<GridPane fx:id="VotersChoices" prefHeight="200.0" prefWidth="500.0">
<GridPane fx:id="VotersChoices" prefHeight="390.0" prefWidth="500.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>