diff --git a/src/Test/Controller.java b/src/Test/Controller.java index 32dfdc5..4cbefaa 100644 --- a/src/Test/Controller.java +++ b/src/Test/Controller.java @@ -94,53 +94,30 @@ public class Controller implements ActionListener, ListSelectionListener { }; } - // TODO: mettre a jour les paramètres de la méthode la pluplart sont inutiles /** * Pour afficher une JTable sans listener * - * @param frameTitle Le titre de la fenêtre - * @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 liste La JTable * */ - private void Display(String frameTitle, int size_x, int size_y, int loca_x, int loca_y, JTable liste) { - JPanel forModal = new JPanel(); - - ListSelectionModel lsm = liste.getSelectionModel(); + private void Display(JTable liste) { liste.getTableHeader().setReorderingAllowed(false); liste.setFillsViewportHeight(true); - this.currentJTableUse = liste; - this.parent.updateTable(liste); - - //forModal.add(liste); - //BFrame frame = new BFrame(frameTitle, loca_x, loca_y, size_x, size_y, this.parent, forModal); } - // TODO: mettre à jour les paramètres de la méthode la pluplart sont inutisées /** * Pour afficher une JTable contenant un listener * - * @param frameTitle Le titre de la fenêtre - * @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 liste La JTable * */ - private void DisplayWithListner(String frameTitle, int size_x, int size_y, int loca_x, int loca_y, JTable liste) { - JPanel forModal = new JPanel(); - + private void DisplayWithListner(JTable liste) { ListSelectionModel lsm = liste.getSelectionModel(); lsm.addListSelectionListener(this); liste.getTableHeader().setReorderingAllowed(false); liste.setFillsViewportHeight(true); this.currentJTableUse = liste; - this.parent.updateTable(liste); } @@ -185,14 +162,7 @@ public class Controller implements ActionListener, ListSelectionListener { data[i] = info; } - Display( - "Liste des étudiants", - 350, - 400, - this.pv.getX(), - this.pv.getY(), - this.createJTable(data, titre) - ); + Display(this.createJTable(data, titre)); } else if(Objects.equals(command, "pv::GetListFiltered") || @@ -230,14 +200,7 @@ public class Controller implements ActionListener, ListSelectionListener { data_final[x] = data[x]; } - Display( - "Liste d'élèves du " + groupeOption, - 350, - 400, - this.pv.getX(), - this.pv.getY(), - this.createJTable(data_final, titre) - ); + Display(this.createJTable(data_final, titre)); } else if(Objects.equals(command, "pv::SearchStudentPer3Letters")) { @@ -281,14 +244,7 @@ public class Controller implements ActionListener, ListSelectionListener { }; } - Display( - "Recherche", - 350, - 400, - this.pv.getX(), - this.pv.getY(), - this.createJTable(data, titre) - ); + Display(this.createJTable(data, titre)); } } } @@ -314,14 +270,7 @@ public class Controller implements ActionListener, ListSelectionListener { data[i] = info; } - DisplayWithListner( - "Déplacer un étudiant", - 350, - 400, - this.av.getX(), - this.av.getY(), - this.createJTable(data, titre) - ); + DisplayWithListner(this.createJTable(data, titre)); } else if(Objects.equals(command, "av::AddStudGrup")) { @@ -350,14 +299,7 @@ public class Controller implements ActionListener, ListSelectionListener { String[][] stringArray = data.stream().map(u -> u.toArray(new String[0])).toArray(String[][]::new); - DisplayWithListner( - "Attribuer un groupe a un étudiant", - 350, - 400, - this.av.getX(), - this.av.getY(), - this.createJTable(stringArray, titre) - ); + DisplayWithListner(this.createJTable(stringArray, titre)); } else if(Objects.equals(command, "crtll::ActionAddAndMoveGrup")) { @@ -407,14 +349,7 @@ public class Controller implements ActionListener, ListSelectionListener { }; } - DisplayWithListner( - "Liste des groupes", - 350, - 400, - this.sv.getX(), - this.sv.getY(), - this.createJTable(data, title) - ); + DisplayWithListner(this.createJTable(data, title)); } else if(Objects.equals(command, "sv::MakeRequest")) { @@ -533,14 +468,7 @@ public class Controller implements ActionListener, ListSelectionListener { data[i] = info; } - Display( - "Vos demandes", - 500, - 500, - 1, - 1, - this.createJTable(data, title) - ); + Display(this.createJTable(data, title)); } }