MAJ V4.5.0

This commit is contained in:
pablo rodriguez 2024-05-20 09:32:45 +02:00
parent 3ce32c337c
commit 041eee77ed
4 changed files with 49 additions and 62 deletions

Binary file not shown.

View File

@ -51,20 +51,25 @@ public class myTableStudent extends AbstractTableModel{
}
public void addOrUpdate() {
if(commandes.nodeCSV!=null)if(!commandes.nodeCSV.isVide()) {
String name = commandes.nodeCSV.getAttributs().get("name");
String firstname = commandes.nodeCSV.getAttributs().get("firstname");
String id = commandes.nodeCSV.getAttributs().get("id");
String email = commandes.nodeCSV.getAttributs().get("email");
node nodeImport = commandes.sujet.retourneFirstEnfantsByName("import_moodle");
if(name==null) name = nodeImport.getAttributs().get("name");
if(firstname==null) firstname = nodeImport.getAttributs().get("firstname");
if(id==null) id = nodeImport.getAttributs().get("id");
if(email==null) email = nodeImport.getAttributs().get("email");
listes = new String[commandes.nodeCSV.getNodes().size()][columNames.size()];
if(commandes.nodeCSV==null) {
listes = new String[0][columNames.size()];
fireTableRowsInserted(0, 0);
return;
}
if(!commandes.nodeCSV.isVide()) {
String name = commandes.nodeCSV.getAttributs().get("name");
String firstname = commandes.nodeCSV.getAttributs().get("firstname");
String id = commandes.nodeCSV.getAttributs().get("id");
String email = commandes.nodeCSV.getAttributs().get("email");
node nodeImport = commandes.sujet.retourneFirstEnfantsByName("import_moodle");
if(name==null) name = nodeImport.getAttributs().get("name");
if(firstname==null) firstname = nodeImport.getAttributs().get("firstname");
if(id==null) id = nodeImport.getAttributs().get("id");
if(email==null) email = nodeImport.getAttributs().get("email");
listes = new String[commandes.nodeCSV.getNodes().size()][columNames.size()];
for(int i = 0 ; i<commandes.nodeCSV.getNodes().size();i++) {
if(commandes.nodeCSV.getNodes().get(i).getAttributs().get(name)!=null &&
commandes.nodeCSV.getNodes().get(i).getAttributs().get(firstname)!=null &&
@ -77,8 +82,11 @@ public class myTableStudent extends AbstractTableModel{
}
}
fireTableRowsInserted(0, commandes.nodeCSV.getNodes().size()-1);
}else {
listes = new String[0][columNames.size()];
fireTableRowsInserted(0, 0);
}
}
}
public void removeRow(int row) {
if (row >= 0 && row < commandes.nodeCSV.getNodes().size()) {

View File

@ -198,7 +198,7 @@ public class baseDonneesListesEtudiants extends JFrame{
}
public static baseDonneesListesEtudiants getInstance(int index) {
public static baseDonneesListesEtudiants getInstance(int indexRow) {
if (isDispose) {
instance = new baseDonneesListesEtudiants();
}else {
@ -214,7 +214,7 @@ public class baseDonneesListesEtudiants extends JFrame{
}
}
}
indexSelect = index;
indexSelect = indexRow;
if(indexSelect>=0) {
selectRow();
}else {
@ -267,6 +267,7 @@ public class baseDonneesListesEtudiants extends JFrame{
@Override
public void actionPerformed(ActionEvent e) {
commandes.nodeCSV = null;
baseDonneesListesEtudiants.getInstance(-1);
lblNomListe.setText("Pas de liste sélectionnée.");
}
});
@ -274,6 +275,13 @@ public class baseDonneesListesEtudiants extends JFrame{
btnAddNewStudent.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if(commandes.nodeCSV == null) {
JOptionPane.showMessageDialog(null, "Veuillez sélectionner une liste d'étudiant.", "Erreur", JOptionPane.ERROR_MESSAGE);
return;
}
// Créer des champs pour entrer les informations de l'étudiant
JTextField idField = new JTextField();
JTextField nameField = new JTextField();
@ -358,8 +366,6 @@ public class baseDonneesListesEtudiants extends JFrame{
});
}

View File

@ -20,12 +20,14 @@ import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JToolBar;
import javax.swing.JTree;
import javax.swing.KeyStroke;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
@ -133,6 +135,8 @@ public final class create extends JFrame {
public static boolean isDispose = true;
private static JLabel lblInfo = new JLabel("Fichier d'analyse");
private final JLabel lblNewLabel_1 = new JLabel("Les méthodes d'évaluation");
private static JScrollPane ScrollPaneTableBouton = new JScrollPane( );
private static JScrollBar verticalScrollBar = ScrollPaneTableBouton.getVerticalScrollBar();
private final static JButton btnAttribut= new JButton(new actAttribut());
private final static JButton btnAllContent = new JButton(new actAllContent());
@ -241,6 +245,7 @@ public final class create extends JFrame {
instance.setVisible(true);
lectureFichierDejaCharger();
refreshLabelInfo();
positionScrollDebut();
isDispose=false;
return instance;
}
@ -319,7 +324,7 @@ public final class create extends JFrame {
textNodeSelect.setBackground(Color.LIGHT_GRAY);
textNodeSelect.setFont(new Font("Monospaced", Font.PLAIN, 15));
JScrollPane ScrollPaneTableBouton = new JScrollPane( );
ScrollPaneTableBouton = new JScrollPane( );
panelDroiteBoutons.setBackground(Color.LIGHT_GRAY);
panelDroiteBoutons.setBorder(null);
@ -464,6 +469,8 @@ public final class create extends JFrame {
this.setExtendedState(MAXIMIZED_BOTH);
rightScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
positionScrollDebut();
ListenerAction();
}
@ -850,42 +857,6 @@ public final class create extends JFrame {
buttonExit.setHideActionText( true );
}
// /**
// * Ferme l'application.</br>
// */
// public void closeWindows() {
// int H = commandes.evaluationChargeEnMemoire.hashCode();
// if(H==commandes.hashCodeEvaluationSave){
// if(JOptionPane.showConfirmDialog(null,"Voulez-vous quitter analyseWriter?", "Quitter", JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE)==JOptionPane.YES_OPTION) {
// baseDonneesEvaluations.ferme();
// evaluate.ferme();
// fermeCreate();
// }
// }else{
// if(JOptionPane.showConfirmDialog(null,"Vous avez apporté des modifications à cette évaluation.\nVoulez-vous quitter analyseWriter?", "Quitter", JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE)==JOptionPane.YES_OPTION) {
// baseDonneesEvaluations.ferme();
// create.fermeCreate();
// }
// }
//
// }
// public void closeDirectlyWindows() {
// int H = commandes.evaluationChargeEnMemoire.hashCode();
// if(H==commandes.hashCodeEvaluationSave){
// if(JOptionPane.showConfirmDialog(null,"Voulez-vous quitter analyseWriter?", "Quitter", JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE)==JOptionPane.YES_OPTION) {
// baseDonneesEvaluations.ferme();
// evaluate.ferme();
// fermeCreate();
// }
// }else{
// if(JOptionPane.showConfirmDialog(null,"Vous avez apporté des modifications à cette évaluation.\nVoulez-vous quitter analyseWriter?", "Quitter", JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE)==JOptionPane.YES_OPTION) {
// baseDonneesEvaluations.ferme();
// create.fermeCreate();
// }
// }
// }
@ -1024,11 +995,7 @@ public final class create extends JFrame {
return textNodeSelect;
}
// public static JToggleButton getTglbtnTousLesNodes() {
// return tglbtnTousLesNodes;
// }
public static JButton getButtonEvaluate() {
return buttonEvaluate;
@ -1072,7 +1039,13 @@ public final class create extends JFrame {
}
public static void positionScrollDebut() {
// Positionne le curseur au début du texte pour que le JScrollPane affiche le haut
SwingUtilities.invokeLater(() -> {
textNodeSelect.setCaretPosition(0);
verticalScrollBar.setValue(verticalScrollBar.getMinimum());
});
}