Createsd the settings panel
the settings panel displays ndifferent options that can happen when on polliing station dashboard panel.voting-station-gui
After Width: | Height: | Size: 805 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 407 B |
After Width: | Height: | Size: 384 B |
After Width: | Height: | Size: 996 B |
After Width: | Height: | Size: 930 B |
|
@ -12,7 +12,7 @@ import java.io.IOException;
|
||||||
*/
|
*/
|
||||||
public class StatusLogLoader {
|
public class StatusLogLoader {
|
||||||
|
|
||||||
private static final String POLLING_STATION_DASHBOARD_FXML_PATH = "../fxml/status_log.fxml";
|
private static final String POLLING_STATION_DASHBOARD_FXML_PATH = "../fxml/settings.fxml";
|
||||||
|
|
||||||
private Stage currentStage;
|
private Stage currentStage;
|
||||||
private FXMLLoader fxmlLoader;
|
private FXMLLoader fxmlLoader;
|
||||||
|
|
|
@ -6,12 +6,13 @@ import javafx.scene.layout.GridPane;
|
||||||
import javafx.scene.layout.Pane;
|
import javafx.scene.layout.Pane;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
import polling_station_dashboard.StatusLog.java.StatusLogUpdate;
|
import polling_station_dashboard.StatusLog.java.StatusLogUpdate;
|
||||||
|
import polling_station_dashboard.settings.java.SettingsUpdate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Vladimir Eliezer Tokarev on 28/05/2016.
|
* Created by Vladimir Eliezer Tokarev on 28/05/2016.
|
||||||
* PollingStationDashboardController controls the behavior of the polling station dashboard
|
* PollingStationDashboardController controls the behavior of the polling station dashboard
|
||||||
*/
|
*/
|
||||||
public class PollingStationDashboardController implements StatusLogUpdate {
|
public class PollingStationDashboardController implements StatusLogUpdate, SettingsUpdate {
|
||||||
|
|
||||||
private Stage currentStage;
|
private Stage currentStage;
|
||||||
private GridPane statusLog;
|
private GridPane statusLog;
|
||||||
|
@ -40,6 +41,12 @@ public class PollingStationDashboardController implements StatusLogUpdate {
|
||||||
statusLogOpened = !statusLogOpened;
|
statusLogOpened = !statusLogOpened;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void UpdateSettings() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void showStatusLogButton(boolean showOrNot){
|
private void showStatusLogButton(boolean showOrNot){
|
||||||
Button statusLogButton = (Button) currentStage.getScene().lookup("#StatusLogButton");
|
Button statusLogButton = (Button) currentStage.getScene().lookup("#StatusLogButton");
|
||||||
statusLogButton.setVisible(showOrNot);
|
statusLogButton.setVisible(showOrNot);
|
||||||
|
@ -61,7 +68,6 @@ public class PollingStationDashboardController implements StatusLogUpdate {
|
||||||
statusLogPane.setPrefWidth(expansionWidth);
|
statusLogPane.setPrefWidth(expansionWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private void OnStatusLogPressed() {
|
private void OnStatusLogPressed() {
|
||||||
UpdateStatusLog();
|
UpdateStatusLog();
|
||||||
|
|
|
@ -0,0 +1,123 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<!-- Created By Vladimir Eliezer Tokarev !-->
|
||||||
|
|
||||||
|
<?import javafx.scene.image.*?>
|
||||||
|
<?import javafx.scene.control.*?>
|
||||||
|
<?import javafx.scene.layout.*?>
|
||||||
|
|
||||||
|
<GridPane fx:id="SettingsGridPane" prefHeight="70.0" prefWidth="850.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="polling_station_dashboard.StatusLog.java.StatusLogController">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="177.0" minWidth="10.0" prefWidth="177.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="172.0" minWidth="10.0" prefWidth="144.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="216.0" minWidth="10.0" prefWidth="200.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="165.0" minWidth="10.0" prefWidth="136.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints maxHeight="202.0" minHeight="0.0" prefHeight="54.0" vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints maxHeight="561.0" minHeight="10.0" prefHeight="561.0" vgrow="SOMETIMES" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<GridPane GridPane.rowIndex="1">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="80.0" minWidth="10.0" prefWidth="53.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="125.0" minWidth="10.0" prefWidth="117.0" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<BorderPane prefHeight="200.0" prefWidth="200.0">
|
||||||
|
<right>
|
||||||
|
<ImageView BorderPane.alignment="CENTER">
|
||||||
|
<image>
|
||||||
|
<Image url="@../../../pictures/bullets.png" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
</right>
|
||||||
|
</BorderPane>
|
||||||
|
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1">
|
||||||
|
<left>
|
||||||
|
<Label text="Manage voting booths" BorderPane.alignment="CENTER" />
|
||||||
|
</left>
|
||||||
|
</BorderPane>
|
||||||
|
</children>
|
||||||
|
</GridPane>
|
||||||
|
<GridPane GridPane.columnIndex="1" GridPane.rowIndex="1">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="80.0" minWidth="10.0" prefWidth="57.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="128.0" minWidth="10.0" prefWidth="113.0" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1">
|
||||||
|
<left>
|
||||||
|
<Label text="Manage Polls workers" BorderPane.alignment="CENTER" />
|
||||||
|
</left>
|
||||||
|
</BorderPane>
|
||||||
|
<BorderPane prefHeight="200.0" prefWidth="200.0">
|
||||||
|
<right>
|
||||||
|
<ImageView BorderPane.alignment="CENTER">
|
||||||
|
<image>
|
||||||
|
<Image url="@../../../pictures/women.png" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
</right>
|
||||||
|
</BorderPane>
|
||||||
|
</children>
|
||||||
|
</GridPane>
|
||||||
|
<GridPane GridPane.columnIndex="2" GridPane.rowIndex="1">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="79.0" minWidth="10.0" prefWidth="60.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="120.0" minWidth="10.0" prefWidth="110.0" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1">
|
||||||
|
<left>
|
||||||
|
<Label text="Manage provisional votes" BorderPane.alignment="CENTER" />
|
||||||
|
</left>
|
||||||
|
</BorderPane>
|
||||||
|
<BorderPane prefHeight="200.0" prefWidth="200.0">
|
||||||
|
<right>
|
||||||
|
<ImageView BorderPane.alignment="CENTER">
|
||||||
|
<image>
|
||||||
|
<Image url="@../../../pictures/settings.png" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
</right>
|
||||||
|
</BorderPane>
|
||||||
|
</children>
|
||||||
|
</GridPane>
|
||||||
|
<GridPane GridPane.columnIndex="3" GridPane.rowIndex="1">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="76.0" minWidth="10.0" prefWidth="54.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="108.0" minWidth="10.0" prefWidth="108.0" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1">
|
||||||
|
<left>
|
||||||
|
<Label text="Close polling station" BorderPane.alignment="CENTER" />
|
||||||
|
</left>
|
||||||
|
</BorderPane>
|
||||||
|
<BorderPane prefHeight="200.0" prefWidth="200.0">
|
||||||
|
<right>
|
||||||
|
<ImageView BorderPane.alignment="CENTER">
|
||||||
|
<image>
|
||||||
|
<Image url="@../../../pictures/exit.png" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
</right>
|
||||||
|
</BorderPane>
|
||||||
|
</children>
|
||||||
|
</GridPane>
|
||||||
|
</children>
|
||||||
|
</GridPane>
|
|
@ -0,0 +1,11 @@
|
||||||
|
package polling_station_dashboard.settings.java;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Vladimir Eliezer Tokarev on 04/06/2016.
|
||||||
|
* SettingsUpdate gives the ability to update the settings object
|
||||||
|
* decouple settings from polling station dashboard
|
||||||
|
*/
|
||||||
|
public interface SettingsUpdate {
|
||||||
|
|
||||||
|
void UpdateSettings();
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package polling_station_dashboard.settings.java;
|
||||||
|
|
||||||
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Vladimir Eliezer Tokarev on 04/06/2016.
|
||||||
|
* manages the button pressing of the settings
|
||||||
|
*/
|
||||||
|
public class settingsController {
|
||||||
|
|
||||||
|
private Stage currentStage;
|
||||||
|
private SettingsUpdate settingsUpdater;
|
||||||
|
|
||||||
|
public void SetStage(Stage stage){
|
||||||
|
this.currentStage = stage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetSettingsUpdate(SettingsUpdate updater){
|
||||||
|
this.settingsUpdater = updater;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
package polling_station_dashboard.settings.java;
|
||||||
|
|
||||||
|
import javafx.fxml.FXMLLoader;
|
||||||
|
import javafx.scene.layout.GridPane;
|
||||||
|
import javafx.stage.Stage;
|
||||||
|
import polling_station_dashboard.StatusLog.java.StatusLogController;
|
||||||
|
import polling_station_dashboard.StatusLog.java.StatusLogUpdate;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Vladimir Eliezer Tokarev on 04/06/2016.
|
||||||
|
* Loads the settings fxml file
|
||||||
|
*/
|
||||||
|
public class settingsLoader {
|
||||||
|
|
||||||
|
private static final String POLLING_STATION_DASHBOARD_FXML_PATH = "../fxml/settings.fxml";
|
||||||
|
|
||||||
|
private Stage currentStage;
|
||||||
|
private FXMLLoader fxmlLoader;
|
||||||
|
private SettingsUpdate settingsUpdater;
|
||||||
|
|
||||||
|
public settingsLoader(Stage primaryStage, SettingsUpdate updater) throws IOException
|
||||||
|
{
|
||||||
|
currentStage = primaryStage;
|
||||||
|
settingsUpdater = updater;
|
||||||
|
fxmlLoader = new FXMLLoader(getClass().getResource(POLLING_STATION_DASHBOARD_FXML_PATH));
|
||||||
|
}
|
||||||
|
|
||||||
|
public GridPane GetSettingsInstance() throws IOException {
|
||||||
|
GridPane settings = fxmlLoader.load();
|
||||||
|
settingsController controller = fxmlLoader.getController();
|
||||||
|
controller.SetStage(currentStage);
|
||||||
|
controller.SetSettingsUpdate(settingsUpdater);
|
||||||
|
|
||||||
|
return settings;
|
||||||
|
}
|
||||||
|
}
|