Resolved the umextendablity of the summary ballot panel

android-scanner
VladimirEliTokarev 2016-11-12 17:49:48 +02:00
parent 08cc50c22a
commit 0509bf6dda
4 changed files with 28 additions and 20 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 953 B

After

Width:  |  Height:  |  Size: 950 B

View File

@ -22,6 +22,9 @@ public class VotersBallot {
* @return String
*/
public String GetCandidateName(){
if (this.VotersImageSelection == null || this.VotersImageSelection.getDescription() == null ){
return null;
}
String[] name = this.VotersImageSelection.getDescription().split(" ");
return name[0] + " " + name[1];
}

View File

@ -46,13 +46,18 @@ class VotersChoicesAdder {
*/
void ShowVotersChoices() throws IOException {
this.RemoveAllAnswers();
this.addAnswer(this.getChannelChoice(this.votersBallot.VoterChannel));
this.addAnswer(this.getNameChoice(this.votersBallot.GetCandidateName()));
this.addAnswer(this.getImageChoice(this.votersBallot.VotersImageSelection.getAnswer()));
this.addAnswer(this.getImageDescription(this.votersBallot.VotersImageSelection.getDescription()));
Label error = new Label();
error.setPrefSize(250,30);
this.addAnswer(error);
if (this.votersBallot != null) {
this.addAnswer(this.getChannelChoice(this.votersBallot.VoterChannel));
this.addAnswer(this.getNameChoice(this.votersBallot.GetCandidateName()));
if (this.votersBallot.VotersImageSelection != null) {
this.addAnswer(this.getImageChoice(this.votersBallot.VotersImageSelection.getAnswer()));
this.addAnswer(this.getImageDescription(this.votersBallot.VotersImageSelection.getDescription()));
}
Label error = new Label();
error.setPrefSize(250, 30);
this.addAnswer(error);
}
this.logger.debug("Add all the choises of the voter to the represent grid pane.");
}

View File

@ -78,11 +78,11 @@
</GridPane>
<GridPane GridPane.rowIndex="1">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="156.0" minHeight="10.0" prefHeight="51.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="285.0" minHeight="10.0" prefHeight="270.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<GridPane>
@ -116,17 +116,17 @@
</GridPane>
<GridPane prefHeight="241.0" prefWidth="600.0" GridPane.rowIndex="1">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="144.0" minWidth="10.0" prefWidth="37.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="529.0" minWidth="10.0" prefWidth="519.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="195.0" minWidth="0.0" prefWidth="37.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="85.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="0.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="66.0" minHeight="0.0" prefHeight="0.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="227.0" minHeight="10.0" prefHeight="227.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="43.0" minHeight="8.0" prefHeight="15.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="0.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="8.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="1">
<BorderPane GridPane.columnIndex="1" GridPane.rowIndex="1">
<center>
<GridPane BorderPane.alignment="CENTER">
<columnConstraints>
@ -137,11 +137,11 @@
<RowConstraints maxHeight="198.0" minHeight="10.0" prefHeight="198.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<ScrollPane prefHeight="444.0" prefWidth="521.0" GridPane.rowIndex="1">
<ScrollPane GridPane.rowIndex="1">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="372.0" prefWidth="500.0">
<AnchorPane>
<children>
<GridPane fx:id="VotersChoices" prefHeight="390.0" prefWidth="500.0">
<GridPane fx:id="VotersChoices">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>