$
This commit is contained in:
parent
dd088c00a2
commit
ef454e5a18
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -10,6 +10,7 @@ import java.awt.*;
|
||||
import javax.swing.event.ListSelectionEvent;
|
||||
import javax.swing.event.ListSelectionListener;
|
||||
import javax.swing.table.TableModel;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.ArrayList;
|
||||
@ -147,7 +148,6 @@ public class Controller implements ActionListener, ListSelectionListener {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
String command = e.getActionCommand();
|
||||
this.e = this.db.getEtuList();
|
||||
String groupeOption = this.pv.getComboSelection();
|
||||
int groupeIndex = 0;
|
||||
String text = this.pv.getSearchStud();
|
||||
@ -432,6 +432,8 @@ public class Controller implements ActionListener, ListSelectionListener {
|
||||
type = 2;
|
||||
}
|
||||
|
||||
this.db.updateRow("ALTER TABLE fi_demandes AUTO_INCREMENT = " + this.r.size());
|
||||
|
||||
if (this.db.insertRow("fi_demandes", new String[] {
|
||||
"id_eleve", "id_groupe", "message", "type" },
|
||||
new String[] {
|
||||
@ -632,7 +634,6 @@ public class Controller implements ActionListener, ListSelectionListener {
|
||||
};
|
||||
|
||||
for (int i = 0; i <= this.r.size() - 1; i++) {
|
||||
System.out.println(this.getGroupeById(this.r.get(i).getWitchGroupe()));
|
||||
Object[] info = {
|
||||
this.getEtuNameById(this.r.get(i).getEtuId()),
|
||||
this.getGroupeById(this.r.get(i).getWitchGroupe()),
|
||||
@ -837,6 +838,9 @@ public class Controller implements ActionListener, ListSelectionListener {
|
||||
}
|
||||
|
||||
public JTable initTable() {
|
||||
this.e = this.db.getEtuList();
|
||||
this.g = this.db.getGroupeList();
|
||||
|
||||
Object[][] data = new Object[this.e.size()][3];
|
||||
String[] title = {
|
||||
"Nom",
|
||||
@ -893,6 +897,22 @@ public class Controller implements ActionListener, ListSelectionListener {
|
||||
return this.g;
|
||||
}
|
||||
|
||||
public BDatabase getDatabase() {
|
||||
return this.db;
|
||||
}
|
||||
|
||||
public void setEtudiants(ArrayList<Etudiant> e) {
|
||||
this.e = e;
|
||||
}
|
||||
|
||||
public void setGroupes(ArrayList<Groupe> g) {
|
||||
this.g = g;
|
||||
}
|
||||
|
||||
public void setRequest(ArrayList<Requete> r) {
|
||||
this.r = r;
|
||||
}
|
||||
|
||||
public void setMainMenu(MainMenu m) {
|
||||
this.parent = m;
|
||||
}
|
||||
|
@ -11,7 +11,8 @@ public class MainMenu extends JFrame {
|
||||
public static final int MENU = 0, ADMIN = 1, PROF = 2, STUDENT = 3;
|
||||
private static final int FULL = 4, WINDOW = 5;
|
||||
private final static Dimension MINIMUM_SIZE = new Dimension(960, 600);
|
||||
private final CardLayout cards = new CardLayout(), adminCards = new CardLayout(), profCards = new CardLayout(), studentCards = new CardLayout();
|
||||
private final CardLayout cards = new CardLayout(), adminCards = new CardLayout(), profCards = new CardLayout(),
|
||||
studentCards = new CardLayout();
|
||||
private final JPanel adminPanel = new JPanel(), profPanel = new JPanel(), studentPanel = new JPanel();
|
||||
private final Color adminColor = new Color(255, 2, 2);
|
||||
private final Color profColor = new Color(182, 2, 189);
|
||||
@ -35,6 +36,7 @@ public class MainMenu extends JFrame {
|
||||
|
||||
/**
|
||||
* Constructeur de base
|
||||
*
|
||||
* @param listener controller initialisé dans le main
|
||||
*/
|
||||
public MainMenu(Controller listener) {
|
||||
@ -60,7 +62,9 @@ public class MainMenu extends JFrame {
|
||||
}
|
||||
|
||||
/**
|
||||
* Construit un objet MainMenu sur la vue sélectionnée et le mode d'affichage choisi
|
||||
* Construit un objet MainMenu sur la vue sélectionnée et le mode d'affichage
|
||||
* choisi
|
||||
*
|
||||
* @param listener controller initialisé dans le main
|
||||
* @param selectedView vue à afficher
|
||||
* @param screenStyle disposition d'affichage plein écran ou fenêtré
|
||||
@ -82,6 +86,7 @@ public class MainMenu extends JFrame {
|
||||
|
||||
/**
|
||||
* Initialise les paramètres de la fenêtre
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
private void init(Controller listener) {
|
||||
@ -106,6 +111,7 @@ public class MainMenu extends JFrame {
|
||||
|
||||
/**
|
||||
* Action réalisée par les boutons du menu principal
|
||||
*
|
||||
* @param e
|
||||
*/
|
||||
private void action(ActionEvent e) {
|
||||
@ -165,9 +171,9 @@ public class MainMenu extends JFrame {
|
||||
this.setJMenuBar(menuBar);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Crée une vue avec le résultat de la base de données à côté
|
||||
*
|
||||
* @param sidePanel actions relatives à l'utilisateur
|
||||
* @param origin
|
||||
* @return panel contenant les boutons et la table
|
||||
@ -180,15 +186,12 @@ public class MainMenu extends JFrame {
|
||||
|
||||
if (origin.equals(viewName[0])) {
|
||||
sidePanel.setBackground(adminColor);
|
||||
System.out.println("admin");
|
||||
|
||||
} else if (origin.equals(viewName[1])) {
|
||||
sidePanel.setBackground(profColor);
|
||||
System.out.println("prof");
|
||||
|
||||
} else {
|
||||
sidePanel.setBackground(studentColor);
|
||||
System.out.println("student");
|
||||
}
|
||||
|
||||
panel.add(sidePanel);
|
||||
@ -201,6 +204,7 @@ public class MainMenu extends JFrame {
|
||||
|
||||
/**
|
||||
* Permet de naviguer entre les vues
|
||||
*
|
||||
* @param index index de la vue
|
||||
*/
|
||||
private void changeView(int index) {
|
||||
@ -239,6 +243,7 @@ public class MainMenu extends JFrame {
|
||||
|
||||
/**
|
||||
* Met à jour la table de cet objet
|
||||
*
|
||||
* @param table nouvelle table
|
||||
*/
|
||||
public void updateTable(JTable table) {
|
||||
@ -259,6 +264,7 @@ public class MainMenu extends JFrame {
|
||||
|
||||
/**
|
||||
* Crée le menu principal
|
||||
*
|
||||
* @return panel contenant le menu principal
|
||||
*/
|
||||
private JPanel firstCard() {
|
||||
@ -288,6 +294,7 @@ public class MainMenu extends JFrame {
|
||||
|
||||
/**
|
||||
* Initialise la vue sélectionnée
|
||||
*
|
||||
* @param index index de la vue choisie
|
||||
*/
|
||||
private void initView(int index) {
|
||||
@ -331,6 +338,7 @@ public class MainMenu extends JFrame {
|
||||
|
||||
/**
|
||||
* Crée la vue administrateur
|
||||
*
|
||||
* @return panel contenant la vue admin
|
||||
*/
|
||||
private JPanel adminView() {
|
||||
@ -342,6 +350,7 @@ public class MainMenu extends JFrame {
|
||||
|
||||
/**
|
||||
* Crée la vue professeur
|
||||
*
|
||||
* @return panel contenant la vue professeur
|
||||
*/
|
||||
private JPanel profView() {
|
||||
@ -353,6 +362,7 @@ public class MainMenu extends JFrame {
|
||||
|
||||
/**
|
||||
* Crée la vue étudiant
|
||||
*
|
||||
* @return panel contenant la vue étudiant
|
||||
*/
|
||||
private JPanel studentView() {
|
||||
@ -372,6 +382,7 @@ public class MainMenu extends JFrame {
|
||||
|
||||
/**
|
||||
* Change le mode d'affichage
|
||||
*
|
||||
* @param screenStyle
|
||||
*/
|
||||
private void setScreenStyle(int screenStyle) {
|
||||
@ -387,6 +398,7 @@ public class MainMenu extends JFrame {
|
||||
|
||||
/**
|
||||
* Passe la fenêtre en plein écran
|
||||
*
|
||||
* @param e
|
||||
*/
|
||||
private void setFullScreen(ActionEvent e) {
|
||||
@ -398,6 +410,7 @@ public class MainMenu extends JFrame {
|
||||
|
||||
/**
|
||||
* Passe la fenêtre en fenêtré
|
||||
*
|
||||
* @param e
|
||||
*/
|
||||
private void unsetFullScreen(ActionEvent e) {
|
||||
@ -409,6 +422,7 @@ public class MainMenu extends JFrame {
|
||||
|
||||
/**
|
||||
* Renvoie au menu principal
|
||||
*
|
||||
* @param e
|
||||
*/
|
||||
private void backtoMainMenu(ActionEvent e) {
|
||||
|
Loading…
Reference in New Issue
Block a user