This commit is contained in:
Bilou 2022-12-07 16:36:22 +01:00
parent e988e3f7fe
commit 79ca7e9c91
35 changed files with 23151 additions and 12325 deletions

View File

@ -1,14 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<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-connector2" level="project" />
<orderEntry type="library" name="mariadb-connector1" level="project" />
<orderEntry type="library" name="mariadb-connector" level="project" />
</component>
<?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://$MODULE_DIR$/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" />
<orderEntry type="library" name="mariadb-connector2" level="project" />
<orderEntry type="library" name="mariadb-connector1" level="project" />
</component>
</module>

View File

@ -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>

View File

@ -7,6 +7,9 @@ OPTION_DOCS = -d docs/
OPTION_COMPILE = -d build/ -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_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
# Chemin
@ -25,6 +28,24 @@ run:
$(JAVAC) $(OPTION_COMPILE) $(API)/$(ALL) $(MNP)/$(ALL) $(TEST)/$(ALL)
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:
$(RM) build/*
$(RM) docs/*

View File

@ -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 manquantes
Par choix arbitraire, nous avons decidé de ne pas creer de sous groupe.
## Tests
### 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
## Conclusions
### 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

10811
build/Test/Untitled.mdj Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -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

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -10,7 +10,6 @@ public class TestTexteMNP {
* */
BDatabase db = new BDatabase();
/**
* Demarrage de l'appli
* */

File diff suppressed because it is too large Load Diff