Every pannel that choses somthing now saves it into VotersBallot`
parent
6655f2dc8e
commit
8e2fdb7828
|
@ -43,36 +43,45 @@ class ChainBuilder {
|
|||
* The Build method creates all the screens and connect between them
|
||||
*/
|
||||
static Map<String, TwoWayNode> Build(Stage primaryStage, VotingBoothConfiguration configuration) throws IOException {
|
||||
VotersBallot votersBallot = new VotersBallot();
|
||||
|
||||
WelcomeSplashLoader welcomeSplashLoader = new WelcomeSplashLoader(primaryStage, configuration);
|
||||
TwoWayNode welcomeSplashController = welcomeSplashLoader.GetWelcomeSplash();
|
||||
welcomeSplashController.SetVotersBallot(votersBallot);
|
||||
|
||||
StraightChannelSectionLoader straightChannelSectionLoader = new StraightChannelSectionLoader(primaryStage, configuration);
|
||||
TwoWayNode straightChannelSectionController = straightChannelSectionLoader.GetStraightChannelSection();
|
||||
straightChannelSectionController.SetVotersBallot(votersBallot);
|
||||
welcomeSplashController.SetNext(straightChannelSectionController);
|
||||
straightChannelSectionController.SetPrevious(welcomeSplashController);
|
||||
|
||||
SelectCandidateNameLoader selectCandidateNameLoader = new SelectCandidateNameLoader(primaryStage, configuration);
|
||||
TwoWayNode selectCandidateNameController = selectCandidateNameLoader.GetSelectCandidateName();
|
||||
selectCandidateNameController.SetVotersBallot(votersBallot);
|
||||
selectCandidateNameController.SetPrevious(straightChannelSectionController);
|
||||
straightChannelSectionController.SetNext(selectCandidateNameController);
|
||||
|
||||
SelectCandidateByPictureLoader selectCandidateByPictureLoader =
|
||||
new SelectCandidateByPictureLoader(primaryStage,configuration);
|
||||
TwoWayNode selectCandidateByPictureController = selectCandidateByPictureLoader.GetSelectCandidateByPicture();
|
||||
selectCandidateByPictureController.SetVotersBallot(votersBallot);
|
||||
selectCandidateByPictureController.SetPrevious(selectCandidateNameController);
|
||||
selectCandidateNameController.SetNext(selectCandidateByPictureController);
|
||||
|
||||
BallotSummaryLoader ballotSummaryLoader = new BallotSummaryLoader(primaryStage, configuration);
|
||||
TwoWayNode ballotSummaryController = ballotSummaryLoader.GetBallotSummary();
|
||||
ballotSummaryController.SetVotersBallot(votersBallot);
|
||||
ballotSummaryController.SetPrevious(selectCandidateByPictureController);
|
||||
selectCandidateByPictureController.SetNext(ballotSummaryController);
|
||||
|
||||
CastOrAuditLoader castOrAuditLoader = new CastOrAuditLoader(primaryStage, configuration);
|
||||
TwoWayNode castOrAuditController = castOrAuditLoader.GetCastOrAudit();
|
||||
castOrAuditController.SetVotersBallot(votersBallot);
|
||||
ballotSummaryController.SetNext(castOrAuditController);
|
||||
|
||||
VoteHaveBeenCastLoader voteHaveBeenCastLoader = new VoteHaveBeenCastLoader(primaryStage, configuration);
|
||||
TwoWayNode voteHaveBeenCastController = voteHaveBeenCastLoader.GetVoteHaveBeenCast();
|
||||
voteHaveBeenCastController.SetVotersBallot(votersBallot);
|
||||
castOrAuditController.SetNext(voteHaveBeenCastController);
|
||||
|
||||
/**
|
||||
|
|
|
@ -20,7 +20,11 @@ public abstract class TwoWayNode {
|
|||
/**
|
||||
* Object which contains the voters selections in different panels
|
||||
*/
|
||||
protected VotersBallot votersChoise;
|
||||
protected VotersBallot votersBallot;
|
||||
|
||||
public void SetVotersBallot(VotersBallot votersBallot){
|
||||
this.votersBallot = votersBallot;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets which next TwoWayNode
|
||||
|
|
|
@ -33,6 +33,7 @@ public class SelectCandidateByPictureController extends TwoWayNode implements Fu
|
|||
*/
|
||||
private void UpdateVoterOptions(){
|
||||
PicturesAnswersUpdater updater = new PicturesAnswersUpdater(this.currentStage);
|
||||
updater.SetImageUpdate(this);
|
||||
updater.UpdateAnswers(this.config.NameSelectionByPictureQuestion);
|
||||
}
|
||||
|
||||
|
@ -43,7 +44,8 @@ public class SelectCandidateByPictureController extends TwoWayNode implements Fu
|
|||
|
||||
@Override
|
||||
public void onSuccess(ByteString result) {
|
||||
this.votersChoise.VotersImageSelection = result;
|
||||
this.votersBallot.VotersImageSelection = result;
|
||||
System.out.println(this.votersBallot.Votershannel +" "+this.votersBallot.VotersNameSelection +" "+ this.votersBallot.VotersImageSelection);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -42,7 +42,8 @@ public class SelectCandidateNameController extends TwoWayNode implements FutureC
|
|||
|
||||
@Override
|
||||
public void onSuccess(String result) {
|
||||
this.votersChoise.VotersNameSelection = result;
|
||||
this.votersBallot.VotersNameSelection = result;
|
||||
System.out.println(this.votersBallot.Votershannel +" "+this.votersBallot.VotersNameSelection +" "+ this.votersBallot.VotersImageSelection);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -45,7 +45,8 @@ public class StraightChannelSectionController extends TwoWayNode {
|
|||
* Updates the channel in the voters choise
|
||||
*/
|
||||
private void UpdateVotersChoise(){
|
||||
this.votersChoise.Votershannel = this.chanelValue;
|
||||
this.votersBallot.Votershannel = this.chanelValue;
|
||||
System.out.println(this.votersBallot.Votershannel +" "+this.votersBallot.VotersNameSelection +" "+ this.votersBallot.VotersImageSelection);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue