Transférer les fichiers vers 'src/Test'

This commit is contained in:
Romain BESSON 2022-12-01 21:08:14 +01:00
parent 4b11806f28
commit 20b60e2e76

View File

@ -18,10 +18,10 @@ import java.util.Objects;
public class Controller implements ActionListener, ListSelectionListener {
private final BDatabase db;
private ProfView pv = null;
private AdminView av = null;
private ProfView pv;
private AdminView av;
private StudentView sv;
private BFrame currentModal;
private MainMenu parent;
private ArrayList<Etudiant> e;
@ -32,17 +32,15 @@ public class Controller implements ActionListener, ListSelectionListener {
private ArrayList<String> tmpStud;
public Controller(BDatabase db, MainMenu frame) {
public Controller(BDatabase db) {
this.db = db;
this.e = this.db.getEtuList();
this.g = this.db.getGroupeList();
parent = frame;
// Les 3 fenetres s'ouvriront en meme temps (Pour le contexte du projet)
//this.pv = new ProfView(this.e, this.g, this);
//System.out.println("[+] Demarrage de la vue professeur -> " + this.pv);
//this.av = new AdminView(this.e, this.g, this);
//System.out.println("[+] Demarrage de la vue Administrateur -> " + this.av);
this.sv = new StudentView(this.e, this.g, this);
this.pv = new ProfView(this.e, this.g, this);
this.av = new AdminView(this.e, this.g, this);
this.parent = new MainMenu(this);
}
/**
@ -58,7 +56,7 @@ public class Controller implements ActionListener, ListSelectionListener {
};
}
// TODO: mettre a jour les parametres de la methode la pluplart sont inutiles
/**
* Pour afficher une JTable sans listener
*
@ -82,10 +80,10 @@ public class Controller implements ActionListener, ListSelectionListener {
//forModal.add(liste);
//BFrame frame = new BFrame(frameTitle, loca_x, loca_y, size_x, size_y, this.parent, forModal);
}
// TODO: mettre a jour les parametres de la methode la pluplart sont inutiles
/**
* Pour afficher une JTable contenant un listener
*
@ -287,7 +285,7 @@ public class Controller implements ActionListener, ListSelectionListener {
}
else if(Objects.equals(command, "av::AddStudGrup")) {
ArrayList<ArrayList<String>> data = new ArrayList();
ArrayList<ArrayList<String>> data = new ArrayList<>();
String[] titre = {
"Nom",
@ -380,7 +378,7 @@ public class Controller implements ActionListener, ListSelectionListener {
JLabel intro = new JLabel(
"Deplacer " + tm.getValueAt(cell[0], 0) + " " +
tm.getValueAt(cell[0], 1) +
" dans le groupe : "
" dans le groupe : "
);
forModal.add(intro, settings);
@ -437,7 +435,6 @@ public class Controller implements ActionListener, ListSelectionListener {
}
}
public JTable initTable() {
Object[][] data = new Object[this.e.size()][3];
String[] title = {
@ -445,7 +442,6 @@ public class Controller implements ActionListener, ListSelectionListener {
"Prenom",
"Groupe",
};
for(int i = 0; i <= this.e.size()-1; i++) {
Object[] info = {
this.e.get(i).getNom(),
@ -453,25 +449,21 @@ public class Controller implements ActionListener, ListSelectionListener {
String.valueOf(this.e.get(i).getGroupe()),
"[DEPLACER]"
};
data[i] = info;
}
return createJTable(data, title);
}
public void setAv (AdminView av) {
if (this.av == null) {
this.av = av;
}
public ProfView getProfView() {
return this.pv;
}
public StudentView getStudentView() {
return this.sv;
}
public void setPv (ProfView pv) {
if (this.pv == null) {
this.pv = pv;
}
public AdminView getAdminView() {
return this.av;
}