added page number to question screen
parent
68e1737f22
commit
19a7d5731c
|
@ -32,12 +32,15 @@ public class VotingController {
|
||||||
|
|
||||||
@FXML ToggleGroup answerGroup;
|
@FXML ToggleGroup answerGroup;
|
||||||
@FXML private Text question;
|
@FXML private Text question;
|
||||||
|
@FXML private Text currentPage;
|
||||||
|
@FXML private Text totalPage;
|
||||||
@FXML private Pane questionPane;
|
@FXML private Pane questionPane;
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
questions = command.getQuestions();
|
questions = command.getQuestions();
|
||||||
answerGroup = new ToggleGroup();
|
answerGroup = new ToggleGroup();
|
||||||
|
totalPage.setText(""+(questions.size()+1));
|
||||||
showQuestion();
|
showQuestion();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +66,8 @@ public class VotingController {
|
||||||
|
|
||||||
private void showQuestion() {
|
private void showQuestion() {
|
||||||
Voting.BallotQuestion ballotQuestion = questions.get(index);
|
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();
|
answerGroup.getToggles().clear();
|
||||||
VBox vbox = VistaNavigator.uiThread.showQuestionInFX(ballotQuestion, answerGroup);
|
VBox vbox = VistaNavigator.uiThread.showQuestionInFX(ballotQuestion, answerGroup);
|
||||||
questionPane.getChildren().clear();
|
questionPane.getChildren().clear();
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.scene.Group?>
|
||||||
<?import javafx.scene.control.Button?>
|
<?import javafx.scene.control.Button?>
|
||||||
<?import javafx.scene.layout.Pane?>
|
<?import javafx.scene.layout.Pane?>
|
||||||
<?import javafx.scene.text.Text?>
|
<?import javafx.scene.text.Text?>
|
||||||
|
@ -10,5 +11,12 @@
|
||||||
<Text fx:id="question" layoutX="84.0" layoutY="89.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Click 'Next' to see the first question." wrappingWidth="431.3046875" />
|
<Text fx:id="question" layoutX="84.0" layoutY="89.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Click 'Next' to see the first question." wrappingWidth="431.3046875" />
|
||||||
<Pane fx:id="questionPane" layoutX="84.0" layoutY="97.0" prefHeight="234.0" prefWidth="422.0" />
|
<Pane fx:id="questionPane" layoutX="84.0" layoutY="97.0" prefHeight="234.0" prefWidth="422.0" />
|
||||||
<Button layoutX="84.0" layoutY="343.0" mnemonicParsing="false" onMousePressed="#goBack" text="Back" />
|
<Button layoutX="84.0" layoutY="343.0" mnemonicParsing="false" onMousePressed="#goBack" text="Back" />
|
||||||
|
<Group layoutX="220.0" layoutY="369.0">
|
||||||
|
<children>
|
||||||
|
<Text fx:id="currentPage" layoutX="-16.0" strokeType="OUTSIDE" strokeWidth="0.0" text="XXX" textAlignment="RIGHT" wrappingWidth="112.30468860268593" />
|
||||||
|
<Text fx:id="question111" layoutX="99.0" strokeType="OUTSIDE" strokeWidth="0.0" text="/" wrappingWidth="12.304688602685928" />
|
||||||
|
<Text fx:id="totalPage" layoutX="109.0" strokeType="OUTSIDE" strokeWidth="0.0" text="YYY" wrappingWidth="46.30468860268593" />
|
||||||
|
</children>
|
||||||
|
</Group>
|
||||||
</children>
|
</children>
|
||||||
</Pane>
|
</Pane>
|
||||||
|
|
Loading…
Reference in New Issue