From 8c76e54ea9cd78ebc0d7388987e6ca4652ad94ae Mon Sep 17 00:00:00 2001 From: "pro.boooooo" Date: Sun, 27 Nov 2022 18:27:50 +0100 Subject: [PATCH] $ --- .../FIProjetIHM2022/Test/BFrame.class | Bin 4560 -> 4641 bytes .../FIProjetIHM2022/Test/Controller$1.class | Bin 879 -> 879 bytes .../FIProjetIHM2022/Test/Controller.class | Bin 8940 -> 10367 bytes src/Test/BFrame.java | 8 +- src/Test/Controller.java | 85 +++++++++++++++--- 5 files changed, 79 insertions(+), 14 deletions(-) diff --git a/out/production/FIProjetIHM2022/Test/BFrame.class b/out/production/FIProjetIHM2022/Test/BFrame.class index a1d56dbf5a83162b48b3b15dd92245791834e1d0..0c4f3a5011ee16ffdd48d4be03f64bb6575f3631 100644 GIT binary patch delta 385 zcmZvXy)T1N6vlsVwc7X9YB4oYO?)M45Qz>VB9#~n1{R4)A`C)0h-e4#Z8DS_B2j~2 z@)6alk5*A%i5NQJk1!j>5h5K7_nzm;bI$qQo2%NYHl98&GC(U2G2_{)+XqI1V}o7o zLn>zt7oQtkkg}4tv&5z9wcTk~s$8$svZ_t@X?JQ^AJrW3H@)AiPY@);IAIkie)UXY zFij~lR4|K=IsD8EWq}SBmEReyiBQBcWvt*uQO_!ktPxXxZP+k_gllffhg2@;8j8cimvK_qIb*DjViLP$v@n7mch zOSPrcA_kjJ(D)YO3 zWyV*xs**6BR!zoD+uKem}gNY0-xbD4okGNOoSEUtkTDt zo>*s?j10Bqy0f&fNe4odEfQ?g%MOF=GD?m~_L<^9JZ{Py;o(?$Cz5fKt*7eF)SVOJ zLK<#VMuOpR5t|#b`i37%yGPlg)8dl6q=T_g`QP-4f>eS%{k1=-^Sj&3wGx^rDj9sr Qy49-isLoOK#4~k5KOL<~)Bpeg diff --git a/out/production/FIProjetIHM2022/Test/Controller$1.class b/out/production/FIProjetIHM2022/Test/Controller$1.class index b7bcefcde7038e08ae0c1374fc757b19cf001a07..f2eab1bf27603490a6360f3ce956628d7582a659 100644 GIT binary patch delta 19 bcmaFQ_MUCSE+$6f$-9}t8BHe(Gsge`Oa=yR delta 19 bcmaFQ_MUCSE+$6J$-9}t8MP-1Gsge`OJ)XH diff --git a/out/production/FIProjetIHM2022/Test/Controller.class b/out/production/FIProjetIHM2022/Test/Controller.class index 008628046e20cfd026a02e4b6699a7fc84eec9db..eda2c5c8f9b27b5d8ee56cf57b7cfef3c085e909 100644 GIT binary patch literal 10367 zcmbta34B!5x&ME&-O0=aVK9WDqJs;BBpO+YIzea>0wji|1cQMpOp=>qU@{YD38LL> zL91xpx?x-E(iXKYt(CC3w`#SEwYAUgt9`B7*4o!@?HWri8&A|Xrqi+Q?eR>uL2aFA;yATW z`VCALOw`+(md3KN?pVeOU=rL4?06HEm@07fc9W#`Qm6(4(*zUr;c4X65Y_K6jvClS9jX8prFz_< zb8PapVu&f8>~9F57Ig+rH*p5)1yi)lOHUIRL+b2AlH@pIDMm4;)4<%k8X9{C<4IeX zXJWci!vYiU#6pT8Mlm>QC_s@D!P$zFa|EY4^p35TA=p5JVDdPLpE@^yD9%;7qlq;* zc*ZQMVdKUk)@_??C^My4d6yuhq;N@nW*a3`-?k=}v=RXS~^Uu zQ;4P#Zdp8$$S9o-rPA3IR=j^8s}$R5Vm&UPPJ43cw3W=-^qile5RTW<&a-PTki;d} zU}7WQL*tJ1^0XSqnqu3O`wtGKl0?(sD7|#jz(s-!F27QN;WqBMr~&;>MUx4hGS1qnuD<-FP(40%Jt(dcqcb3%zBfDhn<1}-=8A$*tzYff}{w;hrZ%V%AjizPUiU93^Z zUyt_SIU54li7O0TY2qV_TswS~rVJW&CVr`9;A%>vBn~*zFmO$20M?PwkB^eeRjENg zt|wt@XyIynBgf0rsoW3^a3?-y;^X)P;mExTj;+N3%OTsqr>Nq_HLdk66hxe%Ifzf< zW)q)Qa`SN~4^dN}HF1lYs^FA;oSMDW#BGW-HJd+p7w$0ed3=G9c{rBHS*!bwI^5yS zk3E!%w$Vthm5Epm2^pokyG-1zP-lI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/BFrame.java index fe3ae02..9569844 100644 --- a/src/Test/BFrame.java +++ b/src/Test/BFrame.java @@ -116,7 +116,6 @@ public class BFrame extends JFrame { JScrollPane scrollPane = new JScrollPane(); frame.getContentPane().add(scrollPane); scrollPane.setViewportView(content); - frame.setResizable(false); frame.setVisible(true); } @@ -174,6 +173,13 @@ public class BFrame extends JFrame { this.dispatchEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING)); } + /** + * Fermer une fenetre modal + * */ + public void closeMBframe() { + this.setVisible(false); + } + /** * Rafraichir la fenetre */ diff --git a/src/Test/Controller.java b/src/Test/Controller.java index 2914a6b..b13c497 100644 --- a/src/Test/Controller.java +++ b/src/Test/Controller.java @@ -17,11 +17,20 @@ import java.util.Objects; public class Controller implements ActionListener, ListSelectionListener { private final BDatabase db; + private final ProfView pv; private final AdminView av; + + private BFrame lastModal; + private BFrame currentModal; + private final ArrayList e; private final ArrayList g; + private JTable currentJTableUse; + private JComboBox list; + + private String[] tmpStud; public Controller(ArrayList e, ArrayList g) { this.e = e; @@ -108,8 +117,8 @@ public class Controller implements ActionListener, ListSelectionListener { * @param loca_y Localisation en y * @param forModal Le panel a mettre dans la fenetre (libre) * */ - private void DisplayModal(BFrame parent, String frameTitle, int size_x, int size_y, int loca_x, int loca_y, JPanel forModal, Object... data) { - BFrame frame = new BFrame(frameTitle, loca_x, loca_y, size_x, size_y, parent, forModal); + private void DisplayModal(BFrame parent, String frameTitle, int size_x, int size_y, int loca_x, int loca_y, JPanel forModal) { + this.currentModal = new BFrame(frameTitle, loca_x, loca_y, size_x, size_y, parent, forModal); } @Override @@ -273,6 +282,18 @@ public class Controller implements ActionListener, ListSelectionListener { this.createJTable(data, titre) ); } + + else if(Objects.equals(command, "crtll::ActionMoveGrup")) { + // TODO: CHANGE GROUPE + db.updateRow("UPDATE fi_eleves SET "); + + JOptionPane.showMessageDialog( + this.currentModal, + this.tmpStud[0] + " " + this.tmpStud[1] + " a bien ete deplace dans le " + this.list.getSelectedItem(), + "Deplacement effectue", + JOptionPane.INFORMATION_MESSAGE + ); + } } @Override @@ -291,25 +312,63 @@ public class Controller implements ActionListener, ListSelectionListener { if(Objects.equals(value, "[DEPLACER]")) { JPanel forModal = new JPanel(new GridBagLayout()); BLayout settings = new BLayout(); + this.tmpStud = new String[] { + (String) tm.getValueAt(cell[0], 0), + (String) tm.getValueAt(cell[0], 1) + }; - JLabel l = new JLabel("test"); - forModal.add(l); + settings.setPositionX(0); + settings.setPositionY(0); + JLabel intro = new JLabel( + "Deplacer " + tm.getValueAt(cell[0], 0) + " " + + tm.getValueAt(cell[0], 1) + + " dans le groupe : " + ); + forModal.add(intro, settings); + + settings.setPositionX(1); + settings.setPositionY(0); + forModal.add(new JLabel(" "), settings); + + settings.setPositionX(2); + settings.setPositionY(0); + forModal.add(new JLabel(" "), settings); + + settings.setPositionX(3); + settings.setPositionY(0); + + this.list = new JComboBox<>(); + + for (Groupe groupe : this.g) { + this.list.addItem(groupe.getName()); + } + + forModal.add(list, settings); + + settings.setPositionX(4); + settings.setPositionY(0); + forModal.add(new JLabel(" "), settings); + + settings.setPositionX(5); + settings.setPositionY(0); + forModal.add(new JLabel(" "), settings); + + settings.setPositionX(6); + settings.setPositionY(0); + JButton moveBtn = new JButton("Deplacer"); + moveBtn.setActionCommand("crtll::ActionMoveGrup"); + moveBtn.addActionListener(this); + forModal.add(moveBtn, settings); DisplayModal( this.av, - "Deplacer l'eleve : " + tm.getValueAt(cell[0], 0) + " " + tm.getValueAt(cell[0], 1), + "Deplacer l'eleve : " + + tm.getValueAt(cell[0], 0) + " " + tm.getValueAt(cell[0], 1), 500, 250, this.av.getX(), this.av.getY(), - forModal, - - /** - * Position toujours similaire { cell[0] = Nom (String), cell[1] = Prenom (String), cell[2] = Groupe (String) } - */ - tm.getValueAt(cell[0], 0), - tm.getValueAt(cell[0], 1), - tm.getValueAt(cell[0], 2) + forModal ); } }