$
This commit is contained in:
@@ -1,71 +1,71 @@
|
||||
package Test;
|
||||
|
||||
import API.Etudiant;
|
||||
import API.Groupe;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
public class AdminView extends JPanel {
|
||||
private final ArrayList<Etudiant> e;
|
||||
private final ArrayList<Groupe> g;
|
||||
private final Controller listener;
|
||||
|
||||
public AdminView(ArrayList<Etudiant> e, ArrayList<Groupe> g, Controller listener) {
|
||||
super();
|
||||
|
||||
this.setLayout(new GridBagLayout());
|
||||
|
||||
this.listener = listener;
|
||||
this.g = g;
|
||||
this.e = e;
|
||||
|
||||
Display();
|
||||
}
|
||||
|
||||
public void Display() {
|
||||
BLayout settings = new BLayout();
|
||||
settings.setPositionX(0);
|
||||
|
||||
settings.setPositionY(0);
|
||||
CustomJButton studList = new CustomJButton("Voir la liste des étudiants");
|
||||
studList.setActionCommand("pv::GetStudList");
|
||||
studList.addActionListener(this.listener);
|
||||
this.add(studList, settings);
|
||||
|
||||
settings.setPositionY(1);
|
||||
this.add(new JLabel(" "), settings);
|
||||
|
||||
settings.setPositionY(2);
|
||||
CustomJButton moveStudGrup = new CustomJButton("Changer le groupe d'un étudiant");
|
||||
moveStudGrup.addActionListener(this.listener);
|
||||
moveStudGrup.setActionCommand("av::MoveStudGrup");
|
||||
this.add(moveStudGrup, settings);
|
||||
|
||||
settings.setPositionY(3);
|
||||
this.add(new JLabel(" "), settings);
|
||||
|
||||
settings.setPositionY(4);
|
||||
CustomJButton addStudGrup = new CustomJButton("Ajouter un étudiant dans un groupe");
|
||||
addStudGrup.addActionListener(this.listener);
|
||||
addStudGrup.setActionCommand("av::AddStudGrup");
|
||||
this.add(addStudGrup, settings);
|
||||
|
||||
settings.setPositionY(5);
|
||||
this.add(new JLabel(" "), settings);
|
||||
|
||||
settings.setPositionY(6);
|
||||
this.add(new JLabel(" "), settings);
|
||||
|
||||
settings.setPositionY(7);
|
||||
CustomJButton createGrup = new CustomJButton("Créer un groupe");
|
||||
createGrup.addActionListener(this.listener);
|
||||
createGrup.setActionCommand("av::CreateGrup");
|
||||
this.add(createGrup, settings);
|
||||
|
||||
this.repaint();
|
||||
}
|
||||
}
|
||||
package Test;
|
||||
|
||||
import API.Etudiant;
|
||||
import API.Groupe;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
public class AdminView extends JPanel {
|
||||
private final ArrayList<Etudiant> e;
|
||||
private final ArrayList<Groupe> g;
|
||||
private final Controller listener;
|
||||
|
||||
public AdminView(ArrayList<Etudiant> e, ArrayList<Groupe> g, Controller listener) {
|
||||
super();
|
||||
|
||||
this.setLayout(new GridBagLayout());
|
||||
|
||||
this.listener = listener;
|
||||
this.g = g;
|
||||
this.e = e;
|
||||
|
||||
Display();
|
||||
}
|
||||
|
||||
public void Display() {
|
||||
BLayout settings = new BLayout();
|
||||
settings.setPositionX(0);
|
||||
|
||||
settings.setPositionY(0);
|
||||
CustomJButton studList = new CustomJButton("Voir la liste des étudiants");
|
||||
studList.setActionCommand("pv::GetStudList");
|
||||
studList.addActionListener(this.listener);
|
||||
this.add(studList, settings);
|
||||
|
||||
settings.setPositionY(1);
|
||||
this.add(new JLabel(" "), settings);
|
||||
|
||||
settings.setPositionY(2);
|
||||
CustomJButton moveStudGrup = new CustomJButton("Changer le groupe d'un étudiant");
|
||||
moveStudGrup.addActionListener(this.listener);
|
||||
moveStudGrup.setActionCommand("av::MoveStudGrup");
|
||||
this.add(moveStudGrup, settings);
|
||||
|
||||
settings.setPositionY(3);
|
||||
this.add(new JLabel(" "), settings);
|
||||
|
||||
settings.setPositionY(4);
|
||||
CustomJButton addStudGrup = new CustomJButton("Ajouter un étudiant dans un groupe");
|
||||
addStudGrup.addActionListener(this.listener);
|
||||
addStudGrup.setActionCommand("av::AddStudGrup");
|
||||
this.add(addStudGrup, settings);
|
||||
|
||||
settings.setPositionY(5);
|
||||
this.add(new JLabel(" "), settings);
|
||||
|
||||
settings.setPositionY(6);
|
||||
this.add(new JLabel(" "), settings);
|
||||
|
||||
settings.setPositionY(7);
|
||||
CustomJButton createGrup = new CustomJButton("Créer un groupe");
|
||||
createGrup.addActionListener(this.listener);
|
||||
createGrup.setActionCommand("av::CreateGrup");
|
||||
this.add(createGrup, settings);
|
||||
|
||||
this.repaint();
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,75 +1,75 @@
|
||||
package Test;
|
||||
|
||||
import javax.swing.JButton;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Font;
|
||||
|
||||
|
||||
public class CustomJButton extends JButton {
|
||||
private int fontSize = 12;
|
||||
private Font font = new Font("Arial", Font.PLAIN, 12);
|
||||
private Color color = Color.BLACK;
|
||||
|
||||
/**
|
||||
* @param text texte affiché dans le bouton
|
||||
* @param fontSize taille du texte
|
||||
*/
|
||||
public CustomJButton(String text, int fontSize) {
|
||||
super(text);
|
||||
init();
|
||||
this.fontSize = fontSize;
|
||||
this.font = new Font("Arial", Font.PLAIN, this.fontSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param text texte affiché dans le bouton
|
||||
* @param c couleur du bouton
|
||||
*/
|
||||
public CustomJButton(String text, Color c) {
|
||||
super(text);
|
||||
this.font = new Font("Arial", Font.PLAIN, 12);
|
||||
this.color = c;
|
||||
this.init();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param text texte affiché dans le bouton
|
||||
* @param font police du texte
|
||||
*/
|
||||
public CustomJButton(String text, Font font) {
|
||||
super(text);
|
||||
this.font = font;
|
||||
this.init();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param text texte affiché dans le bouton
|
||||
* @param font police du texte
|
||||
*/
|
||||
public CustomJButton(String text, Font font, Color c) {
|
||||
super(text);
|
||||
this.color = Color.BLACK;
|
||||
this.font = font;
|
||||
this.init();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param text texte affiché dans le bouton
|
||||
*/
|
||||
public CustomJButton(String text) {
|
||||
super(text);
|
||||
this.font = new Font("Arial", Font.PLAIN, 12);
|
||||
this.color = Color.BLACK;
|
||||
this.init();
|
||||
}
|
||||
|
||||
|
||||
private void init() {
|
||||
this.setForeground(Color.WHITE);
|
||||
this.setBackground(this.color);
|
||||
this.setFont(this.font);
|
||||
this.setFocusPainted(false);
|
||||
this.setContentAreaFilled(true);
|
||||
}
|
||||
}
|
||||
package Test;
|
||||
|
||||
import javax.swing.JButton;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Font;
|
||||
|
||||
|
||||
public class CustomJButton extends JButton {
|
||||
private int fontSize = 12;
|
||||
private Font font = new Font("Arial", Font.PLAIN, 12);
|
||||
private Color color = Color.BLACK;
|
||||
|
||||
/**
|
||||
* @param text texte affiché dans le bouton
|
||||
* @param fontSize taille du texte
|
||||
*/
|
||||
public CustomJButton(String text, int fontSize) {
|
||||
super(text);
|
||||
init();
|
||||
this.fontSize = fontSize;
|
||||
this.font = new Font("Arial", Font.PLAIN, this.fontSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param text texte affiché dans le bouton
|
||||
* @param c couleur du bouton
|
||||
*/
|
||||
public CustomJButton(String text, Color c) {
|
||||
super(text);
|
||||
this.font = new Font("Arial", Font.PLAIN, 12);
|
||||
this.color = c;
|
||||
this.init();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param text texte affiché dans le bouton
|
||||
* @param font police du texte
|
||||
*/
|
||||
public CustomJButton(String text, Font font) {
|
||||
super(text);
|
||||
this.font = font;
|
||||
this.init();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param text texte affiché dans le bouton
|
||||
* @param font police du texte
|
||||
*/
|
||||
public CustomJButton(String text, Font font, Color c) {
|
||||
super(text);
|
||||
this.color = Color.BLACK;
|
||||
this.font = font;
|
||||
this.init();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param text texte affiché dans le bouton
|
||||
*/
|
||||
public CustomJButton(String text) {
|
||||
super(text);
|
||||
this.font = new Font("Arial", Font.PLAIN, 12);
|
||||
this.color = Color.BLACK;
|
||||
this.init();
|
||||
}
|
||||
|
||||
|
||||
private void init() {
|
||||
this.setForeground(Color.WHITE);
|
||||
this.setBackground(this.color);
|
||||
this.setFont(this.font);
|
||||
this.setFocusPainted(false);
|
||||
this.setContentAreaFilled(true);
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,116 +1,116 @@
|
||||
package Test;
|
||||
|
||||
import API.Etudiant;
|
||||
import API.Groupe;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.KeyAdapter;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ProfView extends JPanel {
|
||||
private final ArrayList<Etudiant> e;
|
||||
private final ArrayList<Groupe> g;
|
||||
private final Controller listener;
|
||||
private JComboBox<String> groupeOption;
|
||||
private JTextField text;
|
||||
|
||||
public ProfView(ArrayList<Etudiant> e, ArrayList<Groupe> g, Controller listener) {
|
||||
super();
|
||||
|
||||
this.setLayout(new GridBagLayout());
|
||||
|
||||
this.listener = listener;
|
||||
this.e = e;
|
||||
this.g = g;
|
||||
|
||||
this.Display();
|
||||
}
|
||||
|
||||
public String getComboSelection() {
|
||||
return (String) this.groupeOption.getSelectedItem();
|
||||
}
|
||||
|
||||
public String getSearchStud() {
|
||||
return this.text.getText();
|
||||
}
|
||||
|
||||
public int getComboSelectionIndex() {
|
||||
return this.groupeOption.getSelectedIndex();
|
||||
}
|
||||
|
||||
public void Display() {
|
||||
BLayout settings = new BLayout();
|
||||
settings.setPositionX(0);
|
||||
settings.setPositionY(6);
|
||||
|
||||
settings.setPositionY(0);
|
||||
CustomJButton studList = new CustomJButton("Voir la liste des étudiants");
|
||||
studList.setActionCommand("pv::GetStudList");
|
||||
studList.addActionListener(this.listener);
|
||||
this.add(studList, settings);
|
||||
|
||||
settings.setPositionY(1);
|
||||
this.add(new JLabel(" "), settings);
|
||||
|
||||
settings.setPositionY(2);
|
||||
JLabel gs = new JLabel("Afficher les étudiants se trouvant dans le groupe :");
|
||||
this.add(gs, settings);
|
||||
|
||||
settings.setPositionY(3);
|
||||
settings.setPadding(new Insets(0, 0, 0, 50));
|
||||
String[] groupeList = new String[this.g.size()];
|
||||
|
||||
for(int i = 0; i <= this.g.size()-1; i++) {
|
||||
groupeList[i] = this.g.get(i).getName();
|
||||
}
|
||||
|
||||
this.groupeOption = new JComboBox<>(groupeList);
|
||||
this.groupeOption.setPreferredSize(new Dimension(110, 30));
|
||||
this.add(groupeOption, settings);
|
||||
|
||||
settings.setPositionY(3);
|
||||
settings.setPadding(new Insets(0, 0, 0, 0));
|
||||
settings.setAnchor(GridBagConstraints.EAST);
|
||||
CustomJButton confirm = new CustomJButton("Rechercher");
|
||||
confirm.setActionCommand("pv::GetListFiltered");
|
||||
confirm.addActionListener(this.listener);
|
||||
this.add(confirm, settings);
|
||||
|
||||
settings.setAnchor(GridBagConstraints.CENTER);
|
||||
|
||||
settings.setPositionY(4);
|
||||
this.add(new JLabel(" "), settings);
|
||||
|
||||
settings.setPositionY(5);
|
||||
JLabel pf = new JLabel("Rechercher un étudiant : ");
|
||||
this.add(pf, settings);
|
||||
|
||||
settings.setPositionY(6);
|
||||
settings.setPadding(new Insets(0, 0, 0, 50));
|
||||
this.text = new JTextField();
|
||||
this.text.setPreferredSize(new Dimension(110, 30));
|
||||
text.addKeyListener(new KeyAdapter() {
|
||||
public void keyTyped(KeyEvent e) {
|
||||
if (text.getText().length() >= 3 )
|
||||
e.consume();
|
||||
}
|
||||
});
|
||||
this.add(this.text, settings);
|
||||
|
||||
settings.setPositionY(6);
|
||||
settings.setPadding(new Insets(0, 0, 0, 0));
|
||||
settings.setAnchor(GridBagConstraints.EAST);
|
||||
CustomJButton searchTLetters = new CustomJButton("Rechercher");
|
||||
searchTLetters.addActionListener(this.listener);
|
||||
searchTLetters.setActionCommand("pv::SearchStudentPer3Letters");
|
||||
this.add(searchTLetters, settings);
|
||||
|
||||
this.repaint();
|
||||
}
|
||||
}
|
||||
package Test;
|
||||
|
||||
import API.Etudiant;
|
||||
import API.Groupe;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.KeyAdapter;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ProfView extends JPanel {
|
||||
private final ArrayList<Etudiant> e;
|
||||
private final ArrayList<Groupe> g;
|
||||
private final Controller listener;
|
||||
private JComboBox<String> groupeOption;
|
||||
private JTextField text;
|
||||
|
||||
public ProfView(ArrayList<Etudiant> e, ArrayList<Groupe> g, Controller listener) {
|
||||
super();
|
||||
|
||||
this.setLayout(new GridBagLayout());
|
||||
|
||||
this.listener = listener;
|
||||
this.e = e;
|
||||
this.g = g;
|
||||
|
||||
this.Display();
|
||||
}
|
||||
|
||||
public String getComboSelection() {
|
||||
return (String) this.groupeOption.getSelectedItem();
|
||||
}
|
||||
|
||||
public String getSearchStud() {
|
||||
return this.text.getText();
|
||||
}
|
||||
|
||||
public int getComboSelectionIndex() {
|
||||
return this.groupeOption.getSelectedIndex();
|
||||
}
|
||||
|
||||
public void Display() {
|
||||
BLayout settings = new BLayout();
|
||||
settings.setPositionX(0);
|
||||
settings.setPositionY(6);
|
||||
|
||||
settings.setPositionY(0);
|
||||
CustomJButton studList = new CustomJButton("Voir la liste des étudiants");
|
||||
studList.setActionCommand("pv::GetStudList");
|
||||
studList.addActionListener(this.listener);
|
||||
this.add(studList, settings);
|
||||
|
||||
settings.setPositionY(1);
|
||||
this.add(new JLabel(" "), settings);
|
||||
|
||||
settings.setPositionY(2);
|
||||
JLabel gs = new JLabel("Afficher les étudiants se trouvant dans le groupe :");
|
||||
this.add(gs, settings);
|
||||
|
||||
settings.setPositionY(3);
|
||||
settings.setPadding(new Insets(0, 0, 0, 50));
|
||||
String[] groupeList = new String[this.g.size()];
|
||||
|
||||
for(int i = 0; i <= this.g.size()-1; i++) {
|
||||
groupeList[i] = this.g.get(i).getName();
|
||||
}
|
||||
|
||||
this.groupeOption = new JComboBox<>(groupeList);
|
||||
this.groupeOption.setPreferredSize(new Dimension(110, 30));
|
||||
this.add(groupeOption, settings);
|
||||
|
||||
settings.setPositionY(3);
|
||||
settings.setPadding(new Insets(0, 0, 0, 0));
|
||||
settings.setAnchor(GridBagConstraints.EAST);
|
||||
CustomJButton confirm = new CustomJButton("Rechercher");
|
||||
confirm.setActionCommand("pv::GetListFiltered");
|
||||
confirm.addActionListener(this.listener);
|
||||
this.add(confirm, settings);
|
||||
|
||||
settings.setAnchor(GridBagConstraints.CENTER);
|
||||
|
||||
settings.setPositionY(4);
|
||||
this.add(new JLabel(" "), settings);
|
||||
|
||||
settings.setPositionY(5);
|
||||
JLabel pf = new JLabel("Rechercher un étudiant : ");
|
||||
this.add(pf, settings);
|
||||
|
||||
settings.setPositionY(6);
|
||||
settings.setPadding(new Insets(0, 0, 0, 50));
|
||||
this.text = new JTextField();
|
||||
this.text.setPreferredSize(new Dimension(110, 30));
|
||||
text.addKeyListener(new KeyAdapter() {
|
||||
public void keyTyped(KeyEvent e) {
|
||||
if (text.getText().length() >= 3 )
|
||||
e.consume();
|
||||
}
|
||||
});
|
||||
this.add(this.text, settings);
|
||||
|
||||
settings.setPositionY(6);
|
||||
settings.setPadding(new Insets(0, 0, 0, 0));
|
||||
settings.setAnchor(GridBagConstraints.EAST);
|
||||
CustomJButton searchTLetters = new CustomJButton("Rechercher");
|
||||
searchTLetters.addActionListener(this.listener);
|
||||
searchTLetters.setActionCommand("pv::SearchStudentPer3Letters");
|
||||
this.add(searchTLetters, settings);
|
||||
|
||||
this.repaint();
|
||||
}
|
||||
}
|
||||
|
@@ -1,101 +1,101 @@
|
||||
package Test;
|
||||
|
||||
import API.Etudiant;
|
||||
import API.Groupe;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.KeyAdapter;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class StudentView extends JPanel {
|
||||
private final ArrayList<Etudiant> e;
|
||||
private final ArrayList<Groupe> g;
|
||||
private final Controller listener;
|
||||
private JComboBox<String> groupeOption;
|
||||
|
||||
public StudentView(ArrayList<Etudiant> e, ArrayList<Groupe> g, Controller listener) {
|
||||
super();
|
||||
|
||||
this.setLayout(new GridBagLayout());
|
||||
|
||||
this.listener = listener;
|
||||
this.e = e;
|
||||
this.g = g;
|
||||
|
||||
this.Display();
|
||||
}
|
||||
|
||||
public String getComboSelection() {
|
||||
return (String) this.groupeOption.getSelectedItem();
|
||||
}
|
||||
|
||||
public int getComboSelectionIndex() {
|
||||
return this.groupeOption.getSelectedIndex();
|
||||
}
|
||||
|
||||
public void Display() {
|
||||
BLayout settings = new BLayout();
|
||||
settings.setPositionX(0);
|
||||
settings.setPositionY(1);
|
||||
|
||||
settings.setPositionY(0);
|
||||
CustomJButton studList = new CustomJButton("Voir la liste des groupes");
|
||||
studList.setActionCommand("sv::GetGrup");
|
||||
studList.addActionListener(this.listener);
|
||||
this.add(studList, settings);
|
||||
|
||||
settings.setPositionY(1);
|
||||
this.add(new JLabel(" "), settings);
|
||||
|
||||
settings.setPositionY(2);
|
||||
JLabel gs = new JLabel("Afficher les etudiants se trouvant dans le groupe :");
|
||||
this.add(gs, settings);
|
||||
|
||||
settings.setPositionY(3);
|
||||
settings.setPadding(new Insets(0, 0, 0, 50));
|
||||
String[] groupeList = new String[this.g.size()];
|
||||
|
||||
for(int i = 0; i <= this.g.size()-1; i++) {
|
||||
groupeList[i] = this.g.get(i).getName();
|
||||
}
|
||||
|
||||
this.groupeOption = new JComboBox<>(groupeList);
|
||||
this.groupeOption.setPreferredSize(new Dimension(110, 30));
|
||||
this.add(groupeOption, settings);
|
||||
|
||||
settings.setPositionY(3);
|
||||
settings.setPadding(new Insets(0, 0, 0, 0));
|
||||
settings.setAnchor(GridBagConstraints.EAST);
|
||||
CustomJButton confirm = new CustomJButton("Rechercher");
|
||||
confirm.setActionCommand("sv::GetListFiltered");
|
||||
confirm.addActionListener(this.listener);
|
||||
this.add(confirm, settings);
|
||||
|
||||
settings.setPositionY(4);
|
||||
settings.setAnchor(GridBagConstraints.CENTER);
|
||||
this.add(new JLabel(" "), settings);
|
||||
|
||||
settings.setPositionY(5);
|
||||
CustomJButton makeRequest = new CustomJButton("Faire une requete");
|
||||
makeRequest.setActionCommand("sv::MakeRequest");
|
||||
makeRequest.addActionListener(this.listener);
|
||||
this.add(makeRequest, settings);
|
||||
|
||||
settings.setPositionY(6);
|
||||
this.add(new JLabel(" "), settings);
|
||||
|
||||
settings.setPositionY(7);
|
||||
CustomJButton showRequest = new CustomJButton("Voir mes requetes");
|
||||
showRequest.setActionCommand("sv::ShowRequest");
|
||||
showRequest.addActionListener(this.listener);
|
||||
this.add(showRequest, settings);
|
||||
|
||||
this.repaint();
|
||||
}
|
||||
}
|
||||
package Test;
|
||||
|
||||
import API.Etudiant;
|
||||
import API.Groupe;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.KeyAdapter;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class StudentView extends JPanel {
|
||||
private final ArrayList<Etudiant> e;
|
||||
private final ArrayList<Groupe> g;
|
||||
private final Controller listener;
|
||||
private JComboBox<String> groupeOption;
|
||||
|
||||
public StudentView(ArrayList<Etudiant> e, ArrayList<Groupe> g, Controller listener) {
|
||||
super();
|
||||
|
||||
this.setLayout(new GridBagLayout());
|
||||
|
||||
this.listener = listener;
|
||||
this.e = e;
|
||||
this.g = g;
|
||||
|
||||
this.Display();
|
||||
}
|
||||
|
||||
public String getComboSelection() {
|
||||
return (String) this.groupeOption.getSelectedItem();
|
||||
}
|
||||
|
||||
public int getComboSelectionIndex() {
|
||||
return this.groupeOption.getSelectedIndex();
|
||||
}
|
||||
|
||||
public void Display() {
|
||||
BLayout settings = new BLayout();
|
||||
settings.setPositionX(0);
|
||||
settings.setPositionY(1);
|
||||
|
||||
settings.setPositionY(0);
|
||||
CustomJButton studList = new CustomJButton("Voir la liste des groupes");
|
||||
studList.setActionCommand("sv::GetGrup");
|
||||
studList.addActionListener(this.listener);
|
||||
this.add(studList, settings);
|
||||
|
||||
settings.setPositionY(1);
|
||||
this.add(new JLabel(" "), settings);
|
||||
|
||||
settings.setPositionY(2);
|
||||
JLabel gs = new JLabel("Afficher les etudiants se trouvant dans le groupe :");
|
||||
this.add(gs, settings);
|
||||
|
||||
settings.setPositionY(3);
|
||||
settings.setPadding(new Insets(0, 0, 0, 50));
|
||||
String[] groupeList = new String[this.g.size()];
|
||||
|
||||
for(int i = 0; i <= this.g.size()-1; i++) {
|
||||
groupeList[i] = this.g.get(i).getName();
|
||||
}
|
||||
|
||||
this.groupeOption = new JComboBox<>(groupeList);
|
||||
this.groupeOption.setPreferredSize(new Dimension(110, 30));
|
||||
this.add(groupeOption, settings);
|
||||
|
||||
settings.setPositionY(3);
|
||||
settings.setPadding(new Insets(0, 0, 0, 0));
|
||||
settings.setAnchor(GridBagConstraints.EAST);
|
||||
CustomJButton confirm = new CustomJButton("Rechercher");
|
||||
confirm.setActionCommand("sv::GetListFiltered");
|
||||
confirm.addActionListener(this.listener);
|
||||
this.add(confirm, settings);
|
||||
|
||||
settings.setPositionY(4);
|
||||
settings.setAnchor(GridBagConstraints.CENTER);
|
||||
this.add(new JLabel(" "), settings);
|
||||
|
||||
settings.setPositionY(5);
|
||||
CustomJButton makeRequest = new CustomJButton("Faire une requete");
|
||||
makeRequest.setActionCommand("sv::MakeRequest");
|
||||
makeRequest.addActionListener(this.listener);
|
||||
this.add(makeRequest, settings);
|
||||
|
||||
settings.setPositionY(6);
|
||||
this.add(new JLabel(" "), settings);
|
||||
|
||||
settings.setPositionY(7);
|
||||
CustomJButton showRequest = new CustomJButton("Voir mes requetes");
|
||||
showRequest.setActionCommand("sv::ShowRequest");
|
||||
showRequest.addActionListener(this.listener);
|
||||
this.add(showRequest, settings);
|
||||
|
||||
this.repaint();
|
||||
}
|
||||
}
|
||||
|
@@ -10,7 +10,6 @@ public class TestTexteMNP {
|
||||
* */
|
||||
BDatabase db = new BDatabase();
|
||||
|
||||
|
||||
/**
|
||||
* Demarrage de l'appli
|
||||
* */
|
||||
|
21620
src/Test/Untitled.mdj
21620
src/Test/Untitled.mdj
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user