diff --git a/voting-station-gui/src/pictures/[Originals]/blacktriangle.png b/voting-station-gui/src/pictures/[Originals]/blacktriangle.png deleted file mode 100644 index ec74537..0000000 Binary files a/voting-station-gui/src/pictures/[Originals]/blacktriangle.png and /dev/null differ diff --git a/voting-station-gui/src/pictures/[Originals]/bullets.png b/voting-station-gui/src/pictures/[Originals]/bullets.png deleted file mode 100644 index b4e8384..0000000 Binary files a/voting-station-gui/src/pictures/[Originals]/bullets.png and /dev/null differ diff --git a/voting-station-gui/src/pictures/[Originals]/exit.png b/voting-station-gui/src/pictures/[Originals]/exit.png deleted file mode 100644 index 557b3e2..0000000 Binary files a/voting-station-gui/src/pictures/[Originals]/exit.png and /dev/null differ diff --git a/voting-station-gui/src/pictures/[Originals]/profile.png b/voting-station-gui/src/pictures/[Originals]/profile.png deleted file mode 100644 index 7971691..0000000 Binary files a/voting-station-gui/src/pictures/[Originals]/profile.png and /dev/null differ diff --git a/voting-station-gui/src/pictures/[Originals]/settings.png b/voting-station-gui/src/pictures/[Originals]/settings.png deleted file mode 100644 index d3d54e2..0000000 Binary files a/voting-station-gui/src/pictures/[Originals]/settings.png and /dev/null differ diff --git a/voting-station-gui/src/pictures/[Originals]/women.png b/voting-station-gui/src/pictures/[Originals]/women.png deleted file mode 100644 index 760fad6..0000000 Binary files a/voting-station-gui/src/pictures/[Originals]/women.png and /dev/null differ 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 index ed977d0..13ad32d 100644 --- a/voting-station-gui/src/polling_station_dashboard/StatusLog/java/StatusLogUpdate.java +++ b/voting-station-gui/src/polling_station_dashboard/StatusLog/java/StatusLogUpdate.java @@ -1,11 +1,12 @@ package polling_station_dashboard.statusLog.java; + +import javafx.event.EventHandler; + /** * 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 { - +public interface StatusLogUpdate extends EventHandler { void UpdateStatusLog(); } diff --git a/voting-station-gui/src/polling_station_dashboard/java/EventHandlerMapper.java b/voting-station-gui/src/polling_station_dashboard/java/EventHandlerMapper.java new file mode 100644 index 0000000..3aa14d0 --- /dev/null +++ b/voting-station-gui/src/polling_station_dashboard/java/EventHandlerMapper.java @@ -0,0 +1,32 @@ +package polling_station_dashboard.java; + +import javafx.event.Event; +import javafx.event.EventHandler; +import javafx.scene.control.Control; +import java.util.HashMap; + +/** + * Created by Vladimir Eliezer Tokarev on 12/06/2016. + * EventHandlerMapper maps events ids (that are part of polling station dashboard) + * to the object that handles this specific event + * when EventHandlerMapper gets specific event it activates the handle method of the object + */ +public class EventHandlerMapper { + + private HashMap> eventIdToHandler; + + public EventHandlerMapper() + { + this.eventIdToHandler = new HashMap<>(); + } + + public void Add(String eventId, EventHandler eventHandler) + { + this.eventIdToHandler.put(eventId, eventHandler); + } + + public void Handle(Event event) + { + this.eventIdToHandler.get(((Control)event.getSource()).getId()).handle(event); + } +} diff --git a/voting-station-gui/src/polling_station_dashboard/java/PollingStationDashboardController.java b/voting-station-gui/src/polling_station_dashboard/java/PollingStationDashboardController.java index cc3976f..1e44df4 100644 --- a/voting-station-gui/src/polling_station_dashboard/java/PollingStationDashboardController.java +++ b/voting-station-gui/src/polling_station_dashboard/java/PollingStationDashboardController.java @@ -1,6 +1,7 @@ package polling_station_dashboard.java; import javafx.fxml.FXML; +import javafx.scene.input.MouseEvent; import javafx.stage.Stage; import polling_station_dashboard.statusLog.java.StatusLogUpdate; import polling_station_dashboard.settings.java.SettingsUpdate; @@ -31,7 +32,7 @@ public class PollingStationDashboardController { } @FXML - private void OnStatusLogPressed() + private void OnStatusLogPressed(MouseEvent mousePresed) { StatusLogVisualUpdater.UpdateStatusLog(); } diff --git a/voting-station-gui/src/polling_station_dashboard/settings/java/SettingsUpdate.java b/voting-station-gui/src/polling_station_dashboard/settings/java/SettingsUpdate.java index 33caeb0..3e40979 100644 --- a/voting-station-gui/src/polling_station_dashboard/settings/java/SettingsUpdate.java +++ b/voting-station-gui/src/polling_station_dashboard/settings/java/SettingsUpdate.java @@ -1,11 +1,13 @@ package polling_station_dashboard.settings.java; +import javafx.event.EventHandler; + /** * Created by Vladimir Eliezer Tokarev on 04/06/2016. * SettingsUpdate gives the ability to update the settings object - * decouple settings from polling station dashboard + * this interface extends InvocationHandler in order to be able to be called */ -public interface SettingsUpdate { +public interface SettingsUpdate extends EventHandler { void UpdateSettings(); } diff --git a/voting-station-gui/src/polling_station_dashboard/settings/java/SettingsVisualUpdater.java b/voting-station-gui/src/polling_station_dashboard/settings/java/SettingsVisualUpdater.java index 131265c..996c1a1 100644 --- a/voting-station-gui/src/polling_station_dashboard/settings/java/SettingsVisualUpdater.java +++ b/voting-station-gui/src/polling_station_dashboard/settings/java/SettingsVisualUpdater.java @@ -1,10 +1,13 @@ package polling_station_dashboard.settings.java; +import javafx.event.Event; import javafx.scene.control.Button; import javafx.scene.layout.GridPane; import javafx.scene.layout.Pane; import javafx.stage.Stage; +import java.lang.reflect.Method; + /** * Created by Vladimir Eliezer Tokarev on 12/06/2016. * This object manages the visual changes of the settings panel @@ -57,4 +60,9 @@ public class SettingsVisualUpdater implements SettingsUpdate { Pane settingsPane = (Pane) currentStage.getScene().lookup("#Settings"); settingsPane.getChildren().remove(settings); } + + @Override + public void handle(Event event) { + UpdateSettings(); + } } diff --git a/voting-station-gui/src/polling_station_dashboard/statusLog/java/StatusLogVisualUpdater.java b/voting-station-gui/src/polling_station_dashboard/statusLog/java/StatusLogVisualUpdater.java index 1247c3e..234a3bb 100644 --- a/voting-station-gui/src/polling_station_dashboard/statusLog/java/StatusLogVisualUpdater.java +++ b/voting-station-gui/src/polling_station_dashboard/statusLog/java/StatusLogVisualUpdater.java @@ -1,5 +1,6 @@ package polling_station_dashboard.statusLog.java; +import javafx.event.Event; import javafx.scene.control.Button; import javafx.scene.layout.GridPane; import javafx.scene.layout.Pane; @@ -60,4 +61,8 @@ public class StatusLogVisualUpdater implements StatusLogUpdate { } + @Override + public void handle(Event event) { + UpdateStatusLog(); + } }