diff --git a/classes/production/voting-booth-gui/main/VotingBoothGUIManager.class b/classes/production/voting-booth-gui/main/VotingBoothGUIManager.class index fc91a8f..31289d1 100644 Binary files a/classes/production/voting-booth-gui/main/VotingBoothGUIManager.class and b/classes/production/voting-booth-gui/main/VotingBoothGUIManager.class differ diff --git a/voting-booth-gui/src/main/VotingBoothGUIManager.java b/voting-booth-gui/src/main/VotingBoothGUIManager.java index 0f69099..a815387 100644 --- a/voting-booth-gui/src/main/VotingBoothGUIManager.java +++ b/voting-booth-gui/src/main/VotingBoothGUIManager.java @@ -7,6 +7,7 @@ import meerkat.protobuf.Voting; import meerkat.voting.ui.VotingBoothUI; import org.slf4j.LoggerFactory; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -17,10 +18,23 @@ import java.util.Map; public class VotingBoothGUIManager extends Application implements VotingBoothUI { private static final org.slf4j.Logger logger = LoggerFactory.getLogger(VotingBoothGUIManager.class); private Map visualPanelsMap; + private Stage currentStage; @Override public void start(Stage primaryStage) throws Exception { - visualPanelsMap = ChainBuilder.Build(primaryStage); + doStartNewSession(primaryStage); + } + + /** + * Created new UI panels and sets their primary stage and shows the panels + * @param primaryStage stage object which contains all the panels + * @throws IOException + */ + private void doStartNewSession(Stage primaryStage) throws IOException { + this.visualPanelsMap = ChainBuilder.Build(primaryStage); + this.currentStage = primaryStage; + this.currentStage.setTitle("Voting Booth"); + this.currentStage.show(); } /** @@ -104,6 +118,11 @@ public class VotingBoothGUIManager extends Application implements VotingBoothUI @Override public void startNewVoterSession(FutureCallback callback) { logger.debug("Graphical user interface call to startNewVoterSession"); + try { + this.doStartNewSession(this.currentStage); + } catch (IOException e) { + logger.error(String.format("Couldn't start new session of the voting process :", e)); + } } }