Added Select candidate by picture to the flow

android-scanner
Vladimir Eliezer Tokarev 2016-08-27 16:24:25 +03:00
parent 36d9276ad8
commit 4591c4e2e8
34 changed files with 90 additions and 13 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 996 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 B

View File

@ -7,7 +7,7 @@
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="main.select_candidate_by_picture.SelectCandidateByPictureController">
<children>
<GridPane>
<children>
@ -50,7 +50,7 @@
</BorderPane>
<BorderPane prefHeight="200.0" prefWidth="200.0">
<left>
<Button mnemonicParsing="false" text="Back" BorderPane.alignment="CENTER">
<Button mnemonicParsing="false" onMousePressed="#GetToSelectByName" text="Back" BorderPane.alignment="CENTER">
<font>
<Font size="18.0" />
</font>
@ -150,7 +150,7 @@
<center>
<ImageView BorderPane.alignment="CENTER">
<image>
<Image url="@../../../../voting-station-gui/out/production/voting-station-gui/pictures/profile.png" />
<Image url="@../pics/profile.png" />
</image>
</ImageView>
</center>
@ -159,7 +159,7 @@
<center>
<ImageView BorderPane.alignment="CENTER">
<image>
<Image url="@../../../../voting-station-gui/out/production/voting-station-gui/pictures/profile.png" />
<Image url="@../pics/profile.png" />
</image>
</ImageView>
</center>
@ -168,7 +168,7 @@
<center>
<ImageView BorderPane.alignment="CENTER">
<image>
<Image url="@../../../../voting-station-gui/out/production/voting-station-gui/pictures/profile.png" />
<Image url="@../pics/profile.png" />
</image>
</ImageView>
</center>

View File

@ -195,7 +195,7 @@
<children>
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="2">
<right>
<Button mnemonicParsing="false" prefHeight="39.0" prefWidth="128.0" text="Next" BorderPane.alignment="CENTER">
<Button mnemonicParsing="false" onMousePressed="#SelectCandidateByName" prefHeight="39.0" prefWidth="128.0" text="Next" BorderPane.alignment="CENTER">
<font>
<Font size="18.0" />
</font>

View File

@ -2,6 +2,7 @@ package main;
import javafx.scene.Scene;
import javafx.stage.Stage;
import main.select_candidate_by_picture.SelectCandidateByPictureLoader;
import main.select_candidate_name.SelectCandidateNameLoader;
import main.straight_channel_section.StraightChannelSectionLoader;
import main.welcome_splash.WelcomeSplashLoader;
@ -50,7 +51,11 @@ public class ChainBuilder {
selectCandidateNameController.SetPrevious(straightChannelSectionController);
straightChannelSectionController.SetNext(selectCandidateNameController);
SelectCandidateByPictureLoader selectCandidateByPictureLoader =
new SelectCandidateByPictureLoader(primaryStage);
TwoWayNode selectCandidateByPictureController = selectCandidateByPictureLoader.GetSelectCandidateByPicture();
selectCandidateByPictureController.SetPrevious(selectCandidateNameController);
selectCandidateNameController.SetNext(selectCandidateByPictureController);
/**
* all other two way nodes initialized

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 996 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 B

View File

@ -0,0 +1,19 @@
package main.select_candidate_by_picture;
import javafx.fxml.FXML;
import javafx.scene.input.MouseEvent;
import main.TwoWayNode;
/**
* Created by Vladimir Eliezer Tokarev on 8/27/2016.
* SelectCandidateNameController handle the behavior of welcome splash class
*/
public class SelectCandidateByPictureController extends TwoWayNode {
@FXML
private void GetToSelectByName(MouseEvent mousePressed){
this.currentStage.close();
this.currentStage.setScene(this.previous);
this.currentStage.show();
}
}

View File

@ -0,0 +1,45 @@
package main.select_candidate_by_picture;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.stage.Stage;
import main.TwoWayNode;
import main.select_candidate_name.SelectCandidateNameController;
import java.io.IOException;
/**
* Created by Vladimir Eliezer Tokarev on 8/27/2016.
* SelectCandidateByPictureLoader creates starlight channel section object and sets its controller
*/
public class SelectCandidateByPictureLoader {
private static final String SELECT_CANDIDATE_BY_PICTURE_FXML_PATH = "select_candidate_by_picture.fxml";
private Stage currentStage;
private FXMLLoader fxmlLoader;
public SelectCandidateByPictureLoader(Stage primaryStage) throws IOException
{
fxmlLoader = new FXMLLoader(getClass().getResource(SELECT_CANDIDATE_BY_PICTURE_FXML_PATH));
System.out.println(fxmlLoader);
currentStage = primaryStage;
}
/**
* Creates welcome splash parent node and sets it to the controller
* @return TwoWayNode
* @throws IOException
*/
public TwoWayNode GetSelectCandidateByPicture() throws IOException {
Parent selectCandidateName = fxmlLoader.load();
SelectCandidateByPictureController controller = fxmlLoader.getController();
// set the controller to be functional TwoWayNode
controller.SetParent(selectCandidateName);
controller.SetStage(currentStage);
return controller;
}
}

View File

@ -7,7 +7,7 @@
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="main.select_candidate_by_picture.SelectCandidateByPictureController">
<children>
<GridPane>
<children>
@ -50,7 +50,7 @@
</BorderPane>
<BorderPane prefHeight="200.0" prefWidth="200.0">
<left>
<Button mnemonicParsing="false" text="Back" BorderPane.alignment="CENTER">
<Button mnemonicParsing="false" onMousePressed="#GetToSelectByName" text="Back" BorderPane.alignment="CENTER">
<font>
<Font size="18.0" />
</font>
@ -150,7 +150,7 @@
<center>
<ImageView BorderPane.alignment="CENTER">
<image>
<Image url="@../../../../voting-station-gui/out/production/voting-station-gui/pictures/profile.png" />
<Image url="@../pics/profile.png" />
</image>
</ImageView>
</center>
@ -159,7 +159,7 @@
<center>
<ImageView BorderPane.alignment="CENTER">
<image>
<Image url="@../../../../voting-station-gui/out/production/voting-station-gui/pictures/profile.png" />
<Image url="@../pics/profile.png" />
</image>
</ImageView>
</center>
@ -168,7 +168,7 @@
<center>
<ImageView BorderPane.alignment="CENTER">
<image>
<Image url="@../../../../voting-station-gui/out/production/voting-station-gui/pictures/profile.png" />
<Image url="@../pics/profile.png" />
</image>
</ImageView>
</center>

View File

@ -17,4 +17,12 @@ public class SelectCandidateNameController extends TwoWayNode {
this.currentStage.show();
}
@FXML
private void SelectCandidateByName(MouseEvent mousePressed) {
this.currentStage.close();
this.currentStage.setScene(this.next);
this.currentStage.show();
}
}

View File

@ -195,7 +195,7 @@
<children>
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="2">
<right>
<Button mnemonicParsing="false" prefHeight="39.0" prefWidth="128.0" text="Next" BorderPane.alignment="CENTER">
<Button mnemonicParsing="false" onMousePressed="#SelectCandidateByName" prefHeight="39.0" prefWidth="128.0" text="Next" BorderPane.alignment="CENTER">
<font>
<Font size="18.0" />
</font>