From 272e40647ef88dad0ea6d7d6a4c50f2a31434d3e Mon Sep 17 00:00:00 2001 From: VladimirEliTokarev Date: Sun, 2 Oct 2016 21:03:42 +0300 Subject: [PATCH] Resolved the issue with the encoding --- .../java/meerkat/voting/gui/ChainBuilder.java | 2 +- .../BallotSummaryController.java | 8 +++---- .../SelectCandidateByPictureController.java | 21 ++++--------------- .../SelectCandidateNameController.java | 9 ++++---- .../SelectCandidateNameLoader.java | 2 +- .../view/select_candidate_by_picture.fxml | 6 +++--- 6 files changed, 17 insertions(+), 31 deletions(-) diff --git a/voting-booth-gui/src/main/java/meerkat/voting/gui/ChainBuilder.java b/voting-booth-gui/src/main/java/meerkat/voting/gui/ChainBuilder.java index 8cefdf6..dd3d572 100644 --- a/voting-booth-gui/src/main/java/meerkat/voting/gui/ChainBuilder.java +++ b/voting-booth-gui/src/main/java/meerkat/voting/gui/ChainBuilder.java @@ -78,7 +78,7 @@ class ChainBuilder { * all other two way nodes initialized */ - primaryStage.setScene(welcomeSplashController.GetNode()); + primaryStage.setScene(welcomeSplashController.GetCurrentScene()); Map nameToTwoWayNodeMap = new HashMap<>(); nameToTwoWayNodeMap.put("welcomeSplashController", welcomeSplashController); diff --git a/voting-booth-gui/src/main/java/meerkat/voting/gui/ballot_summary/BallotSummaryController.java b/voting-booth-gui/src/main/java/meerkat/voting/gui/ballot_summary/BallotSummaryController.java index dfe56c5..ff32a50 100644 --- a/voting-booth-gui/src/main/java/meerkat/voting/gui/ballot_summary/BallotSummaryController.java +++ b/voting-booth-gui/src/main/java/meerkat/voting/gui/ballot_summary/BallotSummaryController.java @@ -12,16 +12,16 @@ public class BallotSummaryController extends TwoWayNode { @FXML private void GetToSelectByPicture(MouseEvent mousePressed){ this.currentStage.close(); - this.next.UpdateNode(); - this.currentStage.setScene(this.next.GetCurrentScene()); + this.previous.UpdateNode(); + this.currentStage.setScene(this.previous.GetCurrentScene()); this.currentStage.show(); } @FXML private void GetToCastOrAudit(MouseEvent mousePressed){ this.currentStage.close(); - this.previous.UpdateNode(); - this.currentStage.setScene(this.previous.GetCurrentScene()); + this.next.UpdateNode(); + this.currentStage.setScene(this.next.GetCurrentScene()); this.currentStage.show(); } diff --git a/voting-booth-gui/src/main/java/meerkat/voting/gui/select_candidate_by_picture/SelectCandidateByPictureController.java b/voting-booth-gui/src/main/java/meerkat/voting/gui/select_candidate_by_picture/SelectCandidateByPictureController.java index 6cdd809..317278f 100644 --- a/voting-booth-gui/src/main/java/meerkat/voting/gui/select_candidate_by_picture/SelectCandidateByPictureController.java +++ b/voting-booth-gui/src/main/java/meerkat/voting/gui/select_candidate_by_picture/SelectCandidateByPictureController.java @@ -1,41 +1,28 @@ package meerkat.voting.gui.select_candidate_by_picture; import javafx.fxml.FXML; -import javafx.geometry.Insets; -import javafx.scene.control.Label; import javafx.scene.input.MouseEvent; -import javafx.scene.layout.Background; -import javafx.scene.layout.BackgroundFill; -import javafx.scene.layout.BorderPane; -import javafx.scene.layout.CornerRadii; -import javafx.scene.paint.Color; -import meerkat.protobuf.Voting; import meerkat.voting.gui.TwoWayNode; -import java.util.List; - /** * Created by Vladimir Eliezer Tokarev on 8/27/2016. * SelectCandidateNameController handle the behavior of select by picture screen */ public class SelectCandidateByPictureController extends TwoWayNode { - private List questions; - private List answers; - @FXML private void GetToSelectByName(MouseEvent mousePressed){ this.currentStage.close(); - this.next.UpdateNode(); - this.currentStage.setScene(this.next.GetCurrentScene()); + this.previous.UpdateNode(); + this.currentStage.setScene(this.previous.GetCurrentScene()); this.currentStage.show(); } @FXML private void GetToBallotSummary(MouseEvent mousePressed){ this.currentStage.close(); - this.previous.UpdateNode(); - this.currentStage.setScene(this.previous.GetCurrentScene()); + this.next.UpdateNode(); + this.currentStage.setScene(this.next.GetCurrentScene()); this.currentStage.show(); } diff --git a/voting-booth-gui/src/main/java/meerkat/voting/gui/select_candidate_name/SelectCandidateNameController.java b/voting-booth-gui/src/main/java/meerkat/voting/gui/select_candidate_name/SelectCandidateNameController.java index 5e3adbd..9062d30 100644 --- a/voting-booth-gui/src/main/java/meerkat/voting/gui/select_candidate_name/SelectCandidateNameController.java +++ b/voting-booth-gui/src/main/java/meerkat/voting/gui/select_candidate_name/SelectCandidateNameController.java @@ -1,7 +1,6 @@ package meerkat.voting.gui.select_candidate_name; import javafx.fxml.FXML; -import javafx.scene.Scene; import javafx.scene.input.MouseEvent; import meerkat.voting.gui.TwoWayNode; @@ -13,16 +12,16 @@ public class SelectCandidateNameController extends TwoWayNode { @FXML private void GetToSelectChannel(MouseEvent mousePressed){ this.currentStage.close(); - this.next.UpdateNode(); - this.currentStage.setScene(this.next.GetCurrentScene()); + this.previous.UpdateNode(); + this.currentStage.setScene(this.previous.GetCurrentScene()); this.currentStage.show(); } @FXML private void SelectCandidateByName(MouseEvent mousePressed) { this.currentStage.close(); - this.previous.UpdateNode(); - this.currentStage.setScene(this.previous.GetCurrentScene()); + this.next.UpdateNode(); + this.currentStage.setScene(this.next.GetCurrentScene()); this.currentStage.show(); } diff --git a/voting-booth-gui/src/main/java/meerkat/voting/gui/select_candidate_name/SelectCandidateNameLoader.java b/voting-booth-gui/src/main/java/meerkat/voting/gui/select_candidate_name/SelectCandidateNameLoader.java index 09ca249..0daa19c 100644 --- a/voting-booth-gui/src/main/java/meerkat/voting/gui/select_candidate_name/SelectCandidateNameLoader.java +++ b/voting-booth-gui/src/main/java/meerkat/voting/gui/select_candidate_name/SelectCandidateNameLoader.java @@ -36,7 +36,7 @@ public class SelectCandidateNameLoader { SelectCandidateNameController controller = fxmlLoader.getController(); // set the controller to be functional TwoWayNode - controller.SetParent(selectCandidateName); + controller.SetCurrentScene(selectCandidateName); controller.SetStage(currentStage); // set the controller to have the configuration file diff --git a/voting-booth-gui/src/main/resources/view/select_candidate_by_picture.fxml b/voting-booth-gui/src/main/resources/view/select_candidate_by_picture.fxml index c5e4b95..f7389c4 100644 --- a/voting-booth-gui/src/main/resources/view/select_candidate_by_picture.fxml +++ b/voting-booth-gui/src/main/resources/view/select_candidate_by_picture.fxml @@ -146,7 +146,7 @@ - +
@@ -155,7 +155,7 @@
- +
@@ -164,7 +164,7 @@
- +