From f1704ce16eddccf28d5719111fc1675523938f94 Mon Sep 17 00:00:00 2001 From: Vladimir Eliezer Tokarev Date: Sat, 24 Sep 2016 13:26:15 +0300 Subject: [PATCH] Implemented the start new session functionality When new session needed to be started we call the doStartNewSesison method which generates all of the gui panels and gives to them the primary stage. --- .../main/VotingBoothGUIManager.class | Bin 4769 -> 4915 bytes .../src/main/VotingBoothGUIManager.java | 21 +++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/classes/production/voting-booth-gui/main/VotingBoothGUIManager.class b/classes/production/voting-booth-gui/main/VotingBoothGUIManager.class index fc91a8f75f7c7e956707dd67e6f5da5a28501711..31289d1c984a74e008c9947f38edce2167b42dcb 100644 GIT binary patch delta 1631 zcmb`HOH&g;6opTRm<%%$l&B~^ARr(FH6Xr~had_F%G(!;0Ru!aQ4$ap4L-q*Rn+(g z{0R_2bm7`^W0gO{ojcuFo}P)}VO&_{rf<*b?)%+yXL?>2#)~d~`uY9?fPHwOVm*3P zT*j4jWTICNR~7hG^r2r4*HkJ2DGw+Z)G&mgg6j%yC>U07Q$fgyu!>u_?Zk)^k(q`m zMeiRS83}}Rnp@acx3O8)f>pO80gDn15j07m4}@1HKM9 z3Mi34v@;kT=5%9mv)thu_J;1?Y_ z7ECSMoNwVXYv)|2MqeCr`Q&31jBC7aA!g039*z!E%tRjN@&Gp=A3GQY3Q)*o@^Bxc zjWNd?D_w+b9%_2r6cdBNV0-h*bQG6+OarJku-8{P|*@IH9$XtK; z_by8zlKy?DNE8udwDX`g7el&ReFx13X*O+HDHSYfpP9#N?M)igsP8wy8V=x~S-6Hn zILz}$n8oV5RE|=yUgI(DuS8XX-^-YmtdAOnl?vj#%ilEbFGckc9Uv- zOxiN9k|kC-Y@}j2Y~t)RniDMfUah{8wRSbjL|r1PXUSj;%ULZr!+fmOe4AEZe^=Ck zw&YqTQ(62jYTf_B50F3bfBEN9_j+AQ{~_|jORZk%KUJ^m=+N?dp4b0E^77@G-2fY% zxd?Y0>GA>z^HZ{ZLT)zcA~hQ>VJ~AouTdGsP|kFx_{VFg$;R0X3au2{89R{u3kW@` AhyVZp delta 1482 zcmb`H%X17t9LK*s+3d{D%qFr(vSG9#|m{34&DZ!NE;c zYLt@;CyueDgab|vs$BdRZZ3|LZ}%j#i&09IIn1x;*WKSwe}COQ>B`3yZ6ChBegmKu z(v9Vc0V9S(ociqLX0{kMyD7{4;!CEtO&(A z#%)}~gpI{mVq+2&HVP0CXmGxnap#d43tqQz12@xe%^DG$vT+Nyov+q(;Eq7td1n+m z`N5F$(EjK=370!}!^O_~a55F9ErCVQP$K2%Rg(bbma29kY_`egJIYKoqhQQUyo8ul zLrVA#s$>C{u`MTX0G1=hD6j%6DJm!LV$>KziK;nhFOV~v;+I4Nrs^qzL6lS}bVtss za1Kflr&<~N0*tGeDMtlIN#)JVxXYSDAhRr2w3HL#KP{~it2v2MDW$cBbJuzntJo#A zezRAZr6D|f32c~OM3OPUiPm%EMuM-PYmiIH$?{iCpEXJ*p@ya`&!ENH)+n%rjo75@ zTQpWnfi0AA%PKQlnQ?b#8^>?Qj(L6`W6lEK@a5N$U$6M3YUm&MlB)eetz*We)|1-c zPYwA}TS#rqqGn8!zteN=M{V?|O{6xfBP2Jxi+OpJRIN>4YCEYNit3)F4Am{Gph2F$ zOkG<@a2>X?wHNzHkSw{cUR^C;RySEaz78$4VL#=#RJECISr=B6YQrI~^DsFszmvHm z|HAJlf8hV}kNVfz_VqtZ{*}MfI=j@3G$^eOYB visualPanelsMap; + private Stage currentStage; @Override public void start(Stage primaryStage) throws Exception { - visualPanelsMap = ChainBuilder.Build(primaryStage); + doStartNewSession(primaryStage); + } + + /** + * Created new UI panels and sets their primary stage and shows the panels + * @param primaryStage stage object which contains all the panels + * @throws IOException + */ + private void doStartNewSession(Stage primaryStage) throws IOException { + this.visualPanelsMap = ChainBuilder.Build(primaryStage); + this.currentStage = primaryStage; + this.currentStage.setTitle("Voting Booth"); + this.currentStage.show(); } /** @@ -104,6 +118,11 @@ public class VotingBoothGUIManager extends Application implements VotingBoothUI @Override public void startNewVoterSession(FutureCallback callback) { logger.debug("Graphical user interface call to startNewVoterSession"); + try { + this.doStartNewSession(this.currentStage); + } catch (IOException e) { + logger.error(String.format("Couldn't start new session of the voting process :", e)); + } } }