From 869052ece09486a48f63f6c69fdf78101acefaff Mon Sep 17 00:00:00 2001 From: Rhythm7845~ <66195447+Rhythm7845@users.noreply.github.com> Date: Tue, 24 Oct 2023 17:43:33 +0530 Subject: [PATCH] Completed Project --- bin/AddBook.class | Bin 2767 -> 3210 bytes bin/AddBookFailure.class | Bin 0 -> 1567 bytes bin/AddBookSuccess.class | Bin 0 -> 1542 bytes bin/App.class | Bin 548 -> 378 bytes bin/Authenticate.class | Bin 1076 -> 1076 bytes bin/Dashboard.class | Bin 2269 -> 2342 bytes bin/IssueFailure.class | Bin 0 -> 1545 bytes bin/IssueSuccess.class | Bin 0 -> 1537 bytes bin/Library.class | Bin 1379 -> 1496 bytes bin/Login.class | Bin 3112 -> 2816 bytes bin/ReturnSuccess.class | Bin 0 -> 1542 bytes bin/SearchBook.class | Bin 0 -> 2264 bytes bin/SearchBookFailure.class | Bin 0 -> 1557 bytes bin/ShowBook.class | Bin 0 -> 3171 bytes bin/TreeNode.class | Bin 383 -> 387 bytes src/AddBook.java | 25 ++++++++--- src/AddBookFailure.java | 34 ++++++++++++++ src/AddBookSuccess.java | 33 ++++++++++++++ src/App.java | 5 +-- src/Authenticate.java | 8 ++-- src/Dashboard.java | 21 ++++++--- src/IssueFailure.java | 33 ++++++++++++++ src/IssueSuccess.java | 33 ++++++++++++++ src/Library.java | 13 ++++-- src/Login.java | 34 ++++---------- src/LoginFailure.java | 2 +- src/ReturnSuccess.java | 33 ++++++++++++++ src/SearchBook.java | 58 ++++++++++++++++++++++++ src/SearchBookFailure.java | 33 ++++++++++++++ src/ShowBook.java | 73 +++++++++++++++++++++++++++++++ src/{Tree.java => TreeNode.java} | 5 +-- 31 files changed, 390 insertions(+), 53 deletions(-) create mode 100644 bin/AddBookFailure.class create mode 100644 bin/AddBookSuccess.class create mode 100644 bin/IssueFailure.class create mode 100644 bin/IssueSuccess.class create mode 100644 bin/ReturnSuccess.class create mode 100644 bin/SearchBook.class create mode 100644 bin/SearchBookFailure.class create mode 100644 bin/ShowBook.class create mode 100644 src/AddBookFailure.java create mode 100644 src/AddBookSuccess.java create mode 100644 src/IssueFailure.java create mode 100644 src/IssueSuccess.java create mode 100644 src/ReturnSuccess.java create mode 100644 src/SearchBook.java create mode 100644 src/SearchBookFailure.java create mode 100644 src/ShowBook.java rename src/{Tree.java => TreeNode.java} (87%) diff --git a/bin/AddBook.class b/bin/AddBook.class index 6cd32106f4921f725a1af579c878b9355b3e6baa..c6ec40888dd4c1cd88ef1ff3acdc09d3018d83db 100644 GIT binary patch literal 3210 zcmZuzTW}j!8U9WzdzH;Pw$-?ao3^&oo2)o-aC$>dLv6>hoyv|AJ9g!^kd?G?Hj#Io z-BoUsrllniT1X+K^qxYCo6;5tG*YN%3Nu_Dm|=Khcx8s+fxhv^Fhlvy?#hU5vz_yPmhzP`v>L>J5J?=@dFhUNA2=RDK4(x&Sfmf;B070j%_+H~5?I=XYZPavArbI11R?h%33bdA=5qUYHb zS?ctBUZCDHy@DaI!RPXAOc|%VlxY<5WNOfh-VvK7qQ{H6Mc&f_>+*)1bIb+l137k? zmg()LzIfNPKxEL)8&R~<9ceym>rP%p9X4uc!6teW4-6G_hB)atjI^(7TE#86Rl#QF zBaA`AZMdDb<_vGtay{M3(aCl3uH_ilLZCx~f~bNm0yizEXxK6HY5lZa^i*`>PHFcp z>Wz=`M_LlNM?)N4^w2fDfKy;|=$A}#fE&{-ea>)v?*z7L=*Bkcq0FRthR)PeW7o8T zp6lzD*0V+-iZ76PN+vhip<+8WD!5mmaoNq3ZFy1L&&*C5bGFfOa8$)kJSg4$qQJ%* zq$zNJJNh*2!b5>8QVZ=@IWIBvS;3b=ziMk5MZW-4?8Zi!!95x@G)k~9ieWm_@7Fuo zA&H|J)}t|sM+DUUVfh2fn1&`v*~f_XtaL*_+^?Y-jS42isw_8j(0WlEWV5jCRU8PM zcvQnWs1odxkH<7Tjwb|K*r3;U`j)ClZ!`;xJc_R{H^X+v07pQEp=($x)eGdLAvS%Y zO3R=&1dMSg>7V--6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CuaApMIKni3#|*aUAsZ%zd)TH_;J$1D9wVr~2DSuqHvj+t literal 0 HcmV?d00001 diff --git a/bin/AddBookSuccess.class b/bin/AddBookSuccess.class new file mode 100644 index 0000000000000000000000000000000000000000..785caae98f92fa1135e240bab6825a1132b4ca87 GIT binary patch literal 1542 zcmZuxYi}Ay6g>mjV6rw3<2>xx!D-V1cA@XOB}r>Lc4`O5sfkHQp92hZW4w!Ym$-@A zztiuP8jxzKKcIi8->RP3MSdhfnqlV7+;h)8_s;(F-(PwBJU3CvW^VFc!~!1ztmGQHaZ;at8Z5LvfdDuzjc=!ifZVI&MpAW4v%k5cMN@~C6G)eDAEGcCsgh_W~(Bf+kG#N6f)X%hH$wp{_?dr1TGo4j4J{YuJVGL0&^p1olIcc zk(TTzhXJ(DoPn#DCk}n8<_je-MnoO_n!w~q@J-wDVpwGARn@Uoc7H351-zw6yv@LG z;2(gz^Qy=d*-+gWa&*$w$jVkrwX$wdly<+{eICaRB=odoU>WZP)O378ok>Ppe342c zkxuFu)F6fr1VX#_;wU09!Aw6k5JgOHKQ-_fRs>QE{%UEjp9%4%;`_1{v81&t8@P#E zEHQBe3THgm?ZcjJv31J%pt4&2Q=@kN(!f_(6}U{{@2IxycfIwl?W*0La-?oIHcf6+ z*mVPU5T~Ihn+Mu?)4*MPEnv`jPr2p`+32!#k=&D@s@n$c>GL?xYo=@Zr-_Pbsr&uI zhH@ST_tO=-DZ4f4n0h}lM!cU*S0GtA|6thD7uwW(Pj&iT$w!bl&CIU_`>rj`u3un* z%=vfWTM3bn{!@COoVM*8D#~{4jBIBG-_S45SNjp_Q9KryJ?X~R?iqN3Z%LrTCbs)d zlUihQBkBD|wcB{AnqFCJ_q~B1w3yMB>GmkNfZ(`#n$2tIjEu_2}hxL8Pu zdiwn#K75If3V(78@QMEC;pc_r z0ls)t&|7~oKEQ3BuN5K#Z0Kq051&?r^BR(zV;CpJOC-5Sl0{5n1ylTpCb7-0&K}ZK zI)k4u1CzHbesCOI!4YQhE9S66glv!$?qip`BIgJAhAFRLgZ@=tgooH4iLlRoi1(7D wThly$N0bb|)4amayrz7-d9qnRg6KNN#lUA2gWmX&oCKurB@$dVxD28BKSV2P!~g&Q literal 0 HcmV?d00001 diff --git a/bin/App.class b/bin/App.class index aa0573d40bd0d0819651ec878767e060fc2bf404..8f65a6ae35d693d792417642f7aab737553fb423 100644 GIT binary patch delta 214 zcmYjLs}90I5S+VSd-Q;Eyo1C6A*sSa4HnH8KuAq%5IDZ!!Y^Qus3wr`0eljIFbx94 z&g{F?wqBfFUuSwza8CN=r&H`m>A&5=s04 z{wU*YC1Q++PG|O=edgWy_g}H-^rQ_AiNC&d4{qhBmZhV zaQ);)xS`Kbabiz|J&{ONXNMMYC=on;kRt}eA&)d%9|##S)S7qB+-o;YWE8ZO7wh85 z^M|R7qY=jjLv`Nuqi}30U>wNELOmNIl7NO(|A7*+8;=vuzm&?TNj8oY6AgM$j+RKv zQLmyb2NRq=bpjkhqX-nIux=-?Ur~OcQo|C(JT)HI{8HP_$pI~bavNB^jc`$y#IJU7v0ES(P8X8{*Wn4=D diff --git a/bin/Authenticate.class b/bin/Authenticate.class index e344821ea2fccfd5260bba8cce633b9762517b85..9838ba2f0d5f24c13efac8a9be6c7836704567d7 100644 GIT binary patch delta 41 wcmdnOv4vwp3?pOEk3H7>1vddy^Z&EjDTT2c@LY)+8-0KgCuG(jNhXZ4nB^qM)Ih86`70_nh~8&v)MU`_6d~ zy%UT4^3S~=f&F~^S>(&z=DeLhy5x*4IgVXag!UDR1?L%smQ2kk^l>|9g$YE^h?&&U zplEcD1sZ~>8H2{pRZCl(W-rj9Fp?ShrDh^1Hkxdr%^gsEo7zpbkdSc6a;6I_mLe!b zZ~s>Jx@vCdq}!lN&m+Hvi9y(4r=sp+_DZ%t zyX^EIvWrfb-HPzEmA9?L$xMVD?C~@`mGd3WR?xmnZ@j!h*7*`@-k->rj+-%RVu7x&&^AX_2lVVCtfjml{4-`tsJ_* zMT3I7pl{JGG4Fn&ca2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?Bh>*_)EU4 zzbW;xDD-yKZI*Ckr#L6H{z-6JP9`9^=7BOR`W^02w?($Xnh4HmnL)J7C?Sb)xylI< zI3S|-`^?SN?gz}mLy^nEz3z9ac$4&Bk#&F#uF5kkwYTN}4)4lNU&&j%&xf@92WFY~ AXaE2J diff --git a/bin/IssueFailure.class b/bin/IssueFailure.class new file mode 100644 index 0000000000000000000000000000000000000000..110a9d2416809e87a39c8a26c4cbc676cf626158 GIT binary patch literal 1545 zcmZuxYi|=r6g^`*v12yz1BXXKfp?jfuhZIkqS6g0pMwu1Sm9 zztiuPT3aGge?b2b-%!u&T8VkAG_x~z?&I8Z@63O%Ui=H-I@(c$1dL7B?W>A3yM0GR z5fMl~kCHK&@I;E|OBM&H_6j;#ml05WE>Y1{<(yf+f+E&$cJ!L6JAZ9;Z>wBJU z3Cvbs^AU*40+ZKF%k*vtgmd}2KxEx+s~DzfFanVE?5wE)Wt+DBG>$M52BwgtM$Y$H z>Pn)jc@Dvq^Ytjw0;i9G-EquzRsLr8y*N_HXwzANXl|2Vz8;6bSp(;AUSP^qUZ5#3 zKXR>83uN2Uk{#tRfVP=8Z~+VSLz|lUTnS9jqYi#iVEQdKp5(w?wjiZRf6qEeaKol{({oKG8SQSXgcKgj5Um6SXt}gHyD`HvG zRyJ@A*I8@&5h#pVuGh!ykcOh|-mtP4s+&&BF zS5_eN`t|Uobdiw$jk>R#ecL%uB<gx-G@q!JSJuq^VBkkhWwdR&J<=^8I4+!I^Okqwp00T$ep~iN6vcxu z6;qR*8t18~QDTXK!WR~}|{l(+}H+a5Qhzziyr_H~7SXItzNOF#0k`T`la yB;nRI&OZ?)!tXV%Ff^_i-`@h!EFwYgI>wp6W)y?g_=%VVq;Dk>TsFB3q4hsLNo&*q literal 0 HcmV?d00001 diff --git a/bin/IssueSuccess.class b/bin/IssueSuccess.class new file mode 100644 index 0000000000000000000000000000000000000000..0a158bf696621148372fdb2fdabee4f70c52a03c GIT binary patch literal 1537 zcmZuxYi}Ay6g>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O#Uf#!iePgB(kL1pPRQ5sdLP&VNtfIF3<=$%N#ovw-si#cP;W>3@=gh2e+km!}W# zA(IoQ?T_#={aH_rPk67Vtr-4@Kk>8^sgTw~Nd1|w5o*8AcfQK^7wT?B>?bbu8ia&5^8 diff --git a/bin/ReturnSuccess.class b/bin/ReturnSuccess.class new file mode 100644 index 0000000000000000000000000000000000000000..4031c2f3f881ce3e33b0f22cac5bb32525c3a35a GIT binary patch literal 1542 zcmZuxYi}Ay6g>mjV6rxk;5_Wu!D-V1cA@XOB}p4Qc4`O5sfkHQp92hZW4w!Ym$-@A zztiuP8jxzKKcIi8->RP3MK(@?G{elDx#ymH?w$STzrX$la1*U4LITr!%IiB;wcl(i z*Nq|~kbWwk$zMwDk!f{G+nbI&R8dR{ENFX49(g78Oj%y(cGEL$t75vIvXmnbvk%t# zo@ZMEvz0R#fw?R&dBe0!@0LI~m#+y#*6o&xVOk(MA`nLy2?J9|5+vuNl)92Us-8nS z<$NuQw7~fjDt8^TRgur_z86Od8SOetxZDD zOLmmQ0NQ8Xz!fYIhdx#Fg%X$`q7HtQlAQ$Kv@I`&C8l0g9b0Ahx8hjDTbjh%4EzTE z0mwVAid>Nm)r}!1Ft=vg2U*82ifU!upf2rxxBEPf>qzKn*}w|k3)pE2L>tRTTYQ~L zBb`o48I&Q04+KKH_u?obF~wv*HV{QjZ$CBg8CC^SvekOEy4S`+ys7@aaz!j_`N{@v z;3lg~9D%}^=em8^vn_T{IUf{PSK!pBoxe2j6>bY$qV{)GTlTx&de?T&NrfjfxP(38yr?YwE=F1{8p=)9*~^M!15S-nW^Nl@5r1NZcKoaZ&uHT}~>#kAD@ z{$WEo4}<&ZirtjmnsiLP9~mRw&!#JosGNB+?CNuEO1`H${jTIQNSr3-mx7(wmS)#4 zu|VeR%kZs)NJ#%NJy1^Db`BL)yE>-YxZWH3?fGIqLOqJdY?+gOeC?irC-{~GI&5RR z?=&ezCO1;ve^$GVr>g0dwRGPb_(5wKZJBP5dJ71SE2r7KhECqoRgcQ=$lge!co1gO z)T*b?2vyWHvBXGWjtLIvzT+I?dJ3AuIqv?YHO&9t3Tb1AnZhwr^@&I_mW&N?et-*w zlvqiH9uF{gjKz978%}11xK=sF^?Lfd^J4DC^N#Qb49#oC$6FwqMI?x>V_XP)MltA(AIV8T`d%WzWrNEQn*ReBUu*vW literal 0 HcmV?d00001 diff --git a/bin/SearchBook.class b/bin/SearchBook.class new file mode 100644 index 0000000000000000000000000000000000000000..6f84c060762076ce320bc8ed5661115657fafa53 GIT binary patch literal 2264 zcmZuy$#N4{6g>|Mx7;+bEo3tp5JQ3_8^k;r9I(Ly$QUDIB9f4_q{eQLyG?h?24{dI zWFiw8sr&$o>`28D6<4Jyt5mVgCW~ycNq!)kERxE3-NLp2yVS#d_uY5Tx#!+~_}`B| z0XTxY3YG|{8AEsSML|d)a#^3!uch2+(;7>i>~-`BLqWa3I%!Yo(_YG$GAu83 zEbp1Nl{Q_^unb3_u4v{28q#Sq=jhJ$PJyMK=@kuuRq2|LBgQqa*EEU+y41V=;Q}qS zKHVkHvn@J=b9(;DaoruK?_tw2y)K>nHW{E5~~%g5>TqCYFLA{3^QhU1D5OQR-Q>OiznuxG=T6mC1}J9gmkMt>=tl7~APQBFR1!Q_+s7f}H}(=hN)9Eia7SWHV!o z*+%T#fQlX1E7RR4u<|K11?jirfQExO6r>`f@cc!|OAB*Wa9E)A=`{|61%rxCL?w&I zG&De!uLl$yuTnWLwxH@^^s?ANO;z*+8wWHjgC<`O$V*zoAWjQ3>xIJOLfo_{!>37= z8HaI(nELEkH`OKcI;&y13@qE{fG-PfXetrQewdbS3MzV3eC*(2&Ii zDxQ@)Zd}q!MX#r5yT;I@;pnnmDBE~d882yg8I3edG6%W&6%DUK7tpx*tl^q7dQNsv zD1IT3QeHzruB%)hHC@wRZA_b%ak?~-Gn|pYKa#fddT~^DO!;0lhP-jpW$5%mv$MHW zzd?Ns2}El<(6`d3QTO}&jNx3eoe6`SY*@s}Vt!A^vEWPC!lVLQV9mS&pYYRg6&xB3 z?756xa%9Iv*>U~`zh8%PmyNvFseqbmkOLrR>rO$1iz%twM#X9jB;-o`srpmDXN7fD*p7^$X}xS-%&%5Q0ol*MpQtMiM9oOJwY5x5?Mr3 z6%J*RV@PHlgl6|=JnCvtpY#==;48YwW8}d13GX$fx*8V{Y?nk}BYCakZz)3jNO0uw z3fZ*&ojvH^*(|&-;g6-DcM~97dP~b+$w+erE0Pb;I*YdC9M)&+LrvkPa0Rh4HYc0K zoo3Nd#@0EsXCvDxNTu87up=AURo4`)U{4wQxv4W7Ia0y%vpAak0Y_`sySd(zjhv{U zZx;Pr@2_1yDNV^TP6d8LzTYs7!%zAR`+n_ZWX>n$Nsk`-A3Y5F5A|i7r{{~wP#G8H zC3oK^z~J>F%MDh$p8t}V^}NPO%P!K=jb;oXf*hi-(L!mp;x<;{E>`0^es{h{8y;XC ze&()+*nnSIfZwnQzhg80z!v<;&&MT3Zw;u$7{>Xw3$rkBnZyfRK`|%*{-%#C+C`$7 zkZA8=`5fE|O3Zw^YV5xkFj~e;t=et>>vkoPv0=l#>$ewkmJ!|jd= zK9+GL?m9@^UBn1%CGt2?CWx*bF?1k>ZP<(L*vF4d7j~kL`JTdV3}X+@(wfD7j=qCF zu4IsL6_@1l6MRZMUF4zxpAk_XvERYxJo5{l)`U|d-^a6`eD|4^0!U(>z>-~124 C`XNUE literal 0 HcmV?d00001 diff --git a/bin/SearchBookFailure.class b/bin/SearchBookFailure.class new file mode 100644 index 0000000000000000000000000000000000000000..0d3663a0134fbe1deb6f884b0c4b104de7841030 GIT binary patch literal 1557 zcmZuxe{)ht6g>+h5PS(gBvBI+(bftiLVq_cYHMP!iNt6yD7Lm;V8N&4J?8N+tu81%5J*&%bQ(|BZ2Ngh znw`F*!Uzc@pUD^U*Fx{WwAzKOk|XzNpA=Zs_JTZc3+jck+``R9zlGtOivp9^Ov`j{2m~|Psz7MnZmI~T1?ENs(ypEEd92cP(uyL8n1Lz8 ziJ9?03mr*X71trVVzwG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in~i*ab=9?&F|%G>lBp>2Op9JsLCW|g9ktM-V7XPF^UFy|FYDN-J}FSp zF#(J9%&!R~%j|dA6Ghu%?WaQ~R8}qvm2y$XlVCI0%6#mWmyA-u>nhl;94Jc1P;{`y zNTi?do{kbGDJar+ey=SMU(qp*s{%SroRhA3)fg!-uOn@b2kSr5@nf|f4n*Qph zjA_Z!rHK*g39`1Z*=|yX2@Q zQ_m*jEBMWAVC1sQd1(#Tx#O(wK+w9b;fAWPNfnH@biAzy*7BxXWDqpGOLzT5=rPPf z$&oR9@O2Syy9v2`651B%H^c%#_+MiS7AWIXDs$0f0hgvNH;DCBrk0I|jieXq{fs;L^3UuvaYz`=Q+2-k(=X#D&?3XOrJU8)M+|uxs z!0u&2Ol#5}mtoTnT3HWcV>{ETet#$MetByM(SgB-4J%)e?(PiRM5&lAV>vuR$|Nfk z2d9g29rzPv_%Kf8p$koP8HGaD^kjNdHGUJtAK7{aRpuRS5mEe!u|MuND1Ul~E#+)@ zmimHOfsNhEJ%%zBD2wNCSHW;y>1y~^V9y$Q)^k|Hf|hu3s*?XIRPzAg zF~m;IFZz@0>t%XynYT_lHXwK44RV*Xc?~4 zB6ZQa=p0&Su_w7%ys=sAn?)koK7;)WNDa5o<33;x-|gSGfcuBz4^-CC#L-zCQ>)24 zXl|dy@jEy{7gBpZyu+8;0(@E{p>3AN^o`_Lq7Ouq$#orNxSEVB7qOA1G0B7C#JdIUgq}lxuNv88_R) zc09+oO77zyc%E+&uD^g6gOn4yIaf(|i|O%_3dK#-F5uc6-XI5WhC+E016*t7pL8;d z`aVQ#0q@M=z1wB-VJ<}SGw7pCg3mMa#n#~;n#fbrTq6q{J|e@`{URCI8*li QHLDTiTi_ea{?9bwArEIrQEIAQR$^HqgTlm*lK@~V2%-Q0 diff --git a/src/AddBook.java b/src/AddBook.java index 2cf2198..a7b22ec 100644 --- a/src/AddBook.java +++ b/src/AddBook.java @@ -3,13 +3,14 @@ import java.awt.event.*; public class AddBook extends JFrame implements ActionListener { + Library lib = Library.getInstance(); JButton backDash; JButton add; TextField title; TextField author; TextField quantity; TextField description; - + AddBook(){ super("Dashboard"); setLayout(new GridLayout(5,2,8,8)); @@ -66,16 +67,28 @@ public void actionPerformed(ActionEvent e) { dispose(); } if(e.getSource() == add){ + if(title.getText().equals("") || author.getText().equals("") || quantity.getText().equals("") || description.getText().equals("")){ + new AddBookFailure(); + return; + } String title = this.title.getText(); String author = this.author.getText(); + try{ + Integer.parseInt(this.quantity.getText()); + }catch(NumberFormatException nfe){ + new AddBookFailure(); + this.quantity.setText(""); + return; + } int quantity = Integer.parseInt(this.quantity.getText()); String description = this.description.getText(); Book book = new Book(title, author, quantity, description); - new Dashboard(); - dispose(); + lib.insert(book); + new AddBookSuccess(); + this.title.setText(""); + this.author.setText(""); + this.quantity.setText(""); + this.description.setText(""); } } - public static void main(String[] args) { - new AddBook(); - } } \ No newline at end of file diff --git a/src/AddBookFailure.java b/src/AddBookFailure.java new file mode 100644 index 0000000..d46228b --- /dev/null +++ b/src/AddBookFailure.java @@ -0,0 +1,34 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class AddBookFailure extends JFrame implements ActionListener{ + JButton okButton; + public AddBookFailure(){ + super("Failure to add book"); + setLayout(new GridLayout(2,1,8,8)); + setSize(300, 600); + Font fontRegular = new Font("Segoe UI", Font.PLAIN, 20); + + JLabel failLabel = new JLabel("Please fill all the fields correctly"); + failLabel.setFont(fontRegular); + + okButton = new JButton("OK"); + okButton.addActionListener(this); + okButton.setFont(fontRegular); + + add(failLabel); + add(okButton); + + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + pack(); + setResizable(true); + setVisible(true); + } + public void actionPerformed(ActionEvent e){ + if(e.getSource() == okButton){ + dispose(); + } + } + +} \ No newline at end of file diff --git a/src/AddBookSuccess.java b/src/AddBookSuccess.java new file mode 100644 index 0000000..eb61881 --- /dev/null +++ b/src/AddBookSuccess.java @@ -0,0 +1,33 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class AddBookSuccess extends JFrame implements ActionListener{ + JButton okButton; + public AddBookSuccess(){ + super("Success"); + setLayout(new GridLayout(2,1,8,8)); + setSize(300, 600); + Font fontRegular = new Font("Segoe UI", Font.PLAIN, 20); + + JLabel failLabel = new JLabel("Book added successfully"); + failLabel.setFont(fontRegular); + + okButton = new JButton("OK"); + okButton.addActionListener(this); + okButton.setFont(fontRegular); + + add(failLabel); + add(okButton); + + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + pack(); + setResizable(true); + setVisible(true); + } + public void actionPerformed(ActionEvent e){ + if(e.getSource() == okButton){ + dispose(); + } + } +} \ No newline at end of file diff --git a/src/App.java b/src/App.java index 822af26..3d90f6d 100644 --- a/src/App.java +++ b/src/App.java @@ -1,6 +1,5 @@ public class App { - public static Library lib = new Library(); - public static void main(String[] args) throws Exception { + public static void main(String[] args) { new Login(); } -} +} \ No newline at end of file diff --git a/src/Authenticate.java b/src/Authenticate.java index 7ef5e64..5010b37 100644 --- a/src/Authenticate.java +++ b/src/Authenticate.java @@ -1,11 +1,11 @@ -import java.util.HashMap; +import java.util.*; public class Authenticate { HashMap userDatabase = new HashMap<>(); boolean Check(String enteredUsername, String enteredPassword) { - userDatabase.put("rhythm", "077"); - userDatabase.put("zayaan", "058"); - userDatabase.put("nilansh", "069"); + userDatabase.put("Rhythm", "077"); + userDatabase.put("Zayaan", "058"); + userDatabase.put("Nilansh", "069"); if (userDatabase.containsKey(enteredUsername)) { String storedPassword = userDatabase.get(enteredUsername); diff --git a/src/Dashboard.java b/src/Dashboard.java index 5c70275..2bbfa94 100644 --- a/src/Dashboard.java +++ b/src/Dashboard.java @@ -6,8 +6,7 @@ public class Dashboard extends JFrame implements ActionListener { JLabel welcomeLabel; JButton addBook; JButton searchBook; - JButton issueBook; - JButton returnBook; + JButton logOutButton; public Dashboard() { super("Dashboard"); @@ -22,14 +21,14 @@ public Dashboard() { searchBook = new JButton("Search Book"); searchBook.addActionListener(this); searchBook.setFont(new Font("Segoe UI", Font.PLAIN, 20)); - issueBook = new JButton("Issue Book"); - issueBook.setFont(new Font("Segoe UI", Font.PLAIN, 20)); - issueBook.addActionListener(this); + logOutButton = new JButton("Log Out"); + logOutButton.addActionListener(this); + logOutButton.setFont(new Font("Segoe UI", Font.PLAIN, 20)); add(welcomeLabel); add(addBook); add(searchBook); - add(issueBook); + add(logOutButton); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); pack(); @@ -42,5 +41,13 @@ public void actionPerformed(ActionEvent e) { new AddBook(); dispose(); } + if (e.getSource() == searchBook) { + new SearchBook(); + dispose(); + } + if(e.getSource() == logOutButton){ + new Login(); + dispose(); + } } -} +} \ No newline at end of file diff --git a/src/IssueFailure.java b/src/IssueFailure.java new file mode 100644 index 0000000..418b380 --- /dev/null +++ b/src/IssueFailure.java @@ -0,0 +1,33 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class IssueFailure extends JFrame implements ActionListener{ + JButton okButton; + public IssueFailure(){ + super("Failure to issue book"); + setLayout(new GridLayout(2,1,8,8)); + setSize(300, 600); + Font fontRegular = new Font("Segoe UI", Font.PLAIN, 20); + + JLabel failLabel = new JLabel("Book not available"); + failLabel.setFont(fontRegular); + + okButton = new JButton("OK"); + okButton.addActionListener(this); + okButton.setFont(fontRegular); + + add(failLabel); + add(okButton); + + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + pack(); + setResizable(true); + setVisible(true); + } + public void actionPerformed(ActionEvent e){ + if(e.getSource() == okButton){ + dispose(); + } + } +} \ No newline at end of file diff --git a/src/IssueSuccess.java b/src/IssueSuccess.java new file mode 100644 index 0000000..85b0139 --- /dev/null +++ b/src/IssueSuccess.java @@ -0,0 +1,33 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class IssueSuccess extends JFrame implements ActionListener{ + JButton okButton; + public IssueSuccess(){ + super("Success"); + setLayout(new GridLayout(2,1,8,8)); + setSize(300, 600); + Font fontRegular = new Font("Segoe UI", Font.PLAIN, 20); + + JLabel failLabel = new JLabel("Book issued successfully"); + failLabel.setFont(fontRegular); + + okButton = new JButton("OK"); + okButton.addActionListener(this); + okButton.setFont(fontRegular); + + add(failLabel); + add(okButton); + + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + pack(); + setResizable(true); + setVisible(true); + } + public void actionPerformed(ActionEvent e){ + if(e.getSource() == okButton){ + dispose(); + } + } +} diff --git a/src/Library.java b/src/Library.java index db8db1d..bc3a962 100644 --- a/src/Library.java +++ b/src/Library.java @@ -1,11 +1,18 @@ -import java.io.*; -public class Library implements Serializable { +public class Library{ + private static Library instance; private TreeNode root; - public Library() { + private Library() { root = null; } + public static Library getInstance() { + if (instance == null) { + instance = new Library(); + } + return instance; + } + public void insert(Book book) { root = insertNode(root, book); } diff --git a/src/Login.java b/src/Login.java index 10738c1..02bd536 100644 --- a/src/Login.java +++ b/src/Login.java @@ -6,13 +6,12 @@ public class Login extends JFrame implements ActionListener { public static String username; JButton loginButton1; JButton loginButton2; + JButton quitButton; JTextField userText; JTextField passText; - JTextField adminText; - JTextField pass2Text; public Login(){ super("Login"); - setLayout(new GridLayout(3,1,8,8)); + setLayout(new GridLayout(4,1,8,8)); setSize(400, 300); Font fontRegular = new Font("Segoe UI", Font.PLAIN, 20); @@ -44,24 +43,14 @@ public Login(){ loginButton1.setFont(fontRegular); loginButton1.addActionListener(this); - JPanel loginPanel2 = new JPanel(); - loginPanel2.setLayout(new GridLayout(2, 2, 8, 8)); - JLabel adminLabel = new JLabel("Username: "); - adminLabel.setFont(fontRegular); - adminText = new JTextField(""); - adminText.setFont(fontRegular); - JLabel pass2Label = new JLabel("Password: "); - pass2Label.setFont(fontRegular); - pass2Text = new JTextField(""); - pass2Text.setFont(fontRegular); - - loginButton2 = new JButton("Login"); - loginButton2.addActionListener(this); - loginButton2.setFont(fontRegular); + quitButton = new JButton("Quit"); + quitButton.addActionListener(this); + quitButton.setFont(fontRegular); add(titlePanel1); add(loginPanel1); add(loginButton1); + add(quitButton); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); pack(); @@ -91,15 +80,8 @@ public void actionPerformed(ActionEvent e) { new LoginFailure(); } } - if(e.getSource() == loginButton2){ - try{ - @SuppressWarnings("unused") - String user = adminText.getText(); - @SuppressWarnings("unused") - String pass = passText.getText(); - }catch(NullPointerException npe){ - new LoginFailure(); - } + if(e.getSource() == quitButton){ + dispose(); } } } \ No newline at end of file diff --git a/src/LoginFailure.java b/src/LoginFailure.java index efedd1e..c392c2f 100644 --- a/src/LoginFailure.java +++ b/src/LoginFailure.java @@ -31,4 +31,4 @@ public void actionPerformed(ActionEvent e){ } } -} +} \ No newline at end of file diff --git a/src/ReturnSuccess.java b/src/ReturnSuccess.java new file mode 100644 index 0000000..32c8156 --- /dev/null +++ b/src/ReturnSuccess.java @@ -0,0 +1,33 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class ReturnSuccess extends JFrame implements ActionListener{ + JButton okButton; + public ReturnSuccess(){ + super("Success"); + setLayout(new GridLayout(2,1,8,8)); + setSize(300, 600); + Font fontRegular = new Font("Segoe UI", Font.PLAIN, 20); + + JLabel failLabel = new JLabel("Book returned successfully"); + failLabel.setFont(fontRegular); + + okButton = new JButton("OK"); + okButton.addActionListener(this); + okButton.setFont(fontRegular); + + add(failLabel); + add(okButton); + + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + pack(); + setResizable(true); + setVisible(true); + } + public void actionPerformed(ActionEvent e){ + if(e.getSource() == okButton){ + dispose(); + } + } +} \ No newline at end of file diff --git a/src/SearchBook.java b/src/SearchBook.java new file mode 100644 index 0000000..83a0be5 --- /dev/null +++ b/src/SearchBook.java @@ -0,0 +1,58 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class SearchBook extends JFrame implements ActionListener{ + Library lib = Library.getInstance(); + JTextField title; + JButton search; + JButton backDash; + SearchBook(){ + super("Search Book"); + setLayout(new GridLayout(3,1,8,8)); + setSize(400, 300); + + JLabel titleLabel = new JLabel("Title: "); + titleLabel.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + title = new JTextField(""); + title.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + + search = new JButton("Search"); + search.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + search.addActionListener(this); + + backDash = new JButton("Go Back"); + backDash.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + backDash.addActionListener(this); + + add(titleLabel); + add(title); + add(search); + add(backDash); + + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + pack(); + setResizable(true); + setVisible(true); + } + public void actionPerformed(ActionEvent e){ + if(e.getSource() == backDash){ + new Dashboard(); + dispose(); + } + if(e.getSource() == search){ + if(title.getText().equals("")){ + new SearchBookFailure(); + return; + } + String title = this.title.getText(); + Book book = lib.search(title); + if(book == null){ + new SearchBookFailure(); + return; + } + new ShowBook(title); + dispose(); + } + } +} diff --git a/src/SearchBookFailure.java b/src/SearchBookFailure.java new file mode 100644 index 0000000..044e1e0 --- /dev/null +++ b/src/SearchBookFailure.java @@ -0,0 +1,33 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +class SearchBookFailure extends JFrame implements ActionListener{ + JButton okButton; + public SearchBookFailure(){ + super("Failure to search book"); + setLayout(new GridLayout(2,1,8,8)); + setSize(300, 600); + Font fontRegular = new Font("Segoe UI", Font.PLAIN, 20); + + JLabel failLabel = new JLabel("Book not found"); + failLabel.setFont(fontRegular); + + okButton = new JButton("OK"); + okButton.addActionListener(this); + okButton.setFont(fontRegular); + + add(failLabel); + add(okButton); + + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + pack(); + setResizable(true); + setVisible(true); + } + public void actionPerformed(ActionEvent e){ + if(e.getSource() == okButton){ + dispose(); + } + } +} diff --git a/src/ShowBook.java b/src/ShowBook.java new file mode 100644 index 0000000..d4c5214 --- /dev/null +++ b/src/ShowBook.java @@ -0,0 +1,73 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class ShowBook extends JFrame implements ActionListener{ + Library lib = Library.getInstance(); + JLabel quantityLabel; + JButton backDash; + JButton issue; + JButton returnBook; + String searchedBookCopy; + ShowBook(String searchedBook){ + super("Book"); + setLayout(new GridLayout(7,1,8,8)); + setSize(400, 300); + + searchedBookCopy = searchedBook; + + JLabel titleLabel = new JLabel("Title: " + searchedBook); + titleLabel.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + JLabel authorLabel = new JLabel("Author: " + lib.search(searchedBook).author); + authorLabel.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + quantityLabel = new JLabel("Quantity: " + lib.search(searchedBook).quantity); + quantityLabel.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + JLabel descriptionLabel = new JLabel("Description: " + lib.search(searchedBook).description); + descriptionLabel.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + + backDash = new JButton("Go Back"); + backDash.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + backDash.addActionListener(this); + + issue = new JButton("Issue"); + issue.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + issue.addActionListener(this); + + returnBook = new JButton("Return"); + returnBook.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + returnBook.addActionListener(this); + + add(titleLabel); + add(authorLabel); + add(quantityLabel); + add(descriptionLabel); + add(backDash); + add(issue); + add(returnBook); + + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + pack(); + setResizable(true); + setVisible(true); + } + public void actionPerformed(ActionEvent e){ + if(e.getSource() == backDash){ + new SearchBook(); + dispose(); + } + if(e.getSource() == issue){ + if(lib.search(searchedBookCopy).quantity == 0){ + new IssueFailure(); + return; + } + lib.search(searchedBookCopy).quantity--; + quantityLabel.setText("Quantity: " + lib.search(searchedBookCopy).quantity); + new IssueSuccess(); + } + if(e.getSource() == returnBook){ + lib.search(searchedBookCopy).quantity++; + quantityLabel.setText("Quantity: " + lib.search(searchedBookCopy).quantity); + new ReturnSuccess(); + } + } +} diff --git a/src/Tree.java b/src/TreeNode.java similarity index 87% rename from src/Tree.java rename to src/TreeNode.java index 24d9263..4227c73 100644 --- a/src/Tree.java +++ b/src/TreeNode.java @@ -1,4 +1,4 @@ -class TreeNode{ +public class TreeNode{ Book book; TreeNode left; TreeNode right; @@ -8,5 +8,4 @@ public TreeNode(Book book){ left = null; right = null; } -} - +} \ No newline at end of file