diff --git a/meerkat-common/src/main/proto/meerkat/BallotQuestionUIElement.proto b/meerkat-common/src/main/proto/meerkat/BallotQuestionUIElement.proto index 9c8c704..a8ec3ae 100644 --- a/meerkat-common/src/main/proto/meerkat/BallotQuestionUIElement.proto +++ b/meerkat-common/src/main/proto/meerkat/BallotQuestionUIElement.proto @@ -23,7 +23,7 @@ message Question { // Message object which contains the question and its type message UIQuestion{ - int32 type = 1; + int32 Type = 1; Question question = 2; } diff --git a/voting-booth-gui/src/main/java/meerkat/voting/gui/Main.java b/voting-booth-gui/src/main/java/meerkat/voting/gui/Main.java index 2c874e0..50be19d 100644 --- a/voting-booth-gui/src/main/java/meerkat/voting/gui/Main.java +++ b/voting-booth-gui/src/main/java/meerkat/voting/gui/Main.java @@ -10,11 +10,45 @@ import javafx.stage.Stage; * Main calls to ChainBuilder which initilizes all the TwoWayNode's */ public class Main extends Application { + public VotingBoothConfiguration GetConfig(){ + /** VotingBoothConfiguration config = new VotingBoothConfiguration(); + + config.NameSelectionQuestion = BallotQuestionUIElementOuterClass.BallotQuestionUIElement.newBuilder() + .setQuestion(BallotQuestionUIElementOuterClass.UIQuestion.newBuilder() + .setType(0) + .setQuestion(BallotQuestionUIElementOuterClass.Question.newBuilder() + .setQuestion(ByteString.copyFromUtf8("Who you vote for?")) + .setType(0)) + .setAnswers(BallotQuestionUIElementOuterClass.UIAnswers.newBuilder() + .setAnswersType(0) + .setAnswers(BallotQuestionUIElementOuterClass.ListOfAnswers.newBuilder() + .setAnswers(0, ByteString.copyFromUtf8("George Boosh")) + .setAnswers(1, ByteString.copyFromUtf8("Antonio Banderas")) + .setAnswers(2, ByteString.copyFromUtf8("Michal Jakson")))) + .setRandomizeListOrder(true).build(); + + config.NameSelectionByPictureQuestion = BallotQuestionUIElementOuterClass.BallotQuestionUIElement.newBuilder() + .setQuestion(BallotQuestionUIElementOuterClass.UIQuestion.newBuilder() + .setType(2) + .setQuestion(BallotQuestionUIElementOuterClass.Question.newBuilder() + .mergeFrom() + .setAnswers(BallotQuestionUIElementOuterClass.UIAnswers.newBuilder() + .setAnswersType(0) + .setAnswers(BallotQuestionUIElementOuterClass.ListOfAnswers.newBuilder() + .setAnswers(0, ByteString.copyFromUtf8("George Boosh")) + .setAnswers(1, ByteString.copyFromUtf8("Antonio Banderas")) + .setAnswers(2, ByteString.copyFromUtf8("Michal Jakson")))) + .setRandomizeListOrder(true).build(); + . + +**/ + return null; + } @Override public void start(Stage primaryStage) throws Exception { - VotingBoothConfiguration config = new VotingBoothConfiguration(); + VotingBoothConfiguration config = GetConfig(); ChainBuilder.Build(primaryStage, config); primaryStage.setTitle("Meerkat Polling Station"); primaryStage.show(); diff --git a/voting-booth-gui/src/main/java/meerkat/voting/gui/VotingBoothConfiguration.java b/voting-booth-gui/src/main/java/meerkat/voting/gui/VotingBoothConfiguration.java index fa755b4..f87507e 100644 --- a/voting-booth-gui/src/main/java/meerkat/voting/gui/VotingBoothConfiguration.java +++ b/voting-booth-gui/src/main/java/meerkat/voting/gui/VotingBoothConfiguration.java @@ -6,7 +6,7 @@ import meerkat.protobuf.BallotQuestionUIElementOuterClass; * This object contains all the questions and configurations needed for the voting-booth-gui work */ public class VotingBoothConfiguration { - private BallotQuestionUIElementOuterClass.BallotQuestionUIElement NameSelectionQuestion; - private BallotQuestionUIElementOuterClass.BallotQuestionUIElement NameSelectionByPictureQuestion; + public BallotQuestionUIElementOuterClass.BallotQuestionUIElement NameSelectionQuestion; + public BallotQuestionUIElementOuterClass.BallotQuestionUIElement NameSelectionByPictureQuestion; } diff --git a/voting-booth-gui/src/main/resources/images/AntonioBanderass.jpg b/voting-booth-gui/src/main/resources/images/AntonioBanderass.jpg new file mode 100644 index 0000000..2a240ee Binary files /dev/null and b/voting-booth-gui/src/main/resources/images/AntonioBanderass.jpg differ diff --git a/voting-booth-gui/src/main/resources/images/GeorgeBush.png b/voting-booth-gui/src/main/resources/images/GeorgeBush.png new file mode 100644 index 0000000..7209709 Binary files /dev/null and b/voting-booth-gui/src/main/resources/images/GeorgeBush.png differ diff --git a/voting-booth-gui/src/main/resources/images/MichaelJackson.png b/voting-booth-gui/src/main/resources/images/MichaelJackson.png new file mode 100644 index 0000000..b652075 Binary files /dev/null and b/voting-booth-gui/src/main/resources/images/MichaelJackson.png differ