diff --git a/out/production/FIProjetIHM2022/Test/AdminView.class b/out/production/FIProjetIHM2022/Test/AdminView.class index f540f81..0506ed3 100644 Binary files a/out/production/FIProjetIHM2022/Test/AdminView.class and b/out/production/FIProjetIHM2022/Test/AdminView.class differ diff --git a/out/production/FIProjetIHM2022/Test/BFrame.class b/out/production/FIProjetIHM2022/Test/BFrame.class index 9e24142..a1d56db 100644 Binary files a/out/production/FIProjetIHM2022/Test/BFrame.class and b/out/production/FIProjetIHM2022/Test/BFrame.class differ diff --git a/out/production/FIProjetIHM2022/Test/Controller$1.class b/out/production/FIProjetIHM2022/Test/Controller$1.class index 778a3e1..b7bcefc 100644 Binary files a/out/production/FIProjetIHM2022/Test/Controller$1.class and b/out/production/FIProjetIHM2022/Test/Controller$1.class differ diff --git a/out/production/FIProjetIHM2022/Test/Controller.class b/out/production/FIProjetIHM2022/Test/Controller.class index 4151654..0086280 100644 Binary files a/out/production/FIProjetIHM2022/Test/Controller.class and b/out/production/FIProjetIHM2022/Test/Controller.class differ diff --git a/out/production/FIProjetIHM2022/Test/ProfView.class b/out/production/FIProjetIHM2022/Test/ProfView.class index 41b14cd..f71b8f8 100644 Binary files a/out/production/FIProjetIHM2022/Test/ProfView.class and b/out/production/FIProjetIHM2022/Test/ProfView.class differ diff --git a/src/Test/AdminView.java b/src/Test/AdminView.java index 7b2d547..dccbabb 100644 --- a/src/Test/AdminView.java +++ b/src/Test/AdminView.java @@ -47,6 +47,7 @@ public class AdminView extends BFrame { addStudGrup.setActionCommand("TODO"); this.add(addStudGrup, settings); + this.setResizable(false); this.openBFrame(); this.refreshBFrame(); } diff --git a/src/Test/BFrame.java b/src/Test/BFrame.java index dd7dc9a..fe3ae02 100644 --- a/src/Test/BFrame.java +++ b/src/Test/BFrame.java @@ -117,6 +117,7 @@ public class BFrame extends JFrame { frame.getContentPane().add(scrollPane); scrollPane.setViewportView(content); + frame.setResizable(false); frame.setVisible(true); } diff --git a/src/Test/Controller.java b/src/Test/Controller.java index 0556c46..dcbf820 100644 --- a/src/Test/Controller.java +++ b/src/Test/Controller.java @@ -3,17 +3,16 @@ package Test; import API.Etudiant; import API.Groupe; -import javax.swing.JTable; -import javax.swing.JOptionPane; +import javax.swing.*; import javax.swing.event.ListSelectionEvent; -import javax.swing.ListSelectionModel; import javax.swing.event.ListSelectionListener; import javax.swing.table.TableModel; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.Objects; -import javax.swing.JPanel; +import java.util.Arrays; public class Controller implements ActionListener, ListSelectionListener { private final BDatabase db; @@ -97,6 +96,21 @@ public class Controller implements ActionListener, ListSelectionListener { BFrame frame = new BFrame(frameTitle, loca_x, loca_y, size_x, size_y, parent, forModal); } + /** + * Pour afficher une modale classique pour plus de liberte (panel a creer au prealable) + * + * @param parent La fenetre qui sera bloque + * @param frameTitle Le titre de la fenetre + * @param size_x Taille en x + * @param size_y Taille en y + * @param loca_x Localisation en x + * @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); + } + @Override public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); @@ -262,19 +276,42 @@ public class Controller implements ActionListener, ListSelectionListener { @Override public void valueChanged(ListSelectionEvent e) { - int[] cell; - Object value; + if(!e.getValueIsAdjusting()) { + int[] cell = this.currentJTableUse.getSelectedRows(); + int collumnCount = this.currentJTableUse.getColumnCount(); + Object value; + System.out.println(e.getSource()); - if (!e.getValueIsAdjusting()) { - cell = this.currentJTableUse.getSelectedRows(); - if (cell.length > 0) { - for (int i=0; i < 3; i++) { + if(cell.length > 0) { + for(int i = 0; i < collumnCount; i++) { TableModel tm = this.currentJTableUse.getModel(); value = tm.getValueAt(cell[0], i); - System.out.print(value + " "); - } - System.out.println(); + if(Objects.equals(value, "[DEPLACER]")) { + JPanel forModal = new JPanel(new GridBagLayout()); + BLayout settings = new BLayout(); + + JLabel l = new JLabel("test"); + forModal.add(l); + + DisplayModal( + this.av, + "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) + ); + } + } } } } diff --git a/src/Test/ProfView.java b/src/Test/ProfView.java index df46694..288d734 100644 --- a/src/Test/ProfView.java +++ b/src/Test/ProfView.java @@ -116,6 +116,7 @@ public class ProfView extends BFrame { searchTLetters.setActionCommand("pv::SearchStudentPer3Letters"); this.add(searchTLetters, settings); + this.setResizable(false); this.openBFrame(); this.refreshBFrame(); }