This commit is contained in:
pro.boooooo 2022-11-26 20:34:37 +01:00
parent 044219ec0b
commit f9fb42c899
47 changed files with 23 additions and 23 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,13 +1,9 @@
package Test; package Test;
import API.*; import API.Etudiant;
import MNP.*; import API.Groupe;
import java.util.ArrayList; import java.util.ArrayList;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JTable;
import javax.swing.JScrollPane;
import java.awt.*;
public class AdminView extends BFrame { public class AdminView extends BFrame {
private final ArrayList<Etudiant> e; private final ArrayList<Etudiant> e;
@ -38,7 +34,7 @@ public class AdminView extends BFrame {
settings.setPositionY(0); settings.setPositionY(0);
JButton moveStud = new JButton("Deplacer un etudiant"); JButton moveStud = new JButton("Deplacer un etudiant");
moveStud.addActionListener(this.listener); moveStud.addActionListener(this.listener);
moveStud.setActionCommand("fi::MoveStudent"); moveStud.setActionCommand("av::MoveStudent");
this.add(moveStud, settings); this.add(moveStud, settings);
this.openBFrame(); this.openBFrame();

View File

@ -169,6 +169,6 @@ public class BFrame extends JFrame {
@Override @Override
public String toString() { public String toString() {
return this.title + ": is opened"; return this.title + ": est ouverte";
} }
} }

View File

@ -36,7 +36,7 @@ public class Controller implements ActionListener {
int groupeIndex = this.pv.getComboSelectionIndex(); int groupeIndex = this.pv.getComboSelectionIndex();
String text = this.pv.getSearchStud(); String text = this.pv.getSearchStud();
if (Objects.equals(command, "fi::GetStudList")) { if(Objects.equals(command, "pv::GetStudList")) {
BFrame frame = new BFrame( BFrame frame = new BFrame(
"Liste des eleves", "Liste des eleves",
1, 1,
@ -70,7 +70,7 @@ public class Controller implements ActionListener {
Display(frame, data, titre); Display(frame, data, titre);
} }
else if(Objects.equals(command, "fi::GetListFiltered")) { else if(Objects.equals(command, "pv::GetListFiltered")) {
BFrame frame = new BFrame( BFrame frame = new BFrame(
"Liste des eleves du " + groupeOption, "Liste des eleves du " + groupeOption,
1, 1,
@ -112,7 +112,7 @@ public class Controller implements ActionListener {
Display(frame, data_final, titre); Display(frame, data_final, titre);
} }
else if(Objects.equals(command, "fi::SearchStudentPer3Letters")) { else if(Objects.equals(command, "pv::SearchStudentPer3Letters")) {
if(text.length() < 3 || text == null) { if(text.length() < 3 || text == null) {
JOptionPane.showMessageDialog( JOptionPane.showMessageDialog(
this.pv, this.pv,
@ -171,8 +171,18 @@ public class Controller implements ActionListener {
} }
} }
} }
else if(Objects.equals(command, "av::MoveStudent")) {
}
} }
/**
* Pour afficher le JTable
* @param frame La fenetre
* @param data Les donnees des colonnes du tableau
* @param titre Les titres des colonnes
* */
private void Display(BFrame frame, String[][] data, String[] titre) { private void Display(BFrame frame, String[][] data, String[] titre) {
JTable liste = new JTable(data, titre) { JTable liste = new JTable(data, titre) {
public boolean editCellAt(int row, int column, java.util.EventObject e) { public boolean editCellAt(int row, int column, java.util.EventObject e) {

View File

@ -1,29 +1,23 @@
package Test; package Test;
import API.*; import API.Etudiant;
import MNP.*; import API.Groupe;
import javax.swing.JComboBox; import javax.swing.JComboBox;
import javax.swing.JTextField; import javax.swing.JTextField;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Insets; import java.awt.Insets;
import java.awt.GridBagConstraints; import java.awt.GridBagConstraints;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.KeyAdapter; import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
public class ProfView extends BFrame { public class ProfView extends BFrame {
private final ArrayList<Etudiant> e; private final ArrayList<Etudiant> e;
private final ArrayList<Groupe> g; private final ArrayList<Groupe> g;
private JComboBox<String> groupeOption;
private final Controller listener; private final Controller listener;
private JComboBox<String> groupeOption;
private JTextField text; private JTextField text;
public ProfView(ArrayList<Etudiant> e, ArrayList<Groupe> g, Controller listener) { public ProfView(ArrayList<Etudiant> e, ArrayList<Groupe> g, Controller listener) {
@ -62,7 +56,7 @@ public class ProfView extends BFrame {
settings.setPositionY(0); settings.setPositionY(0);
JButton studList = new JButton("Voir la liste des etudiants"); JButton studList = new JButton("Voir la liste des etudiants");
studList.setActionCommand("fi::GetStudList"); studList.setActionCommand("pv::GetStudList");
studList.addActionListener(this.listener); studList.addActionListener(this.listener);
this.add(studList, settings); this.add(studList, settings);
@ -89,7 +83,7 @@ public class ProfView extends BFrame {
settings.setPadding(new Insets(0, 0, 0, 0)); settings.setPadding(new Insets(0, 0, 0, 0));
settings.setAnchor(GridBagConstraints.EAST); settings.setAnchor(GridBagConstraints.EAST);
JButton confirm = new JButton("Rechercher"); JButton confirm = new JButton("Rechercher");
confirm.setActionCommand("fi::GetListFiltered"); confirm.setActionCommand("pv::GetListFiltered");
confirm.addActionListener(this.listener); confirm.addActionListener(this.listener);
this.add(confirm, settings); this.add(confirm, settings);
@ -119,7 +113,7 @@ public class ProfView extends BFrame {
settings.setAnchor(GridBagConstraints.EAST); settings.setAnchor(GridBagConstraints.EAST);
JButton searchTLetters = new JButton("Rechercher"); JButton searchTLetters = new JButton("Rechercher");
searchTLetters.addActionListener(this.listener); searchTLetters.addActionListener(this.listener);
searchTLetters.setActionCommand("fi::SearchStudentPer3Letters"); searchTLetters.setActionCommand("pv::SearchStudentPer3Letters");
this.add(searchTLetters, settings); this.add(searchTLetters, settings);
this.openBFrame(); this.openBFrame();