From 9ed74f6a7882c522fd19e6b2138cf62d288aa257 Mon Sep 17 00:00:00 2001 From: Michael Tikhonenko Date: Wed, 4 Aug 2021 18:27:37 +0200 Subject: [PATCH 01/59] JavaFX migration in progress --- testar/build.gradle | 2 + testar/resources/jfx/dashboard.fxml | 130 ++++++++++++++ testar/resources/jfx/icons/auto.png | Bin 0 -> 839 bytes testar/resources/jfx/icons/home.png | Bin 0 -> 177 bytes testar/resources/jfx/icons/rec.png | Bin 0 -> 646 bytes testar/resources/jfx/icons/replay.png | Bin 0 -> 1118 bytes testar/resources/jfx/icons/settings.png | Bin 0 -> 299 bytes testar/resources/jfx/icons/spy.png | Bin 0 -> 1044 bytes testar/resources/jfx/icons/view.png | Bin 0 -> 848 bytes testar/resources/jfx/logos/ing.png | Bin 0 -> 1344 bytes testar/resources/jfx/logos/marviq.png | Bin 0 -> 941 bytes .../resources/jfx/logos/open_university.png | Bin 0 -> 1319 bytes testar/resources/jfx/logos/philips.png | Bin 0 -> 1282 bytes testar/resources/jfx/logos/sogeti.png | Bin 0 -> 1055 bytes testar/resources/jfx/main.fxml | 75 ++++++++ testar/resources/jfx/settings.fxml | 79 +++++++++ .../fruit/monkey/jfx/SettingsDialogJFX.java | 11 ++ testar/src/org/testar/jfx/MainController.java | 8 + testar/src/org/testar/monkey/Main.java | 160 +++++++++++++++--- .../testar/settingsdialog/SettingsDialog.java | 7 +- 20 files changed, 439 insertions(+), 33 deletions(-) create mode 100644 testar/resources/jfx/dashboard.fxml create mode 100644 testar/resources/jfx/icons/auto.png create mode 100644 testar/resources/jfx/icons/home.png create mode 100644 testar/resources/jfx/icons/rec.png create mode 100644 testar/resources/jfx/icons/replay.png create mode 100644 testar/resources/jfx/icons/settings.png create mode 100644 testar/resources/jfx/icons/spy.png create mode 100644 testar/resources/jfx/icons/view.png create mode 100644 testar/resources/jfx/logos/ing.png create mode 100644 testar/resources/jfx/logos/marviq.png create mode 100644 testar/resources/jfx/logos/open_university.png create mode 100644 testar/resources/jfx/logos/philips.png create mode 100644 testar/resources/jfx/logos/sogeti.png create mode 100644 testar/resources/jfx/main.fxml create mode 100644 testar/resources/jfx/settings.fxml create mode 100644 testar/src/org/fruit/monkey/jfx/SettingsDialogJFX.java create mode 100644 testar/src/org/testar/jfx/MainController.java diff --git a/testar/build.gradle b/testar/build.gradle index a5eeecf38..2f1a34317 100644 --- a/testar/build.gradle +++ b/testar/build.gradle @@ -103,6 +103,8 @@ dependencies { implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1' implementation group: 'com.sun.xml.bind', name: 'jaxb-impl', version: '2.3.1' implementation group: 'com.orientechnologies', name: 'orientdb-graphdb', version: '3.0.34' + implementation 'com.jfoenix:jfoenix:8.0.10' + implementation 'org.jsoup:jsoup:1.13.1' implementation group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '5.10.0.202012080955-r' } diff --git a/testar/resources/jfx/dashboard.fxml b/testar/resources/jfx/dashboard.fxml new file mode 100644 index 000000000..37f1cf43e --- /dev/null +++ b/testar/resources/jfx/dashboard.fxml @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testar/resources/jfx/icons/auto.png b/testar/resources/jfx/icons/auto.png new file mode 100644 index 0000000000000000000000000000000000000000..b5304cb7f35b615daa00e201e450923fc8259eb4 GIT binary patch literal 839 zcmeAS@N?(olHy`uVBq!ia0vp^-XP4u3?%s{blm__jKx9jPK-BC>eK@{#sNMdu0Z-f ziD3KGM@>L&f+azI!3_T!J}giWIFR6Q{((WkhJXng4LhDOFfc9kba4!+n6q}q>qV^s z0{H$3K4U%zvQqf^s0%fOPZgn!)A9Jh0%-jCG&wCHsD z3@!teeV5EcJZl#hPI>Wz<+kv&4ZUtNN}F1}bqfDosVK;i^!@FTYrHZ1x5qyN&%hIH zhYo$cCw+UB(WLi}1Wh06O*zxdb$G^;fYKf&R+S}xqc1hYtN(AVI&}L`tlr}&!`vwq zMMwVRPrBi1b7YIQR?#w#uz4LByb(Vx*R>vs)qnUy|B0yD=K6>&8h<9Y$AqvYsNSrN z_J3NLYqQ3NU8G`aAD7bfa@AO)qWaG(8-70x-Tm?8-G{pKU;YpiUi2_#%PsF)96OcF z85FqhF}v;Q6Pz$LdfDPhjoU6A$+(glyeK5)woinjaptirArXm39xY5MPMm8jY`3GA zf6?T(0-aGT884@@%vG5j%ftOAd1GF*@zzVX{p^lCxn#PvwAfW{U14Qh>B|$VR^}~u z|0wd4>)DQ~l*mNc@Rv_#c>FS$l~h=%?)j&w)JY^xR$JtT%;`#&pRW4?)_mA7V^wF0 z`;y+(T*gO}G(>NzelNAp5oTlbG~l;7`j9WEV!njk)5HU}mi^^sDSNy1&AGxm8k3TR zFO?tHTP|93Xn%=G&$}0=u9%g-n&SU`pM3P)L%%*oWR&Vpc;f!N#xpCuX4^xL$(~!H z9?Y2`X0hs%wsId2oK> zmMBxs)&C}HT1~pnZE(7F;<3m2e7#ZUvYDR79Z~7^INQT?O>^(#Hq)$ literal 0 HcmV?d00001 diff --git a/testar/resources/jfx/icons/home.png b/testar/resources/jfx/icons/home.png new file mode 100644 index 0000000000000000000000000000000000000000..6e6dabc024fcafb75d17d3606ca4d4a3a3d43b39 GIT binary patch literal 177 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_+i3Qrfu5R21q&+p}JP!MoP)O@od zwn1=CqpC!+r9`vljDx%}4YST2ve6cH{$W_AQup*}te&}VvcrRdj_p5t*bf-*KdIUn z?eOhWYwz;jrBk)bimX>nTkqnfl&yJPB}>TaJTJR0`?HzRepP-sbxRli`SQK>*OPdO aYphPwN_wUmdUyccz~JfX=d#Wzp$PzT^+JsR literal 0 HcmV?d00001 diff --git a/testar/resources/jfx/icons/rec.png b/testar/resources/jfx/icons/rec.png new file mode 100644 index 0000000000000000000000000000000000000000..4d1417c2bfa0795243c5533fd5ffbeacf9d84aa7 GIT binary patch literal 646 zcmeAS@N?(olHy`uVBq!ia0vp^u|Vw2!3-o-6{^dD)an4A5LX}#1pl#te_()31}X-W zhs*x``xnke7KaOx%J}{JH=33chgtc=xhsEC9bQZd-r?&*52iAzIV*n^UIzuPndjA-*6_+%)}lSrN7aN2THF! zxh`_1)aJ#*@As2a8PqM9-?)BP?@?)jG0&&W?+UGY`&Q+PT}W zcAwcPp>VmE>PIJ?)ZG?lc!2q;&<38c*)jKX_k3FLU+1j4SzEi;o=FF-cis6FbdGx? z=P&l8``3P@Y}~23zW#IaUKzutjgzy_#|0d${`Dt-Wz%PEkr=@lNA9r3{Lxc;w`A#k z5v%7Mu?}5=-r-hyR?ZT?w#217>ZhugaohDAk7!Jr=zJ;r?>eqHyLVY-RffJKlYdMcZ1eW ztt~pdE$p9n*#yhWx8F)nYhTloo0i%iYkX?<`J5Sin>ck)iA6g|1y6Gc}s|_e76O{g7&vi5`pV820IC-P!uPCKHsLJYD@< J);T3K0RW(6e1HG| literal 0 HcmV?d00001 diff --git a/testar/resources/jfx/icons/replay.png b/testar/resources/jfx/icons/replay.png new file mode 100644 index 0000000000000000000000000000000000000000..4bbcefc41eafe58fd912816c7e6871416757f5c3 GIT binary patch literal 1118 zcmeAS@N?(olHy`uVBq!ia0vp^u0ZU=!3-pMV!AE^DaPU;cPGZ1Cw1z9oMQn#As`k1 zv4MYJfK3J@29!jT`uq3qpFe-l1mP-?)kD~D5uipOz|;sAfvbcw;8JkLediKEpii7i zg8YIR{x=8&gl_n#edYe--F+Qyvz`>bJ`pFr&p=`6dzm@vtCFrO3vZtvb!^MavrZ;; zoIy8pSi@4^J1zkcv5LXJjTnQV?i6xNfy!r&`w4 zU2nRgy1X zQT+DnS8Jk;gk*KpJ}Ttav1O!uhK| zC$P0_`q>{KCwas>x-R~q=7iTvOCA3&D0&lT%(l{N*$P2vK9%g9dN;N!9d5j%lK#}$ zT1)0{!wgQrbFzyy{3Iiot`)?6Wqu@*ZE{n>}ySZ5wC?2i-WJ}Sd^`#h`kQ3<}{ z!Z#w$7H5)M7CZ@>!XsSacV0qJCb31-cVX`&zLp7=r+><=WIpc`=%cH1gYo0d^RqgY z*o9usj@-T{rP3ha%6o}j?<)4iWNDsq=qOll?nKws!ueKRWgEXrs9Jqr5V9*csHD;5 zs0NQk6~~SI)OE&ds#e_Jba?pT&Fq89 zd{gK1uUz7}HIm2XXzIZi>(icj+?%-9l&hr2L-+bU`)R4Sr`cFH+1(Vr7-eYfxwFe$ zXJyztDS@dDQA}2QdrW&i@>Ty8dVN>^WXD&@@6q8)&n%EzKV^=w9-ptc+J6Qm5e=4> T1JdTe9L3=2>gTe~DWM4f^w(iF literal 0 HcmV?d00001 diff --git a/testar/resources/jfx/icons/settings.png b/testar/resources/jfx/icons/settings.png new file mode 100644 index 0000000000000000000000000000000000000000..eb0072af8f3df4ac5f8c15b8a21c6c95c20b7aa8 GIT binary patch literal 299 zcmV+`0o4A9P)x4Zl9$;_L+ z8IeDTfSLMw#ek5frp17H4rH#_kd%%HeGWNrWFUf1!pM%7*#WTShOQf10QOW&V9YOt zdfek|6xT#VtPSr<{RK2QYNeQxhzKQO%{|f5*Ql~kh0PRf*w>xJ6qf%~S3*+YfBb2N68?Y2iG_#zCnpLn1z xLWh*0Yi_d~m>0Vb(~kq^0DAcq4gT>&+yTCc%0NX9y=4FZ002ovPDHLkV1n|ogYWqTW$B>FSZzFC_ zTdW|^+o7>T&24jO`K8}>r~m)I!_vdH@X8`}{^E0AY7Hkn3KCzTRbbY9Fw)>dzte=} z-1f4Y4Gh2A=rekLw$j~kJ)tCkIr6e7yeCkg7$_M5!(`6x4e+6YdoH0^W$vXbL*UceSQy9rMK2RyvzDS#qL^`+xOSp zA2sjnKcA+e%5`h;@0nTrCIQu7>>VdO7dDi>su{gRRBO}XFD0g5S7)49_U@5l;zyDD zPWO4ZFW9^|D!$f@Q#-l-;?7**SvOhawmUvnPKV~sY8neGu1lygS4FD zx2$(6l!{wrt*ol+Zp?g?VWHIC?a!aGPW*OFebS_z`;IKVy4u+%cjBZ=*QL3lmz1hthK%UTvovovNsy|rNr)9&R@bjUWfK4;D<;d~+DjHm!3FvbJYZgmF`Zp zjoMZdx6YBza+xbN?b_SbAC8}P`W)E5ymH=k?$8B3hraDwV|UDMKG(*nhNe^87Cm%` z+ptMcUeV^<{DK)Ap4~`eU|`bs zba4!cIQ({o@9Aa(p5xwvIvw|1uB`lV=uW1AfLUVl^xFUDzic?YdD}A2S2n!=x9fgP z&%La+Qeb!4+h2iq5AT}wB)T{2^y9WC#ReV@p4%9A=cz1upk1br`BeL6tYT$QdHoN^ zUm0JTuJL%rUQ*6Mqm2b~pf)cZwd`-dkn@0r%+l^nTR)be9PnsRMLf>{SgP0O-N zafh4LTNkZj*>LQFQmV_(lr~rSs{bAa;aOh{-Q?E_<{5qOHgNy(Z{p|tT}+bSUhio4 zS$q4wFn@aUm7fjwXFfjl;+)Te(xf_`=Glk(=XRVtkn`r?AcGRdDj}Q>Vy&OH zlw&}ys^QostaVmKRx7gfwdfifUL}2*!f<9?>^Hl0XbNzvjSdpWgdGau8Pqwpx6OAW z5tM^vI;Yg?OPzbXpl~!9q?uTwon;AQC+lHuciw?4D+XJ{1aBzK&SofA)$SbKHT3m7PL?_4 zMfyEdt$ov!6XikD!5d2B#+7f^jrmG%yGYReqJ<}l!v5A|f!eS(Lt*?(;y08=0?xhV zD&RMFbSIfOkL);-m0os1B0?i6(Kd-1asEsqo+yXO^!}jbTRO_}2ycrPK&olI@9khV zjcNK!@X*lRW^W{2tw}viW(^`jKeD@Z-AKtcS8ukUypudob`x_e`cH$4jW1b& z9?Em9GuU+@&i%+CVkLp$u=Q2*K9FoWbD-=d)#3MtwUCgKoAS*yx%T4)JGM?zz3fjU z#$8Z$6aStj&ynrIA~JAXl$J$d-6}g!MBF7qvXRPKRG&z0D7%Ten|~UNTx@5hQRB#M z0Sp6ZP?)%kSQ^LXJoUCel3Y=C6S$l2w|JID9SM})A2o0asi@nCGa<{ZO*S=|GQi(S zE-1T+d&VTyId|)tGrEM`kYViHkaYFLGaM}B_p_hR3WRSYCyKq@&Q)RQ^~MGmmU(gP zF6ccr+~&`olRiwb#A|woT8Ai**uJ$xz*P4?s?<#KFK?+*|cb-}2;w zvM;MuynH9ox}SJ4^DJD#nW#ilOQ}osc{?=+qWZ_*Nx0*@lEnI>c{kokOzzZDvLh^O zf555A|Dqgi&EPe*n?TNg*OLdz7E1NJo;MO&=FZ}qE>nq8QvWs(dKYu3ShQ6#A0~S*k zrj9Ztll)Lgvcg`1)SJr@wg%-vLU)o4<#;Bl;5WU?)dgWT+H;W&<*{+mnVelv)>qw; z94*hnkAAJOeqym-g1Ob$|-VW2yoAzWIPgx z7uJZV`Iwp4n-4YHaZV4EOD905&XnQkY@J+?dRX>~iv(J^J}ujCVyd)^JBG5`!pHvs zNp9nQLFqmdtyk4qAak{BM<=rPXpi621&Z6B&9Xlg6Dff6r#}S%0000+pot|^~(atyoKNf`u@mBnP%+q8K>0dwcY)c+? zn#|o+T#mHIs`HoaG)ZTVjYdchlFS>eYJ*FgP)CwGqqmctW|#C#F&K_&%Lbi z1G(EWL^$`qRFWqS3N!)@mGuGFIqUIU(~q!d7bNyyG;5UcfNXk*Tiz?!ch=(R#Muc}u& z>Q-DRjX-uITLjTS<`6`+-gC)OnneN8)rZ!rbPn^0Szxtneu=`6FC}_8%I+qvrs2!N^9)`=GjLExM( zMQJVjB8X~#Z#Vh{i0nXMXR0yel0C@HR`>zP&5JPzu*xyt6x>N2N2%*_-Xz`v5qcGSQ~&)q%K)l!5~OIMoa+s1qif<=4LJ3rUzjM zMerj;H>(+h&P?-yWs_er}Mx`K0EvHRFdb-kUb{C4JcDR&3&JKdeV-2)<`VFi<- zRsuYysvQp+9}rBA312B`nPkgse+DArs#4(G_ln5$XCOb6{|4kLph^7$MY0zEp!p?{ P00000NkvXXu0mjf=@^hH literal 0 HcmV?d00001 diff --git a/testar/resources/jfx/logos/open_university.png b/testar/resources/jfx/logos/open_university.png new file mode 100644 index 0000000000000000000000000000000000000000..6905e5feb3f366c8b22bfa7c37bdb7d3acb93e21 GIT binary patch literal 1319 zcmV+?1=#wDP)7&_R0VN02g#pPE!E?fWScT5MbcYa3G+s zkT6g`uz$b1pB?aRz5oCOZAnByRCt`ln2ma~Dhz-L|B6*-{k;E6JqbaJ3avX`w>;0* zRs%02A&CmOE&@f~GZ7WhHv|5rYqxjuP5$Y^S?ru{-|RQ}jg+pHoqxjDC>=ETzpe0X z1E5Cj6wY^H0o&}xh4tFdRrw?m6s-g=gs+hYg?^rIE`G(aY%?K7p}v1hmP%_&&q1wI%Rt!xdLUibKw zZu)Hw54Z%SR6}>H2h*|=jqKYVM+N4a;p`aqn&08BLIXWAEngXhLZh$J!<3@Npv75f zz+K~_;#UJ5^9y(y{fZx5HiGxiM>jV(p8}cLP^D20&9EuqqFAS6TR>aF3!Lgz{6)!C z8ZnjjFG8;5S3dffMn4?37k!=Is3aJ4W}6`TpW_<5c_wI=7?DxC& z&-rS0ZU(aqaq9NYGmrOH;AM#QP=ARq3ftb6F)HDx7Ly=*Dqv;&Zv5r^Rm>>&jm(&6&QxD@=qP@lB&nT%Zn_aCNWfMWeA@$r}tKW+eVzL2x0# z6>R+2DaZ&Wt-gr2$3Aq=A5VO=!-Rj0q`rv7t@U4#BQ`!p-i(IoMN09-3b;Ut@2SaR z@A@NujOWX_EEjA^LO0Mn_^8>jX*h}tIp~Ckgyq$?(YSlQh#e-igE9WvG4b7OqZ08| z3{pY1?S$A$+|dH|j8C16q4L%@5QF=`?|D{2jg*2U^U)`6G`xSjw`e|EI^)AFV8b}<74_|O~lq64&IJ0ti%I0?dzCHx7$<{ zN34Lc)UCgJB}3|U#@=O*2|2*b%l*ET;Q;kM>HC5fNnu=reUfi`zddsN1z%?;?l1Vm z)NU!)T*lWP6W){KLrz`lb^0ACKkEM;|NNL+lP7)B8)9FBlRW7Y-;vUrj-p(7oAf{A zsso-proAQh;t8xiCBG}}CH!Yjf0Ww$zMXt1`bds_W=THf{V1n5O(&_f$Uh{nl3?lm z+)qk+HSkw>T);C6d>${JokA5}kNyEEw!HAEvQrXS$b{YRY(9zG$Dwb3l}=(uN$*EN dDd~O#{vUhTCmJ9zUx@$!002ovPDHLkV1l*QY3~34 literal 0 HcmV?d00001 diff --git a/testar/resources/jfx/logos/philips.png b/testar/resources/jfx/logos/philips.png new file mode 100644 index 0000000000000000000000000000000000000000..28b9e71aec39e41a3b21921d39fe7903085df406 GIT binary patch literal 1282 zcmV+d1^xPoP)7##o&69I}a%sDHxQV}+@SvkDujNr z!vw3(iLSM}wIhu3$>?Czjl;mq*YGEOFglJtaiC)w(L?YNcofO%cv-%9l&?i}f)Pv1 zk31&AR>{n*it%n3_?JlNgNn&hA~mFAka9qB*urg$$uO@bTFTd)2P`c(U*pmcuUNid zxAy}4$}PW6{aMuOxDkvz^-*{`u3y`Rxi|Wu1VA?(_vq@{bcc@6)E_-7*~h7f8g!-e zsMx7Lqeq0^=<(+H(%PU~4AW60&h`%7r`Y2O)d}4zIV`7YchM8}F~rI^{0^dg2nSXz z3^3~zJ+zPeq)Z?5i;@E3%5$Tu(6u1Wuubu*Iu~WOXLNvK6WtH}AY(_zIbM<-f;c=$ zVrsjWH`St>eM%kCZFPE}fzpS=3>}X%ZoS z939oMWUJCtY_&XRRLji_C&6!`yCsSHIQj}Op-Lnl4|Hp&4(F9nhZ}UzH|QnKl5b-1 zN6^PZNt-xdqM(n-ys~m65o;|Y5@w5DOsjjMS4u#fGNktplhAWXo5v3~y8W|;a^a~4 zU2OTvbVRR}z_k=G5q-+8lh5O8tMAz^=(rSd68fQ^lte7OXUK>p0($lnf)jY`A=Ix| zfemXS3}?epeVR__oZGXK>So?GVkVgznM5ANsy|09>bkn!9cE2EUKigbl4 zZFuAe+;g=5RwlJDRlvim$n%V!Wj=|Xg}jSS(N%0zm0p3|b3jf_G-p|Z;#Z~5qqBF> zF}g@BT72ll)izX3`&?Bz>k#>SpqqEmue)j$y~Ku`DhwsZLQSGln)S7W?SnqPiw;fk zRm^K{;y%m^A3|kpmf&a}E9c7Vo&O#^6enl&ZPZNA=ME4rnA*?Q-x18jHWhp!F{9 sJW|B@=K$p%9a>tMosRfQyR(!31Nu%a?f+K$Pyhe`07*qoM6N<$f`T?mQ~&?~ literal 0 HcmV?d00001 diff --git a/testar/resources/jfx/logos/sogeti.png b/testar/resources/jfx/logos/sogeti.png new file mode 100644 index 0000000000000000000000000000000000000000..269c3d394af4575044bf0c21ca249700f94eadff GIT binary patch literal 1055 zcmV+)1mOFLP)V!cc}YY; zRCt`lnA>)&APhhSL@tWp|Nra(Ny2reUG1rpmsSF7NJ0p+EFY2GXl?e-u$Nu3DDp#i z!)`Ip(01<*R(;D%*N?!}%^Kh7#R%0cZCCeH#~C{MfufdWjh_k!9IO^-4zg~Pp+<01 z>#W0>maCddhlWlfZaQP`)+*U*^B~oYVMJIq*XzKn+u63BZ|RIrlyaNG8S@C2qb_UK zzS+&_3OlC7=?;G9fUA5LR`&2_M|h@>CQ1A3>4uiM(k8X%+rqgIIlO?NRr*x0zO%LZ@H`0I(@u18OAb<^XIJSqreR4IT5-Fo?8NdWq$-DigCGRl^u!T;B?}GO za{a^1mbNZ&wPk8iR#^EVcKn)tHt@YTtu@Au0YQhnOf7M*xZY9Z0gaz3UJ(m4m;mQ$<;17G+R+;V`rFp6_Pr27MuuI`T^lvU-vqp5Q^YSD}O20e Z_78C&8qASsG86y+002ovPDHLkV1ie?>Q(>% literal 0 HcmV?d00001 diff --git a/testar/resources/jfx/main.fxml b/testar/resources/jfx/main.fxml new file mode 100644 index 000000000..86be6f9b8 --- /dev/null +++ b/testar/resources/jfx/main.fxml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testar/resources/jfx/settings.fxml b/testar/resources/jfx/settings.fxml new file mode 100644 index 000000000..1bae1240a --- /dev/null +++ b/testar/resources/jfx/settings.fxml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testar/src/org/fruit/monkey/jfx/SettingsDialogJFX.java b/testar/src/org/fruit/monkey/jfx/SettingsDialogJFX.java new file mode 100644 index 000000000..502ac6e61 --- /dev/null +++ b/testar/src/org/fruit/monkey/jfx/SettingsDialogJFX.java @@ -0,0 +1,11 @@ +package org.fruit.monkey.jfx; + +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.scene.paint.Color; + +public class SettingsDialogJFX extends Scene { + public SettingsDialogJFX(Parent root) { + super(root); + } +} diff --git a/testar/src/org/testar/jfx/MainController.java b/testar/src/org/testar/jfx/MainController.java new file mode 100644 index 000000000..476978740 --- /dev/null +++ b/testar/src/org/testar/jfx/MainController.java @@ -0,0 +1,8 @@ +package org.testar.jfx; + +import javafx.scene.layout.Pane; + +public class MainController { + +// public void open +} diff --git a/testar/src/org/testar/monkey/Main.java b/testar/src/org/testar/monkey/Main.java index 2f8ebb103..6d9c07a8f 100644 --- a/testar/src/org/testar/monkey/Main.java +++ b/testar/src/org/testar/monkey/Main.java @@ -37,7 +37,14 @@ import org.testar.serialisation.TestSerialiser; import org.testar.monkey.alayer.Tag; -import javax.swing.*; +import javafx.application.Application; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.scene.control.ChoiceDialog; +import javafx.scene.layout.BorderPane; +import javafx.stage.Stage; + import java.io.*; import java.lang.reflect.InvocationTargetException; import java.net.MalformedURLException; @@ -56,7 +63,7 @@ import static org.testar.monkey.Util.compileProtocol; import static org.testar.monkey.ConfigTags.*; -public class Main { +public class Main extends Application { //public static final String TESTAR_DIR_PROPERTY = "DIRNAME"; //Use the OS environment to obtain TESTAR directory public static final String SETTINGS_FILE = "test.settings"; @@ -95,58 +102,83 @@ public static String getTestSettingsFile() { /** * Main method to run TESTAR - * + * * @param args * @throws IOException */ - public static void main(String[] args) throws IOException { + public static void main(String args[]) { + launch(args); + } + + @Override + public void start(Stage primaryStage) throws Exception { + + System.out.println("(0)"); isValidJavaEnvironment(); - + + System.out.println("(1)"); verifyTestarInitialDirectory(); - initTestarSSE(args); + System.out.println("(2)"); + initTestarSSE(getParameters()); + System.out.println("(3)"); String testSettingsFileName = getTestSettingsFile(); System.out.println("Test settings is <" + testSettingsFileName + ">"); - Settings settings = loadTestarSettings(args, testSettingsFileName); + System.out.println("(4)"); + Settings settings = loadTestarSettings(getParameters().getRaw(), testSettingsFileName); // Continuous Integration: If GUI is disabled TESTAR was executed from command line. // We only want to execute TESTAR one time with the selected settings. if(!settings.get(ConfigTags.ShowVisualSettingsDialogOnStartup)){ + System.out.println("(5)"); setTestarDirectory(settings); + System.out.println("(6)"); initCodingManager(settings); + System.out.println("(7)"); initOperatingSystem(); + System.out.println("(8)"); startTestar(settings); } //TESTAR GUI is enabled, we're going to show again the GUI when the selected protocol execution finishes else{ - while(startTestarDialog(settings, testSettingsFileName)) { + System.out.println("(9)"); + while(startTestarDialog(primaryStage, settings, testSettingsFileName)) { + System.out.println("(10)"); testSettingsFileName = getTestSettingsFile(); - settings = loadTestarSettings(args, testSettingsFileName); + settings = loadTestarSettings(getParameters().getRaw(), testSettingsFileName); + System.out.println("(11)"); setTestarDirectory(settings); + System.out.println("(12)"); initCodingManager(settings); + System.out.println("(13)"); initOperatingSystem(); + System.out.println("(14)"); startTestar(settings); } } + System.out.println("(15)"); TestSerialiser.exit(); + System.out.println("(16)"); ScreenshotSerialiser.exit(); + System.out.println("(17)"); LogSerialiser.exit(); - System.exit(0); +// System.out.println("(18)"); +// System.exit(0); } @@ -206,10 +238,10 @@ private static void setTestarDirectory(Settings settings) { /** * Find or create the .sse file, to known with what settings and protocol start TESTAR - * - * @param args + * + * @param parameters */ - private static void initTestarSSE(String[] args){ + private static void initTestarSSE(Parameters parameters){ Locale.setDefault(Locale.ENGLISH); @@ -218,16 +250,19 @@ private static void initTestarSSE(String[] args){ // and that there is exactly one. //Allow users to use command line to choose a protocol modifying sse file - for(String sett : args) { + System.out.println("[0]"); + for(String sett : parameters.getRaw()) { if(sett.toString().contains("sse=")) try { protocolFromCmd(sett); }catch(IOException e) {System.out.println("Error trying to modify sse from command line");} } + System.out.println("[1]"); String[] files = getSSE(); // If there is more than 1, then delete them all + System.out.println("[2]"); if (files != null && files.length > 1) { System.out.println("Too many *.sse files - exactly one expected!"); for (String f : files) { @@ -237,14 +272,18 @@ private static void initTestarSSE(String[] args){ } //If there is none, then start up a selection menu + System.out.println("[3]"); if (files == null || files.length == 0) { + System.out.println("[4]"); settingsSelection(); + System.out.println("[5]"); if (SSE_ACTIVATED == null) { System.exit(-1); } } else { //Use the only file that was found + System.out.println("[6]"); SSE_ACTIVATED = files[0].split(SUT_SETTINGS_EXT)[0]; } } @@ -268,22 +307,23 @@ private static void settingsSelection() { else { Object[] options = sutSettings.toArray(); Arrays.sort(options); - JFrame settingsSelectorDialog = new JFrame(); - settingsSelectorDialog.setAlwaysOnTop(true); - String sseSelected = (String) JOptionPane.showInputDialog(settingsSelectorDialog, - "Select the desired setting:", "TESTAR settings", JOptionPane.QUESTION_MESSAGE, null, options, options[0]); - if (sseSelected == null) { + ChoiceDialog settingsSelectorDialog = new ChoiceDialog(options[0], options); + settingsSelectorDialog.setTitle("TESTAR settings"); + settingsSelectorDialog.setContentText("Select the desired setting:"); + Optional sseSelected = settingsSelectorDialog.showAndWait(); + + if (!sseSelected.isPresent()) { SSE_ACTIVATED = null; return; } - final String sseFile = sseSelected + SUT_SETTINGS_EXT; + final String sseFile = sseSelected.get() + SUT_SETTINGS_EXT; try { File f = new File(settingsDir + File.separator + sseFile); if (f.createNewFile()) { - SSE_ACTIVATED = sseSelected; + SSE_ACTIVATED = sseSelected.get(); return; } } catch (IOException e) { @@ -302,7 +342,7 @@ private static void settingsSelection() { * @param testSettingsFileName * @return settings */ - private static Settings loadTestarSettings(String[] args, String testSettingsFileName){ + private static Settings loadTestarSettings(List args, String testSettingsFileName){ Settings settings = null; try { @@ -328,7 +368,44 @@ private static Settings loadTestarSettings(String[] args, String testSettingsFil * @param testSettingsFileName * @return true if users starts TESTAR, or false is users close TESTAR */ - public static boolean startTestarDialog(Settings settings, String testSettingsFileName) { + public static boolean startTestarDialog(Stage stage, Settings settings, String testSettingsFileName) { + + FXMLLoader loader = new FXMLLoader(Main.class.getClassLoader().getResource("jfx/main.fxml")); + try { + Parent root = loader.load(); + //TODO: set controller + Scene scene = new Scene(root); + + BorderPane mainPane = (BorderPane) scene.lookup("#main"); + if (mainPane == null) { + System.out.println("Main pane not found"); + } + else { + System.out.println("Main pane found"); + } + + FXMLLoader contentLoader = new FXMLLoader(Main.class.getClassLoader().getResource("jfx/dashboard.fxml")); + Parent contentRoot = contentLoader.load(); + mainPane.setCenter(contentRoot); + + stage.setTitle("Testar"); + stage.setScene(scene); + + stage.show(); + +// paneMain = (BorderPane) scene.lookup("#paneMain"); +// if (paneMain == null) { +// System.out.println("Main pane not found"); +// } +// else { +// System.out.println("Main pane found"); +// } + } catch (IOException e) { + e.printStackTrace(); + } + + if (true) return false; + // Start up the TESTAR Dialog try { if ((settings = new SettingsDialog().run(settings, testSettingsFileName)) == null) { @@ -350,6 +427,9 @@ public static boolean startTestarDialog(Settings settings, String testSettingsFi */ private static void startTestar(Settings settings) { + launch(); + if (true) return; + // Compile the Java protocols if AlwaysCompile setting is true if (settings.get(ConfigTags.AlwaysCompile)) { compileProtocol(Main.settingsDir, settings.get(ConfigTags.ProtocolClass), settings.get(ConfigTags.ProtocolCompileDirectory)); @@ -428,12 +508,12 @@ private static void startTestar(Settings settings) { /** * Load the default settings for all the configurable settings and add/overwrite with those from the file * This is needed because the user might not have set all the possible settings in the test.settings file. - * @param argv + * @param args * @param file * @return An instance of Settings * @throws ConfigException */ - public static Settings loadSettings(String[] argv, String file) throws ConfigException { + public static Settings loadSettings(List args, String file) throws ConfigException { Assert.notNull(file); try { List> defaults = new ArrayList>(); @@ -583,10 +663,13 @@ public static Settings loadSettings(String[] argv, String file) throws ConfigExc Settings settings = Settings.fromFile(defaults, file); //If user use command line to input properties, mix file settings with cmd properties - if(argv.length>0) { + + int size = args.size(); + if(size>0) { + String argArray[] = new String[size]; try { - settings = Settings.fromFileCmd(defaults, file, argv); - }catch(IOException e) { + settings = Settings.fromFileCmd(defaults, file, args.toArray(argArray)); + }catch(Exception e) { System.out.println("Error with command line properties. Examples:"); System.out.println("testar SUTConnectorValue=\"C:\\\\Windows\\\\System32\\\\notepad.exe\" Sequences=11 SequenceLength=12 SuspiciousTitle=.*aaa.*"); System.out.println("SUTConnectorValue=\" \"\"C:\\\\Program Files\\\\Internet Explorer\\\\iexplore.exe\"\" \"\"https://www.google.es\"\" \""); @@ -781,4 +864,25 @@ private static void initOperatingSystem() { Environment.setInstance(new UnknownEnvironment()); } } + +// @Override +// public void start(Stage primaryStage) throws Exception { +// Button btn = new Button(); +// btn.setText("Say 'Preved'"); +// btn.setOnAction(new EventHandler() { +// @Override +// public void handle(ActionEvent event) { +// System.out.println("Preved Medved!"); +// } +// }); +// +// StackPane root = new StackPane(); +// root.getChildren().add(btn); +// +// Scene scene = new Scene(root, 300, 250); +// +// primaryStage.setTitle("Preved Medved!"); +// primaryStage.setScene(scene); +// primaryStage.show(); +// } } diff --git a/testar/src/org/testar/settingsdialog/SettingsDialog.java b/testar/src/org/testar/settingsdialog/SettingsDialog.java index f8caeca21..638cf6e55 100644 --- a/testar/src/org/testar/settingsdialog/SettingsDialog.java +++ b/testar/src/org/testar/settingsdialog/SettingsDialog.java @@ -47,10 +47,7 @@ import java.awt.event.WindowEvent; import java.io.File; import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.Observable; -import java.util.Observer; +import java.util.*; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; @@ -213,7 +210,7 @@ private void switchSettings(String sutSettings) { new File(settingsDir + previousSSE).renameTo(new File(settingsDir + sse)); try { settingsFile = settingsDir + sutSettings + File.separator + Main.SETTINGS_FILE; - settings = Main.loadSettings(new String[0], settingsFile); + settings = Main.loadSettings(new ArrayList<>(), settingsFile); populateInformation(settings); System.out.println("Switched to <" + settingsFile + ">"); Main.SSE_ACTIVATED = sutSettings; From 05eed55800d8c203b50f5392598655303979ff43 Mon Sep 17 00:00:00 2001 From: Michael Tikhonenko Date: Tue, 17 Aug 2021 08:06:23 +0200 Subject: [PATCH 02/59] Dashboard screen and settings main menu basically implemented --- testar/resources/jfx/dashboard.fxml | 20 +--- testar/resources/jfx/main.fxml | 26 ++++- testar/resources/jfx/settings.fxml | 108 ++++++------------ testar/resources/jfx/settings_new.fxml | 56 +++++++++ .../src/nl/ou/testar/jfx/MainController.java | 66 +++++++++++ .../ou/testar/jfx/MainControllerDelegate.java | 7 ++ .../testar/jfx/core/NavigationController.java | 89 +++++++++++++++ .../testar/jfx/core/NavigationDelegate.java | 7 ++ .../nl/ou/testar/jfx/core/ViewController.java | 60 ++++++++++ .../jfx/dashboard/DashboardController.java | 9 ++ .../jfx/settings/SettingsController.java | 9 ++ testar/src/org/testar/jfx/MainController.java | 8 -- testar/src/org/testar/monkey/Main.java | 92 ++------------- 13 files changed, 382 insertions(+), 175 deletions(-) create mode 100644 testar/resources/jfx/settings_new.fxml create mode 100644 testar/src/nl/ou/testar/jfx/MainController.java create mode 100644 testar/src/nl/ou/testar/jfx/MainControllerDelegate.java create mode 100644 testar/src/nl/ou/testar/jfx/core/NavigationController.java create mode 100644 testar/src/nl/ou/testar/jfx/core/NavigationDelegate.java create mode 100644 testar/src/nl/ou/testar/jfx/core/ViewController.java create mode 100644 testar/src/nl/ou/testar/jfx/dashboard/DashboardController.java create mode 100644 testar/src/nl/ou/testar/jfx/settings/SettingsController.java delete mode 100644 testar/src/org/testar/jfx/MainController.java diff --git a/testar/resources/jfx/dashboard.fxml b/testar/resources/jfx/dashboard.fxml index 37f1cf43e..954744c93 100644 --- a/testar/resources/jfx/dashboard.fxml +++ b/testar/resources/jfx/dashboard.fxml @@ -8,19 +8,9 @@ - - + - - - - - - + @@ -69,7 +59,7 @@ - + @@ -88,7 +78,7 @@ - + - + diff --git a/testar/resources/jfx/main.fxml b/testar/resources/jfx/main.fxml index 86be6f9b8..d67b7fdb3 100644 --- a/testar/resources/jfx/main.fxml +++ b/testar/resources/jfx/main.fxml @@ -1,6 +1,7 @@ + @@ -16,7 +17,7 @@ - - + @@ -72,4 +73,25 @@ +
+ + + +
+ +
+
+
+
+
diff --git a/testar/resources/jfx/settings.fxml b/testar/resources/jfx/settings.fxml index 1bae1240a..18be1f2fa 100644 --- a/testar/resources/jfx/settings.fxml +++ b/testar/resources/jfx/settings.fxml @@ -1,79 +1,47 @@ - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - +
diff --git a/testar/resources/jfx/settings_new.fxml b/testar/resources/jfx/settings_new.fxml new file mode 100644 index 000000000..5ff90fa8c --- /dev/null +++ b/testar/resources/jfx/settings_new.fxml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testar/src/nl/ou/testar/jfx/MainController.java b/testar/src/nl/ou/testar/jfx/MainController.java new file mode 100644 index 000000000..d3a57f532 --- /dev/null +++ b/testar/src/nl/ou/testar/jfx/MainController.java @@ -0,0 +1,66 @@ +package nl.ou.testar.jfx; + +import javafx.scene.Parent; +import javafx.scene.layout.BorderPane; +import javafx.scene.layout.Pane; +import nl.ou.testar.jfx.core.NavigationDelegate; +import nl.ou.testar.jfx.core.ViewController; +import nl.ou.testar.jfx.dashboard.DashboardController; +import nl.ou.testar.jfx.settings.SettingsController; + +import javafx.scene.control.*; + +public class MainController extends ViewController { + + enum Mode { + HOME, SETTINGS + } + + private Mode mode; + + public MainController() { + super("Testar", "jfx/main.fxml"); + } + + private void setupMode(Parent view, Mode mode) { + if (mode != this.mode) { + final Label titleLabel = (Label) view.lookup("#titleLabel"); + final BorderPane contentPane = (BorderPane) view.lookup("#contentPane"); + ViewController targetController; + switch (mode) { + case SETTINGS: + targetController = new SettingsController(); + break; + default: //HOME + targetController = new DashboardController(); + break; + } + addChild(targetController, new NavigationDelegate() { + @Override + public void onViewControllerActivated(ViewController viewController, Parent view) { + titleLabel.setText(viewController.getTitle()); + contentPane.setCenter(view); +// contentPane.getChildren().removeAll(); +// contentPane.getChildren().add(view); + } + }); + this.mode = mode; + } + } + + @Override + public void viewDidLoad(Parent view) { + Button btnHome = (Button) view.lookup("#btnHome"); + Button btnSettings = (Button) view.lookup("#btnSettings"); + + btnHome.setOnAction(event -> { + setupMode(view, Mode.HOME); + }); + + btnSettings.setOnAction(event -> { + setupMode(view, Mode.SETTINGS); + }); + + setupMode(view, Mode.HOME); + } +} diff --git a/testar/src/nl/ou/testar/jfx/MainControllerDelegate.java b/testar/src/nl/ou/testar/jfx/MainControllerDelegate.java new file mode 100644 index 000000000..65c3338e6 --- /dev/null +++ b/testar/src/nl/ou/testar/jfx/MainControllerDelegate.java @@ -0,0 +1,7 @@ +package nl.ou.testar.jfx; + +import javafx.scene.Parent; + +public interface MainControllerDelegate { + void setContentView(Parent contentView); +} diff --git a/testar/src/nl/ou/testar/jfx/core/NavigationController.java b/testar/src/nl/ou/testar/jfx/core/NavigationController.java new file mode 100644 index 000000000..d839e5527 --- /dev/null +++ b/testar/src/nl/ou/testar/jfx/core/NavigationController.java @@ -0,0 +1,89 @@ +package nl.ou.testar.jfx.core; + +import javafx.scene.Parent; + +import java.io.IOException; +import java.util.Stack; + +public class NavigationController { + + private NavigationDelegate delegate; + private Stack viewControllerStack = new Stack<>(); + private ViewController currentViewController; + private ViewController rootViewController; + + public NavigationController(ViewController rootViewController) { + this.currentViewController = rootViewController; + this.rootViewController = rootViewController; + } + + public NavigationDelegate getDelegate() { + return delegate; + } + + void setDelegate(NavigationDelegate delegate) { + this.delegate = delegate; + } + + public void startWithDelegate(NavigationDelegate delegate) { + this.delegate = delegate; + try { + Parent view = currentViewController.obtainView(); + currentViewController.viewWillAppear(view); + delegate.onViewControllerActivated(currentViewController, view); + currentViewController.viewDidAppear(view); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public ViewController getRootViewController() { + return rootViewController; + } + + public ViewController getCurrentViewController() { + return currentViewController; + } + + public void navigateTo(ViewController viewController, Boolean pushToStack) { + //TODO: delegate shouldn't be nil + try { + Parent view = viewController.obtainView(); + ViewController previousViewController = currentViewController; + previousViewController.viewWillDisappear(); + if (pushToStack) { + viewControllerStack.push(currentViewController); + } + currentViewController = viewController; + + currentViewController.viewWillAppear(view); + delegate.onViewControllerActivated(currentViewController, view); + previousViewController.viewDidDisappear(); + currentViewController.viewDidAppear(view); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public ViewController navigateBack() throws UnsupportedOperationException { + if (currentViewController.equals(rootViewController)) { + throw new UnsupportedOperationException("No way back from the root view controller"); + } + + try { + Parent view = currentViewController.obtainView(); + ViewController redundantViewController = currentViewController; + redundantViewController.viewWillDisappear(); + currentViewController = viewControllerStack.pop(); + + currentViewController.viewWillAppear(view); + delegate.onViewControllerActivated(currentViewController, view); + redundantViewController.viewDidDisappear(); + currentViewController.viewDidAppear(view); + } catch (IOException e) { + e.printStackTrace(); + } + + return currentViewController; + } +} diff --git a/testar/src/nl/ou/testar/jfx/core/NavigationDelegate.java b/testar/src/nl/ou/testar/jfx/core/NavigationDelegate.java new file mode 100644 index 000000000..3b1f39bbd --- /dev/null +++ b/testar/src/nl/ou/testar/jfx/core/NavigationDelegate.java @@ -0,0 +1,7 @@ +package nl.ou.testar.jfx.core; + +import javafx.scene.Parent; + +public interface NavigationDelegate { + void onViewControllerActivated(ViewController viewController, Parent view); +} diff --git a/testar/src/nl/ou/testar/jfx/core/ViewController.java b/testar/src/nl/ou/testar/jfx/core/ViewController.java new file mode 100644 index 000000000..bd29bda8f --- /dev/null +++ b/testar/src/nl/ou/testar/jfx/core/ViewController.java @@ -0,0 +1,60 @@ +package nl.ou.testar.jfx.core; + +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; + +import java.io.IOException; +import java.lang.ref.WeakReference; + +public abstract class ViewController { + + private WeakReference viewReference = new WeakReference<>(null); + private String title; + private String resourcePath; + + public String getTitle() { + return title; + } + + public ViewController(String title, String resourcePath) { + this.title = title; + this.resourcePath = resourcePath; + } + + Parent obtainView() throws IOException { + Parent view = viewReference.get(); + if (view == null) { + FXMLLoader loader = new FXMLLoader(getClass().getClassLoader().getResource(resourcePath)); + view = loader.load(); + viewDidLoad(view); + } + viewReference = new WeakReference<>(view); + return view; + } + + public void viewDidLoad(Parent view) { + // To be overridden + } + + public void viewWillAppear(Parent view) { + // To be overridden + } + + public void viewDidAppear(Parent view) { + // To be overridden + } + + public void viewWillDisappear() { + // To be overridden + } + + public void viewDidDisappear() { + // to be overridden + } + + public NavigationController addChild(ViewController child, NavigationDelegate delegate) { + NavigationController navigationController = new NavigationController(child); + navigationController.startWithDelegate(delegate); + return navigationController; + } +} diff --git a/testar/src/nl/ou/testar/jfx/dashboard/DashboardController.java b/testar/src/nl/ou/testar/jfx/dashboard/DashboardController.java new file mode 100644 index 000000000..a104312c0 --- /dev/null +++ b/testar/src/nl/ou/testar/jfx/dashboard/DashboardController.java @@ -0,0 +1,9 @@ +package nl.ou.testar.jfx.dashboard; + +import nl.ou.testar.jfx.core.ViewController; + +public class DashboardController extends ViewController { + public DashboardController() { + super("Dashboard", "jfx/dashboard.fxml"); + } +} diff --git a/testar/src/nl/ou/testar/jfx/settings/SettingsController.java b/testar/src/nl/ou/testar/jfx/settings/SettingsController.java new file mode 100644 index 000000000..2fe352335 --- /dev/null +++ b/testar/src/nl/ou/testar/jfx/settings/SettingsController.java @@ -0,0 +1,9 @@ +package nl.ou.testar.jfx.settings; + +import nl.ou.testar.jfx.core.ViewController; + +public class SettingsController extends ViewController { + public SettingsController() { + super("Settings", "jfx/settings_new.fxml"); + } +} diff --git a/testar/src/org/testar/jfx/MainController.java b/testar/src/org/testar/jfx/MainController.java deleted file mode 100644 index 476978740..000000000 --- a/testar/src/org/testar/jfx/MainController.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.testar.jfx; - -import javafx.scene.layout.Pane; - -public class MainController { - -// public void open -} diff --git a/testar/src/org/testar/monkey/Main.java b/testar/src/org/testar/monkey/Main.java index 6d9c07a8f..333c369fb 100644 --- a/testar/src/org/testar/monkey/Main.java +++ b/testar/src/org/testar/monkey/Main.java @@ -38,12 +38,14 @@ import org.testar.monkey.alayer.Tag; import javafx.application.Application; -import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.ChoiceDialog; -import javafx.scene.layout.BorderPane; import javafx.stage.Stage; +import nl.ou.testar.jfx.MainController; +import nl.ou.testar.jfx.core.NavigationController; +import nl.ou.testar.jfx.core.NavigationDelegate; +import nl.ou.testar.jfx.core.ViewController; import java.io.*; import java.lang.reflect.InvocationTargetException; @@ -76,7 +78,6 @@ public class Main extends Application { public static String outputDir = testarDir + "output" + File.separator; public static String tempDir = outputDir + "temp" + File.separator; - /** * This method scans the settings directory of TESTAR for a file that end with extension SUT_SETTINGS_EXT * @return A list of file names that have extension SUT_SETTINGS_EXT @@ -114,16 +115,12 @@ public static void main(String args[]) { @Override public void start(Stage primaryStage) throws Exception { - System.out.println("(0)"); isValidJavaEnvironment(); - System.out.println("(1)"); verifyTestarInitialDirectory(); - System.out.println("(2)"); initTestarSSE(getParameters()); - System.out.println("(3)"); String testSettingsFileName = getTestSettingsFile(); System.out.println("Test settings is <" + testSettingsFileName + ">"); @@ -134,47 +131,34 @@ public void start(Stage primaryStage) throws Exception { // We only want to execute TESTAR one time with the selected settings. if(!settings.get(ConfigTags.ShowVisualSettingsDialogOnStartup)){ - System.out.println("(5)"); setTestarDirectory(settings); - System.out.println("(6)"); initCodingManager(settings); - System.out.println("(7)"); initOperatingSystem(); - System.out.println("(8)"); startTestar(settings); } //TESTAR GUI is enabled, we're going to show again the GUI when the selected protocol execution finishes else{ - System.out.println("(9)"); while(startTestarDialog(primaryStage, settings, testSettingsFileName)) { - System.out.println("(10)"); testSettingsFileName = getTestSettingsFile(); settings = loadTestarSettings(getParameters().getRaw(), testSettingsFileName); - System.out.println("(11)"); setTestarDirectory(settings); - System.out.println("(12)"); initCodingManager(settings); - System.out.println("(13)"); initOperatingSystem(); - System.out.println("(14)"); startTestar(settings); } } - System.out.println("(15)"); TestSerialiser.exit(); - System.out.println("(16)"); ScreenshotSerialiser.exit(); - System.out.println("(17)"); LogSerialiser.exit(); // System.out.println("(18)"); @@ -250,7 +234,6 @@ private static void initTestarSSE(Parameters parameters){ // and that there is exactly one. //Allow users to use command line to choose a protocol modifying sse file - System.out.println("[0]"); for(String sett : parameters.getRaw()) { if(sett.toString().contains("sse=")) try { @@ -258,11 +241,9 @@ private static void initTestarSSE(Parameters parameters){ }catch(IOException e) {System.out.println("Error trying to modify sse from command line");} } - System.out.println("[1]"); String[] files = getSSE(); // If there is more than 1, then delete them all - System.out.println("[2]"); if (files != null && files.length > 1) { System.out.println("Too many *.sse files - exactly one expected!"); for (String f : files) { @@ -272,18 +253,14 @@ private static void initTestarSSE(Parameters parameters){ } //If there is none, then start up a selection menu - System.out.println("[3]"); if (files == null || files.length == 0) { - System.out.println("[4]"); settingsSelection(); - System.out.println("[5]"); if (SSE_ACTIVATED == null) { System.exit(-1); } } else { //Use the only file that was found - System.out.println("[6]"); SSE_ACTIVATED = files[0].split(SUT_SETTINGS_EXT)[0]; } } @@ -370,39 +347,15 @@ private static Settings loadTestarSettings(List args, String testSetting */ public static boolean startTestarDialog(Stage stage, Settings settings, String testSettingsFileName) { - FXMLLoader loader = new FXMLLoader(Main.class.getClassLoader().getResource("jfx/main.fxml")); - try { - Parent root = loader.load(); - //TODO: set controller - Scene scene = new Scene(root); - - BorderPane mainPane = (BorderPane) scene.lookup("#main"); - if (mainPane == null) { - System.out.println("Main pane not found"); - } - else { - System.out.println("Main pane found"); + NavigationController navigationController = new NavigationController(new MainController()); + navigationController.startWithDelegate(new NavigationDelegate() { + @Override + public void onViewControllerActivated(ViewController viewController, Parent view) { + stage.setTitle(viewController.getTitle()); + stage.setScene(new Scene(view)); + stage.show(); } - - FXMLLoader contentLoader = new FXMLLoader(Main.class.getClassLoader().getResource("jfx/dashboard.fxml")); - Parent contentRoot = contentLoader.load(); - mainPane.setCenter(contentRoot); - - stage.setTitle("Testar"); - stage.setScene(scene); - - stage.show(); - -// paneMain = (BorderPane) scene.lookup("#paneMain"); -// if (paneMain == null) { -// System.out.println("Main pane not found"); -// } -// else { -// System.out.println("Main pane found"); -// } - } catch (IOException e) { - e.printStackTrace(); - } + }); if (true) return false; @@ -864,25 +817,4 @@ private static void initOperatingSystem() { Environment.setInstance(new UnknownEnvironment()); } } - -// @Override -// public void start(Stage primaryStage) throws Exception { -// Button btn = new Button(); -// btn.setText("Say 'Preved'"); -// btn.setOnAction(new EventHandler() { -// @Override -// public void handle(ActionEvent event) { -// System.out.println("Preved Medved!"); -// } -// }); -// -// StackPane root = new StackPane(); -// root.getChildren().add(btn); -// -// Scene scene = new Scene(root, 300, 250); -// -// primaryStage.setTitle("Preved Medved!"); -// primaryStage.setScene(scene); -// primaryStage.show(); -// } } From d7ec84e7c13d05ddf8d184dcab846c8c7f40e30e Mon Sep 17 00:00:00 2001 From: Michael Tikhonenko Date: Wed, 4 Aug 2021 18:27:37 +0200 Subject: [PATCH 03/59] JavaFX migration in progress --- .../jfx/icons/settings_white_24dp.svg | 1 + testar/src/org/testar/monkey/Main.java | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 testar/resources/jfx/icons/settings_white_24dp.svg diff --git a/testar/resources/jfx/icons/settings_white_24dp.svg b/testar/resources/jfx/icons/settings_white_24dp.svg new file mode 100644 index 000000000..7074fa8ba --- /dev/null +++ b/testar/resources/jfx/icons/settings_white_24dp.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testar/src/org/testar/monkey/Main.java b/testar/src/org/testar/monkey/Main.java index 333c369fb..eedf1b662 100644 --- a/testar/src/org/testar/monkey/Main.java +++ b/testar/src/org/testar/monkey/Main.java @@ -47,6 +47,7 @@ import nl.ou.testar.jfx.core.NavigationDelegate; import nl.ou.testar.jfx.core.ViewController; +import javafx.fxml.FXMLLoader; import java.io.*; import java.lang.reflect.InvocationTargetException; import java.net.MalformedURLException; @@ -115,12 +116,16 @@ public static void main(String args[]) { @Override public void start(Stage primaryStage) throws Exception { + System.out.println("(0)"); isValidJavaEnvironment(); + System.out.println("(1)"); verifyTestarInitialDirectory(); + System.out.println("(2)"); initTestarSSE(getParameters()); + System.out.println("(3)"); String testSettingsFileName = getTestSettingsFile(); System.out.println("Test settings is <" + testSettingsFileName + ">"); @@ -131,34 +136,47 @@ public void start(Stage primaryStage) throws Exception { // We only want to execute TESTAR one time with the selected settings. if(!settings.get(ConfigTags.ShowVisualSettingsDialogOnStartup)){ + System.out.println("(5)"); setTestarDirectory(settings); + System.out.println("(6)"); initCodingManager(settings); + System.out.println("(7)"); initOperatingSystem(); + System.out.println("(8)"); startTestar(settings); } //TESTAR GUI is enabled, we're going to show again the GUI when the selected protocol execution finishes else{ + System.out.println("(9)"); while(startTestarDialog(primaryStage, settings, testSettingsFileName)) { + System.out.println("(10)"); testSettingsFileName = getTestSettingsFile(); settings = loadTestarSettings(getParameters().getRaw(), testSettingsFileName); + System.out.println("(11)"); setTestarDirectory(settings); + System.out.println("(12)"); initCodingManager(settings); + System.out.println("(13)"); initOperatingSystem(); + System.out.println("(14)"); startTestar(settings); } } + System.out.println("(15)"); TestSerialiser.exit(); + System.out.println("(16)"); ScreenshotSerialiser.exit(); + System.out.println("(17)"); LogSerialiser.exit(); // System.out.println("(18)"); @@ -234,6 +252,7 @@ private static void initTestarSSE(Parameters parameters){ // and that there is exactly one. //Allow users to use command line to choose a protocol modifying sse file + System.out.println("[0]"); for(String sett : parameters.getRaw()) { if(sett.toString().contains("sse=")) try { @@ -241,9 +260,11 @@ private static void initTestarSSE(Parameters parameters){ }catch(IOException e) {System.out.println("Error trying to modify sse from command line");} } + System.out.println("[1]"); String[] files = getSSE(); // If there is more than 1, then delete them all + System.out.println("[2]"); if (files != null && files.length > 1) { System.out.println("Too many *.sse files - exactly one expected!"); for (String f : files) { @@ -253,14 +274,18 @@ private static void initTestarSSE(Parameters parameters){ } //If there is none, then start up a selection menu + System.out.println("[3]"); if (files == null || files.length == 0) { + System.out.println("[4]"); settingsSelection(); + System.out.println("[5]"); if (SSE_ACTIVATED == null) { System.exit(-1); } } else { //Use the only file that was found + System.out.println("[6]"); SSE_ACTIVATED = files[0].split(SUT_SETTINGS_EXT)[0]; } } @@ -817,4 +842,25 @@ private static void initOperatingSystem() { Environment.setInstance(new UnknownEnvironment()); } } + +// @Override +// public void start(Stage primaryStage) throws Exception { +// Button btn = new Button(); +// btn.setText("Say 'Preved'"); +// btn.setOnAction(new EventHandler() { +// @Override +// public void handle(ActionEvent event) { +// System.out.println("Preved Medved!"); +// } +// }); +// +// StackPane root = new StackPane(); +// root.getChildren().add(btn); +// +// Scene scene = new Scene(root, 300, 250); +// +// primaryStage.setTitle("Preved Medved!"); +// primaryStage.setScene(scene); +// primaryStage.show(); +// } } From 1caaf12c44aa91a6d548eeb04b79bbf0d73a585c Mon Sep 17 00:00:00 2001 From: Michael Tikhonenko Date: Tue, 17 Aug 2021 12:50:32 +0200 Subject: [PATCH 04/59] Settings navigation implemented (work in progress) --- testar/resources/jfx/main.fxml | 16 +++++- testar/resources/jfx/settings_new.fxml | 10 ++-- .../src/nl/ou/testar/jfx/MainController.java | 12 +++- .../testar/jfx/core/NavigationController.java | 9 ++- .../nl/ou/testar/jfx/core/ViewController.java | 16 ++++-- .../settings/FilterSettingsController.java | 9 +++ .../settings/GeneralSettingsController.java | 9 +++ .../jfx/settings/MiscSettingsController.java | 9 +++ .../jfx/settings/SettingsController.java | 27 +++++++++ .../jfx/settings/StateSettingsController.java | 9 +++ .../jfx/settings/TimeSettingsController.java | 9 +++ testar/src/org/testar/monkey/Main.java | 56 +++---------------- 12 files changed, 129 insertions(+), 62 deletions(-) create mode 100644 testar/src/nl/ou/testar/jfx/settings/FilterSettingsController.java create mode 100644 testar/src/nl/ou/testar/jfx/settings/GeneralSettingsController.java create mode 100644 testar/src/nl/ou/testar/jfx/settings/MiscSettingsController.java create mode 100644 testar/src/nl/ou/testar/jfx/settings/StateSettingsController.java create mode 100644 testar/src/nl/ou/testar/jfx/settings/TimeSettingsController.java diff --git a/testar/resources/jfx/main.fxml b/testar/resources/jfx/main.fxml index d67b7fdb3..1c97186ec 100644 --- a/testar/resources/jfx/main.fxml +++ b/testar/resources/jfx/main.fxml @@ -78,7 +78,7 @@
-
+ + + + + + + + + + + + + +
diff --git a/testar/resources/jfx/settings_new.fxml b/testar/resources/jfx/settings_new.fxml index 5ff90fa8c..8f9a9d89b 100644 --- a/testar/resources/jfx/settings_new.fxml +++ b/testar/resources/jfx/settings_new.fxml @@ -7,7 +7,7 @@ - + @@ -16,7 +16,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -34,7 +34,7 @@ - + @@ -43,7 +43,7 @@ - + diff --git a/testar/src/nl/ou/testar/jfx/MainController.java b/testar/src/nl/ou/testar/jfx/MainController.java index d3a57f532..4651a049b 100644 --- a/testar/src/nl/ou/testar/jfx/MainController.java +++ b/testar/src/nl/ou/testar/jfx/MainController.java @@ -3,6 +3,7 @@ import javafx.scene.Parent; import javafx.scene.layout.BorderPane; import javafx.scene.layout.Pane; +import nl.ou.testar.jfx.core.NavigationController; import nl.ou.testar.jfx.core.NavigationDelegate; import nl.ou.testar.jfx.core.ViewController; import nl.ou.testar.jfx.dashboard.DashboardController; @@ -25,6 +26,8 @@ public MainController() { private void setupMode(Parent view, Mode mode) { if (mode != this.mode) { final Label titleLabel = (Label) view.lookup("#titleLabel"); + final Button btnBack = (Button) view.lookup("#btnBack"); + final BorderPane contentPane = (BorderPane) view.lookup("#contentPane"); ViewController targetController; switch (mode) { @@ -35,15 +38,22 @@ private void setupMode(Parent view, Mode mode) { targetController = new DashboardController(); break; } - addChild(targetController, new NavigationDelegate() { + final NavigationController navigationController = new NavigationController(targetController); + navigationController.startWithDelegate(new NavigationDelegate() { @Override public void onViewControllerActivated(ViewController viewController, Parent view) { titleLabel.setText(viewController.getTitle()); contentPane.setCenter(view); + btnBack.setVisible(navigationController.isBackAvailable()); // contentPane.getChildren().removeAll(); // contentPane.getChildren().add(view); } }); + + btnBack.setOnAction(event -> { + navigationController.navigateBack(); + }); + this.mode = mode; } } diff --git a/testar/src/nl/ou/testar/jfx/core/NavigationController.java b/testar/src/nl/ou/testar/jfx/core/NavigationController.java index d839e5527..8e5ee20cd 100644 --- a/testar/src/nl/ou/testar/jfx/core/NavigationController.java +++ b/testar/src/nl/ou/testar/jfx/core/NavigationController.java @@ -15,6 +15,7 @@ public class NavigationController { public NavigationController(ViewController rootViewController) { this.currentViewController = rootViewController; this.rootViewController = rootViewController; + rootViewController.setNavigationController(this); } public NavigationDelegate getDelegate() { @@ -55,6 +56,7 @@ public void navigateTo(ViewController viewController, Boolean pushToStack) { viewControllerStack.push(currentViewController); } currentViewController = viewController; + viewController.setNavigationController(this); currentViewController.viewWillAppear(view); delegate.onViewControllerActivated(currentViewController, view); @@ -65,17 +67,22 @@ public void navigateTo(ViewController viewController, Boolean pushToStack) { } } + public boolean isBackAvailable() { + return !currentViewController.equals(rootViewController); + } + public ViewController navigateBack() throws UnsupportedOperationException { if (currentViewController.equals(rootViewController)) { throw new UnsupportedOperationException("No way back from the root view controller"); } try { - Parent view = currentViewController.obtainView(); ViewController redundantViewController = currentViewController; redundantViewController.viewWillDisappear(); + currentViewController = viewControllerStack.pop(); + Parent view = currentViewController.obtainView(); currentViewController.viewWillAppear(view); delegate.onViewControllerActivated(currentViewController, view); redundantViewController.viewDidDisappear(); diff --git a/testar/src/nl/ou/testar/jfx/core/ViewController.java b/testar/src/nl/ou/testar/jfx/core/ViewController.java index bd29bda8f..8372779fe 100644 --- a/testar/src/nl/ou/testar/jfx/core/ViewController.java +++ b/testar/src/nl/ou/testar/jfx/core/ViewController.java @@ -12,10 +12,20 @@ public abstract class ViewController { private String title; private String resourcePath; + private NavigationController navigationController; + public String getTitle() { return title; } + public NavigationController getNavigationController() { + return navigationController; + } + + public void setNavigationController(NavigationController navigationController) { + this.navigationController = navigationController; + } + public ViewController(String title, String resourcePath) { this.title = title; this.resourcePath = resourcePath; @@ -51,10 +61,4 @@ public void viewWillDisappear() { public void viewDidDisappear() { // to be overridden } - - public NavigationController addChild(ViewController child, NavigationDelegate delegate) { - NavigationController navigationController = new NavigationController(child); - navigationController.startWithDelegate(delegate); - return navigationController; - } } diff --git a/testar/src/nl/ou/testar/jfx/settings/FilterSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/FilterSettingsController.java new file mode 100644 index 000000000..f960c18c4 --- /dev/null +++ b/testar/src/nl/ou/testar/jfx/settings/FilterSettingsController.java @@ -0,0 +1,9 @@ +package nl.ou.testar.jfx.settings; + +import nl.ou.testar.jfx.core.ViewController; + +public class FilterSettingsController extends ViewController { + public FilterSettingsController() { + super("Filters & oracles", "jfx/settings_filter.fxml"); + } +} diff --git a/testar/src/nl/ou/testar/jfx/settings/GeneralSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/GeneralSettingsController.java new file mode 100644 index 000000000..c11d769be --- /dev/null +++ b/testar/src/nl/ou/testar/jfx/settings/GeneralSettingsController.java @@ -0,0 +1,9 @@ +package nl.ou.testar.jfx.settings; + +import nl.ou.testar.jfx.core.ViewController; + +public class GeneralSettingsController extends ViewController { + public GeneralSettingsController() { + super("General settings", "jfx/settings_general.fxml"); + } +} diff --git a/testar/src/nl/ou/testar/jfx/settings/MiscSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/MiscSettingsController.java new file mode 100644 index 000000000..fbad62151 --- /dev/null +++ b/testar/src/nl/ou/testar/jfx/settings/MiscSettingsController.java @@ -0,0 +1,9 @@ +package nl.ou.testar.jfx.settings; + +import nl.ou.testar.jfx.core.ViewController; + +public class MiscSettingsController extends ViewController { + public MiscSettingsController() { + super("Misc", "jfx/settings_misc.fxml"); + } +} diff --git a/testar/src/nl/ou/testar/jfx/settings/SettingsController.java b/testar/src/nl/ou/testar/jfx/settings/SettingsController.java index 2fe352335..cc783020e 100644 --- a/testar/src/nl/ou/testar/jfx/settings/SettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/SettingsController.java @@ -1,9 +1,36 @@ package nl.ou.testar.jfx.settings; +import javafx.scene.Parent; +import javafx.scene.control.Button; import nl.ou.testar.jfx.core.ViewController; public class SettingsController extends ViewController { public SettingsController() { super("Settings", "jfx/settings_new.fxml"); } + + @Override + public void viewDidLoad(Parent view) { + Button btnGeneral = (Button) view.lookup("#btnGeneral"); + Button btnFilters = (Button) view.lookup("#btnFilters"); + Button btnTime = (Button) view.lookup("#btnTime"); + Button btnMisc = (Button) view.lookup("#btnMisc"); + Button btnState = (Button) view.lookup("#btnState"); + + btnGeneral.setOnAction(event -> { + getNavigationController().navigateTo(new GeneralSettingsController(), true); + }); + btnFilters.setOnAction(event -> { + getNavigationController().navigateTo(new FilterSettingsController(), true); + }); + btnTime.setOnAction(event -> { + getNavigationController().navigateTo(new TimeSettingsController(), true); + }); + btnMisc.setOnAction(event -> { + getNavigationController().navigateTo(new MiscSettingsController(), true); + }); + btnState.setOnAction(event -> { + getNavigationController().navigateTo(new StateSettingsController(), true); + }); + } } diff --git a/testar/src/nl/ou/testar/jfx/settings/StateSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/StateSettingsController.java new file mode 100644 index 000000000..d8c521656 --- /dev/null +++ b/testar/src/nl/ou/testar/jfx/settings/StateSettingsController.java @@ -0,0 +1,9 @@ +package nl.ou.testar.jfx.settings; + +import nl.ou.testar.jfx.core.ViewController; + +public class StateSettingsController extends ViewController { + public StateSettingsController() { + super("State model", "jfx/settings_state.fxml"); + } +} diff --git a/testar/src/nl/ou/testar/jfx/settings/TimeSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/TimeSettingsController.java new file mode 100644 index 000000000..1c43df9b1 --- /dev/null +++ b/testar/src/nl/ou/testar/jfx/settings/TimeSettingsController.java @@ -0,0 +1,9 @@ +package nl.ou.testar.jfx.settings; + +import nl.ou.testar.jfx.core.ViewController; + +public class TimeSettingsController extends ViewController { + public TimeSettingsController() { + super("Time settings", "jfx/settings_time.fxml"); + } +} diff --git a/testar/src/org/testar/monkey/Main.java b/testar/src/org/testar/monkey/Main.java index eedf1b662..ed1517598 100644 --- a/testar/src/org/testar/monkey/Main.java +++ b/testar/src/org/testar/monkey/Main.java @@ -47,7 +47,6 @@ import nl.ou.testar.jfx.core.NavigationDelegate; import nl.ou.testar.jfx.core.ViewController; -import javafx.fxml.FXMLLoader; import java.io.*; import java.lang.reflect.InvocationTargetException; import java.net.MalformedURLException; @@ -95,7 +94,7 @@ public boolean accept(File dir, String name) { /** * According to the TESTAR directory and SSE file (settings and protocol to run) * return the path of the selected settings - * + * * @return test.settings path */ public static String getTestSettingsFile() { @@ -136,16 +135,12 @@ public void start(Stage primaryStage) throws Exception { // We only want to execute TESTAR one time with the selected settings. if(!settings.get(ConfigTags.ShowVisualSettingsDialogOnStartup)){ - System.out.println("(5)"); setTestarDirectory(settings); - System.out.println("(6)"); initCodingManager(settings); - System.out.println("(7)"); initOperatingSystem(); - System.out.println("(8)"); startTestar(settings); } @@ -154,29 +149,21 @@ public void start(Stage primaryStage) throws Exception { System.out.println("(9)"); while(startTestarDialog(primaryStage, settings, testSettingsFileName)) { - System.out.println("(10)"); testSettingsFileName = getTestSettingsFile(); settings = loadTestarSettings(getParameters().getRaw(), testSettingsFileName); - System.out.println("(11)"); setTestarDirectory(settings); - System.out.println("(12)"); initCodingManager(settings); - System.out.println("(13)"); initOperatingSystem(); - System.out.println("(14)"); startTestar(settings); } } - System.out.println("(15)"); TestSerialiser.exit(); - System.out.println("(16)"); ScreenshotSerialiser.exit(); - System.out.println("(17)"); LogSerialiser.exit(); // System.out.println("(18)"); @@ -199,7 +186,7 @@ private static boolean isValidJavaEnvironment() { return true; } - + /** * Verify the initial directory of TESTAR * If this directory didn't contain testar.bat file inform the user @@ -260,11 +247,9 @@ private static void initTestarSSE(Parameters parameters){ }catch(IOException e) {System.out.println("Error trying to modify sse from command line");} } - System.out.println("[1]"); String[] files = getSSE(); // If there is more than 1, then delete them all - System.out.println("[2]"); if (files != null && files.length > 1) { System.out.println("Too many *.sse files - exactly one expected!"); for (String f : files) { @@ -274,18 +259,14 @@ private static void initTestarSSE(Parameters parameters){ } //If there is none, then start up a selection menu - System.out.println("[3]"); if (files == null || files.length == 0) { - System.out.println("[4]"); settingsSelection(); - System.out.println("[5]"); if (SSE_ACTIVATED == null) { System.exit(-1); } } else { //Use the only file that was found - System.out.println("[6]"); SSE_ACTIVATED = files[0].split(SUT_SETTINGS_EXT)[0]; } } @@ -339,7 +320,7 @@ private static void settingsSelection() { //TODO: After know what overrideWithUserProperties does, unify this method with loadSettings /** * Load the settings of the selected test.settings file - * + * * @param args * @param testSettingsFileName * @return settings @@ -365,7 +346,7 @@ private static Settings loadTestarSettings(List args, String testSetting /** * Open TESTAR GUI to allow the users modify the settings and the protocol with which the want run TESTAR - * + * * @param settings * @param testSettingsFileName * @return true if users starts TESTAR, or false is users close TESTAR @@ -398,9 +379,9 @@ public void onViewControllerActivated(ViewController viewController, Parent view /** * Start TESTAR protocol with the selected settings - * + * * This method get the specific protocol class of the selected settings to run TESTAR - * + * * @param settings */ private static void startTestar(Settings settings) { @@ -677,7 +658,7 @@ public static Settings loadSettings(List args, String file) throws Confi /** * This method creates a sse file to change TESTAR protocol if sett param matches an existing protocol * @param sett - * @throws IOException + * @throws IOException */ public static void protocolFromCmd(String sett) throws IOException { String sseName = sett.substring(sett.indexOf("=")+1); @@ -698,7 +679,7 @@ public static void protocolFromCmd(String sett) throws IOException { //Obtain previous sse file and delete it (if exist) String[] files = getSSE(); if (files != null) { - for (String f : files) + for (String f : files) new File(settingsDir+f).delete(); } @@ -842,25 +823,4 @@ private static void initOperatingSystem() { Environment.setInstance(new UnknownEnvironment()); } } - -// @Override -// public void start(Stage primaryStage) throws Exception { -// Button btn = new Button(); -// btn.setText("Say 'Preved'"); -// btn.setOnAction(new EventHandler() { -// @Override -// public void handle(ActionEvent event) { -// System.out.println("Preved Medved!"); -// } -// }); -// -// StackPane root = new StackPane(); -// root.getChildren().add(btn); -// -// Scene scene = new Scene(root, 300, 250); -// -// primaryStage.setTitle("Preved Medved!"); -// primaryStage.setScene(scene); -// primaryStage.show(); -// } } From 30d062b058ee7798f3ec671a2f8bd6146112ad37 Mon Sep 17 00:00:00 2001 From: Michael Tikhonenko Date: Mon, 23 Aug 2021 06:49:21 +0200 Subject: [PATCH 05/59] Dashboard and Settings are basically here, continue with Settings details --- .../nl/ou/testar/jfx/core/ViewController.java | 2 +- .../settings/FilterSettingsController.java | 9 ----- .../jfx/settings/SettingsController.java | 1 + .../child/ChildSettingsController.java | 38 +++++++++++++++++++ .../child/FilterSettingsController.java | 9 +++++ 5 files changed, 49 insertions(+), 10 deletions(-) delete mode 100644 testar/src/nl/ou/testar/jfx/settings/FilterSettingsController.java create mode 100644 testar/src/nl/ou/testar/jfx/settings/child/ChildSettingsController.java create mode 100644 testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java diff --git a/testar/src/nl/ou/testar/jfx/core/ViewController.java b/testar/src/nl/ou/testar/jfx/core/ViewController.java index 8372779fe..90af9ecdc 100644 --- a/testar/src/nl/ou/testar/jfx/core/ViewController.java +++ b/testar/src/nl/ou/testar/jfx/core/ViewController.java @@ -31,7 +31,7 @@ public ViewController(String title, String resourcePath) { this.resourcePath = resourcePath; } - Parent obtainView() throws IOException { + public Parent obtainView() throws IOException { Parent view = viewReference.get(); if (view == null) { FXMLLoader loader = new FXMLLoader(getClass().getClassLoader().getResource(resourcePath)); diff --git a/testar/src/nl/ou/testar/jfx/settings/FilterSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/FilterSettingsController.java deleted file mode 100644 index f960c18c4..000000000 --- a/testar/src/nl/ou/testar/jfx/settings/FilterSettingsController.java +++ /dev/null @@ -1,9 +0,0 @@ -package nl.ou.testar.jfx.settings; - -import nl.ou.testar.jfx.core.ViewController; - -public class FilterSettingsController extends ViewController { - public FilterSettingsController() { - super("Filters & oracles", "jfx/settings_filter.fxml"); - } -} diff --git a/testar/src/nl/ou/testar/jfx/settings/SettingsController.java b/testar/src/nl/ou/testar/jfx/settings/SettingsController.java index cc783020e..73d9affcd 100644 --- a/testar/src/nl/ou/testar/jfx/settings/SettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/SettingsController.java @@ -3,6 +3,7 @@ import javafx.scene.Parent; import javafx.scene.control.Button; import nl.ou.testar.jfx.core.ViewController; +import nl.ou.testar.jfx.settings.child.FilterSettingsController; public class SettingsController extends ViewController { public SettingsController() { diff --git a/testar/src/nl/ou/testar/jfx/settings/child/ChildSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/ChildSettingsController.java new file mode 100644 index 000000000..c75370277 --- /dev/null +++ b/testar/src/nl/ou/testar/jfx/settings/child/ChildSettingsController.java @@ -0,0 +1,38 @@ +package nl.ou.testar.jfx.settings.child; + +import javafx.collections.ObservableList; +import javafx.fxml.FXMLLoader; +import javafx.scene.Node; +import javafx.scene.Parent; +import javafx.scene.layout.VBox; +import nl.ou.testar.jfx.core.ViewController; + +import java.io.IOException; + +public class ChildSettingsController extends ViewController { + + private String contentResourcePath; + + public ChildSettingsController(String title, String resourcePath) { + super(title, "jfx/settings_child.fxml"); + this.contentResourcePath = resourcePath; + } + + @Override + public Parent obtainView() throws IOException { + Parent view = super.obtainView(); + VBox contentBox = (VBox) view.lookup("#contentBox"); + ObservableList children = contentBox.getChildren(); + if (children.size() == 0) { + FXMLLoader loader = new FXMLLoader(getClass().getClassLoader().getResource(contentResourcePath)); + Parent contentView = loader.load(); + children.add(contentView); + contentViewDidLoad(contentView); + } + return view; + } + + public void contentViewDidLoad(Parent contentView) { + //To be overriden + } +} diff --git a/testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java new file mode 100644 index 000000000..704abf8ca --- /dev/null +++ b/testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java @@ -0,0 +1,9 @@ +package nl.ou.testar.jfx.settings.child; + +import nl.ou.testar.jfx.core.ViewController; + +public class FilterSettingsController extends ChildSettingsController { + public FilterSettingsController() { + super("Filters & oracles", "jfx/settings_general.fxml"); + } +} From 570138ed155380a2c81d50b2d05c89071d0ab545 Mon Sep 17 00:00:00 2001 From: Michael Tikhonenko Date: Mon, 23 Aug 2021 11:40:05 +0200 Subject: [PATCH 06/59] Filter settings UI draftly implemented --- testar/resources/jfx/icons/add.png | Bin 0 -> 250 bytes testar/resources/jfx/icons/attach.png | Bin 0 -> 281 bytes testar/resources/jfx/icons/back.png | Bin 0 -> 182 bytes testar/resources/jfx/icons/close.png | Bin 0 -> 142 bytes testar/resources/jfx/icons/filter.png | Bin 0 -> 756 bytes testar/resources/jfx/icons/general.png | Bin 0 -> 777 bytes testar/resources/jfx/icons/info.png | Bin 0 -> 304 bytes testar/resources/jfx/icons/misc.png | Bin 0 -> 1361 bytes testar/resources/jfx/icons/state.png | Bin 0 -> 910 bytes testar/resources/jfx/icons/time.png | Bin 0 -> 1134 bytes testar/resources/jfx/settings_child.fxml | 22 +++ testar/resources/jfx/settings_filter.fxml | 101 ++++++++++++ testar/resources/jfx/settings_general.fxml | 154 ++++++++++++++++++ testar/resources/jfx/settings_misc.fxml | 15 ++ testar/resources/jfx/settings_state.fxml | 15 ++ testar/resources/jfx/settings_time.fxml | 15 ++ testar/resources/logos/ing.png | Bin 0 -> 1344 bytes testar/resources/logos/marviq.png | Bin 0 -> 941 bytes testar/resources/logos/open_university.png | Bin 0 -> 1319 bytes testar/resources/logos/philips.png | Bin 0 -> 1282 bytes testar/resources/logos/sogeti.png | Bin 0 -> 1055 bytes .../jfx/settings/SettingsController.java | 1 + .../child/FilterSettingsController.java | 2 +- .../GeneralSettingsController.java | 4 +- 24 files changed, 326 insertions(+), 3 deletions(-) create mode 100644 testar/resources/jfx/icons/add.png create mode 100644 testar/resources/jfx/icons/attach.png create mode 100644 testar/resources/jfx/icons/back.png create mode 100644 testar/resources/jfx/icons/close.png create mode 100644 testar/resources/jfx/icons/filter.png create mode 100644 testar/resources/jfx/icons/general.png create mode 100644 testar/resources/jfx/icons/info.png create mode 100644 testar/resources/jfx/icons/misc.png create mode 100644 testar/resources/jfx/icons/state.png create mode 100644 testar/resources/jfx/icons/time.png create mode 100644 testar/resources/jfx/settings_child.fxml create mode 100644 testar/resources/jfx/settings_filter.fxml create mode 100644 testar/resources/jfx/settings_general.fxml create mode 100644 testar/resources/jfx/settings_misc.fxml create mode 100644 testar/resources/jfx/settings_state.fxml create mode 100644 testar/resources/jfx/settings_time.fxml create mode 100644 testar/resources/logos/ing.png create mode 100644 testar/resources/logos/marviq.png create mode 100644 testar/resources/logos/open_university.png create mode 100644 testar/resources/logos/philips.png create mode 100644 testar/resources/logos/sogeti.png rename testar/src/nl/ou/testar/jfx/settings/{ => child}/GeneralSettingsController.java (58%) diff --git a/testar/resources/jfx/icons/add.png b/testar/resources/jfx/icons/add.png new file mode 100644 index 0000000000000000000000000000000000000000..f03edd454e05ce86f83bb18be4ba6b0e2ab99dad GIT binary patch literal 250 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_+igPtyqAr^vr4=xlvWFXRZF+M~= zfT!hvq7{Qs=ZY5sC%SkVQW)4Al&qMH7BL;<=;&9tck<+7k?Yl_=33k4yy$evV=I4QryBjL y>2)txn6$O2$E7U4A5r+=RC9kLceU88o6<`*_-!)u&({QchQZU-&t;ucLK6Vne_zM| literal 0 HcmV?d00001 diff --git a/testar/resources/jfx/icons/attach.png b/testar/resources/jfx/icons/attach.png new file mode 100644 index 0000000000000000000000000000000000000000..6e8992d2015738b11ef8d0b77dd09ed9b798b243 GIT binary patch literal 281 zcmeAS@N?(olHy`uVBq!ia0vp@KrG3@3?%Osg&YP_jKx9jPK-BC>eK@{#sNMdu0Yz) z&o3Y#z}MFoNP2mB0l9DyprE(6H=GM(07Zi9T@!)Y1WSVaf*Jlh98gF&|6ZVBLBV~4 zfC=_q>-I$fCCfcs978JRoSneP$D+u=tf{r)^}Df8f?m>wbrbta zT7UId6rRX-{_Jx7Q0I-TEk(u!dAzIHN~~+#5A)yo%XFk8QN#e~1O`u6KbLh*2~7ZW CZDT9| literal 0 HcmV?d00001 diff --git a/testar/resources/jfx/icons/back.png b/testar/resources/jfx/icons/back.png new file mode 100644 index 0000000000000000000000000000000000000000..539f6583ab8b03d4c9df09ddc705432fbf143260 GIT binary patch literal 182 zcmeAS@N?(olHy`uVBq!ia0vp^oIotV!VDzM(mV=)6k~CayA$KhlREW4jzoY@h%1ox z1A_oC05W}jeSzf4mF$;*avUW=e!&d?KNvVHxNzSkY8%Kz3r`ovkcv6U2@QeK@{GXs1=T!Hj| z9N^!-f0#0GK{x|V4KDG&fB&MXgm7_*ixr=e1Uk;RB*-tA;s5?s4QH06b+%5Q-9Ks5 zx5D|R8Dd;FcX=I4zPgStL81J@DV0U6Oj7E#+XHeB3CTUY^ZHC2Ybnsbr#xL8Ln`LH zy>W9^lY$6C!h}tmE|uN>UORW@_xc^0lZ}%$b=*1gy>Q*5f4t&L*z$ zD7E^bQb*gdK-PEMSa)0HGW&Yb;gCXaBuC4ht<1R)W(Q@bcmLHd?w8| zIJ|c4p2j=O$BMkeqxFSu9`-%Yockr=lWlvMPU)6t{j0^-KR6U$l5#Ts;8(fz!@P^P z+1F3;w?1$5yZph`PZ@RdgEz9TU$xG+{Et#9|GnT%;!_*13uJ{xJ@eWpwrAObj&u1H z+82f99oKD)|G6#1yQ0*uQC<7Q)2mOHpZ~ZikJsnkqS>cE+R5Judwa3iX3{GKE2(mu z@XeP$H5@;lk{R@LX<9Rf#a7Ms-U+8!_gK1!$W1RcF{!%kTevRr+{QUib0i&!xyPUIdR+puqp99U6*dQ)z4*}Q$iB}`Lw3s literal 0 HcmV?d00001 diff --git a/testar/resources/jfx/icons/general.png b/testar/resources/jfx/icons/general.png new file mode 100644 index 0000000000000000000000000000000000000000..6d787b52727686a7350c7e151d6ab5701464f7e6 GIT binary patch literal 777 zcmV+k1NQuhP)g?m(MWuH8Km$skVf#SiN}wtGK#NMCW&1#zN}wJ4Km{exv2C12E>Nr4E>Igf zb$I`#P2?!CPA~Np*Xww~7cI~pL)Yq(tWsp3h&!P4m3e_lTFY0v*hQ*5-Q}t%6C7S$ zUvPtSo3je@B5U-Jp@fMp$dY7*^D3{HInaCj)P^a}L;O~s2~OBxow(Hj4RWC8*wDBX zC&D)?Kqo|HK=atrk}Pxrhc1e8eK@{HUT~%u0Z<# z|Nnk|ewQy_1~P!)-@ktl2Aurz(T>hV130G3zTp2ba4!+n3FppQm8?J$2nSKHIv@={j0qemb!fwm6P=1 z`miF@$z>JqvY3M_A4%x8Xhl`M>dpJ1V*ES#c3+;6gVgukhSs}T3O9VU2`>};lX8vk znIcbG@5VPw585C4^F6gqRVkht`g8s!HQN@^x7LyGe{Y{|J(D$6J=*soJCEJ6x?K!! X^qJSLwRs`{bPa>2tDnm{r-UW|Bs-3W literal 0 HcmV?d00001 diff --git a/testar/resources/jfx/icons/misc.png b/testar/resources/jfx/icons/misc.png new file mode 100644 index 0000000000000000000000000000000000000000..6cf50a70e8b1c8badffe21900c259673141f1ba2 GIT binary patch literal 1361 zcmeAS@N?(olHy`uVBq!ia0vp^ejv=j3?z4!T+jznjKx9jPK-BC>eK@{R|9-PT!Hj| zY~bI&f7paUVh|}fiAN=}34j0oMdlKz3(Y#X32^Ob#zNF{3-t2?J?35#l{Ja34)3cS+c6!vb?SB}X zoy3*v^(kzV3ub2hEb06k8o7CWJtG4H^L0-b$B>FSOCw%7Ju(pR^Ipi&dg)ZJh5}cS zX8Wc^@2cMX`q#fDmusfytYz)@*Q*(SE-gCe!x8xSIkT=+^{ZCz z_3?W4SgmdCHQ&R}-X7Ify{*6U;?YCf)?N_fNzk|vrTF$>;_Du!mtOjLrxN%5_SiNd zZLiv^FVlTL&YxbiZP9|Tt{Kz6UT0l@V`8Rg#oW%M*ysP zw=(j4Q%LV1D0@%{WKRy1zE zBCoPSJykiS^US>`=kBVdD?j0rJd~yId{*WS4oy#;iN#M#a#HTI-F}^XU%F%|C!>h$ zhSKJF;o6&v<ozZ&+S)6? zaq8c#LxFYOTc7u2a_bRC=9Z}qEh~~P@og3|;Vvm+V_kXSa7W;li#B{W z-=9tH_l%X0n|&=nX-UHlZoxAtmt-bC+p$bhFi5ANua<9y$@wK;=7j8=rm$o~V_&LF zuG&?GnqZ(>&gR1BGpFoa9J(_tRB4Gpqk@a6=;#NNjPL!DHq4@Kx z#=8?!YSVY!sy$#?t7!H6T#aMlMaH1JUVE1E2wKl;ckXzZnJk%*UBc%;|rR^ul~Z(G~LHi z@R;e1dCR!2TEE?T$$}?j-3H@+uf8ejyu53)KU>7E+Uwk=v2NF=cNPm=CZE2Tovh+< zrj7mTgL%4f6I_H}Z{>Kf$jRn?OzSSsL&x@R`@-^YUUkTeuSf1%WGDPA=DbWwF~m@U>x~Z5ob-b8R_%Kd>cN`5I%zV$h15H(wzJwFo~}<3 z+9Kq7Y2w8G<)7Yt@;>=&>Y{7i>93bozL`5sDeiyYj)`(CtiRqb{9ENzK5eDMoBijH wD_w2>J*nhWiiFtoV;|F^OT0JlU|;%w@@gyZv&W1AfTae5r>mdKI;Vst0H7}Svj6}9 literal 0 HcmV?d00001 diff --git a/testar/resources/jfx/icons/state.png b/testar/resources/jfx/icons/state.png new file mode 100644 index 0000000000000000000000000000000000000000..882508ff065119cc7fccfbfbf3f8a6d953a11d96 GIT binary patch literal 910 zcmeAS@N?(olHy`uVBq!ia0vp^F+d!`!3-oVk`}N7DaPU;cPGZ1Cw1z99LoTo5LY1m zpDe&-WttDvEL;-g7tHYgfP=vMgar)+1`q7dD@+L3Q2+6l$W#UfrYD{*jv*CuoOJ-614^Ao@0I+ZJZa?ktv z87vnaX1-hR>!%T@*~yfw`6;epkNS?(ppqZECxlOR+!-I$vPbHF-s9*i@fFD0A&nw;wO?}!Dr?AuG=--8z2j98QYIV-veNI<#sjGbN1_}Gm53UM^pOD+W=w6-o zx^Twj+6JeElXBN_T)%gI-FwmM>EC5i_Wr*fdh!(4;>d(+KP(>$ZCerV6Zo5R&%>)f zxt`u=2$E1q>0e*Ttk&bRVE6N)D~+;Tn_}a+uV1-r$@0x?%kOpB(@z-|=&b*+-@C8% z>c&9Esz>KHz2ewqw<5ShCjZ5y)~i=eT=Xpn-TSFjl4H@$`%F1JCkli0_J2ORGkt5k z?Ecl8cRt?!?m_f!6Nkss7@qGr(7Aba#NkSo8OS1!ty}vwRMpG?-X?GH(*Y;_jCv@=FfB+^@FF!KirtOBuT@-xm}f{_L|Odr{$b z+hcY5jgyYaS%pfiThY;bV&99iyX-!H%iq0jb#MHl_U%FvE_16Vzf6+2mXQ3hmg`hN z|IE)@|2_LNQM0I<)#ysHn~g#8da2GkMvi_tcQQX!Xk4E3n{92~bH7Q+&f6A$UsSAi zpQ(0d@RJ`NY2m(Qj|vNxpZI8aqfXwLT`rDq?wzcf$1Cn#5y?5_H`8RJ1+$sCeD#67 zM_cE-k>xc%wN6^X$k?+eQ_SeejwvlC{#coQJ zdXPYztKE&4U(|~d{p*iSmzu2BKK+#NeI1v66O#Zn-?+0Jha&8og R5MXv-@O1TaS?83{1OU|V&a?mk literal 0 HcmV?d00001 diff --git a/testar/resources/jfx/icons/time.png b/testar/resources/jfx/icons/time.png new file mode 100644 index 0000000000000000000000000000000000000000..5daa1ddaff18aec41faec0939736a8f52df3a937 GIT binary patch literal 1134 zcmeAS@N?(olHy`uVBq!ia0vp^en9NY!3-qrA1rDFQjEnx?oNz1PwLbIIp+g>LR^9L ze^S7oKY!4a|NHk3O$3em_wQe15rXQ0is7~pRQ&t*Z)C&wI3JG!ddamU$S;`T|AB`1 ziJxTLSzjCU3oI)zy)7*NVP9a#F2D8P4?kYTndMY|zxL#odFOhxcFZw4b}7X{FMWEe za^mmMvkPxr<|(nXd#)aNC;Lhl0|V0^PZ!6KiaBc|o+mvr;3;!baL`!Y!=xKU3E4nR?vDCDX4zEU9_6 zmx38esdg7YG@4-R4F6u`ARATdfUy`G+Re)D^<@Ohs$_u-%+)#hQ zw|KE~d5&&*Us`kDny1=ZN>Y5q&1aP;9JgCgz-Ajeac$bcDKj5$O=_Ii7jyaP>=nP~ zmvM(5zxYw%=Z5!v!n19s^!;CRa^G>EkLNd*e7`Vd_Lk2JMUKDV*xd6WXMaZZ(kX5) zZzNXi{x)IT)p8E6>x)GW$Ih<0>!90vX`D=F!Zl;D3%U1_Y z68e~_J-@Z@Xwm#Dnc34?^V~dN{Ruf1`C>-$*AvRQrJFBol>R@_`cAEw)w49q&v#$G zE81xNxc>Q*l-63x7hORAFpwj W1*duB_efyIV(@hJb6Mw<&;$VODTmhp literal 0 HcmV?d00001 diff --git a/testar/resources/jfx/settings_child.fxml b/testar/resources/jfx/settings_child.fxml new file mode 100644 index 000000000..bb4592592 --- /dev/null +++ b/testar/resources/jfx/settings_child.fxml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/testar/resources/jfx/settings_filter.fxml b/testar/resources/jfx/settings_filter.fxml new file mode 100644 index 000000000..2109b6a83 --- /dev/null +++ b/testar/resources/jfx/settings_filter.fxml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testar/resources/jfx/settings_general.fxml b/testar/resources/jfx/settings_general.fxml new file mode 100644 index 000000000..b01797315 --- /dev/null +++ b/testar/resources/jfx/settings_general.fxml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testar/resources/jfx/settings_misc.fxml b/testar/resources/jfx/settings_misc.fxml new file mode 100644 index 000000000..5449e746e --- /dev/null +++ b/testar/resources/jfx/settings_misc.fxml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/testar/resources/jfx/settings_state.fxml b/testar/resources/jfx/settings_state.fxml new file mode 100644 index 000000000..5449e746e --- /dev/null +++ b/testar/resources/jfx/settings_state.fxml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/testar/resources/jfx/settings_time.fxml b/testar/resources/jfx/settings_time.fxml new file mode 100644 index 000000000..5449e746e --- /dev/null +++ b/testar/resources/jfx/settings_time.fxml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/testar/resources/logos/ing.png b/testar/resources/logos/ing.png new file mode 100644 index 0000000000000000000000000000000000000000..ae176c208e333980d8b85a9c94762a1d91fc3517 GIT binary patch literal 1344 zcmV-G1;6@AcGRdDj}Q>Vy&OH zlw&}ys^QostaVmKRx7gfwdfifUL}2*!f<9?>^Hl0XbNzvjSdpWgdGau8Pqwpx6OAW z5tM^vI;Yg?OPzbXpl~!9q?uTwon;AQC+lHuciw?4D+XJ{1aBzK&SofA)$SbKHT3m7PL?_4 zMfyEdt$ov!6XikD!5d2B#+7f^jrmG%yGYReqJ<}l!v5A|f!eS(Lt*?(;y08=0?xhV zD&RMFbSIfOkL);-m0os1B0?i6(Kd-1asEsqo+yXO^!}jbTRO_}2ycrPK&olI@9khV zjcNK!@X*lRW^W{2tw}viW(^`jKeD@Z-AKtcS8ukUypudob`x_e`cH$4jW1b& z9?Em9GuU+@&i%+CVkLp$u=Q2*K9FoWbD-=d)#3MtwUCgKoAS*yx%T4)JGM?zz3fjU z#$8Z$6aStj&ynrIA~JAXl$J$d-6}g!MBF7qvXRPKRG&z0D7%Ten|~UNTx@5hQRB#M z0Sp6ZP?)%kSQ^LXJoUCel3Y=C6S$l2w|JID9SM})A2o0asi@nCGa<{ZO*S=|GQi(S zE-1T+d&VTyId|)tGrEM`kYViHkaYFLGaM}B_p_hR3WRSYCyKq@&Q)RQ^~MGmmU(gP zF6ccr+~&`olRiwb#A|woT8Ai**uJ$xz*P4?s?<#KFK?+*|cb-}2;w zvM;MuynH9ox}SJ4^DJD#nW#ilOQ}osc{?=+qWZ_*Nx0*@lEnI>c{kokOzzZDvLh^O zf555A|Dqgi&EPe*n?TNg*OLdz7E1NJo;MO&=FZ}qE>nq8QvWs(dKYu3ShQ6#A0~S*k zrj9Ztll)Lgvcg`1)SJr@wg%-vLU)o4<#;Bl;5WU?)dgWT+H;W&<*{+mnVelv)>qw; z94*hnkAAJOeqym-g1Ob$|-VW2yoAzWIPgx z7uJZV`Iwp4n-4YHaZV4EOD905&XnQkY@J+?dRX>~iv(J^J}ujCVyd)^JBG5`!pHvs zNp9nQLFqmdtyk4qAak{BM<=rPXpi621&Z6B&9Xlg6Dff6r#}S%0000+pot|^~(atyoKNf`u@mBnP%+q8K>0dwcY)c+? zn#|o+T#mHIs`HoaG)ZTVjYdchlFS>eYJ*FgP)CwGqqmctW|#C#F&K_&%Lbi z1G(EWL^$`qRFWqS3N!)@mGuGFIqUIU(~q!d7bNyyG;5UcfNXk*Tiz?!ch=(R#Muc}u& z>Q-DRjX-uITLjTS<`6`+-gC)OnneN8)rZ!rbPn^0Szxtneu=`6FC}_8%I+qvrs2!N^9)`=GjLExM( zMQJVjB8X~#Z#Vh{i0nXMXR0yel0C@HR`>zP&5JPzu*xyt6x>N2N2%*_-Xz`v5qcGSQ~&)q%K)l!5~OIMoa+s1qif<=4LJ3rUzjM zMerj;H>(+h&P?-yWs_er}Mx`K0EvHRFdb-kUb{C4JcDR&3&JKdeV-2)<`VFi<- zRsuYysvQp+9}rBA312B`nPkgse+DArs#4(G_ln5$XCOb6{|4kLph^7$MY0zEp!p?{ P00000NkvXXu0mjf=@^hH literal 0 HcmV?d00001 diff --git a/testar/resources/logos/open_university.png b/testar/resources/logos/open_university.png new file mode 100644 index 0000000000000000000000000000000000000000..6905e5feb3f366c8b22bfa7c37bdb7d3acb93e21 GIT binary patch literal 1319 zcmV+?1=#wDP)7&_R0VN02g#pPE!E?fWScT5MbcYa3G+s zkT6g`uz$b1pB?aRz5oCOZAnByRCt`ln2ma~Dhz-L|B6*-{k;E6JqbaJ3avX`w>;0* zRs%02A&CmOE&@f~GZ7WhHv|5rYqxjuP5$Y^S?ru{-|RQ}jg+pHoqxjDC>=ETzpe0X z1E5Cj6wY^H0o&}xh4tFdRrw?m6s-g=gs+hYg?^rIE`G(aY%?K7p}v1hmP%_&&q1wI%Rt!xdLUibKw zZu)Hw54Z%SR6}>H2h*|=jqKYVM+N4a;p`aqn&08BLIXWAEngXhLZh$J!<3@Npv75f zz+K~_;#UJ5^9y(y{fZx5HiGxiM>jV(p8}cLP^D20&9EuqqFAS6TR>aF3!Lgz{6)!C z8ZnjjFG8;5S3dffMn4?37k!=Is3aJ4W}6`TpW_<5c_wI=7?DxC& z&-rS0ZU(aqaq9NYGmrOH;AM#QP=ARq3ftb6F)HDx7Ly=*Dqv;&Zv5r^Rm>>&jm(&6&QxD@=qP@lB&nT%Zn_aCNWfMWeA@$r}tKW+eVzL2x0# z6>R+2DaZ&Wt-gr2$3Aq=A5VO=!-Rj0q`rv7t@U4#BQ`!p-i(IoMN09-3b;Ut@2SaR z@A@NujOWX_EEjA^LO0Mn_^8>jX*h}tIp~Ckgyq$?(YSlQh#e-igE9WvG4b7OqZ08| z3{pY1?S$A$+|dH|j8C16q4L%@5QF=`?|D{2jg*2U^U)`6G`xSjw`e|EI^)AFV8b}<74_|O~lq64&IJ0ti%I0?dzCHx7$<{ zN34Lc)UCgJB}3|U#@=O*2|2*b%l*ET;Q;kM>HC5fNnu=reUfi`zddsN1z%?;?l1Vm z)NU!)T*lWP6W){KLrz`lb^0ACKkEM;|NNL+lP7)B8)9FBlRW7Y-;vUrj-p(7oAf{A zsso-proAQh;t8xiCBG}}CH!Yjf0Ww$zMXt1`bds_W=THf{V1n5O(&_f$Uh{nl3?lm z+)qk+HSkw>T);C6d>${JokA5}kNyEEw!HAEvQrXS$b{YRY(9zG$Dwb3l}=(uN$*EN dDd~O#{vUhTCmJ9zUx@$!002ovPDHLkV1l*QY3~34 literal 0 HcmV?d00001 diff --git a/testar/resources/logos/philips.png b/testar/resources/logos/philips.png new file mode 100644 index 0000000000000000000000000000000000000000..28b9e71aec39e41a3b21921d39fe7903085df406 GIT binary patch literal 1282 zcmV+d1^xPoP)7##o&69I}a%sDHxQV}+@SvkDujNr z!vw3(iLSM}wIhu3$>?Czjl;mq*YGEOFglJtaiC)w(L?YNcofO%cv-%9l&?i}f)Pv1 zk31&AR>{n*it%n3_?JlNgNn&hA~mFAka9qB*urg$$uO@bTFTd)2P`c(U*pmcuUNid zxAy}4$}PW6{aMuOxDkvz^-*{`u3y`Rxi|Wu1VA?(_vq@{bcc@6)E_-7*~h7f8g!-e zsMx7Lqeq0^=<(+H(%PU~4AW60&h`%7r`Y2O)d}4zIV`7YchM8}F~rI^{0^dg2nSXz z3^3~zJ+zPeq)Z?5i;@E3%5$Tu(6u1Wuubu*Iu~WOXLNvK6WtH}AY(_zIbM<-f;c=$ zVrsjWH`St>eM%kCZFPE}fzpS=3>}X%ZoS z939oMWUJCtY_&XRRLji_C&6!`yCsSHIQj}Op-Lnl4|Hp&4(F9nhZ}UzH|QnKl5b-1 zN6^PZNt-xdqM(n-ys~m65o;|Y5@w5DOsjjMS4u#fGNktplhAWXo5v3~y8W|;a^a~4 zU2OTvbVRR}z_k=G5q-+8lh5O8tMAz^=(rSd68fQ^lte7OXUK>p0($lnf)jY`A=Ix| zfemXS3}?epeVR__oZGXK>So?GVkVgznM5ANsy|09>bkn!9cE2EUKigbl4 zZFuAe+;g=5RwlJDRlvim$n%V!Wj=|Xg}jSS(N%0zm0p3|b3jf_G-p|Z;#Z~5qqBF> zF}g@BT72ll)izX3`&?Bz>k#>SpqqEmue)j$y~Ku`DhwsZLQSGln)S7W?SnqPiw;fk zRm^K{;y%m^A3|kpmf&a}E9c7Vo&O#^6enl&ZPZNA=ME4rnA*?Q-x18jHWhp!F{9 sJW|B@=K$p%9a>tMosRfQyR(!31Nu%a?f+K$Pyhe`07*qoM6N<$f`T?mQ~&?~ literal 0 HcmV?d00001 diff --git a/testar/resources/logos/sogeti.png b/testar/resources/logos/sogeti.png new file mode 100644 index 0000000000000000000000000000000000000000..269c3d394af4575044bf0c21ca249700f94eadff GIT binary patch literal 1055 zcmV+)1mOFLP)V!cc}YY; zRCt`lnA>)&APhhSL@tWp|Nra(Ny2reUG1rpmsSF7NJ0p+EFY2GXl?e-u$Nu3DDp#i z!)`Ip(01<*R(;D%*N?!}%^Kh7#R%0cZCCeH#~C{MfufdWjh_k!9IO^-4zg~Pp+<01 z>#W0>maCddhlWlfZaQP`)+*U*^B~oYVMJIq*XzKn+u63BZ|RIrlyaNG8S@C2qb_UK zzS+&_3OlC7=?;G9fUA5LR`&2_M|h@>CQ1A3>4uiM(k8X%+rqgIIlO?NRr*x0zO%LZ@H`0I(@u18OAb<^XIJSqreR4IT5-Fo?8NdWq$-DigCGRl^u!T;B?}GO za{a^1mbNZ&wPk8iR#^EVcKn)tHt@YTtu@Au0YQhnOf7M*xZY9Z0gaz3UJ(m4m;mQ$<;17G+R+;V`rFp6_Pr27MuuI`T^lvU-vqp5Q^YSD}O20e Z_78C&8qASsG86y+002ovPDHLkV1ie?>Q(>% literal 0 HcmV?d00001 diff --git a/testar/src/nl/ou/testar/jfx/settings/SettingsController.java b/testar/src/nl/ou/testar/jfx/settings/SettingsController.java index 73d9affcd..6f15dbe9c 100644 --- a/testar/src/nl/ou/testar/jfx/settings/SettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/SettingsController.java @@ -4,6 +4,7 @@ import javafx.scene.control.Button; import nl.ou.testar.jfx.core.ViewController; import nl.ou.testar.jfx.settings.child.FilterSettingsController; +import nl.ou.testar.jfx.settings.child.GeneralSettingsController; public class SettingsController extends ViewController { public SettingsController() { diff --git a/testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java index 704abf8ca..a633d329d 100644 --- a/testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java @@ -4,6 +4,6 @@ public class FilterSettingsController extends ChildSettingsController { public FilterSettingsController() { - super("Filters & oracles", "jfx/settings_general.fxml"); + super("Filters & oracles", "jfx/settings_filter.fxml"); } } diff --git a/testar/src/nl/ou/testar/jfx/settings/GeneralSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java similarity index 58% rename from testar/src/nl/ou/testar/jfx/settings/GeneralSettingsController.java rename to testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java index c11d769be..01edd9d8e 100644 --- a/testar/src/nl/ou/testar/jfx/settings/GeneralSettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java @@ -1,8 +1,8 @@ -package nl.ou.testar.jfx.settings; +package nl.ou.testar.jfx.settings.child; import nl.ou.testar.jfx.core.ViewController; -public class GeneralSettingsController extends ViewController { +public class GeneralSettingsController extends ChildSettingsController { public GeneralSettingsController() { super("General settings", "jfx/settings_general.fxml"); } From 4817a117e12f55d65672eac128c6542a676ae6e0 Mon Sep 17 00:00:00 2001 From: Michael Tikhonenko Date: Mon, 23 Aug 2021 13:32:27 +0200 Subject: [PATCH 07/59] Time settings UI basically implemented --- testar/resources/jfx/settings_time.fxml | 94 +++++++++++++++++-- .../jfx/settings/SettingsController.java | 1 + .../jfx/settings/TimeSettingsController.java | 9 -- .../child/FilterSettingsController.java | 2 - .../child/GeneralSettingsController.java | 2 - .../child/TimeSettingsController.java | 7 ++ 6 files changed, 92 insertions(+), 23 deletions(-) delete mode 100644 testar/src/nl/ou/testar/jfx/settings/TimeSettingsController.java create mode 100644 testar/src/nl/ou/testar/jfx/settings/child/TimeSettingsController.java diff --git a/testar/resources/jfx/settings_time.fxml b/testar/resources/jfx/settings_time.fxml index 5449e746e..cec9f9ae5 100644 --- a/testar/resources/jfx/settings_time.fxml +++ b/testar/resources/jfx/settings_time.fxml @@ -1,15 +1,89 @@ - - - + + + + + + + + - + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + - + diff --git a/testar/src/nl/ou/testar/jfx/settings/SettingsController.java b/testar/src/nl/ou/testar/jfx/settings/SettingsController.java index 6f15dbe9c..aa691ad6a 100644 --- a/testar/src/nl/ou/testar/jfx/settings/SettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/SettingsController.java @@ -5,6 +5,7 @@ import nl.ou.testar.jfx.core.ViewController; import nl.ou.testar.jfx.settings.child.FilterSettingsController; import nl.ou.testar.jfx.settings.child.GeneralSettingsController; +import nl.ou.testar.jfx.settings.child.TimeSettingsController; public class SettingsController extends ViewController { public SettingsController() { diff --git a/testar/src/nl/ou/testar/jfx/settings/TimeSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/TimeSettingsController.java deleted file mode 100644 index 1c43df9b1..000000000 --- a/testar/src/nl/ou/testar/jfx/settings/TimeSettingsController.java +++ /dev/null @@ -1,9 +0,0 @@ -package nl.ou.testar.jfx.settings; - -import nl.ou.testar.jfx.core.ViewController; - -public class TimeSettingsController extends ViewController { - public TimeSettingsController() { - super("Time settings", "jfx/settings_time.fxml"); - } -} diff --git a/testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java index a633d329d..7c416f6fb 100644 --- a/testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java @@ -1,7 +1,5 @@ package nl.ou.testar.jfx.settings.child; -import nl.ou.testar.jfx.core.ViewController; - public class FilterSettingsController extends ChildSettingsController { public FilterSettingsController() { super("Filters & oracles", "jfx/settings_filter.fxml"); diff --git a/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java index 01edd9d8e..1bbe203a0 100644 --- a/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java @@ -1,7 +1,5 @@ package nl.ou.testar.jfx.settings.child; -import nl.ou.testar.jfx.core.ViewController; - public class GeneralSettingsController extends ChildSettingsController { public GeneralSettingsController() { super("General settings", "jfx/settings_general.fxml"); diff --git a/testar/src/nl/ou/testar/jfx/settings/child/TimeSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/TimeSettingsController.java new file mode 100644 index 000000000..a317fcaca --- /dev/null +++ b/testar/src/nl/ou/testar/jfx/settings/child/TimeSettingsController.java @@ -0,0 +1,7 @@ +package nl.ou.testar.jfx.settings.child; + +public class TimeSettingsController extends ChildSettingsController { + public TimeSettingsController() { + super("Time settings", "jfx/settings_time.fxml"); + } +} From 0bf52b4ff4920f5bde321e4260f0b0de5b45d7af Mon Sep 17 00:00:00 2001 From: Michael Tikhonenko Date: Wed, 25 Aug 2021 08:28:30 +0200 Subject: [PATCH 08/59] Settings screen now can have multiple sections --- testar/resources/jfx/dashboard.fxml | 12 ++ testar/resources/jfx/main.fxml | 36 +----- testar/resources/jfx/settings.fxml | 96 +++++++++------ testar/resources/jfx/settings_child.fxml | 27 ++++- testar/resources/jfx/settings_new.fxml | 114 ++++++++++-------- .../src/nl/ou/testar/jfx/MainController.java | 14 +-- .../child/ChildSettingsController.java | 59 ++++++--- .../child/FilterSettingsController.java | 16 ++- .../child/GeneralSettingsController.java | 16 ++- .../child/TimeSettingsController.java | 16 ++- 10 files changed, 257 insertions(+), 149 deletions(-) diff --git a/testar/resources/jfx/dashboard.fxml b/testar/resources/jfx/dashboard.fxml index 954744c93..c2bf070ea 100644 --- a/testar/resources/jfx/dashboard.fxml +++ b/testar/resources/jfx/dashboard.fxml @@ -1,6 +1,7 @@ + @@ -10,6 +11,17 @@ + diff --git a/testar/resources/jfx/main.fxml b/testar/resources/jfx/main.fxml index 1c97186ec..7f7718598 100644 --- a/testar/resources/jfx/main.fxml +++ b/testar/resources/jfx/main.fxml @@ -1,7 +1,6 @@ - @@ -14,7 +13,6 @@ -
- - - -
- -
- - - - - - - - - - - - - - -
-
-
+
diff --git a/testar/resources/jfx/settings.fxml b/testar/resources/jfx/settings.fxml index 18be1f2fa..581fc3494 100644 --- a/testar/resources/jfx/settings.fxml +++ b/testar/resources/jfx/settings.fxml @@ -1,47 +1,67 @@ + + + + - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - +
diff --git a/testar/resources/jfx/settings_child.fxml b/testar/resources/jfx/settings_child.fxml index bb4592592..c995f8147 100644 --- a/testar/resources/jfx/settings_child.fxml +++ b/testar/resources/jfx/settings_child.fxml @@ -2,16 +2,37 @@ + + - - + + + + + + + + + + + + + + + + + + + + + - + diff --git a/testar/resources/jfx/settings_new.fxml b/testar/resources/jfx/settings_new.fxml index 8f9a9d89b..e6dfcba3c 100644 --- a/testar/resources/jfx/settings_new.fxml +++ b/testar/resources/jfx/settings_new.fxml @@ -1,56 +1,76 @@ + + + + - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/testar/src/nl/ou/testar/jfx/MainController.java b/testar/src/nl/ou/testar/jfx/MainController.java index 4651a049b..e5656f7eb 100644 --- a/testar/src/nl/ou/testar/jfx/MainController.java +++ b/testar/src/nl/ou/testar/jfx/MainController.java @@ -25,8 +25,8 @@ public MainController() { private void setupMode(Parent view, Mode mode) { if (mode != this.mode) { - final Label titleLabel = (Label) view.lookup("#titleLabel"); - final Button btnBack = (Button) view.lookup("#btnBack"); +// final Label titleLabel = (Label) view.lookup("#titleLabel"); +// final Button btnBack = (Button) view.lookup("#btnBack"); final BorderPane contentPane = (BorderPane) view.lookup("#contentPane"); ViewController targetController; @@ -42,17 +42,17 @@ private void setupMode(Parent view, Mode mode) { navigationController.startWithDelegate(new NavigationDelegate() { @Override public void onViewControllerActivated(ViewController viewController, Parent view) { - titleLabel.setText(viewController.getTitle()); +// titleLabel.setText(viewController.getTitle()); contentPane.setCenter(view); - btnBack.setVisible(navigationController.isBackAvailable()); +// btnBack.setVisible(navigationController.isBackAvailable()); // contentPane.getChildren().removeAll(); // contentPane.getChildren().add(view); } }); - btnBack.setOnAction(event -> { - navigationController.navigateBack(); - }); +// btnBack.setOnAction(event -> { +// navigationController.navigateBack(); +// }); this.mode = mode; } diff --git a/testar/src/nl/ou/testar/jfx/settings/child/ChildSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/ChildSettingsController.java index c75370277..14c356338 100644 --- a/testar/src/nl/ou/testar/jfx/settings/child/ChildSettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/child/ChildSettingsController.java @@ -4,35 +4,62 @@ import javafx.fxml.FXMLLoader; import javafx.scene.Node; import javafx.scene.Parent; +import javafx.scene.control.Button; +import javafx.scene.control.Label; import javafx.scene.layout.VBox; import nl.ou.testar.jfx.core.ViewController; +import org.fruit.Pair; import java.io.IOException; public class ChildSettingsController extends ViewController { - private String contentResourcePath; +// private String contentResourcePath; - public ChildSettingsController(String title, String resourcePath) { + public ChildSettingsController(String title) { super(title, "jfx/settings_child.fxml"); - this.contentResourcePath = resourcePath; +// this.contentResourcePath = resourcePath; } +// @Override +// public Parent obtainView() throws IOException { +// Parent view = super.obtainView(); +// VBox contentBox = (VBox) view.lookup("#contentBox"); +// ObservableList children = contentBox.getChildren(); +// if (children.size() == 0) { +// FXMLLoader loader = new FXMLLoader(getClass().getClassLoader().getResource(contentResourcePath)); +// Parent contentView = loader.load(); +// children.add(contentView); +// contentViewDidLoad(contentView); +// } +// return view; +// } +// +// public void contentViewDidLoad(Parent contentView) { +// //To be overriden +// } + @Override - public Parent obtainView() throws IOException { - Parent view = super.obtainView(); - VBox contentBox = (VBox) view.lookup("#contentBox"); - ObservableList children = contentBox.getChildren(); - if (children.size() == 0) { - FXMLLoader loader = new FXMLLoader(getClass().getClassLoader().getResource(contentResourcePath)); - Parent contentView = loader.load(); - children.add(contentView); - contentViewDidLoad(contentView); - } - return view; + public void viewDidLoad(Parent view) { + super.viewDidLoad(view); + Button btnBack = (Button) view.lookup("#btnBack"); + btnBack.setOnAction(event -> { + getNavigationController().navigateBack(); + }); } - public void contentViewDidLoad(Parent contentView) { - //To be overriden + // TODO: put some docs + protected void putSection(Parent contentView, String title, String resourcePath) throws IOException { + FXMLLoader loader = new FXMLLoader(getClass().getClassLoader().getResource("jfx/settings_section.fxml")); + VBox sectionBox = (VBox) loader.load(); + + loader = new FXMLLoader(getClass().getClassLoader().getResource(resourcePath)); + sectionBox.getChildren().add(loader.load()); + + Label titleLabel = (Label) sectionBox.lookup("#titleLabel"); + titleLabel.setText(title); + + VBox contentBox = (VBox) contentView.lookup("#contentBox"); + contentBox.getChildren().add(sectionBox); } } diff --git a/testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java index 7c416f6fb..21c3be7af 100644 --- a/testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java @@ -1,7 +1,21 @@ package nl.ou.testar.jfx.settings.child; +import javafx.scene.Parent; + +import java.io.IOException; + public class FilterSettingsController extends ChildSettingsController { public FilterSettingsController() { - super("Filters & oracles", "jfx/settings_filter.fxml"); + super("Filters & oracles"); + } + + @Override + public void viewDidLoad(Parent view) { + super.viewDidLoad(view); + try { + putSection(view, "Filters & oracles", "jfx/settings_filter.fxml"); + } catch (IOException e) { + e.printStackTrace(); + } } } diff --git a/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java index 1bbe203a0..efb0682ff 100644 --- a/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java @@ -1,7 +1,21 @@ package nl.ou.testar.jfx.settings.child; +import javafx.scene.Parent; + +import java.io.IOException; + public class GeneralSettingsController extends ChildSettingsController { public GeneralSettingsController() { - super("General settings", "jfx/settings_general.fxml"); + super("General settings"); + } + + @Override + public void viewDidLoad(Parent view) { + super.viewDidLoad(view); + try { + putSection(view, "General settings", "jfx/settings_general.fxml"); + } catch (IOException e) { + e.printStackTrace(); + } } } diff --git a/testar/src/nl/ou/testar/jfx/settings/child/TimeSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/TimeSettingsController.java index a317fcaca..f83527426 100644 --- a/testar/src/nl/ou/testar/jfx/settings/child/TimeSettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/child/TimeSettingsController.java @@ -1,7 +1,21 @@ package nl.ou.testar.jfx.settings.child; +import javafx.scene.Parent; + +import java.io.IOException; + public class TimeSettingsController extends ChildSettingsController { public TimeSettingsController() { - super("Time settings", "jfx/settings_time.fxml"); + super("Time settings"); + } + + @Override + public void viewDidLoad(Parent view) { + super.viewDidLoad(view); + try { + putSection(view, "Time settings", "jfx/settings_time.fxml"); + } catch (IOException e) { + e.printStackTrace(); + } } } From 36883ebaf2de98a1ad0685f6a7852c46754dbfef Mon Sep 17 00:00:00 2001 From: Michael Tikhonenko Date: Wed, 25 Aug 2021 17:02:00 +0200 Subject: [PATCH 09/59] All settings screens implemented --- testar/resources/jfx/icons/close_white.png | Bin 0 -> 143 bytes .../resources/jfx/icons/settings_state.fxml | 207 ++++++++++++++++++ testar/resources/jfx/settings_misc.fxml | 118 +++++++++- testar/resources/jfx/settings_section.fxml | 50 +++++ testar/resources/jfx/settings_startup.fxml | 113 ++++++++++ testar/resources/jfx/settings_state.fxml | 202 ++++++++++++++++- testar/resources/jfx/settings_widgets.fxml | 74 +++++++ .../jfx/settings/MiscSettingsController.java | 9 - .../jfx/settings/SettingsController.java | 4 +- .../jfx/settings/StateSettingsController.java | 9 - .../child/MiscSettingsController.java | 22 ++ .../child/StateSettingsController.java | 22 ++ 12 files changed, 799 insertions(+), 31 deletions(-) create mode 100644 testar/resources/jfx/icons/close_white.png create mode 100644 testar/resources/jfx/icons/settings_state.fxml create mode 100644 testar/resources/jfx/settings_section.fxml create mode 100644 testar/resources/jfx/settings_startup.fxml create mode 100644 testar/resources/jfx/settings_widgets.fxml delete mode 100644 testar/src/nl/ou/testar/jfx/settings/MiscSettingsController.java delete mode 100644 testar/src/nl/ou/testar/jfx/settings/StateSettingsController.java create mode 100644 testar/src/nl/ou/testar/jfx/settings/child/MiscSettingsController.java create mode 100644 testar/src/nl/ou/testar/jfx/settings/child/StateSettingsController.java diff --git a/testar/resources/jfx/icons/close_white.png b/testar/resources/jfx/icons/close_white.png new file mode 100644 index 0000000000000000000000000000000000000000..6f52e6b9bc262ea39958f06aa9bcc19e59ad5e12 GIT binary patch literal 143 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_+iFi#i95R21KC++5CP~c#VZPLB7 zKbec&id(wVt + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testar/resources/jfx/settings_misc.fxml b/testar/resources/jfx/settings_misc.fxml index 5449e746e..d8c16ef0d 100644 --- a/testar/resources/jfx/settings_misc.fxml +++ b/testar/resources/jfx/settings_misc.fxml @@ -1,15 +1,123 @@ + + + + + + - + + - + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/testar/resources/jfx/settings_section.fxml b/testar/resources/jfx/settings_section.fxml new file mode 100644 index 000000000..85467a038 --- /dev/null +++ b/testar/resources/jfx/settings_section.fxml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + + + + +
+
diff --git a/testar/resources/jfx/settings_startup.fxml b/testar/resources/jfx/settings_startup.fxml new file mode 100644 index 000000000..3ae4628a7 --- /dev/null +++ b/testar/resources/jfx/settings_startup.fxml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testar/resources/jfx/settings_state.fxml b/testar/resources/jfx/settings_state.fxml index 5449e746e..5d1d46617 100644 --- a/testar/resources/jfx/settings_state.fxml +++ b/testar/resources/jfx/settings_state.fxml @@ -1,15 +1,207 @@ + + + + + + + + - + + - + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/testar/resources/jfx/settings_widgets.fxml b/testar/resources/jfx/settings_widgets.fxml new file mode 100644 index 000000000..d43880dff --- /dev/null +++ b/testar/resources/jfx/settings_widgets.fxml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testar/src/nl/ou/testar/jfx/settings/MiscSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/MiscSettingsController.java deleted file mode 100644 index fbad62151..000000000 --- a/testar/src/nl/ou/testar/jfx/settings/MiscSettingsController.java +++ /dev/null @@ -1,9 +0,0 @@ -package nl.ou.testar.jfx.settings; - -import nl.ou.testar.jfx.core.ViewController; - -public class MiscSettingsController extends ViewController { - public MiscSettingsController() { - super("Misc", "jfx/settings_misc.fxml"); - } -} diff --git a/testar/src/nl/ou/testar/jfx/settings/SettingsController.java b/testar/src/nl/ou/testar/jfx/settings/SettingsController.java index aa691ad6a..9d0833cb5 100644 --- a/testar/src/nl/ou/testar/jfx/settings/SettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/SettingsController.java @@ -3,9 +3,7 @@ import javafx.scene.Parent; import javafx.scene.control.Button; import nl.ou.testar.jfx.core.ViewController; -import nl.ou.testar.jfx.settings.child.FilterSettingsController; -import nl.ou.testar.jfx.settings.child.GeneralSettingsController; -import nl.ou.testar.jfx.settings.child.TimeSettingsController; +import nl.ou.testar.jfx.settings.child.*; public class SettingsController extends ViewController { public SettingsController() { diff --git a/testar/src/nl/ou/testar/jfx/settings/StateSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/StateSettingsController.java deleted file mode 100644 index d8c521656..000000000 --- a/testar/src/nl/ou/testar/jfx/settings/StateSettingsController.java +++ /dev/null @@ -1,9 +0,0 @@ -package nl.ou.testar.jfx.settings; - -import nl.ou.testar.jfx.core.ViewController; - -public class StateSettingsController extends ViewController { - public StateSettingsController() { - super("State model", "jfx/settings_state.fxml"); - } -} diff --git a/testar/src/nl/ou/testar/jfx/settings/child/MiscSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/MiscSettingsController.java new file mode 100644 index 000000000..6d285772a --- /dev/null +++ b/testar/src/nl/ou/testar/jfx/settings/child/MiscSettingsController.java @@ -0,0 +1,22 @@ +package nl.ou.testar.jfx.settings.child; + +import javafx.scene.Parent; + +import java.io.IOException; + +public class MiscSettingsController extends ChildSettingsController { + public MiscSettingsController() { + super(""); + } + + @Override + public void viewDidLoad(Parent view) { + super.viewDidLoad(view); + try { + putSection(view, "Misc", "jfx/settings_misc.fxml"); + putSection(view, "Files on SUT startup", "jfx/settings_startup.fxml"); + } catch (IOException e) { + e.printStackTrace(); + } + } +} diff --git a/testar/src/nl/ou/testar/jfx/settings/child/StateSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/StateSettingsController.java new file mode 100644 index 000000000..3db41616b --- /dev/null +++ b/testar/src/nl/ou/testar/jfx/settings/child/StateSettingsController.java @@ -0,0 +1,22 @@ +package nl.ou.testar.jfx.settings.child; + +import javafx.scene.Parent; + +import java.io.IOException; + +public class StateSettingsController extends ChildSettingsController { + public StateSettingsController() { + super(""); + } + + @Override + public void viewDidLoad(Parent view) { + super.viewDidLoad(view); + try { + putSection(view, "State", "jfx/settings_state.fxml"); + putSection(view, "Widgets", "jfx/settings_widgets.fxml"); + } catch (IOException e) { + e.printStackTrace(); + } + } +} From 87917bdff4aeb0eb5ae411a497252f500d9cb4aa Mon Sep 17 00:00:00 2001 From: Michael Tikhonenko Date: Fri, 27 Aug 2021 08:41:40 +0200 Subject: [PATCH 10/59] Settings parameter added --- testar/src/nl/ou/testar/jfx/MainController.java | 9 +++++---- .../src/nl/ou/testar/jfx/core/ViewController.java | 5 ++++- .../testar/jfx/dashboard/DashboardController.java | 5 +++-- .../testar/jfx/settings/SettingsController.java | 15 ++++++++------- .../settings/child/ChildSettingsController.java | 5 +++-- .../settings/child/FilterSettingsController.java | 5 +++-- .../settings/child/GeneralSettingsController.java | 5 +++-- .../settings/child/MiscSettingsController.java | 5 +++-- .../settings/child/StateSettingsController.java | 5 +++-- .../settings/child/TimeSettingsController.java | 5 +++-- testar/src/org/testar/monkey/Main.java | 2 +- 11 files changed, 39 insertions(+), 27 deletions(-) diff --git a/testar/src/nl/ou/testar/jfx/MainController.java b/testar/src/nl/ou/testar/jfx/MainController.java index e5656f7eb..a6ced04e8 100644 --- a/testar/src/nl/ou/testar/jfx/MainController.java +++ b/testar/src/nl/ou/testar/jfx/MainController.java @@ -10,6 +10,7 @@ import nl.ou.testar.jfx.settings.SettingsController; import javafx.scene.control.*; +import org.fruit.monkey.Settings; public class MainController extends ViewController { @@ -19,8 +20,8 @@ enum Mode { private Mode mode; - public MainController() { - super("Testar", "jfx/main.fxml"); + public MainController(Settings settings) { + super("Testar", "jfx/main.fxml", settings); } private void setupMode(Parent view, Mode mode) { @@ -32,10 +33,10 @@ private void setupMode(Parent view, Mode mode) { ViewController targetController; switch (mode) { case SETTINGS: - targetController = new SettingsController(); + targetController = new SettingsController(settings); break; default: //HOME - targetController = new DashboardController(); + targetController = new DashboardController(settings); break; } final NavigationController navigationController = new NavigationController(targetController); diff --git a/testar/src/nl/ou/testar/jfx/core/ViewController.java b/testar/src/nl/ou/testar/jfx/core/ViewController.java index 90af9ecdc..d3849fa66 100644 --- a/testar/src/nl/ou/testar/jfx/core/ViewController.java +++ b/testar/src/nl/ou/testar/jfx/core/ViewController.java @@ -2,6 +2,7 @@ import javafx.fxml.FXMLLoader; import javafx.scene.Parent; +import org.fruit.monkey.Settings; import java.io.IOException; import java.lang.ref.WeakReference; @@ -11,6 +12,7 @@ public abstract class ViewController { private WeakReference viewReference = new WeakReference<>(null); private String title; private String resourcePath; + protected Settings settings; private NavigationController navigationController; @@ -26,9 +28,10 @@ public void setNavigationController(NavigationController navigationController) { this.navigationController = navigationController; } - public ViewController(String title, String resourcePath) { + public ViewController(String title, String resourcePath, Settings settings) { this.title = title; this.resourcePath = resourcePath; + this.settings = settings; } public Parent obtainView() throws IOException { diff --git a/testar/src/nl/ou/testar/jfx/dashboard/DashboardController.java b/testar/src/nl/ou/testar/jfx/dashboard/DashboardController.java index a104312c0..a4bdf8c84 100644 --- a/testar/src/nl/ou/testar/jfx/dashboard/DashboardController.java +++ b/testar/src/nl/ou/testar/jfx/dashboard/DashboardController.java @@ -1,9 +1,10 @@ package nl.ou.testar.jfx.dashboard; import nl.ou.testar.jfx.core.ViewController; +import org.fruit.monkey.Settings; public class DashboardController extends ViewController { - public DashboardController() { - super("Dashboard", "jfx/dashboard.fxml"); + public DashboardController(Settings settings) { + super("Dashboard", "jfx/dashboard.fxml", settings); } } diff --git a/testar/src/nl/ou/testar/jfx/settings/SettingsController.java b/testar/src/nl/ou/testar/jfx/settings/SettingsController.java index 9d0833cb5..23344c7f6 100644 --- a/testar/src/nl/ou/testar/jfx/settings/SettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/SettingsController.java @@ -4,10 +4,11 @@ import javafx.scene.control.Button; import nl.ou.testar.jfx.core.ViewController; import nl.ou.testar.jfx.settings.child.*; +import org.fruit.monkey.Settings; public class SettingsController extends ViewController { - public SettingsController() { - super("Settings", "jfx/settings_new.fxml"); + public SettingsController(Settings settings) { + super("Settings", "jfx/settings_new.fxml", settings); } @Override @@ -19,19 +20,19 @@ public void viewDidLoad(Parent view) { Button btnState = (Button) view.lookup("#btnState"); btnGeneral.setOnAction(event -> { - getNavigationController().navigateTo(new GeneralSettingsController(), true); + getNavigationController().navigateTo(new GeneralSettingsController(settings), true); }); btnFilters.setOnAction(event -> { - getNavigationController().navigateTo(new FilterSettingsController(), true); + getNavigationController().navigateTo(new FilterSettingsController(settings), true); }); btnTime.setOnAction(event -> { - getNavigationController().navigateTo(new TimeSettingsController(), true); + getNavigationController().navigateTo(new TimeSettingsController(settings), true); }); btnMisc.setOnAction(event -> { - getNavigationController().navigateTo(new MiscSettingsController(), true); + getNavigationController().navigateTo(new MiscSettingsController(settings), true); }); btnState.setOnAction(event -> { - getNavigationController().navigateTo(new StateSettingsController(), true); + getNavigationController().navigateTo(new StateSettingsController(settings), true); }); } } diff --git a/testar/src/nl/ou/testar/jfx/settings/child/ChildSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/ChildSettingsController.java index 14c356338..18c1876d7 100644 --- a/testar/src/nl/ou/testar/jfx/settings/child/ChildSettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/child/ChildSettingsController.java @@ -9,6 +9,7 @@ import javafx.scene.layout.VBox; import nl.ou.testar.jfx.core.ViewController; import org.fruit.Pair; +import org.fruit.monkey.Settings; import java.io.IOException; @@ -16,8 +17,8 @@ public class ChildSettingsController extends ViewController { // private String contentResourcePath; - public ChildSettingsController(String title) { - super(title, "jfx/settings_child.fxml"); + public ChildSettingsController(String title, Settings settings) { + super(title, "jfx/settings_child.fxml", settings); // this.contentResourcePath = resourcePath; } diff --git a/testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java index 21c3be7af..6c103c789 100644 --- a/testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java @@ -1,12 +1,13 @@ package nl.ou.testar.jfx.settings.child; import javafx.scene.Parent; +import org.fruit.monkey.Settings; import java.io.IOException; public class FilterSettingsController extends ChildSettingsController { - public FilterSettingsController() { - super("Filters & oracles"); + public FilterSettingsController(Settings settings) { + super("Filters & oracles", settings); } @Override diff --git a/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java index efb0682ff..2b2778246 100644 --- a/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java @@ -1,12 +1,13 @@ package nl.ou.testar.jfx.settings.child; import javafx.scene.Parent; +import org.fruit.monkey.Settings; import java.io.IOException; public class GeneralSettingsController extends ChildSettingsController { - public GeneralSettingsController() { - super("General settings"); + public GeneralSettingsController(Settings settings) { + super("General settings", settings); } @Override diff --git a/testar/src/nl/ou/testar/jfx/settings/child/MiscSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/MiscSettingsController.java index 6d285772a..5de88e677 100644 --- a/testar/src/nl/ou/testar/jfx/settings/child/MiscSettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/child/MiscSettingsController.java @@ -1,12 +1,13 @@ package nl.ou.testar.jfx.settings.child; import javafx.scene.Parent; +import org.fruit.monkey.Settings; import java.io.IOException; public class MiscSettingsController extends ChildSettingsController { - public MiscSettingsController() { - super(""); + public MiscSettingsController(Settings settings) { + super("", settings); } @Override diff --git a/testar/src/nl/ou/testar/jfx/settings/child/StateSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/StateSettingsController.java index 3db41616b..225857016 100644 --- a/testar/src/nl/ou/testar/jfx/settings/child/StateSettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/child/StateSettingsController.java @@ -1,12 +1,13 @@ package nl.ou.testar.jfx.settings.child; import javafx.scene.Parent; +import org.fruit.monkey.Settings; import java.io.IOException; public class StateSettingsController extends ChildSettingsController { - public StateSettingsController() { - super(""); + public StateSettingsController(Settings settings) { + super("", settings); } @Override diff --git a/testar/src/nl/ou/testar/jfx/settings/child/TimeSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/TimeSettingsController.java index f83527426..106907745 100644 --- a/testar/src/nl/ou/testar/jfx/settings/child/TimeSettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/child/TimeSettingsController.java @@ -1,12 +1,13 @@ package nl.ou.testar.jfx.settings.child; import javafx.scene.Parent; +import org.fruit.monkey.Settings; import java.io.IOException; public class TimeSettingsController extends ChildSettingsController { - public TimeSettingsController() { - super("Time settings"); + public TimeSettingsController(Settings settings) { + super("Time settings", settings); } @Override diff --git a/testar/src/org/testar/monkey/Main.java b/testar/src/org/testar/monkey/Main.java index ed1517598..48213a861 100644 --- a/testar/src/org/testar/monkey/Main.java +++ b/testar/src/org/testar/monkey/Main.java @@ -353,7 +353,7 @@ private static Settings loadTestarSettings(List args, String testSetting */ public static boolean startTestarDialog(Stage stage, Settings settings, String testSettingsFileName) { - NavigationController navigationController = new NavigationController(new MainController()); + NavigationController navigationController = new NavigationController(new MainController(settings)); navigationController.startWithDelegate(new NavigationDelegate() { @Override public void onViewControllerActivated(ViewController viewController, Parent view) { From cfa1de5afc80ae283b30713a37766ddbbc99d503 Mon Sep 17 00:00:00 2001 From: Michael Tikhonenko Date: Mon, 30 Aug 2021 19:07:08 +0200 Subject: [PATCH 11/59] Implementing general settings (work in progress) --- testar/resources/jfx/settings_general.fxml | 16 ++--- .../child/GeneralSettingsController.java | 69 +++++++++++++++++++ .../testar/jfx/utils/DisplayModeWrapper.java | 21 ++++++ 3 files changed, 98 insertions(+), 8 deletions(-) create mode 100644 testar/src/nl/ou/testar/jfx/utils/DisplayModeWrapper.java diff --git a/testar/resources/jfx/settings_general.fxml b/testar/resources/jfx/settings_general.fxml index b01797315..d963d5c93 100644 --- a/testar/resources/jfx/settings_general.fxml +++ b/testar/resources/jfx/settings_general.fxml @@ -39,7 +39,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -75,7 +75,7 @@ - + @@ -93,7 +93,7 @@ - + @@ -111,7 +111,7 @@ - + @@ -120,9 +120,9 @@
- - - + + + diff --git a/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java index 2b2778246..3f3f7fd40 100644 --- a/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java @@ -1,11 +1,23 @@ package nl.ou.testar.jfx.settings.child; +import javafx.collections.FXCollections; import javafx.scene.Parent; +import javafx.scene.control.ComboBox; +import javafx.scene.control.SingleSelectionModel; +import nl.ou.testar.jfx.utils.DisplayModeWrapper; +import org.fruit.monkey.ConfigTags; import org.fruit.monkey.Settings; +import java.awt.*; import java.io.IOException; +import java.util.Arrays; +import java.util.stream.Collectors; public class GeneralSettingsController extends ChildSettingsController { + + private DisplayMode availableDisplayModes[]; + private int displayModeSelectedIndex; + public GeneralSettingsController(Settings settings) { super("General settings", settings); } @@ -18,5 +30,62 @@ public void viewDidLoad(Parent view) { } catch (IOException e) { e.printStackTrace(); } + + GraphicsDevice dev = GraphicsEnvironment.getLocalGraphicsEnvironment() + .getDefaultScreenDevice(); + availableDisplayModes = dev.getDisplayModes(); + + + ComboBox sutComboBox = (ComboBox) view.lookup("#sutConnectorSelection"); + sutComboBox.getItems().addAll( + Settings.SUT_CONNECTOR_CMDLINE, + Settings.SUT_CONNECTOR_PROCESS_NAME, + Settings.SUT_CONNECTOR_WINDOW_TITLE, + Settings.SUT_CONNECTOR_WEBDRIVER + ); + + ComboBox resolutionComboBox = (ComboBox) view.lookup("#resolutionSelection"); +// SingleSelectionModel resolutionSelectionModel = new SingleSelectionModel() { +// @Override +// protected DisplayMode getModelItem(int index) { +// return availableDisplayModes[index]; +// } +// +// @Override +// protected int getItemCount() { +// return availableDisplayModes.length; +// } +// }; +// resolutionComboBox.setSelectionModel(resolutionSelectionModel); + resolutionComboBox.setItems(FXCollections.observableArrayList( + Arrays.stream(availableDisplayModes).map(DisplayModeWrapper::new).collect(Collectors.toList()) + )); + DisplayMode currentDisplayMode = dev.getDisplayMode(); + int index = 0; + displayModeSelectedIndex = 0; + for (DisplayMode displayMode : availableDisplayModes) { +// resolutionComboBox.getItems().add(String.format("%dx%d", displayMode.getWidth(), displayMode.getHeight())); + if (displayMode.equals(currentDisplayMode)) { + resolutionComboBox.getSelectionModel().select(index); +// resolutionComboBox.setValue("Skunk"); +// displayModeSelectedIndex = index; + } + index++; + } + System.out.println(String.format("Current display mode: %dx%d", currentDisplayMode.getWidth(), currentDisplayMode.getHeight())); + System.out.println("General settings: " + settings.get(ConfigTags.OverrideWebDriverDisplayScale)); +// resolutionComboBox.setId(String.format("%dx%d", currentDisplayMode.getWidth(), currentDisplayMode.getHeight())); + +// GraphicsDevice[] devices = GraphicsEnvironment.getLocalGraphicsEnvironment() +// .getScreenDevices(); +// for (int i = 0; i < devices.length; i++) { +//// GraphicsDevice dev = devices[i]; +//// System.out.println("device " + i); +// DisplayMode[] modes = dev.getDisplayModes(); +// for (int j = 0; j < modes.length; j++) { +// DisplayMode m = modes[j]; +// System.out.println(" " + j + ": " + m.getWidth() + " x " + m.getHeight()); +// } +// } } } diff --git a/testar/src/nl/ou/testar/jfx/utils/DisplayModeWrapper.java b/testar/src/nl/ou/testar/jfx/utils/DisplayModeWrapper.java new file mode 100644 index 000000000..6f566caba --- /dev/null +++ b/testar/src/nl/ou/testar/jfx/utils/DisplayModeWrapper.java @@ -0,0 +1,21 @@ +package nl.ou.testar.jfx.utils; + +import java.awt.*; + +public class DisplayModeWrapper { + + private final DisplayMode mode; + + public DisplayModeWrapper(DisplayMode mode) { + this.mode = mode; + }; + + public DisplayMode getMode() { + return mode; + } + + @Override + public String toString() { + return String.format("%dx%d", mode.getWidth(), mode.getHeight()); + } +} From 590deaa9b6d379f01533af961e9a7d05334ade64 Mon Sep 17 00:00:00 2001 From: Michael Tikhonenko Date: Tue, 31 Aug 2021 11:10:52 +0200 Subject: [PATCH 12/59] General settings almost implemented --- testar/resources/jfx/settings_general.fxml | 27 +++---- .../child/GeneralSettingsController.java | 71 +++++++++++++++---- .../testar/jfx/utils/DisplayModeWrapper.java | 14 +++- .../ou/testar/jfx/utils/GeneralSettings.java | 66 +++++++++++++++++ 4 files changed, 151 insertions(+), 27 deletions(-) create mode 100644 testar/src/nl/ou/testar/jfx/utils/GeneralSettings.java diff --git a/testar/resources/jfx/settings_general.fxml b/testar/resources/jfx/settings_general.fxml index d963d5c93..87fb83628 100644 --- a/testar/resources/jfx/settings_general.fxml +++ b/testar/resources/jfx/settings_general.fxml @@ -13,7 +13,7 @@ - + @@ -39,7 +39,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -75,7 +75,7 @@ - + @@ -93,7 +93,7 @@ - + @@ -111,7 +111,7 @@ - + @@ -120,10 +120,10 @@
- - - - + + + + @@ -132,8 +132,8 @@ - - + + @@ -147,7 +147,8 @@ - + +
diff --git a/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java index 3f3f7fd40..d4f17fae6 100644 --- a/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java @@ -2,13 +2,17 @@ import javafx.collections.FXCollections; import javafx.scene.Parent; -import javafx.scene.control.ComboBox; -import javafx.scene.control.SingleSelectionModel; +import javafx.scene.control.*; +import javafx.stage.FileChooser; import nl.ou.testar.jfx.utils.DisplayModeWrapper; +import nl.ou.testar.jfx.utils.GeneralSettings; import org.fruit.monkey.ConfigTags; import org.fruit.monkey.Settings; -import java.awt.*; +import java.awt.DisplayMode; +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; +import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.stream.Collectors; @@ -58,22 +62,43 @@ public void viewDidLoad(Parent view) { // }; // resolutionComboBox.setSelectionModel(resolutionSelectionModel); resolutionComboBox.setItems(FXCollections.observableArrayList( - Arrays.stream(availableDisplayModes).map(DisplayModeWrapper::new).collect(Collectors.toList()) + Arrays.stream(availableDisplayModes).map(mode -> new DisplayModeWrapper(mode, true)) + .collect(Collectors.toList()) )); DisplayMode currentDisplayMode = dev.getDisplayMode(); + System.out.println(String.format("Current dislpay mode: %dx%d+%d+%d", currentDisplayMode.getWidth(), currentDisplayMode.getHeight(), currentDisplayMode.getBitDepth(), currentDisplayMode.getRefreshRate())); int index = 0; displayModeSelectedIndex = 0; +// for (DisplayMode displayMode : availableDisplayModes) { +//// resolutionComboBox.getItems().add(String.format("%dx%d", displayMode.getWidth(), displayMode.getHeight())); +// if (displayMode.equals(currentDisplayMode)) { +// resolutionComboBox.getSelectionModel().select(index); +//// resolutionComboBox.setValue("Skunk"); +//// displayModeSelectedIndex = index; +// } +// index++; +// } + System.out.println(String.format("Current display mode: %dx%d", currentDisplayMode.getWidth(), currentDisplayMode.getHeight())); + System.out.println("SUT connector value: " + settings.get(ConfigTags.SUTConnectorValue)); + GeneralSettings generalSettings = new GeneralSettings(settings.get(ConfigTags.SUTConnectorValue)); + + sutComboBox.setValue(settings.get(ConfigTags.SUTConnector)); + + DisplayMode selectedDisplayMode = generalSettings.getDisplayMode(); + int selectedWidth = selectedDisplayMode.getWidth(); + int selectedHeight = selectedDisplayMode.getHeight(); + int displayModeIndex = 0; for (DisplayMode displayMode : availableDisplayModes) { -// resolutionComboBox.getItems().add(String.format("%dx%d", displayMode.getWidth(), displayMode.getHeight())); - if (displayMode.equals(currentDisplayMode)) { - resolutionComboBox.getSelectionModel().select(index); -// resolutionComboBox.setValue("Skunk"); -// displayModeSelectedIndex = index; + if (displayMode.getWidth() == selectedWidth && displayMode.getHeight() == selectedHeight) { + break; } - index++; + displayModeIndex++; } - System.out.println(String.format("Current display mode: %dx%d", currentDisplayMode.getWidth(), currentDisplayMode.getHeight())); - System.out.println("General settings: " + settings.get(ConfigTags.OverrideWebDriverDisplayScale)); + if (displayModeIndex == availableDisplayModes.length) { + resolutionComboBox.getItems().add(new DisplayModeWrapper(selectedDisplayMode, false)); + } + resolutionComboBox.getSelectionModel().select(displayModeIndex); +// resolutionComboBox.setValue(new DisplayModeWrapper(generalSettings.getDisplayMode())); // resolutionComboBox.setId(String.format("%dx%d", currentDisplayMode.getWidth(), currentDisplayMode.getHeight())); // GraphicsDevice[] devices = GraphicsEnvironment.getLocalGraphicsEnvironment() @@ -87,5 +112,27 @@ public void viewDidLoad(Parent view) { // System.out.println(" " + j + ": " + m.getWidth() + " x " + m.getHeight()); // } // } + + TextField webDriverPathField = (TextField) view.lookup("#driverPath"); + webDriverPathField.setText(generalSettings.getDriver()); + + TextField locationInputField = (TextField) view.lookup("#locationInput"); + locationInputField.setText(generalSettings.getLocation()); + + FileChooser driverChooser = new FileChooser(); + FileChooser locationChooser = new FileChooser(); + + Button btnSelectDriver = (Button) view.lookup("#btnSelectDriver"); + Button btnSelectLocation = (Button) view.lookup("#btnSelectLocation"); + + btnSelectDriver.setOnAction(event -> { + File driverFile = driverChooser.showOpenDialog(view.getScene().getWindow()); + webDriverPathField.setText(driverFile.getAbsolutePath()); + }); + + btnSelectLocation.setOnAction(event -> { + File locationFile = locationChooser.showOpenDialog(view.getScene().getWindow()); + locationInputField.setText(locationFile.toURI().toString()); + }); } } diff --git a/testar/src/nl/ou/testar/jfx/utils/DisplayModeWrapper.java b/testar/src/nl/ou/testar/jfx/utils/DisplayModeWrapper.java index 6f566caba..a51045e39 100644 --- a/testar/src/nl/ou/testar/jfx/utils/DisplayModeWrapper.java +++ b/testar/src/nl/ou/testar/jfx/utils/DisplayModeWrapper.java @@ -5,17 +5,27 @@ public class DisplayModeWrapper { private final DisplayMode mode; + private final boolean supported; - public DisplayModeWrapper(DisplayMode mode) { + public DisplayModeWrapper(DisplayMode mode, boolean supported) { this.mode = mode; + this.supported = supported; }; public DisplayMode getMode() { return mode; } + public boolean isSupported() { + return supported; + } + @Override public String toString() { - return String.format("%dx%d", mode.getWidth(), mode.getHeight()); + String result = String.format("%dx%d", mode.getWidth(), mode.getHeight()); + if (!supported) { + result = result.concat(" (not supported)"); + } + return result; } } diff --git a/testar/src/nl/ou/testar/jfx/utils/GeneralSettings.java b/testar/src/nl/ou/testar/jfx/utils/GeneralSettings.java new file mode 100644 index 000000000..16c40cef7 --- /dev/null +++ b/testar/src/nl/ou/testar/jfx/utils/GeneralSettings.java @@ -0,0 +1,66 @@ +package nl.ou.testar.jfx.utils; + +import java.awt.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class GeneralSettings { + + private String source; + private String driver; + private String location; + private DisplayMode displayMode; + + private final static String TEMPLATE = "\"([^\"]*)\"\\s+\"(\\d+)x(\\d+)\\+(\\d+)\\+(\\d+)\"\\s+\"([^\"]*)\""; + private final static String FORMAT = "\"%s\" \"%dx%d+%d+%d\" \"%s\""; + + public GeneralSettings(String source) { + this.source = source; + Pattern pattern = Pattern.compile(TEMPLATE); + Matcher matcher = pattern.matcher(source); + if (matcher.find()) { + driver = matcher.group(1); + location = matcher.group(6); + + int width = Integer.parseInt(matcher.group(2)); + int height = Integer.parseInt(matcher.group(3)); + int bitDepth = Integer.parseInt(matcher.group(4)); + int refreshRate = Integer.parseInt(matcher.group(5)); + displayMode = new DisplayMode(width, height, bitDepth, refreshRate); + } + } + + public String getSource() { + return source; + } + + public String getDriver() { + return driver; + } + + public void setDriver(String driver) { + this.driver = driver; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public DisplayMode getDisplayMode() { + return displayMode; + } + + public void setDisplayMode(DisplayMode displayMode) { + this.displayMode = displayMode; + } + + @Override + public String toString() { + return String.format(FORMAT, driver, displayMode.getWidth(), displayMode.getHeight(), + displayMode.getBitDepth(), displayMode.getRefreshRate(), location); + } +} From ec79d2c657a11860c19b24a209b2db78a41a0bcd Mon Sep 17 00:00:00 2001 From: Michael Tikhonenko Date: Tue, 31 Aug 2021 13:17:52 +0200 Subject: [PATCH 13/59] General and time settings now readable in UI --- testar/resources/jfx/settings_general.fxml | 53 ++++++++++++------- testar/resources/jfx/settings_time.fxml | 10 ++-- .../child/GeneralSettingsController.java | 14 +++++ .../child/TimeSettingsController.java | 24 +++++++++ 4 files changed, 76 insertions(+), 25 deletions(-) diff --git a/testar/resources/jfx/settings_general.fxml b/testar/resources/jfx/settings_general.fxml index 87fb83628..0f8565ee6 100644 --- a/testar/resources/jfx/settings_general.fxml +++ b/testar/resources/jfx/settings_general.fxml @@ -1,8 +1,11 @@ + + + @@ -27,7 +30,6 @@ - @@ -102,27 +104,8 @@ - - - - - - - - - - - - - - - @@ -151,5 +134,35 @@ + + + + + + + + + + + + + + + + + + +
diff --git a/testar/resources/jfx/settings_time.fxml b/testar/resources/jfx/settings_time.fxml index cec9f9ae5..2b8f98790 100644 --- a/testar/resources/jfx/settings_time.fxml +++ b/testar/resources/jfx/settings_time.fxml @@ -29,7 +29,7 @@ - + - + - - + + - + diff --git a/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java index d4f17fae6..95cf6c0e5 100644 --- a/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java @@ -134,5 +134,19 @@ public void viewDidLoad(Parent view) { File locationFile = locationChooser.showOpenDialog(view.getScene().getWindow()); locationInputField.setText(locationFile.toURI().toString()); }); + + Spinner numSequencesSpinner = (Spinner) view.lookup("#numSequences"); + SpinnerValueFactory numSequencesValueFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(1, Integer.MAX_VALUE); + numSequencesValueFactory.setValue(settings.get(ConfigTags.Sequences)); + numSequencesSpinner.setValueFactory(numSequencesValueFactory); + Spinner numActionsSpinner = (Spinner) view.lookup("#numActions"); + SpinnerValueFactory numActionsValueFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(1, Integer.MAX_VALUE); + numActionsValueFactory.setValue(settings.get(ConfigTags.SequenceLength)); + numActionsSpinner.setValueFactory(numActionsValueFactory); +// numActionsSpinner.getValueFactory().setValue(settings.get(ConfigTags.SequenceLength)); +// numActionsSpinner.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(settings. +// get(ConfigTags.SequenceLength), 1)); + CheckBox alwaysCompileCheckBox = (CheckBox) view.lookup("#alwaysCompile"); + alwaysCompileCheckBox.setSelected(settings.get(ConfigTags.AlwaysCompile)); } } diff --git a/testar/src/nl/ou/testar/jfx/settings/child/TimeSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/TimeSettingsController.java index 106907745..668ec32cc 100644 --- a/testar/src/nl/ou/testar/jfx/settings/child/TimeSettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/child/TimeSettingsController.java @@ -1,6 +1,10 @@ package nl.ou.testar.jfx.settings.child; import javafx.scene.Parent; +import javafx.scene.control.CheckBox; +import javafx.scene.control.Spinner; +import javafx.scene.control.SpinnerValueFactory; +import org.fruit.monkey.ConfigTags; import org.fruit.monkey.Settings; import java.io.IOException; @@ -18,5 +22,25 @@ public void viewDidLoad(Parent view) { } catch (IOException e) { e.printStackTrace(); } + + Spinner actionDurationSpinner = (Spinner) view.lookup("#actionDuration"); + SpinnerValueFactory actionDurationValueFactory = new SpinnerValueFactory.DoubleSpinnerValueFactory(0, Double.MAX_VALUE); + actionDurationValueFactory.setValue(settings.get(ConfigTags.ActionDuration)); + actionDurationSpinner.setValueFactory(actionDurationValueFactory); + Spinner waitTimeSpinner = (Spinner) view.lookup("#waitTime"); + SpinnerValueFactory waitTimeValueFactory = new SpinnerValueFactory.DoubleSpinnerValueFactory(0, Double.MAX_VALUE); + waitTimeValueFactory.setValue(settings.get(ConfigTags.TimeToWaitAfterAction)); + waitTimeSpinner.setValueFactory(waitTimeValueFactory); + Spinner startupTimeSpinner = (Spinner) view.lookup("#startupTime"); + SpinnerValueFactory startupTimeValueFactory = new SpinnerValueFactory.DoubleSpinnerValueFactory(0, Double.MAX_VALUE); + startupTimeValueFactory.setValue(settings.get(ConfigTags.StartupTime)); + startupTimeSpinner.setValueFactory(startupTimeValueFactory); + Spinner maxTestTimeSpinner = (Spinner) view.lookup("#maxTestTime"); + SpinnerValueFactory maxTestTimeValueFactory = new SpinnerValueFactory.DoubleSpinnerValueFactory(0, Double.MAX_VALUE); + maxTestTimeValueFactory.setValue(settings.get(ConfigTags.MaxTime)); + maxTestTimeSpinner.setValueFactory(maxTestTimeValueFactory); + + CheckBox useRecordTimingCheckbox = (CheckBox) view.lookup("#useRecordTiming"); + useRecordTimingCheckbox.setSelected(settings.get(ConfigTags.UseRecordedActionDurationAndWaitTimeDuringReplay)); } } From eb7e9cc65b7d50c24bcf04dec4c677a7442037c9 Mon Sep 17 00:00:00 2001 From: Michael Tikhonenko Date: Wed, 1 Sep 2021 10:58:10 +0200 Subject: [PATCH 14/59] Minor changes in setings scenes --- testar/resources/jfx/settings_section.fxml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/testar/resources/jfx/settings_section.fxml b/testar/resources/jfx/settings_section.fxml index 85467a038..2a5a8dbb3 100644 --- a/testar/resources/jfx/settings_section.fxml +++ b/testar/resources/jfx/settings_section.fxml @@ -15,7 +15,7 @@
- - + - + diff --git a/testar/resources/jfx/settings_new.fxml b/testar/resources/jfx/settings_new.fxml index 36e9ad964..e9ebb0dab 100644 --- a/testar/resources/jfx/settings_new.fxml +++ b/testar/resources/jfx/settings_new.fxml @@ -64,11 +64,11 @@ - + - + diff --git a/testar/resources/jfx/settings_time.fxml b/testar/resources/jfx/settings_time.fxml index bd6d85b9a..4256e95f4 100644 --- a/testar/resources/jfx/settings_time.fxml +++ b/testar/resources/jfx/settings_time.fxml @@ -3,7 +3,7 @@ - + @@ -29,7 +29,6 @@ - - - - - + + @@ -53,7 +54,7 @@ - + @@ -87,7 +88,7 @@ - + @@ -106,7 +107,7 @@ - + - + diff --git a/testar/resources/jfx/main.fxml b/testar/resources/jfx/main.fxml index f15d5b47c..752457d17 100644 --- a/testar/resources/jfx/main.fxml +++ b/testar/resources/jfx/main.fxml @@ -4,6 +4,7 @@ + @@ -13,7 +14,7 @@ - + diff --git a/testar/resources/jfx/settings_child.fxml b/testar/resources/jfx/settings_child.fxml index 64918f6aa..f92a5d421 100644 --- a/testar/resources/jfx/settings_child.fxml +++ b/testar/resources/jfx/settings_child.fxml @@ -7,11 +7,11 @@ - + - + - + @@ -30,11 +30,11 @@ - + - + diff --git a/testar/resources/jfx/settings_filter.fxml b/testar/resources/jfx/settings_filter.fxml index 6d9c87736..829f6c434 100644 --- a/testar/resources/jfx/settings_filter.fxml +++ b/testar/resources/jfx/settings_filter.fxml @@ -4,41 +4,36 @@ + - - + - + + - - - - - - - + - + - + - - + + diff --git a/testar/resources/jfx/settings_general.fxml b/testar/resources/jfx/settings_general.fxml index 6dae9200a..e9ac7b562 100644 --- a/testar/resources/jfx/settings_general.fxml +++ b/testar/resources/jfx/settings_general.fxml @@ -15,14 +15,14 @@ - + - - - - + + + + diff --git a/testar/resources/jfx/settings_git.fxml b/testar/resources/jfx/settings_git.fxml index b3d428459..f53e29c98 100644 --- a/testar/resources/jfx/settings_git.fxml +++ b/testar/resources/jfx/settings_git.fxml @@ -10,12 +10,12 @@ - + - - - - + + + + diff --git a/testar/resources/jfx/settings_misc.fxml b/testar/resources/jfx/settings_misc.fxml index 3ce9eef5f..12ff52b57 100644 --- a/testar/resources/jfx/settings_misc.fxml +++ b/testar/resources/jfx/settings_misc.fxml @@ -11,113 +11,130 @@ - - - - - - - - - - - + + - + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + - + - + diff --git a/testar/resources/jfx/settings_new.fxml b/testar/resources/jfx/settings_new.fxml index e9ebb0dab..6e67aa539 100644 --- a/testar/resources/jfx/settings_new.fxml +++ b/testar/resources/jfx/settings_new.fxml @@ -9,9 +9,9 @@ - + - - + diff --git a/testar/src/nl/ou/testar/jfx/MainController.java b/testar/src/nl/ou/testar/jfx/MainController.java index 16b325957..424e7d33b 100644 --- a/testar/src/nl/ou/testar/jfx/MainController.java +++ b/testar/src/nl/ou/testar/jfx/MainController.java @@ -1,11 +1,13 @@ package nl.ou.testar.jfx; import javafx.scene.Parent; +import javafx.scene.layout.AnchorPane; import javafx.scene.layout.BorderPane; import nl.ou.testar.jfx.core.NavigationController; import nl.ou.testar.jfx.core.NavigationDelegate; import nl.ou.testar.jfx.core.ViewController; import nl.ou.testar.jfx.dashboard.DashboardController; +import nl.ou.testar.jfx.misc.MiscController; import nl.ou.testar.jfx.settings.SettingsController; import javafx.scene.control.*; @@ -14,7 +16,7 @@ public class MainController extends ViewController { enum Mode { - HOME, SETTINGS + HOME, SETTINGS, MISC } private Mode mode; @@ -22,6 +24,7 @@ enum Mode { private DashboardController dashboardController; private SettingsController settingsController; + private MiscController miscController; public DashboardController getDashboardController() { return dashboardController; @@ -32,6 +35,7 @@ public MainController(Settings settings, String settingsPath) { this.settingsPath = settingsPath; dashboardController = new DashboardController(settings, settingsPath); settingsController = new SettingsController(settings, settingsPath); + miscController = new MiscController("Misc", settings); } private void setupMode(Parent view, Mode mode) { @@ -39,12 +43,16 @@ private void setupMode(Parent view, Mode mode) { // final Label titleLabel = (Label) view.lookup("#titleLabel"); // final Button btnBack = (Button) view.lookup("#btnBack"); - final BorderPane contentPane = (BorderPane) view.lookup("#contentPane"); +// final BorderPane contentPane = (BorderPane) view.lookup("#contentPane"); + final AnchorPane contentPane = (AnchorPane) view.lookup("#contentPane"); ViewController targetController; switch (mode) { case SETTINGS: targetController = settingsController; break; + case MISC: + targetController = miscController; + break; default: //HOME targetController = dashboardController; break; @@ -54,7 +62,12 @@ private void setupMode(Parent view, Mode mode) { @Override public void onViewControllerActivated(ViewController viewController, Parent view) { // titleLabel.setText(viewController.getTitle()); - contentPane.setCenter(view); + contentPane.getChildren().clear(); + contentPane.getChildren().add(view); + AnchorPane.setLeftAnchor(view, 0.0); + AnchorPane.setTopAnchor(view, 0.0); + AnchorPane.setRightAnchor(view, 0.0); + AnchorPane.setBottomAnchor(view, 0.0); // btnBack.setVisible(navigationController.isBackAvailable()); // contentPane.getChildren().removeAll(); // contentPane.getChildren().add(view); @@ -73,6 +86,7 @@ public void onViewControllerActivated(ViewController viewController, Parent view public void viewDidLoad(Parent view) { Button btnHome = (Button) view.lookup("#btnHome"); Button btnSettings = (Button) view.lookup("#btnSettings"); + Button btnMisc = (Button) view.lookup("#btnMisc"); btnHome.setOnAction(event -> { setupMode(view, Mode.HOME); @@ -82,6 +96,10 @@ public void viewDidLoad(Parent view) { setupMode(view, Mode.SETTINGS); }); - setupMode(view, Mode.HOME); +// btnMisc.setOnAction(event -> { +// setupMode(view, Mode.MISC); +// }); + + setupMode(view, Mode.MISC); } } diff --git a/testar/src/nl/ou/testar/jfx/misc/MiscController.java b/testar/src/nl/ou/testar/jfx/misc/MiscController.java new file mode 100644 index 000000000..48836586a --- /dev/null +++ b/testar/src/nl/ou/testar/jfx/misc/MiscController.java @@ -0,0 +1,10 @@ +package nl.ou.testar.jfx.misc; + +import nl.ou.testar.jfx.core.ViewController; +import org.fruit.monkey.Settings; + +public class MiscController extends ViewController { + public MiscController(String title, Settings settings) { + super(title, "jfx/misc.fxml", settings); + } +} diff --git a/testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java index 426a6d942..459baf8d3 100644 --- a/testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/child/FilterSettingsController.java @@ -129,8 +129,9 @@ public FilterSettingsController(Settings settings, String settingsPath) { @Override public void viewDidLoad(Parent view) { super.viewDidLoad(view); + Parent filterSection = null; try { - putSection(view, "Filters & oracles", "jfx/settings_filter.fxml"); + filterSection = putSection(view, "Filters & oracles", "jfx/settings_filter.fxml"); } catch (IOException e) { e.printStackTrace(); } @@ -142,23 +143,23 @@ public void viewDidLoad(Parent view) { oracleTags = settings.get(ConfigTags.TagsForSuspiciousOracle, Collections.emptyList()); suspiciousProcessOutput = settings.get(ConfigTags.SuspiciousProcessOutput, ""); - descriptionLabel = (Label) view.lookup("#descriptionLabel"); - textArea = (JFXTextArea) view.lookup("#textArea"); - tagsPane = (FlowPane) view.lookup("#tagsPane"); + descriptionLabel = (Label) filterSection.lookup("#descriptionLabel"); + textArea = (JFXTextArea) filterSection.lookup("#textArea"); + tagsPane = (FlowPane) filterSection.lookup("#tagsPane"); - choiceButtons[0] = (Button) view.lookup("#btnFilterClick"); + choiceButtons[0] = (Button) filterSection.lookup("#btnFilterClick"); choiceButtons[0].setOnAction(event -> { selectItem(0); }); - choiceButtons[1] = (Button) view.lookup("#btnFilterTags"); + choiceButtons[1] = (Button) filterSection.lookup("#btnFilterTags"); choiceButtons[1].setOnAction(event -> {selectItem(1);}); - choiceButtons[2] = (Button) view.lookup("#btnFilterProcess"); + choiceButtons[2] = (Button) filterSection.lookup("#btnFilterProcess"); choiceButtons[2].setOnAction(event -> {selectItem(2);}); - choiceButtons[3] = (Button) view.lookup("#btnOracleTitles"); + choiceButtons[3] = (Button) filterSection.lookup("#btnOracleTitles"); choiceButtons[3].setOnAction(event -> {selectItem(3);}); - choiceButtons[4] = (Button) view.lookup("#btnOracleTags"); + choiceButtons[4] = (Button) filterSection.lookup("#btnOracleTags"); choiceButtons[4].setOnAction(event -> {selectItem(4);}); - choiceButtons[5] = (Button) view.lookup("#btnOracleProcess"); + choiceButtons[5] = (Button) filterSection.lookup("#btnOracleProcess"); choiceButtons[5].setOnAction(event -> {selectItem(5);}); setSelection(selectedIndex, true); diff --git a/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java index 392948575..4ecc9c920 100644 --- a/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/child/GeneralSettingsController.java @@ -38,18 +38,55 @@ public GeneralSettingsController(Settings settings, String settingsPath) { @Override public void viewDidLoad(Parent view) { super.viewDidLoad(view); + Parent generalSection = null; try { - putSection(view, "General settings", "jfx/settings_general.fxml"); + generalSection = putSection(view, "General settings", "jfx/settings_general.fxml"); } catch (IOException e) { e.printStackTrace(); } + System.out.println("General settings loaded"); + GraphicsDevice dev = GraphicsEnvironment.getLocalGraphicsEnvironment() .getDefaultScreenDevice(); availableDisplayModes = dev.getDisplayModes(); - - ComboBox sutComboBox = (ComboBox) view.lookup("#sutConnectorSelection"); +// TextField webDriverPathField = (TextField) generalSection.lookup("#driverPath"); +// TextField locationInputField = (TextField) generalSection.lookup("#locationInput"); +// +// Button btnSelectDriver = (Button) generalSection.lookup("#btnSelectDriver"); +// Button btnSelectLocation = (Button) generalSection.lookup("#btnSelectLocation"); +// +// TextField numSequencesField = (TextField) generalSection.lookup("#numSequences"); +// TextField numActionsField = (TextField) generalSection.lookup("#numActions"); +// CheckBox alwaysCompileCheckBox = (CheckBox) generalSection.lookup("#alwaysCompile"); + +// if (webDriverPathField == null) { +// System.out.println("Failed to lookup web driver path field"); +// } +// if (locationInputField == null) { +// System.out.println("Failed to lookup location input field"); +// } +// if (btnSelectDriver == null) { +// System.out.println("Failed to lookup driver selection button"); +// } +// if (btnSelectLocation == null) { +// System.out.println("Failed to lookup location selection button"); +// } +// if (numSequencesField == null) { +// System.out.println("Failed to lookup sequence number field"); +// } +// if (numActionsField == null) { +// System.out.println("Failed to lookup action number field"); +// } +// if (alwaysCompileCheckBox == null) { +// System.out.println("Failed to lookup sa check box"); +// } + + ComboBox sutComboBox = (ComboBox) generalSection.lookup("#sutConnectorSelection"); + if (sutComboBox == null) { + System.out.println("Failed to lookup SUT combo box"); + } sutComboBox.getItems().addAll( Settings.SUT_CONNECTOR_CMDLINE, Settings.SUT_CONNECTOR_PROCESS_NAME, @@ -59,7 +96,7 @@ public void viewDidLoad(Parent view) { final List availableResolutions = Arrays.stream(availableDisplayModes).map(mode -> new DisplayModeWrapper(mode, true)) .collect(Collectors.toList()); - ComboBox resolutionComboBox = (ComboBox) view.lookup("#resolutionSelection"); + ComboBox resolutionComboBox = (ComboBox) generalSection.lookup("#resolutionSelection"); DisplayMode currentDisplayMode = dev.getDisplayMode(); System.out.println(String.format("Current dislpay mode: %dx%d+%d+%d", currentDisplayMode.getWidth(), currentDisplayMode.getHeight(), currentDisplayMode.getBitDepth(), currentDisplayMode.getRefreshRate())); generalSettings = new GeneralSettings(settings.get(ConfigTags.SUTConnectorValue, "")); @@ -71,18 +108,18 @@ public void viewDidLoad(Parent view) { } resolutionComboBox.setItems(FXCollections.observableArrayList(availableResolutions)); - TextField webDriverPathField = (TextField) view.lookup("#driverPath"); - TextField locationInputField = (TextField) view.lookup("#locationInput"); + TextField webDriverPathField = (TextField) generalSection.lookup("#driverPath"); + TextField locationInputField = (TextField) generalSection.lookup("#locationInput"); FileChooser driverChooser = new FileChooser(); FileChooser locationChooser = new FileChooser(); - Button btnSelectDriver = (Button) view.lookup("#btnSelectDriver"); - Button btnSelectLocation = (Button) view.lookup("#btnSelectLocation"); + Button btnSelectDriver = (Button) generalSection.lookup("#btnSelectDriver"); + Button btnSelectLocation = (Button) generalSection.lookup("#btnSelectLocation"); - TextField numSequencesField = (TextField) view.lookup("#numSequences"); - TextField numActionsField = (TextField) view.lookup("#numActions"); - CheckBox alwaysCompileCheckBox = (CheckBox) view.lookup("#alwaysCompile"); + TextField numSequencesField = (TextField) generalSection.lookup("#numSequences"); + TextField numActionsField = (TextField) generalSection.lookup("#numActions"); + CheckBox alwaysCompileCheckBox = (CheckBox) generalSection.lookup("#alwaysCompile"); AbstractConfigBinding webDriverBinding = new AbstractConfigBinding(webDriverPathField) { @Override diff --git a/testar/src/nl/ou/testar/jfx/settings/child/MiscSettingsController.java b/testar/src/nl/ou/testar/jfx/settings/child/MiscSettingsController.java index 55181fa35..69efcf52d 100644 --- a/testar/src/nl/ou/testar/jfx/settings/child/MiscSettingsController.java +++ b/testar/src/nl/ou/testar/jfx/settings/child/MiscSettingsController.java @@ -35,6 +35,14 @@ public MiscSettingsController(Settings settings, String settingsPath) { @Override public void viewDidLoad(Parent view) { super.viewDidLoad(view); + +// try { +// putSection(view, "Stub", "jfx/settings_stub.fxml"); +// } catch (IOException e) { +// e.printStackTrace(); +// } +// if (true) return; + try { putSection(view, "Misc", "jfx/settings_misc.fxml"); putSection(view, "Files on SUT startup", "jfx/settings_startup.fxml"); @@ -44,6 +52,7 @@ public void viewDidLoad(Parent view) { } catch (IOException e) { e.printStackTrace(); } + if (true) return; Button btnSelectOutDir = (Button) view.lookup("#btnSelectOutDir"); diff --git a/testar/src/nl/ou/testar/jfx/settings/child/SettingsEditController.java b/testar/src/nl/ou/testar/jfx/settings/child/SettingsEditController.java index f64ea318d..84b3af745 100644 --- a/testar/src/nl/ou/testar/jfx/settings/child/SettingsEditController.java +++ b/testar/src/nl/ou/testar/jfx/settings/child/SettingsEditController.java @@ -3,6 +3,8 @@ import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.control.*; +import javafx.scene.layout.AnchorPane; +import javafx.scene.layout.Priority; import javafx.scene.layout.VBox; import nl.ou.testar.jfx.core.ViewController; import org.testar.extendedsettings.ExtendedSettingsFactory; @@ -46,18 +48,30 @@ public void viewDidLoad(Parent view) { } // TODO: put some docs - protected void putSection(Parent contentView, String title, String resourcePath) throws IOException { + protected Parent putSection(Parent contentView, String title, String resourcePath) throws IOException { FXMLLoader loader = new FXMLLoader(getClass().getClassLoader().getResource("jfx/settings_section.fxml")); VBox sectionBox = (VBox) loader.load(); loader = new FXMLLoader(getClass().getClassLoader().getResource(resourcePath)); - sectionBox.getChildren().add(loader.load()); + Parent section = loader.load(); + VBox.setVgrow(section, Priority.ALWAYS); + sectionBox.getChildren().add(section); Label titleLabel = (Label) sectionBox.lookup("#titleLabel"); titleLabel.setText(title); +// AnchorPane contentPane = (AnchorPane) sectionBox.lookup("#contentPane"); +// contentPane.getChildren().add(contentView); +// AnchorPane.setLeftAnchor(contentView, 0.0); +// AnchorPane.setTopAnchor(contentView, 0.0); +// AnchorPane.setRightAnchor(contentView, 0.0); +// AnchorPane.setBottomAnchor(contentView, 0.0); + VBox contentBox = (VBox) contentView.lookup("#contentBox"); + VBox.setVgrow(sectionBox, Priority.ALWAYS); contentBox.getChildren().add(sectionBox); + + return section; } protected boolean needsSave(Settings settings) { From 33b1e3459dc362c7cc7d97f3698a46109bf37620 Mon Sep 17 00:00:00 2001 From: Ardolynk Date: Sun, 12 Dec 2021 16:54:15 +0100 Subject: [PATCH 50/59] Making JavaFX UI resizable (near complete) --- testar/resources/jfx/Untitled.fxml | 22 +++ testar/resources/jfx/main.fxml | 45 ++---- testar/resources/jfx/misc.fxml | 11 ++ testar/resources/jfx/settings_filter.fxml | 2 +- testar/resources/jfx/settings_general.fxml | 30 ++-- testar/resources/jfx/settings_git.fxml | 10 +- testar/resources/jfx/settings_misc.fxml | 15 +- testar/resources/jfx/settings_misc_old.fxml | 135 ++++++++++++++++++ testar/resources/jfx/settings_section.fxml | 9 +- .../resources/jfx/settings_sonar_project.fxml | 15 +- testar/resources/jfx/settings_sonarqube.fxml | 14 +- testar/resources/jfx/settings_time.fxml | 22 +-- testar/resources/jfx/settings_web.fxml | 3 +- .../src/nl/ou/testar/jfx/MainController.java | 3 +- .../nl/ou/testar/jfx/misc/MiscController.java | 2 +- .../child/MiscSettingsController.java | 8 +- .../child/SettingsEditController.java | 10 +- .../child/WhiteboxSettingsController.java | 6 +- testar/src/org/testar/monkey/Main.java | 4 + 19 files changed, 257 insertions(+), 109 deletions(-) create mode 100644 testar/resources/jfx/Untitled.fxml create mode 100644 testar/resources/jfx/misc.fxml create mode 100644 testar/resources/jfx/settings_misc_old.fxml diff --git a/testar/resources/jfx/Untitled.fxml b/testar/resources/jfx/Untitled.fxml new file mode 100644 index 000000000..f819b39ce --- /dev/null +++ b/testar/resources/jfx/Untitled.fxml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + diff --git a/testar/resources/jfx/main.fxml b/testar/resources/jfx/main.fxml index 752457d17..c761571ce 100644 --- a/testar/resources/jfx/main.fxml +++ b/testar/resources/jfx/main.fxml @@ -1,6 +1,7 @@ + @@ -8,10 +9,6 @@ - - - - @@ -45,43 +42,21 @@ - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - + + + + + + +
- +
diff --git a/testar/resources/jfx/misc.fxml b/testar/resources/jfx/misc.fxml new file mode 100644 index 000000000..8c5e62e5c --- /dev/null +++ b/testar/resources/jfx/misc.fxml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/testar/resources/jfx/settings_filter.fxml b/testar/resources/jfx/settings_filter.fxml index 829f6c434..0156e2511 100644 --- a/testar/resources/jfx/settings_filter.fxml +++ b/testar/resources/jfx/settings_filter.fxml @@ -20,7 +20,7 @@ - + diff --git a/testar/resources/jfx/settings_general.fxml b/testar/resources/jfx/settings_general.fxml index e9ac7b562..c2d856ecb 100644 --- a/testar/resources/jfx/settings_general.fxml +++ b/testar/resources/jfx/settings_general.fxml @@ -15,23 +15,23 @@ - + - + - + - + - - - - + + + + - + - + - + - + - + - + - + diff --git a/testar/resources/jfx/settings_git.fxml b/testar/resources/jfx/settings_git.fxml index f53e29c98..63b2d4513 100644 --- a/testar/resources/jfx/settings_git.fxml +++ b/testar/resources/jfx/settings_git.fxml @@ -18,9 +18,9 @@ - - - + + + -