From c0ed5ea3fc72ee3201f7a61223c705b610c634fe Mon Sep 17 00:00:00 2001 From: Vladimir Eliezer Tokarev Date: Sat, 1 Oct 2016 15:41:13 +0300 Subject: [PATCH] Added the configuration object that will contains all needed data for voting booth initilization --- .../meerkat/BallotQuestionUIElement.proto | 50 +++++++++++++++++++ .../main/java/meerkat/voting/gui/Main.java | 1 + .../voting/gui/VotingBoothConfiguration.java | 9 ++++ 3 files changed, 60 insertions(+) create mode 100644 meerkat-common/src/main/proto/meerkat/BallotQuestionUIElement.proto create mode 100644 voting-booth-gui/src/main/java/meerkat/voting/gui/VotingBoothConfiguration.java diff --git a/meerkat-common/src/main/proto/meerkat/BallotQuestionUIElement.proto b/meerkat-common/src/main/proto/meerkat/BallotQuestionUIElement.proto new file mode 100644 index 0000000..9c8c704 --- /dev/null +++ b/meerkat-common/src/main/proto/meerkat/BallotQuestionUIElement.proto @@ -0,0 +1,50 @@ +syntax = "proto3"; + +package meerkat; + +option java_package = "meerkat.protobuf"; + +// Message object which is number of bytes +message ListOfAnswers{ + repeated bytes answers = 1; +} + +// Message object which contains the type of the answers and their data in bytes +message UIAnswers { + int32 AnswersType = 1; + + ListOfAnswers answers = 2; +} + +// Message Question are bytes +message Question { + bytes question = 1; +} + +// Message object which contains the question and its type +message UIQuestion{ + int32 type = 1; + + Question question = 2; +} + +message BallotQuestionUIElement { + // Message object which contains all the potential answers for given question + UIAnswers answers = 1; + + // Should those answers locations should be randomized before shown to the voter ? + bool RandomizeListOrder = 2; + + // Message object which contains the question itself + UIQuestion question = 3; +} + +// Enumeration that represents the available types of questions/answers that can be +enum ValueType { + TEXT_TYPE = 0; + AUDIO_TYPE = 1; + IMAGE_TYPE = 2; +} + + +// NOTE: the idea is next when UIQuestion/Answer is received i first check out its type then i convert it to given type. \ No newline at end of file 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 58d9a9d..7aa7551 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 @@ -6,6 +6,7 @@ import javafx.stage.Stage; /** * Created by Vladimir Eliezer Tokarev on 8/27/2016. + * The current voting-booth intialization process is next: * Main calls to ChainBuilder which initilizes all the TwoWayNode's */ public class Main extends Application { 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 new file mode 100644 index 0000000..f303307 --- /dev/null +++ b/voting-booth-gui/src/main/java/meerkat/voting/gui/VotingBoothConfiguration.java @@ -0,0 +1,9 @@ +package meerkat.voting.gui; + +/** + * Created by Vladimir Eliezer Tokarev on 10/1/2016. + * This object contains all the questions and configurations needed for the voting-booth-gui work + */ +public class VotingBoothConfiguration { + +}