From d1bc0d7c844d1facfbea85d2df48fef3e5cf42a2 Mon Sep 17 00:00:00 2001 From: Hai Brenner Date: Fri, 18 Mar 2016 10:22:05 +0200 Subject: [PATCH] Some small changes according to code review --- .../main/java/meerkat/voting/VotingBooth.java | 18 +++++++----------- .../java/meerkat/voting/VotingBoothUI.java | 10 +++++----- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/voting-booth/src/main/java/meerkat/voting/VotingBooth.java b/voting-booth/src/main/java/meerkat/voting/VotingBooth.java index a2b211b..9ef863c 100644 --- a/voting-booth/src/main/java/meerkat/voting/VotingBooth.java +++ b/voting-booth/src/main/java/meerkat/voting/VotingBooth.java @@ -8,22 +8,18 @@ import meerkat.protobuf.Voting.*; public interface VotingBooth { /** - * setting all the different components of the Voting Booth to be recognized by this controller + * initialize using the BoothParams protobuf and sett all the different components of the Voting Booth to be recognized by this controller + * @param boothParams * @param outputDevice the ballot output device. Naturally a printer and/or ethernet connection * @param vbEncryptor the encryption module * @param vbUI User interface in which the voter chooses his answers * @param vbStorageManager storage component for handling files and USB sticks */ - public void setComponenets (BallotOutputDevice outputDevice, - VotingBoothEncryptor vbEncryptor, - VotingBoothUI vbUI, - StorageManager vbStorageManager); - - /** - * initialize using the BoothParams protobuf - * @param boothParams - */ - public void initBoothParams (BoothParams boothParams); + public void init (BoothParams boothParams, + BallotOutputDevice outputDevice, + VotingBoothEncryptor vbEncryptor, + VotingBoothUI vbUI, + StorageManager vbStorageManager); /** * set the voting questions diff --git a/voting-booth/src/main/java/meerkat/voting/VotingBoothUI.java b/voting-booth/src/main/java/meerkat/voting/VotingBoothUI.java index 78ccfef..c2ccfea 100644 --- a/voting-booth/src/main/java/meerkat/voting/VotingBoothUI.java +++ b/voting-booth/src/main/java/meerkat/voting/VotingBoothUI.java @@ -8,7 +8,7 @@ import meerkat.protobuf.Voting.*; */ public interface VotingBoothUI { - enum FinalizeBallotChoice { + public static enum FinalizeBallotChoice { CAST, AUDIT } @@ -24,7 +24,7 @@ public interface VotingBoothUI { * @param question a question to determine the right voting channel for this voter * @param callback that's where we store the channel for the current voter */ - public void chooseChannel (BallotQuestion question, FutureCallback callback); + public void chooseChannel (BallotQuestion question, FutureCallback callback); /** * Presents the set of questions to the voter. Collect all his responses. @@ -50,14 +50,14 @@ public interface VotingBoothUI { * @param message a message to show the user on the UI device while waiting * @param callback a success return value of the wait (cancelling returns false) */ - public void askVoterToWaitForFinish (String message, FutureCallback callback); + public void notifyVoterToWaitForFinish (UIElement message, FutureCallback callback); /** * show a fatal error message in the UI. Halts system. Waits for administrator interrupt or reset * @param errorMessage message to show in UI device * @param callback returns interrupt */ - public void showErrorMessageAndHalt (String errorMessage, FutureCallback callback); + public void showErrorMessageAndHalt (UIElement errorMessage, FutureCallback callback); /** * show an error message and let user press his chosen button for continuation @@ -65,7 +65,7 @@ public interface VotingBoothUI { * @param buttonLabels labels for buttons to present to voter * @param callback the number of the selected button */ - public void showErrorMessageWithButtons (String errorMessage, String[] buttonLabels, + public void showErrorMessageWithButtons (UIElement errorMessage, UIElement[] buttonLabels, FutureCallback callback); }