From 19a7d5731c9abadc9cb369bca8a79217e7a22f0f Mon Sep 17 00:00:00 2001 From: Laura Radaelli Date: Mon, 26 Jun 2017 13:25:07 +0300 Subject: [PATCH] added page number to question screen --- .../voting/gui/controllersFX/VotingController.java | 6 +++++- voting-booth-gui/src/main/resources/views/voting.fxml | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/voting-booth-gui/src/main/java/meerkat/voting/gui/controllersFX/VotingController.java b/voting-booth-gui/src/main/java/meerkat/voting/gui/controllersFX/VotingController.java index edd431f..917f670 100644 --- a/voting-booth-gui/src/main/java/meerkat/voting/gui/controllersFX/VotingController.java +++ b/voting-booth-gui/src/main/java/meerkat/voting/gui/controllersFX/VotingController.java @@ -32,12 +32,15 @@ public class VotingController { @FXML ToggleGroup answerGroup; @FXML private Text question; + @FXML private Text currentPage; + @FXML private Text totalPage; @FXML private Pane questionPane; @FXML public void initialize() { questions = command.getQuestions(); answerGroup = new ToggleGroup(); + totalPage.setText(""+(questions.size()+1)); showQuestion(); } @@ -63,7 +66,8 @@ public class VotingController { private void showQuestion() { Voting.BallotQuestion ballotQuestion = questions.get(index); - question.setText("This is question n. "+index); + //question.setText("This is question n. "+index); + currentPage.setText("Page "+(index+1)); answerGroup.getToggles().clear(); VBox vbox = VistaNavigator.uiThread.showQuestionInFX(ballotQuestion, answerGroup); questionPane.getChildren().clear(); diff --git a/voting-booth-gui/src/main/resources/views/voting.fxml b/voting-booth-gui/src/main/resources/views/voting.fxml index bc11ae0..637faa9 100644 --- a/voting-booth-gui/src/main/resources/views/voting.fxml +++ b/voting-booth-gui/src/main/resources/views/voting.fxml @@ -1,5 +1,6 @@ + @@ -10,5 +11,12 @@