$
This commit is contained in:
parent
e988e3f7fe
commit
79ca7e9c91
@ -1,14 +1,16 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<module type="JAVA_MODULE" version="4">
|
<module type="JAVA_MODULE" version="4">
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
<component name="NewModuleRootManager">
|
||||||
<exclude-output />
|
<output url="file://$MODULE_DIR$/build" />
|
||||||
<content url="file://$MODULE_DIR$">
|
<output-test url="file://$MODULE_DIR$/build" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
<exclude-output />
|
||||||
</content>
|
<content url="file://$MODULE_DIR$">
|
||||||
<orderEntry type="inheritedJdk" />
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
</content>
|
||||||
<orderEntry type="library" name="mariadb-connector2" level="project" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="library" name="mariadb-connector1" level="project" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
<orderEntry type="library" name="mariadb-connector" level="project" />
|
<orderEntry type="library" name="mariadb-connector" level="project" />
|
||||||
</component>
|
<orderEntry type="library" name="mariadb-connector2" level="project" />
|
||||||
|
<orderEntry type="library" name="mariadb-connector1" level="project" />
|
||||||
|
</component>
|
||||||
</module>
|
</module>
|
14
FI_PRJ.iml
14
FI_PRJ.iml
@ -1,14 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager">
|
|
||||||
<output url="file://$MODULE_DIR$/build" />
|
|
||||||
<output-test url="file://C:/UseC:/Users/probo/Desktop/FIProjetIHM2022/build" />
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="library" name="mariadb-connector" level="project" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
21
Makefile
21
Makefile
@ -7,6 +7,9 @@ OPTION_DOCS = -d docs/
|
|||||||
OPTION_COMPILE = -d build/ -cp "src/Test/libs/mariadb-connector.jar"
|
OPTION_COMPILE = -d build/ -cp "src/Test/libs/mariadb-connector.jar"
|
||||||
OPTION_DOCS = -d docs/ -cp "src/Test/libs/mariadb-connector.jar"
|
OPTION_DOCS = -d docs/ -cp "src/Test/libs/mariadb-connector.jar"
|
||||||
OPTION_EXE = -cp ".:Test/libs/mariadb-connector.jar" Test.TestTexteMNP
|
OPTION_EXE = -cp ".:Test/libs/mariadb-connector.jar" Test.TestTexteMNP
|
||||||
|
OPTION_EXE_A = -cp ".:Test/libs/mariadb-connector.jar" Test.MainAdmin
|
||||||
|
OPTION_EXE_P = -cp ".:Test/libs/mariadb-connector.jar" Test.MainProf
|
||||||
|
OPTION_EXE_S = -cp ".:Test/libs/mariadb-connector.jar" Test.MainStudent
|
||||||
RM = rm -rf
|
RM = rm -rf
|
||||||
|
|
||||||
# Chemin
|
# Chemin
|
||||||
@ -25,6 +28,24 @@ run:
|
|||||||
$(JAVAC) $(OPTION_COMPILE) $(API)/$(ALL) $(MNP)/$(ALL) $(TEST)/$(ALL)
|
$(JAVAC) $(OPTION_COMPILE) $(API)/$(ALL) $(MNP)/$(ALL) $(TEST)/$(ALL)
|
||||||
cp -r src/Test/libs build/Test && cd build/ && $(JAVA) $(OPTION_EXE)
|
cp -r src/Test/libs build/Test && cd build/ && $(JAVA) $(OPTION_EXE)
|
||||||
|
|
||||||
|
admin:
|
||||||
|
$(RM) build/*
|
||||||
|
$(RM) docs/*
|
||||||
|
$(JAVAC) $(OPTION_COMPILE) $(API)/$(ALL) $(MNP)/$(ALL) $(TEST)/$(ALL)
|
||||||
|
cp -r src/Test/libs build/Test && cd build/ && $(JAVA) $(OPTION_EXE_A)
|
||||||
|
|
||||||
|
student:
|
||||||
|
$(RM) build/*
|
||||||
|
$(RM) docs/*
|
||||||
|
$(JAVAC) $(OPTION_COMPILE) $(API)/$(ALL) $(MNP)/$(ALL) $(TEST)/$(ALL)
|
||||||
|
cp -r src/Test/libs build/Test && cd build/ && $(JAVA) $(OPTION_EXE_S)
|
||||||
|
|
||||||
|
prof:
|
||||||
|
$(RM) build/*
|
||||||
|
$(RM) docs/*
|
||||||
|
$(JAVAC) $(OPTION_COMPILE) $(API)/$(ALL) $(MNP)/$(ALL) $(TEST)/$(ALL)
|
||||||
|
cp -r src/Test/libs build/Test && cd build/ && $(JAVA) $(OPTION_EXE_P)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) build/*
|
$(RM) build/*
|
||||||
$(RM) docs/*
|
$(RM) docs/*
|
||||||
|
@ -34,15 +34,22 @@ Pour les 3 vues, nous avons pas fait d'interface malgrès que les vues ont des m
|
|||||||
### Fonctionnalitées non réussi
|
### Fonctionnalitées non réussi
|
||||||
|
|
||||||
### Fonctionnalitées manquantes
|
### Fonctionnalitées manquantes
|
||||||
|
Par choix arbitraire, nous avons decidé de ne pas creer de sous groupe.
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
### Tests réussi
|
### Tests réussi
|
||||||
|
Nous pensons que l'ensemble des fonctionnalités demandés ont été faite. (Mis a part ce qui se trouve dans la catégorie: Fonctionnalitées manquantes et Fonctionnalitées non reussi).
|
||||||
|
|
||||||
### Tests montrant des bugs
|
### Tests montrant des bugs
|
||||||
|
|
||||||
## Conclusions
|
## Conclusions
|
||||||
|
|
||||||
### Conclusions personnelles
|
### Conclusions personnelles
|
||||||
|
Bilal: J'ai trouvé ce projet interessant a faire. Il a demandé une mobilisation de casi toutes les connaissances qu'on a acquerie dans le BUT2. Ce que je trouve dommage, c'est qu'on etait restraint a l'API.
|
||||||
|
|
||||||
|
Felix: ()
|
||||||
|
|
||||||
|
Romain: ()
|
||||||
|
|
||||||
### Conclusion générale
|
### Conclusion générale
|
10811
build/Test/Untitled.mdj
Normal file
10811
build/Test/Untitled.mdj
Normal file
File diff suppressed because it is too large
Load Diff
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.
@ -1,71 +1,71 @@
|
|||||||
package Test;
|
package Test;
|
||||||
|
|
||||||
import API.Etudiant;
|
import API.Etudiant;
|
||||||
import API.Groupe;
|
import API.Groupe;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
|
||||||
public class AdminView extends JPanel {
|
public class AdminView extends JPanel {
|
||||||
private final ArrayList<Etudiant> e;
|
private final ArrayList<Etudiant> e;
|
||||||
private final ArrayList<Groupe> g;
|
private final ArrayList<Groupe> g;
|
||||||
private final Controller listener;
|
private final Controller listener;
|
||||||
|
|
||||||
public AdminView(ArrayList<Etudiant> e, ArrayList<Groupe> g, Controller listener) {
|
public AdminView(ArrayList<Etudiant> e, ArrayList<Groupe> g, Controller listener) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.setLayout(new GridBagLayout());
|
this.setLayout(new GridBagLayout());
|
||||||
|
|
||||||
this.listener = listener;
|
this.listener = listener;
|
||||||
this.g = g;
|
this.g = g;
|
||||||
this.e = e;
|
this.e = e;
|
||||||
|
|
||||||
Display();
|
Display();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Display() {
|
public void Display() {
|
||||||
BLayout settings = new BLayout();
|
BLayout settings = new BLayout();
|
||||||
settings.setPositionX(0);
|
settings.setPositionX(0);
|
||||||
|
|
||||||
settings.setPositionY(0);
|
settings.setPositionY(0);
|
||||||
CustomJButton studList = new CustomJButton("Voir la liste des étudiants");
|
CustomJButton studList = new CustomJButton("Voir la liste des étudiants");
|
||||||
studList.setActionCommand("pv::GetStudList");
|
studList.setActionCommand("pv::GetStudList");
|
||||||
studList.addActionListener(this.listener);
|
studList.addActionListener(this.listener);
|
||||||
this.add(studList, settings);
|
this.add(studList, settings);
|
||||||
|
|
||||||
settings.setPositionY(1);
|
settings.setPositionY(1);
|
||||||
this.add(new JLabel(" "), settings);
|
this.add(new JLabel(" "), settings);
|
||||||
|
|
||||||
settings.setPositionY(2);
|
settings.setPositionY(2);
|
||||||
CustomJButton moveStudGrup = new CustomJButton("Changer le groupe d'un étudiant");
|
CustomJButton moveStudGrup = new CustomJButton("Changer le groupe d'un étudiant");
|
||||||
moveStudGrup.addActionListener(this.listener);
|
moveStudGrup.addActionListener(this.listener);
|
||||||
moveStudGrup.setActionCommand("av::MoveStudGrup");
|
moveStudGrup.setActionCommand("av::MoveStudGrup");
|
||||||
this.add(moveStudGrup, settings);
|
this.add(moveStudGrup, settings);
|
||||||
|
|
||||||
settings.setPositionY(3);
|
settings.setPositionY(3);
|
||||||
this.add(new JLabel(" "), settings);
|
this.add(new JLabel(" "), settings);
|
||||||
|
|
||||||
settings.setPositionY(4);
|
settings.setPositionY(4);
|
||||||
CustomJButton addStudGrup = new CustomJButton("Ajouter un étudiant dans un groupe");
|
CustomJButton addStudGrup = new CustomJButton("Ajouter un étudiant dans un groupe");
|
||||||
addStudGrup.addActionListener(this.listener);
|
addStudGrup.addActionListener(this.listener);
|
||||||
addStudGrup.setActionCommand("av::AddStudGrup");
|
addStudGrup.setActionCommand("av::AddStudGrup");
|
||||||
this.add(addStudGrup, settings);
|
this.add(addStudGrup, settings);
|
||||||
|
|
||||||
settings.setPositionY(5);
|
settings.setPositionY(5);
|
||||||
this.add(new JLabel(" "), settings);
|
this.add(new JLabel(" "), settings);
|
||||||
|
|
||||||
settings.setPositionY(6);
|
settings.setPositionY(6);
|
||||||
this.add(new JLabel(" "), settings);
|
this.add(new JLabel(" "), settings);
|
||||||
|
|
||||||
settings.setPositionY(7);
|
settings.setPositionY(7);
|
||||||
CustomJButton createGrup = new CustomJButton("Créer un groupe");
|
CustomJButton createGrup = new CustomJButton("Créer un groupe");
|
||||||
createGrup.addActionListener(this.listener);
|
createGrup.addActionListener(this.listener);
|
||||||
createGrup.setActionCommand("av::CreateGrup");
|
createGrup.setActionCommand("av::CreateGrup");
|
||||||
this.add(createGrup, settings);
|
this.add(createGrup, settings);
|
||||||
|
|
||||||
this.repaint();
|
this.repaint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,75 +1,75 @@
|
|||||||
package Test;
|
package Test;
|
||||||
|
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
|
|
||||||
|
|
||||||
public class CustomJButton extends JButton {
|
public class CustomJButton extends JButton {
|
||||||
private int fontSize = 12;
|
private int fontSize = 12;
|
||||||
private Font font = new Font("Arial", Font.PLAIN, 12);
|
private Font font = new Font("Arial", Font.PLAIN, 12);
|
||||||
private Color color = Color.BLACK;
|
private Color color = Color.BLACK;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param text texte affiché dans le bouton
|
* @param text texte affiché dans le bouton
|
||||||
* @param fontSize taille du texte
|
* @param fontSize taille du texte
|
||||||
*/
|
*/
|
||||||
public CustomJButton(String text, int fontSize) {
|
public CustomJButton(String text, int fontSize) {
|
||||||
super(text);
|
super(text);
|
||||||
init();
|
init();
|
||||||
this.fontSize = fontSize;
|
this.fontSize = fontSize;
|
||||||
this.font = new Font("Arial", Font.PLAIN, this.fontSize);
|
this.font = new Font("Arial", Font.PLAIN, this.fontSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param text texte affiché dans le bouton
|
* @param text texte affiché dans le bouton
|
||||||
* @param c couleur du bouton
|
* @param c couleur du bouton
|
||||||
*/
|
*/
|
||||||
public CustomJButton(String text, Color c) {
|
public CustomJButton(String text, Color c) {
|
||||||
super(text);
|
super(text);
|
||||||
this.font = new Font("Arial", Font.PLAIN, 12);
|
this.font = new Font("Arial", Font.PLAIN, 12);
|
||||||
this.color = c;
|
this.color = c;
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param text texte affiché dans le bouton
|
* @param text texte affiché dans le bouton
|
||||||
* @param font police du texte
|
* @param font police du texte
|
||||||
*/
|
*/
|
||||||
public CustomJButton(String text, Font font) {
|
public CustomJButton(String text, Font font) {
|
||||||
super(text);
|
super(text);
|
||||||
this.font = font;
|
this.font = font;
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param text texte affiché dans le bouton
|
* @param text texte affiché dans le bouton
|
||||||
* @param font police du texte
|
* @param font police du texte
|
||||||
*/
|
*/
|
||||||
public CustomJButton(String text, Font font, Color c) {
|
public CustomJButton(String text, Font font, Color c) {
|
||||||
super(text);
|
super(text);
|
||||||
this.color = Color.BLACK;
|
this.color = Color.BLACK;
|
||||||
this.font = font;
|
this.font = font;
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param text texte affiché dans le bouton
|
* @param text texte affiché dans le bouton
|
||||||
*/
|
*/
|
||||||
public CustomJButton(String text) {
|
public CustomJButton(String text) {
|
||||||
super(text);
|
super(text);
|
||||||
this.font = new Font("Arial", Font.PLAIN, 12);
|
this.font = new Font("Arial", Font.PLAIN, 12);
|
||||||
this.color = Color.BLACK;
|
this.color = Color.BLACK;
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void init() {
|
private void init() {
|
||||||
this.setForeground(Color.WHITE);
|
this.setForeground(Color.WHITE);
|
||||||
this.setBackground(this.color);
|
this.setBackground(this.color);
|
||||||
this.setFont(this.font);
|
this.setFont(this.font);
|
||||||
this.setFocusPainted(false);
|
this.setFocusPainted(false);
|
||||||
this.setContentAreaFilled(true);
|
this.setContentAreaFilled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,116 +1,116 @@
|
|||||||
package Test;
|
package Test;
|
||||||
|
|
||||||
import API.Etudiant;
|
import API.Etudiant;
|
||||||
import API.Groupe;
|
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.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.KeyAdapter;
|
import java.awt.event.KeyAdapter;
|
||||||
import java.awt.event.KeyEvent;
|
import java.awt.event.KeyEvent;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class ProfView extends JPanel {
|
public class ProfView extends JPanel {
|
||||||
private final ArrayList<Etudiant> e;
|
private final ArrayList<Etudiant> e;
|
||||||
private final ArrayList<Groupe> g;
|
private final ArrayList<Groupe> g;
|
||||||
private final Controller listener;
|
private final Controller listener;
|
||||||
private JComboBox<String> groupeOption;
|
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) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.setLayout(new GridBagLayout());
|
this.setLayout(new GridBagLayout());
|
||||||
|
|
||||||
this.listener = listener;
|
this.listener = listener;
|
||||||
this.e = e;
|
this.e = e;
|
||||||
this.g = g;
|
this.g = g;
|
||||||
|
|
||||||
this.Display();
|
this.Display();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getComboSelection() {
|
public String getComboSelection() {
|
||||||
return (String) this.groupeOption.getSelectedItem();
|
return (String) this.groupeOption.getSelectedItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSearchStud() {
|
public String getSearchStud() {
|
||||||
return this.text.getText();
|
return this.text.getText();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getComboSelectionIndex() {
|
public int getComboSelectionIndex() {
|
||||||
return this.groupeOption.getSelectedIndex();
|
return this.groupeOption.getSelectedIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Display() {
|
public void Display() {
|
||||||
BLayout settings = new BLayout();
|
BLayout settings = new BLayout();
|
||||||
settings.setPositionX(0);
|
settings.setPositionX(0);
|
||||||
settings.setPositionY(6);
|
settings.setPositionY(6);
|
||||||
|
|
||||||
settings.setPositionY(0);
|
settings.setPositionY(0);
|
||||||
CustomJButton studList = new CustomJButton("Voir la liste des étudiants");
|
CustomJButton studList = new CustomJButton("Voir la liste des étudiants");
|
||||||
studList.setActionCommand("pv::GetStudList");
|
studList.setActionCommand("pv::GetStudList");
|
||||||
studList.addActionListener(this.listener);
|
studList.addActionListener(this.listener);
|
||||||
this.add(studList, settings);
|
this.add(studList, settings);
|
||||||
|
|
||||||
settings.setPositionY(1);
|
settings.setPositionY(1);
|
||||||
this.add(new JLabel(" "), settings);
|
this.add(new JLabel(" "), settings);
|
||||||
|
|
||||||
settings.setPositionY(2);
|
settings.setPositionY(2);
|
||||||
JLabel gs = new JLabel("Afficher les étudiants se trouvant dans le groupe :");
|
JLabel gs = new JLabel("Afficher les étudiants se trouvant dans le groupe :");
|
||||||
this.add(gs, settings);
|
this.add(gs, settings);
|
||||||
|
|
||||||
settings.setPositionY(3);
|
settings.setPositionY(3);
|
||||||
settings.setPadding(new Insets(0, 0, 0, 50));
|
settings.setPadding(new Insets(0, 0, 0, 50));
|
||||||
String[] groupeList = new String[this.g.size()];
|
String[] groupeList = new String[this.g.size()];
|
||||||
|
|
||||||
for(int i = 0; i <= this.g.size()-1; i++) {
|
for(int i = 0; i <= this.g.size()-1; i++) {
|
||||||
groupeList[i] = this.g.get(i).getName();
|
groupeList[i] = this.g.get(i).getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.groupeOption = new JComboBox<>(groupeList);
|
this.groupeOption = new JComboBox<>(groupeList);
|
||||||
this.groupeOption.setPreferredSize(new Dimension(110, 30));
|
this.groupeOption.setPreferredSize(new Dimension(110, 30));
|
||||||
this.add(groupeOption, settings);
|
this.add(groupeOption, settings);
|
||||||
|
|
||||||
settings.setPositionY(3);
|
settings.setPositionY(3);
|
||||||
settings.setPadding(new Insets(0, 0, 0, 0));
|
settings.setPadding(new Insets(0, 0, 0, 0));
|
||||||
settings.setAnchor(GridBagConstraints.EAST);
|
settings.setAnchor(GridBagConstraints.EAST);
|
||||||
CustomJButton confirm = new CustomJButton("Rechercher");
|
CustomJButton confirm = new CustomJButton("Rechercher");
|
||||||
confirm.setActionCommand("pv::GetListFiltered");
|
confirm.setActionCommand("pv::GetListFiltered");
|
||||||
confirm.addActionListener(this.listener);
|
confirm.addActionListener(this.listener);
|
||||||
this.add(confirm, settings);
|
this.add(confirm, settings);
|
||||||
|
|
||||||
settings.setAnchor(GridBagConstraints.CENTER);
|
settings.setAnchor(GridBagConstraints.CENTER);
|
||||||
|
|
||||||
settings.setPositionY(4);
|
settings.setPositionY(4);
|
||||||
this.add(new JLabel(" "), settings);
|
this.add(new JLabel(" "), settings);
|
||||||
|
|
||||||
settings.setPositionY(5);
|
settings.setPositionY(5);
|
||||||
JLabel pf = new JLabel("Rechercher un étudiant : ");
|
JLabel pf = new JLabel("Rechercher un étudiant : ");
|
||||||
this.add(pf, settings);
|
this.add(pf, settings);
|
||||||
|
|
||||||
settings.setPositionY(6);
|
settings.setPositionY(6);
|
||||||
settings.setPadding(new Insets(0, 0, 0, 50));
|
settings.setPadding(new Insets(0, 0, 0, 50));
|
||||||
this.text = new JTextField();
|
this.text = new JTextField();
|
||||||
this.text.setPreferredSize(new Dimension(110, 30));
|
this.text.setPreferredSize(new Dimension(110, 30));
|
||||||
text.addKeyListener(new KeyAdapter() {
|
text.addKeyListener(new KeyAdapter() {
|
||||||
public void keyTyped(KeyEvent e) {
|
public void keyTyped(KeyEvent e) {
|
||||||
if (text.getText().length() >= 3 )
|
if (text.getText().length() >= 3 )
|
||||||
e.consume();
|
e.consume();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.add(this.text, settings);
|
this.add(this.text, settings);
|
||||||
|
|
||||||
settings.setPositionY(6);
|
settings.setPositionY(6);
|
||||||
settings.setPadding(new Insets(0, 0, 0, 0));
|
settings.setPadding(new Insets(0, 0, 0, 0));
|
||||||
settings.setAnchor(GridBagConstraints.EAST);
|
settings.setAnchor(GridBagConstraints.EAST);
|
||||||
CustomJButton searchTLetters = new CustomJButton("Rechercher");
|
CustomJButton searchTLetters = new CustomJButton("Rechercher");
|
||||||
searchTLetters.addActionListener(this.listener);
|
searchTLetters.addActionListener(this.listener);
|
||||||
searchTLetters.setActionCommand("pv::SearchStudentPer3Letters");
|
searchTLetters.setActionCommand("pv::SearchStudentPer3Letters");
|
||||||
this.add(searchTLetters, settings);
|
this.add(searchTLetters, settings);
|
||||||
|
|
||||||
this.repaint();
|
this.repaint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,101 +1,101 @@
|
|||||||
package Test;
|
package Test;
|
||||||
|
|
||||||
import API.Etudiant;
|
import API.Etudiant;
|
||||||
import API.Groupe;
|
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.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.KeyAdapter;
|
import java.awt.event.KeyAdapter;
|
||||||
import java.awt.event.KeyEvent;
|
import java.awt.event.KeyEvent;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class StudentView extends JPanel {
|
public class StudentView extends JPanel {
|
||||||
private final ArrayList<Etudiant> e;
|
private final ArrayList<Etudiant> e;
|
||||||
private final ArrayList<Groupe> g;
|
private final ArrayList<Groupe> g;
|
||||||
private final Controller listener;
|
private final Controller listener;
|
||||||
private JComboBox<String> groupeOption;
|
private JComboBox<String> groupeOption;
|
||||||
|
|
||||||
public StudentView(ArrayList<Etudiant> e, ArrayList<Groupe> g, Controller listener) {
|
public StudentView(ArrayList<Etudiant> e, ArrayList<Groupe> g, Controller listener) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.setLayout(new GridBagLayout());
|
this.setLayout(new GridBagLayout());
|
||||||
|
|
||||||
this.listener = listener;
|
this.listener = listener;
|
||||||
this.e = e;
|
this.e = e;
|
||||||
this.g = g;
|
this.g = g;
|
||||||
|
|
||||||
this.Display();
|
this.Display();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getComboSelection() {
|
public String getComboSelection() {
|
||||||
return (String) this.groupeOption.getSelectedItem();
|
return (String) this.groupeOption.getSelectedItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getComboSelectionIndex() {
|
public int getComboSelectionIndex() {
|
||||||
return this.groupeOption.getSelectedIndex();
|
return this.groupeOption.getSelectedIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Display() {
|
public void Display() {
|
||||||
BLayout settings = new BLayout();
|
BLayout settings = new BLayout();
|
||||||
settings.setPositionX(0);
|
settings.setPositionX(0);
|
||||||
settings.setPositionY(1);
|
settings.setPositionY(1);
|
||||||
|
|
||||||
settings.setPositionY(0);
|
settings.setPositionY(0);
|
||||||
CustomJButton studList = new CustomJButton("Voir la liste des groupes");
|
CustomJButton studList = new CustomJButton("Voir la liste des groupes");
|
||||||
studList.setActionCommand("sv::GetGrup");
|
studList.setActionCommand("sv::GetGrup");
|
||||||
studList.addActionListener(this.listener);
|
studList.addActionListener(this.listener);
|
||||||
this.add(studList, settings);
|
this.add(studList, settings);
|
||||||
|
|
||||||
settings.setPositionY(1);
|
settings.setPositionY(1);
|
||||||
this.add(new JLabel(" "), settings);
|
this.add(new JLabel(" "), settings);
|
||||||
|
|
||||||
settings.setPositionY(2);
|
settings.setPositionY(2);
|
||||||
JLabel gs = new JLabel("Afficher les etudiants se trouvant dans le groupe :");
|
JLabel gs = new JLabel("Afficher les etudiants se trouvant dans le groupe :");
|
||||||
this.add(gs, settings);
|
this.add(gs, settings);
|
||||||
|
|
||||||
settings.setPositionY(3);
|
settings.setPositionY(3);
|
||||||
settings.setPadding(new Insets(0, 0, 0, 50));
|
settings.setPadding(new Insets(0, 0, 0, 50));
|
||||||
String[] groupeList = new String[this.g.size()];
|
String[] groupeList = new String[this.g.size()];
|
||||||
|
|
||||||
for(int i = 0; i <= this.g.size()-1; i++) {
|
for(int i = 0; i <= this.g.size()-1; i++) {
|
||||||
groupeList[i] = this.g.get(i).getName();
|
groupeList[i] = this.g.get(i).getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.groupeOption = new JComboBox<>(groupeList);
|
this.groupeOption = new JComboBox<>(groupeList);
|
||||||
this.groupeOption.setPreferredSize(new Dimension(110, 30));
|
this.groupeOption.setPreferredSize(new Dimension(110, 30));
|
||||||
this.add(groupeOption, settings);
|
this.add(groupeOption, settings);
|
||||||
|
|
||||||
settings.setPositionY(3);
|
settings.setPositionY(3);
|
||||||
settings.setPadding(new Insets(0, 0, 0, 0));
|
settings.setPadding(new Insets(0, 0, 0, 0));
|
||||||
settings.setAnchor(GridBagConstraints.EAST);
|
settings.setAnchor(GridBagConstraints.EAST);
|
||||||
CustomJButton confirm = new CustomJButton("Rechercher");
|
CustomJButton confirm = new CustomJButton("Rechercher");
|
||||||
confirm.setActionCommand("sv::GetListFiltered");
|
confirm.setActionCommand("sv::GetListFiltered");
|
||||||
confirm.addActionListener(this.listener);
|
confirm.addActionListener(this.listener);
|
||||||
this.add(confirm, settings);
|
this.add(confirm, settings);
|
||||||
|
|
||||||
settings.setPositionY(4);
|
settings.setPositionY(4);
|
||||||
settings.setAnchor(GridBagConstraints.CENTER);
|
settings.setAnchor(GridBagConstraints.CENTER);
|
||||||
this.add(new JLabel(" "), settings);
|
this.add(new JLabel(" "), settings);
|
||||||
|
|
||||||
settings.setPositionY(5);
|
settings.setPositionY(5);
|
||||||
CustomJButton makeRequest = new CustomJButton("Faire une requete");
|
CustomJButton makeRequest = new CustomJButton("Faire une requete");
|
||||||
makeRequest.setActionCommand("sv::MakeRequest");
|
makeRequest.setActionCommand("sv::MakeRequest");
|
||||||
makeRequest.addActionListener(this.listener);
|
makeRequest.addActionListener(this.listener);
|
||||||
this.add(makeRequest, settings);
|
this.add(makeRequest, settings);
|
||||||
|
|
||||||
settings.setPositionY(6);
|
settings.setPositionY(6);
|
||||||
this.add(new JLabel(" "), settings);
|
this.add(new JLabel(" "), settings);
|
||||||
|
|
||||||
settings.setPositionY(7);
|
settings.setPositionY(7);
|
||||||
CustomJButton showRequest = new CustomJButton("Voir mes requetes");
|
CustomJButton showRequest = new CustomJButton("Voir mes requetes");
|
||||||
showRequest.setActionCommand("sv::ShowRequest");
|
showRequest.setActionCommand("sv::ShowRequest");
|
||||||
showRequest.addActionListener(this.listener);
|
showRequest.addActionListener(this.listener);
|
||||||
this.add(showRequest, settings);
|
this.add(showRequest, settings);
|
||||||
|
|
||||||
this.repaint();
|
this.repaint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,6 @@ public class TestTexteMNP {
|
|||||||
* */
|
* */
|
||||||
BDatabase db = new BDatabase();
|
BDatabase db = new BDatabase();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Demarrage de l'appli
|
* Demarrage de l'appli
|
||||||
* */
|
* */
|
||||||
|
21620
src/Test/Untitled.mdj
21620
src/Test/Untitled.mdj
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user