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 * @return String
*/ */
public String GetCandidateName(){ public String GetCandidateName(){
if (this.VotersImageSelection == null || this.VotersImageSelection.getDescription() == null ){
return null;
}
String[] name = this.VotersImageSelection.getDescription().split(" "); String[] name = this.VotersImageSelection.getDescription().split(" ");
return name[0] + " " + name[1]; return name[0] + " " + name[1];
} }

View File

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

View File

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