diff --git a/voting-station-gui/src/pictures/[Originals]/blacktriangle.png b/voting-station-gui/src/pictures/[Originals]/blacktriangle.png new file mode 100644 index 0000000..ec74537 Binary files /dev/null and b/voting-station-gui/src/pictures/[Originals]/blacktriangle.png differ diff --git a/voting-station-gui/src/pictures/blacktriangle.png b/voting-station-gui/src/pictures/blacktriangle.png new file mode 100644 index 0000000..e90203f Binary files /dev/null and b/voting-station-gui/src/pictures/blacktriangle.png differ diff --git a/voting-station-gui/src/polling_station_dashboard/StatusLog/fxml/status_log.fxml b/voting-station-gui/src/polling_station_dashboard/StatusLog/fxml/status_log.fxml index 4992518..6cdbb56 100644 --- a/voting-station-gui/src/polling_station_dashboard/StatusLog/fxml/status_log.fxml +++ b/voting-station-gui/src/polling_station_dashboard/StatusLog/fxml/status_log.fxml @@ -2,17 +2,27 @@ - + - + - +
+ + + + + + + + + +
diff --git a/voting-station-gui/src/polling_station_dashboard/StatusLog/java/StatusLogController.java b/voting-station-gui/src/polling_station_dashboard/StatusLog/java/StatusLogController.java index f62cd82..625e432 100644 --- a/voting-station-gui/src/polling_station_dashboard/StatusLog/java/StatusLogController.java +++ b/voting-station-gui/src/polling_station_dashboard/StatusLog/java/StatusLogController.java @@ -1,5 +1,6 @@ package polling_station_dashboard.StatusLog.java; +import javafx.fxml.FXML; import javafx.stage.Stage; /** @@ -9,10 +10,21 @@ import javafx.stage.Stage; public class StatusLogController { private Stage primaryStage; + private StatusLogUpdate statusLogUpdater; + public void SetStatusLogUpdater(StatusLogUpdate updater){ + statusLogUpdater = updater; + } public void SetStage(Stage stage){ primaryStage = stage; } + @FXML + private void CloseStatusLog(){ + // UpdateStatusLog is called from open status log object which means that + // the current UpdateStatusLog will close it + statusLogUpdater.UpdateStatusLog(); + } + } diff --git a/voting-station-gui/src/polling_station_dashboard/StatusLog/java/StatusLogLoader.java b/voting-station-gui/src/polling_station_dashboard/StatusLog/java/StatusLogLoader.java index d8ffa31..12d403a 100644 --- a/voting-station-gui/src/polling_station_dashboard/StatusLog/java/StatusLogLoader.java +++ b/voting-station-gui/src/polling_station_dashboard/StatusLog/java/StatusLogLoader.java @@ -16,17 +16,20 @@ public class StatusLogLoader { private Stage currentStage; private FXMLLoader fxmlLoader; + private StatusLogUpdate statusLogUpdater; - public StatusLogLoader (Stage primaryStage) throws IOException + public StatusLogLoader (Stage primaryStage, StatusLogUpdate updater) throws IOException { currentStage = primaryStage; + statusLogUpdater = updater; fxmlLoader = new FXMLLoader(getClass().getResource(POLLING_STATION_DASHBOARD_FXML_PATH)); } - private GridPane GetStatusLogInstance() throws IOException { - GridPane StatusLog = (GridPane) fxmlLoader.load(); + public GridPane GetStatusLogInstance() throws IOException { + GridPane StatusLog = fxmlLoader.load(); StatusLogController controller = fxmlLoader.getController(); controller.SetStage(currentStage); + controller.SetStatusLogUpdater(statusLogUpdater); return StatusLog; } diff --git a/voting-station-gui/src/polling_station_dashboard/StatusLog/java/StatusLogUpdate.java b/voting-station-gui/src/polling_station_dashboard/StatusLog/java/StatusLogUpdate.java new file mode 100644 index 0000000..e032d72 --- /dev/null +++ b/voting-station-gui/src/polling_station_dashboard/StatusLog/java/StatusLogUpdate.java @@ -0,0 +1,11 @@ +package polling_station_dashboard.StatusLog.java; + +/** + * Created by Vladimir Eliezer Tokarev on 04/06/2016. + * StatusLogUpdate gives the ability to update the status log object + * decouple status log from polling station dashboard + */ +public interface StatusLogUpdate { + + void UpdateStatusLog(); +} diff --git a/voting-station-gui/src/polling_station_dashboard/fxml/polling_station_dashboard.fxml b/voting-station-gui/src/polling_station_dashboard/fxml/polling_station_dashboard.fxml index a83d831..f755ce7 100644 --- a/voting-station-gui/src/polling_station_dashboard/fxml/polling_station_dashboard.fxml +++ b/voting-station-gui/src/polling_station_dashboard/fxml/polling_station_dashboard.fxml @@ -69,7 +69,7 @@
-