Some small changes according to code review

vbdev2
Hai Brenner 2016-03-18 10:22:05 +02:00
parent 0fa5d4094a
commit d1bc0d7c84
2 changed files with 12 additions and 16 deletions

View File

@ -8,22 +8,18 @@ import meerkat.protobuf.Voting.*;
public interface VotingBooth { 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 outputDevice the ballot output device. Naturally a printer and/or ethernet connection
* @param vbEncryptor the encryption module * @param vbEncryptor the encryption module
* @param vbUI User interface in which the voter chooses his answers * @param vbUI User interface in which the voter chooses his answers
* @param vbStorageManager storage component for handling files and USB sticks * @param vbStorageManager storage component for handling files and USB sticks
*/ */
public void setComponenets (BallotOutputDevice outputDevice, public void init (BoothParams boothParams,
VotingBoothEncryptor vbEncryptor, BallotOutputDevice outputDevice,
VotingBoothUI vbUI, VotingBoothEncryptor vbEncryptor,
StorageManager vbStorageManager); VotingBoothUI vbUI,
StorageManager vbStorageManager);
/**
* initialize using the BoothParams protobuf
* @param boothParams
*/
public void initBoothParams (BoothParams boothParams);
/** /**
* set the voting questions * set the voting questions

View File

@ -8,7 +8,7 @@ import meerkat.protobuf.Voting.*;
*/ */
public interface VotingBoothUI { public interface VotingBoothUI {
enum FinalizeBallotChoice { public static enum FinalizeBallotChoice {
CAST, CAST,
AUDIT AUDIT
} }
@ -24,7 +24,7 @@ public interface VotingBoothUI {
* @param question a question to determine the right voting channel for this voter * @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 * @param callback that's where we store the channel for the current voter
*/ */
public void chooseChannel (BallotQuestion question, FutureCallback<Integer> callback); public void chooseChannel (BallotQuestion question, FutureCallback<BallotAnswer> callback);
/** /**
* Presents the set of questions to the voter. Collect all his responses. * 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 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) * @param callback a success return value of the wait (cancelling returns false)
*/ */
public void askVoterToWaitForFinish (String message, FutureCallback<Boolean> callback); public void notifyVoterToWaitForFinish (UIElement message, FutureCallback<Boolean> callback);
/** /**
* show a fatal error message in the UI. Halts system. Waits for administrator interrupt or reset * 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 errorMessage message to show in UI device
* @param callback returns interrupt * @param callback returns interrupt
*/ */
public void showErrorMessageAndHalt (String errorMessage, FutureCallback<Boolean> callback); public void showErrorMessageAndHalt (UIElement errorMessage, FutureCallback<Boolean> callback);
/** /**
* show an error message and let user press his chosen button for continuation * 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 buttonLabels labels for buttons to present to voter
* @param callback the number of the selected button * @param callback the number of the selected button
*/ */
public void showErrorMessageWithButtons (String errorMessage, String[] buttonLabels, public void showErrorMessageWithButtons (UIElement errorMessage, UIElement[] buttonLabels,
FutureCallback<Integer> callback); FutureCallback<Integer> callback);
} }