From f2a26b71453db2293d57fee265ca781a680559a4 Mon Sep 17 00:00:00 2001 From: Vladimir ELazar Tokarev Date: Sat, 4 Jun 2016 15:11:18 +0300 Subject: [PATCH] Created the status log update interface in order to reduce coupling between polling station dashboard and all other elements it produces and uses i have created status log update interface, which expose the functuality of update the state of status log panel. the idea behind this is status log does not have to know polling station dashboard. all other objects that polling station dashboard will use will have their own interfaces (for the same reason too). --- .../pictures/[Originals]/blacktriangle.png | Bin 0 -> 8107 bytes .../src/pictures/blacktriangle.png | Bin 0 -> 371 bytes .../StatusLog/fxml/status_log.fxml | 16 +++++-- .../StatusLog/java/StatusLogController.java | 12 +++++ .../StatusLog/java/StatusLogLoader.java | 9 ++-- .../StatusLog/java/StatusLogUpdate.java | 11 +++++ .../fxml/polling_station_dashboard.fxml | 2 +- .../PollingStationDashboardController.java | 41 +++++++++++++++--- .../java/PollingStationDashboardLoader.java | 6 ++- 9 files changed, 82 insertions(+), 15 deletions(-) create mode 100644 voting-station-gui/src/pictures/[Originals]/blacktriangle.png create mode 100644 voting-station-gui/src/pictures/blacktriangle.png create mode 100644 voting-station-gui/src/polling_station_dashboard/StatusLog/java/StatusLogUpdate.java 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 0000000000000000000000000000000000000000..ec7453797997c4c1c5456b3aa206e7b6070ae646 GIT binary patch literal 8107 zcmYLOdpy+X_x}({Hdd2tA?>PZ7s=MRH7>DRDwi(CP;R4KbI%$fA$3$o-!tYG`d;NZ|`D0$s^Z7i_bIy6rd7t+=pKHe*Z8xmn zx*kE04Mz_DdJ;ioIuS&6)4H`VbD<#GAO6;!v9tXZS(W~7H`DKfF?F=Ab{awzl4PIM}=CJDDvycU5&Zjjms7KeZ$<+tqHi)V3@8 z$YDWy{P08rt4lIElk@p^Lmji}r3T5PPZzEF7Ut-S(P)Ae@_}hUN=3Q!iDO0bi1Di{ zZGA0hGTOli%iFJt1Xm~xv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I&`H#R>Oy0tOiwzK>FMJz%bJ{(=yhbUpJV)zz{(XT-Gt``J z2LJnEiSBSp0rjU(*F8#yqR^Pg^s9!O8m?m1J@49>sAWRD?^h+|xR-W-F*JL`A5Jd- z5b`TKmG4Ed;9HSPLdZ|Wnn;{K^=1{otSsdxKZRGieWf)1Md+jZ##0b+wdgU29(8;$ z_nE=h&u6>iEJ(}N5|gaY-^(26RH^r^+DGF*`Wg0TJ{7aM0}|KKf!SV6-fkrr8TrXC zb!d#4jE$lRwI7ekBSnwJBg7C_I-K<0PhsRpuL!&*VGk^}Hzcl0uLVzKtNJOtsjULx z$iww?6$D8OqWrMS!p8rJ^Qc3YL^uQV=Glv*moFC|^;JiRXPnc|Se=M(+nS(^xYqk#9Rr7wo>rQrn&q!Ce0{kD zs}CyNhV%w(naHv#207>XW6}gEOQ|j(=%>@Go%cWvMB>Klyer`@8>0*O<`tGF8v|bc zj<8jW-Ve-5?*&2krGmJ{^~k8YcMfc`Uchx=jt?z#K=Rgl#>={RaDJ`Q6d5iTh)@cJS zF-TdWk5ep#nxd`3e)xaIA!bwEbjn7+D)1w=L;XY>s(>Yi8TcA&8MqPfE2FV3iFoI0&#p@V73o3jBbrTy0ZemA{u*Wwcvmg|BsEn7-3S{$A8NS2d%9dH!d~ zH^Pzn%cgX(6I3?Zln8pm5#|!;+qGyU7zl-5$64Rrzb7%3A>r1+K - + - + - +
+ + + + + + + + + +
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 @@
-