MAJ V1.0.4 - images du lanceur
Before Width: | Height: | Size: 556 KiB After Width: | Height: | Size: 556 KiB |
BIN
resources/Sans titre_2.png
Normal file
After Width: | Height: | Size: 642 KiB |
@ -1,4 +1,4 @@
|
||||
package baseUFRHG;
|
||||
package Inscriptions;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
@ -6,10 +6,10 @@ import javax.swing.JLabel;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import baseUFRHG.FileChooserCSV;
|
||||
import baseUFRHG.commandes;
|
||||
import baseUFRHG.noeud;
|
||||
import baseUFRHG.recupeBases;
|
||||
import base.recupeBases;
|
||||
import outils.FileChooserCSV;
|
||||
import outils.commandes;
|
||||
import outils.noeud;
|
||||
|
||||
public class importInscriptionCSV {
|
||||
|
||||
|
@ -15,11 +15,11 @@ import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import baseUFRHG.commandes;
|
||||
import baseUFRHG.noeud;
|
||||
import baseUFRHG.recupeBases;
|
||||
import baseUFRHG.sauvegardeXMLBase;
|
||||
import baseUFRHG.supprimeCaracatresSpeciaux;
|
||||
import base.recupeBases;
|
||||
import base.sauvegardeXMLBase;
|
||||
import outils.commandes;
|
||||
import outils.noeud;
|
||||
import outils.supprimeCaracatresSpeciaux;
|
||||
|
||||
public class importInscriptionXLS {
|
||||
|
||||
|
@ -9,9 +9,8 @@ import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
import baseUFRHG.FileEncodingDetector;
|
||||
import baseUFRHG.noeud;
|
||||
import baseUFRHG.supprimeCaracatresSpeciaux;
|
||||
import outils.noeud;
|
||||
import outils.supprimeCaracatresSpeciaux;
|
||||
|
||||
public class lectureCSV {
|
||||
|
||||
|
@ -2,10 +2,10 @@ package Inscriptions;
|
||||
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
import baseUFRHG.noeud;
|
||||
import baseUFRHG.sauvegardeXMLBase;
|
||||
import baseUFRHG.supprimeCaracatresSpeciaux;
|
||||
import baseUFRHG.sauvegardeXMLBase.saveType;
|
||||
import base.sauvegardeXMLBase;
|
||||
import base.sauvegardeXMLBase.saveType;
|
||||
import outils.noeud;
|
||||
import outils.supprimeCaracatresSpeciaux;
|
||||
|
||||
public class majBaseWithCSV {
|
||||
|
||||
|
@ -13,6 +13,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Random;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
@ -27,14 +28,15 @@ import javax.swing.UIManager;
|
||||
|
||||
import Inscriptions.importInscriptionCSV;
|
||||
import Inscriptions.importInscriptionXLS;
|
||||
import baseUFRHG.CreateUpdateZipArchive;
|
||||
import baseUFRHG.FileChooserXLSX;
|
||||
import baseUFRHG.VersionChecker;
|
||||
import baseUFRHG.commandes;
|
||||
import baseUFRHG.exportBaseToExcel;
|
||||
import baseUFRHG.importAllBaseToExcel;
|
||||
import baseUFRHG.recupeBases;
|
||||
import baseUFRHG.sauvegardeXMLBase;
|
||||
import base.CreateUpdateZipArchive;
|
||||
import base.Hash;
|
||||
import base.recupeBases;
|
||||
import base.sauvegardeXMLBase;
|
||||
import exportations.exportBaseToExcel;
|
||||
import gestion_version.VersionChecker;
|
||||
import importations.importAllBaseToExcel;
|
||||
import outils.FileChooserXLSX;
|
||||
import outils.commandes;
|
||||
|
||||
public class Window_demarre extends JFrame {
|
||||
|
||||
@ -73,10 +75,12 @@ public class Window_demarre extends JFrame {
|
||||
|
||||
// mise à jour de la base de données si nouvelle version de l'application utilisé.
|
||||
commandes.nBase=recupeBases.recupeLaBase();
|
||||
|
||||
VersionChecker.UpdateVersion(commandes.nBase);
|
||||
|
||||
if(commandes.blocageApplication) {
|
||||
JOptionPane.showMessageDialog(null, "<html>Blocage de l'application.<br>Par pablo rodriguez</html>");
|
||||
JOptionPane.showMessageDialog(null, "<html>Blocage de l'application.<br>"
|
||||
+ "Contacter votre administrateur réseau.<br>Erreur : <b><u>Autorisation refusée.</u></b></html>");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -95,8 +99,10 @@ public class Window_demarre extends JFrame {
|
||||
@Override
|
||||
public void run() {
|
||||
// Appeler la méthode de sauvegarde ici
|
||||
sauvegardeXMLBase.saveSauvegarde(commandes.nBase);
|
||||
CreateUpdateZipArchive.save();
|
||||
if(Hash.faireLaSauvegarde()) {
|
||||
sauvegardeXMLBase.saveSauvegarde(commandes.nBase);
|
||||
CreateUpdateZipArchive.save();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -185,21 +191,16 @@ public class Window_demarre extends JFrame {
|
||||
btnimporterDesInscriptionsdepuisClasseur.setBounds(397, 323, 366, 60);
|
||||
frmEvalwriter.getContentPane().add(btnimporterDesInscriptionsdepuisClasseur);
|
||||
|
||||
JLabel lblAuteurVersion = new JLabel("<html>Pablo Rodriguez - 2023<br>Version "+ commandes.version+"</html>");
|
||||
lblAuteurVersion.setVerticalAlignment(SwingConstants.TOP);
|
||||
lblAuteurVersion.setHorizontalAlignment(SwingConstants.LEFT);
|
||||
lblAuteurVersion.setFont(new Font("Tahoma", Font.BOLD, 16));
|
||||
lblAuteurVersion.setForeground(new Color(255, 255, 255));
|
||||
lblAuteurVersion.setBounds(22, 11, 307, 55);
|
||||
frmEvalwriter.getContentPane().add(lblAuteurVersion);
|
||||
|
||||
btnNAideMiseAJour.setForeground(Color.GRAY);
|
||||
btnNAideMiseAJour.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 12));
|
||||
btnNAideMiseAJour.setBounds(10, 561, 377, 30);
|
||||
frmEvalwriter.getContentPane().add(btnNAideMiseAJour);
|
||||
|
||||
|
||||
ImageIcon imageIcon = new ImageIcon(Window_demarre.class.getResource("/resources/Sans titre.png"));
|
||||
// Générer un nombre aléatoire entre 1 et 4 inclusivement
|
||||
Random random = new Random();
|
||||
int randomNumber = random.nextInt(16) + 1;
|
||||
ImageIcon imageIcon = new ImageIcon(Window_demarre.class.getResource("/resources/Sans titre_"+ String.valueOf(randomNumber) +".jpg"));
|
||||
// imageIcon = new ImageIcon(Window_demarre.class.getResource("/resources/Sans titre_16.jpg"));
|
||||
Image image = imageIcon.getImage();
|
||||
|
||||
// Détermination de la taille souhaitée pour l'image
|
||||
@ -209,9 +210,20 @@ public class Window_demarre extends JFrame {
|
||||
// Redimensionnement de l'image pour qu'elle s'adapte à la taille souhaitée
|
||||
Image resizedImage = image.getScaledInstance(newWidth, newHeight, Image.SCALE_SMOOTH);
|
||||
|
||||
JLabel lblAuteurVersion = new JLabel("<html>Pablo Rodriguez - 2023<br>Version "+ commandes.version+"</html>");
|
||||
lblAuteurVersion.setVerticalAlignment(SwingConstants.TOP);
|
||||
lblAuteurVersion.setHorizontalAlignment(SwingConstants.LEFT);
|
||||
lblAuteurVersion.setFont(new Font("Tahoma", Font.BOLD, 16));
|
||||
lblAuteurVersion.setForeground(new Color(255, 255, 255));
|
||||
lblAuteurVersion.setBounds(22, 11, 307, 55);
|
||||
frmEvalwriter.getContentPane().add(lblAuteurVersion);
|
||||
if(randomNumber==3 || randomNumber==4 || randomNumber==7
|
||||
|| randomNumber==10 || randomNumber==11 || randomNumber==12
|
||||
|| randomNumber==14 || randomNumber==15) lblAuteurVersion.setForeground(new Color(0, 0, 0));
|
||||
|
||||
JLabel lblFondImage= new JLabel(new ImageIcon(resizedImage));
|
||||
lblFondImage.setVerticalAlignment(SwingConstants.BOTTOM);
|
||||
lblFondImage.setBounds(10, -48, 753, 365);
|
||||
lblFondImage.setBounds(10, 0, 753, 317);
|
||||
frmEvalwriter.getContentPane().add(lblFondImage);
|
||||
|
||||
|
||||
|
@ -15,6 +15,7 @@ import java.awt.event.InputEvent;
|
||||
import java.awt.event.ItemEvent;
|
||||
import java.awt.event.ItemListener;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.KeyListener;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@ -54,15 +55,15 @@ import javax.swing.table.DefaultTableCellRenderer;
|
||||
import javax.swing.table.DefaultTableModel;
|
||||
import javax.swing.table.TableModel;
|
||||
|
||||
import baseUFRHG.sauvegardeXMLBase.saveType;
|
||||
import baseUFRHG.FileChooserXML;
|
||||
import baseUFRHG.commandes;
|
||||
import baseUFRHG.noeud;
|
||||
import baseUFRHG.recupeBases;
|
||||
import baseUFRHG.sauvegardeXMLBase;
|
||||
import baseUFRHG.actions.exportEmargement;
|
||||
import baseUFRHG.actions.exportTable;
|
||||
import baseUFRHG.actions.saveTable;
|
||||
import actions.exportEmargement;
|
||||
import actions.exportTable;
|
||||
import actions.saveTable;
|
||||
import base.recupeBases;
|
||||
import base.sauvegardeXMLBase;
|
||||
import base.sauvegardeXMLBase.saveType;
|
||||
import outils.FileChooserXML;
|
||||
import outils.commandes;
|
||||
import outils.noeud;
|
||||
|
||||
public class Window_gestionnaire extends JFrame {
|
||||
|
||||
@ -108,6 +109,7 @@ public class Window_gestionnaire extends JFrame {
|
||||
private JTable table;
|
||||
private String defautYear = null;
|
||||
public noeud nTable = null;
|
||||
public noeud nStudent = null;
|
||||
|
||||
String oldValue = null;
|
||||
|
||||
@ -281,7 +283,8 @@ public class Window_gestionnaire extends JFrame {
|
||||
cLangueLV1.setSelectedIndex(0);
|
||||
cLangueLV2.setSelectedIndex(0);
|
||||
cRegime.setSelectedIndex(0);
|
||||
majTableGroupes();
|
||||
nStudent = null;
|
||||
majTable();
|
||||
}
|
||||
});
|
||||
|
||||
@ -301,7 +304,7 @@ public class Window_gestionnaire extends JFrame {
|
||||
cGroupeTD.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
majTableGroupes();
|
||||
majTable();
|
||||
}
|
||||
});
|
||||
|
||||
@ -326,7 +329,7 @@ public class Window_gestionnaire extends JFrame {
|
||||
cLangueLV1.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
majTableGroupes();
|
||||
majTable();
|
||||
}
|
||||
});
|
||||
|
||||
@ -341,7 +344,7 @@ public class Window_gestionnaire extends JFrame {
|
||||
cGroupePrincipal.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
majTableGroupes();
|
||||
majTable();
|
||||
}
|
||||
});
|
||||
|
||||
@ -353,12 +356,12 @@ public class Window_gestionnaire extends JFrame {
|
||||
gbc_cGroupeProjet.gridy = 1;
|
||||
panelFiltre.add(cGroupeProjet, gbc_cGroupeProjet);
|
||||
|
||||
cGroupeProjet.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
majTableGroupes();
|
||||
}
|
||||
});
|
||||
cGroupeProjet.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
majTable();
|
||||
}
|
||||
});
|
||||
|
||||
cLV1= new JComboBox<String>();
|
||||
GridBagConstraints gbc_cLV1 = new GridBagConstraints();
|
||||
@ -371,7 +374,7 @@ public class Window_gestionnaire extends JFrame {
|
||||
cLV1.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
majTableGroupes();
|
||||
majTable();
|
||||
}
|
||||
});
|
||||
|
||||
@ -386,7 +389,7 @@ public class Window_gestionnaire extends JFrame {
|
||||
cProfil.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
majTableGroupes();
|
||||
majTable();
|
||||
}
|
||||
});
|
||||
textPaneNom.setFont(new Font("Tahoma", Font.BOLD, 12));
|
||||
@ -400,13 +403,13 @@ public class Window_gestionnaire extends JFrame {
|
||||
|
||||
@Override
|
||||
public void insertUpdate(DocumentEvent e) {
|
||||
majTableGroupes();
|
||||
majTable();
|
||||
System.out.println("insertUpdate");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeUpdate(DocumentEvent e) {
|
||||
majTableGroupes();
|
||||
majTable();
|
||||
System.out.println("removeUpdate");
|
||||
}
|
||||
|
||||
@ -465,8 +468,6 @@ public class Window_gestionnaire extends JFrame {
|
||||
panelFiltre.add(lblLV2, gbc_lblLV2);
|
||||
|
||||
|
||||
|
||||
|
||||
// Ajout d'un ActionListener à la JComboBox
|
||||
cFormations = new JComboBox<String>();
|
||||
cFormations.setVisible(true);
|
||||
@ -480,11 +481,10 @@ public class Window_gestionnaire extends JFrame {
|
||||
cFormations.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
majTableFormation();
|
||||
majFiltres();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
JLabel lblRegime = new JLabel("Régime");
|
||||
lblRegime.setFont(new Font("Tahoma", Font.BOLD, 12));
|
||||
@ -534,8 +534,6 @@ public class Window_gestionnaire extends JFrame {
|
||||
JMenu menuAffichage = new JMenu("Affichage");
|
||||
menuAffichage.setFont(new Font("Segoe UI", Font.BOLD, 14));
|
||||
menuBar.add(menuAffichage);
|
||||
|
||||
|
||||
|
||||
menuAffichage.add(chckToutesLesColonnes);
|
||||
chckToutesLesColonnes.addItemListener(new ItemListener() {
|
||||
@ -659,6 +657,39 @@ public class Window_gestionnaire extends JFrame {
|
||||
|
||||
mnNewMenu.addSeparator();
|
||||
|
||||
JMenuItem menuSupprimeEtudiantDeLaBase = new JMenuItem("Supprimer de la base l'étudiant sélectionné.");
|
||||
mnNewMenu.add(menuSupprimeEtudiantDeLaBase);
|
||||
menuSupprimeEtudiantDeLaBase.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if(nStudent!=null) {
|
||||
|
||||
String nomStudent = nStudent.getAttributes("Individu_-_Nom");
|
||||
String prenomStudent = nStudent.getAttributes("Individu_-_Prenom");
|
||||
String codeStudent = nStudent.getAttributes("Individu_-_Code_Etudiant");
|
||||
String nomFormation = cFormations.getSelectedItem().toString();
|
||||
|
||||
int userChoice = JOptionPane.showConfirmDialog(null, "<html>Vous êtes sur le point de supprimer de la formation : \"<b>" + nomFormation +"</b>\"<br>"
|
||||
+ "L'étudiant(e) : <b><u>" +codeStudent + " - "+ prenomStudent + " " + nomStudent + "</u></b><br><br>"
|
||||
+ "Voulez-vous réellement le(a) retirer de cette formation ?", "Confirmation",JOptionPane.YES_NO_CANCEL_OPTION);
|
||||
|
||||
// Vérifier le choix de l'utilisateur
|
||||
if (userChoice == JOptionPane.YES_OPTION) {
|
||||
System.out.println("Vous avez choisi Oui.");
|
||||
commandes.nBase.getChild(nomFormation).removeChild(nStudent);
|
||||
majTable();
|
||||
} else if (userChoice == JOptionPane.NO_OPTION) {
|
||||
System.out.println("Vous avez choisi Non.");
|
||||
} else if (userChoice == JOptionPane.CANCEL_OPTION) {
|
||||
System.out.println("Vous avez choisi Annuler.");
|
||||
} else {
|
||||
System.out.println("Aucun choix n'a été fait.");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mnNewMenu.addSeparator();
|
||||
|
||||
JMenuItem menuSelectYearDefautl = new JMenuItem("Sélectionner une année universitaire par défaut");
|
||||
mnNewMenu.add(menuSelectYearDefautl);
|
||||
|
||||
@ -684,7 +715,7 @@ public class Window_gestionnaire extends JFrame {
|
||||
cInformatique.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
majTableGroupes();
|
||||
majTable();
|
||||
}
|
||||
});
|
||||
|
||||
@ -698,7 +729,7 @@ public class Window_gestionnaire extends JFrame {
|
||||
cLangueLV2.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
majTableGroupes();
|
||||
majTable();
|
||||
}
|
||||
});
|
||||
|
||||
@ -709,11 +740,10 @@ public class Window_gestionnaire extends JFrame {
|
||||
gbc_cDocumentation.gridx = 4;
|
||||
gbc_cDocumentation.gridy = 3;
|
||||
panelFiltre.add(cDocumentation, gbc_cDocumentation);
|
||||
|
||||
cDocumentation.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
majTableGroupes();
|
||||
majTable();
|
||||
}
|
||||
});
|
||||
|
||||
@ -724,11 +754,10 @@ public class Window_gestionnaire extends JFrame {
|
||||
gbc_cLV2.gridx = 6;
|
||||
gbc_cLV2.gridy = 3;
|
||||
panelFiltre.add(cLV2, gbc_cLV2);
|
||||
|
||||
cLV2.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
majTableGroupes();
|
||||
majTable();
|
||||
}
|
||||
});
|
||||
|
||||
@ -739,11 +768,10 @@ public class Window_gestionnaire extends JFrame {
|
||||
gbc_cRegime.gridx = 7;
|
||||
gbc_cRegime.gridy = 3;
|
||||
panelFiltre.add(cRegime, gbc_cRegime);
|
||||
|
||||
cRegime.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
majTableGroupes();
|
||||
majTable();
|
||||
}
|
||||
});
|
||||
|
||||
@ -792,8 +820,10 @@ public class Window_gestionnaire extends JFrame {
|
||||
|
||||
if(rowData[indexPrenom]!=null && rowData[indexNom]!=null && rowData[indexCode]!=null) {
|
||||
lblInformationStudent.setText(rowData[indexPrenom].toString() + " " + rowData[indexNom].toString() + " - " + rowData[indexCode].toString() );
|
||||
nStudent = commandes.nBase.getChild(cFormations.getSelectedItem().toString()).getChild("n"+ rowData[indexCode]);
|
||||
}else {
|
||||
lblInformationStudent.setText("");
|
||||
nStudent = null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -817,16 +847,42 @@ public class Window_gestionnaire extends JFrame {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Ajouter un KeyListener à la JFrame
|
||||
// détection de la touche escape pour remettre à null le noeud nStudent
|
||||
// et réinitialise la selection de la ligne.
|
||||
table.addKeyListener(new KeyListener() {
|
||||
@Override
|
||||
public void keyTyped(KeyEvent e) {
|
||||
// Cette méthode n'est pas utilisée ici
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyPressed(KeyEvent e) {
|
||||
// Vérifier si la touche Echap est pressée
|
||||
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
|
||||
nStudent = null;
|
||||
table.clearSelection();
|
||||
System.out.println("La touche Echap a été pressée !");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyReleased(KeyEvent e) {
|
||||
// Cette méthode n'est pas utilisée ici
|
||||
}
|
||||
});
|
||||
|
||||
majTableFormation();
|
||||
majTableGroupes();
|
||||
|
||||
majFiltres();
|
||||
majTable();
|
||||
frame.setVisible(true);
|
||||
}
|
||||
|
||||
|
||||
public void majTableFormation() {
|
||||
/**
|
||||
* Mise à jour des combox
|
||||
*/
|
||||
public void majFiltres() {
|
||||
|
||||
chargeAffichageColonne();
|
||||
|
||||
@ -1058,7 +1114,7 @@ public class Window_gestionnaire extends JFrame {
|
||||
/**
|
||||
* Mise à jour de la table.
|
||||
*/
|
||||
public void majTableGroupes() {
|
||||
public void majTable() {
|
||||
|
||||
lblInformationStudent.setText("");
|
||||
|
||||
@ -1386,8 +1442,8 @@ public class Window_gestionnaire extends JFrame {
|
||||
table.setValueAt(oldValue, row, column);
|
||||
}
|
||||
|
||||
majTableFormation();
|
||||
majTableGroupes();
|
||||
majFiltres();
|
||||
majTable();
|
||||
|
||||
}
|
||||
});
|
||||
@ -1453,6 +1509,11 @@ public class Window_gestionnaire extends JFrame {
|
||||
return columnNames;
|
||||
}
|
||||
|
||||
/**
|
||||
* Permet de construire un dictionnaire<String index> qui permet
|
||||
* d'associer au nom des colonnes de la table l'index de la colonne.
|
||||
* @return
|
||||
*/
|
||||
private Map<String, Integer> getMapNamesColumnsIndexColumns(){
|
||||
// Obtenir le modèle de la table
|
||||
TableModel model = table.getModel();
|
||||
@ -1470,6 +1531,10 @@ public class Window_gestionnaire extends JFrame {
|
||||
return MapColumnNames;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mise à jour dans la table des chckMenu pour l'affichage de colonne.
|
||||
* Enregistre dans la base l'état des chcMenu.
|
||||
*/
|
||||
private void majAffichageDesChck() {
|
||||
|
||||
noeud nYears = commandes.nBase.getChild(cYears.getSelectedItem().toString());
|
||||
@ -1493,9 +1558,13 @@ public class Window_gestionnaire extends JFrame {
|
||||
|
||||
sauvegardeXMLBase.save(commandes.nBase, saveType.SANS_MESSAGE,"");
|
||||
|
||||
majTableGroupes();
|
||||
majTable();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Mise à jour de l'affichage des colonnes en fonction de l'information qui se trouve dans le noeud commandes.nBase.
|
||||
*/
|
||||
private void chargeAffichageColonne() {
|
||||
noeud nYears = commandes.nBase.getChild(cYears.getSelectedItem().toString());
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG.actions;
|
||||
package actions;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.InputEvent;
|
||||
@ -10,9 +10,9 @@ import javax.swing.ImageIcon;
|
||||
import javax.swing.KeyStroke;
|
||||
|
||||
import Windows.Window_gestionnaire;
|
||||
import baseUFRHG.exportBaseToExcel;
|
||||
import baseUFRHG.exportBaseToExcel.exportType;
|
||||
import baseUFRHG.noeud;
|
||||
import exportations.exportBaseToExcel;
|
||||
import exportations.exportBaseToExcel.exportType;
|
||||
import outils.noeud;
|
||||
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ public class exportEmargement extends AbstractAction{
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
instance.majTableGroupes();
|
||||
instance.majTable();
|
||||
this.nTable = instance.nTable;
|
||||
if(nTable!=null) {
|
||||
exportBaseToExcel.exportTable(nTable, exportType.EMARGEMENT);
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG.actions;
|
||||
package actions;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.InputEvent;
|
||||
@ -11,9 +11,9 @@ import javax.swing.JOptionPane;
|
||||
import javax.swing.KeyStroke;
|
||||
|
||||
import Windows.Window_gestionnaire;
|
||||
import baseUFRHG.exportBaseToExcel;
|
||||
import baseUFRHG.exportBaseToExcel.exportType;
|
||||
import baseUFRHG.noeud;
|
||||
import exportations.exportBaseToExcel;
|
||||
import exportations.exportBaseToExcel.exportType;
|
||||
import outils.noeud;
|
||||
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ public class exportTable extends AbstractAction{
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
instance.majTableGroupes();
|
||||
instance.majTable();
|
||||
this.nTable = instance.nTable;
|
||||
if(nTable!=null) {
|
||||
exportBaseToExcel.exportTable(nTable, exportType.TABLE);
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG.actions;
|
||||
package actions;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.InputEvent;
|
||||
@ -10,19 +10,15 @@ import javax.swing.ImageIcon;
|
||||
import javax.swing.KeyStroke;
|
||||
|
||||
import Windows.Window_gestionnaire;
|
||||
import baseUFRHG.CreateUpdateZipArchive;
|
||||
import baseUFRHG.commandes;
|
||||
import baseUFRHG.sauvegardeXMLBase;
|
||||
import baseUFRHG.sauvegardeXMLBase.saveType;
|
||||
import base.CreateUpdateZipArchive;
|
||||
import base.sauvegardeXMLBase;
|
||||
import base.sauvegardeXMLBase.saveType;
|
||||
import outils.commandes;
|
||||
|
||||
public class saveTable extends AbstractAction{
|
||||
|
||||
private Window_gestionnaire instance;
|
||||
|
||||
|
||||
public saveTable(Window_gestionnaire instance) {
|
||||
|
||||
this.instance = instance;
|
||||
putValue( Action.NAME, "Sauvegarder les modifications" );
|
||||
putValue( Action.SMALL_ICON, new ImageIcon(Window_gestionnaire.class.getResource("/resources/saveTable.png")) );
|
||||
putValue( Action.LARGE_ICON_KEY, new ImageIcon(Window_gestionnaire.class.getResource("/resources/saveTable.png")) );
|
||||
@ -40,10 +36,6 @@ public class saveTable extends AbstractAction{
|
||||
|
||||
// Sauvegarde de la base
|
||||
sauvegardeXMLBase.save(commandes.nBase,saveType.WITH_DEFAULT_MESSAGE,"");
|
||||
CreateUpdateZipArchive.save();
|
||||
|
||||
instance.majTableFormation();
|
||||
instance.majTableGroupes();
|
||||
|
||||
CreateUpdateZipArchive.save();
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG;
|
||||
package base;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileWriter;
|
||||
@ -17,6 +17,8 @@ import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
import outils.commandes;
|
||||
|
||||
public class CreateUpdateZipArchive {
|
||||
|
||||
|
77
src/base/Hash.java
Normal file
@ -0,0 +1,77 @@
|
||||
package base;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import outils.commandes;
|
||||
import outils.noeud;
|
||||
|
||||
public class Hash {
|
||||
|
||||
/**
|
||||
* Retourne TRUE si doit réaliser une sauvegarde de la base.
|
||||
* @return
|
||||
*/
|
||||
public static boolean faireLaSauvegarde() {
|
||||
boolean result = false;
|
||||
noeud nSauvgardeBase = recupeBases.recupereLaSauvegardeBase();
|
||||
String nSauvegardeBaseString = "";
|
||||
String nBaseString = "";
|
||||
|
||||
boolean sauvegareExiste = false;
|
||||
String defaut_Year = "";
|
||||
if(nSauvgardeBase!=null) {
|
||||
if(nSauvgardeBase.getAttributes("defaut_Year")!=null) {
|
||||
defaut_Year = nSauvgardeBase.getAttributes("defaut_Year");
|
||||
if(nSauvgardeBase.getChild(defaut_Year)!=null) {
|
||||
nSauvegardeBaseString = nSauvgardeBase.getChild(defaut_Year).toWrite();
|
||||
if(commandes.nBase.getChild(defaut_Year)!=null) {
|
||||
nBaseString = commandes.nBase.getChild(defaut_Year).toWrite();
|
||||
sauvegareExiste = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}else {
|
||||
// Si le fichier de sauvegarde n'existe pas alors doit créer une sauvegarde.
|
||||
result = true;
|
||||
}
|
||||
|
||||
if(!sauvegareExiste) return result;
|
||||
|
||||
try {
|
||||
// Calculer le hachage (hash) du contenu du fichier
|
||||
String fileHashFileSave = calculateHash(nSauvegardeBaseString);
|
||||
|
||||
// Hachage de référence à comparer
|
||||
String fileHashBase = calculateHash(nBaseString);
|
||||
|
||||
// Comparer les hachages
|
||||
if (!fileHashFileSave.equals(fileHashBase)) {
|
||||
System.out.println("Les hachages sont différents. Sauvegarde.");
|
||||
result = true;
|
||||
} else {
|
||||
System.out.println("Les hachages sont identiques. Pas de sauvegarde.");
|
||||
}
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static String calculateHash(String input) throws NoSuchAlgorithmException {
|
||||
MessageDigest md = MessageDigest.getInstance("SHA-256");
|
||||
byte[] hashBytes = md.digest(input.getBytes());
|
||||
|
||||
StringBuilder hash = new StringBuilder();
|
||||
for (byte b : hashBytes) {
|
||||
hash.append(String.format("%02x", b));
|
||||
}
|
||||
|
||||
return hash.toString();
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG;
|
||||
package base;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
@ -10,7 +10,10 @@ import javax.swing.JLabel;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import baseUFRHG.sauvegardeXMLBase.saveType;
|
||||
import base.sauvegardeXMLBase.saveType;
|
||||
import outils.commandes;
|
||||
import outils.noeud;
|
||||
import outils.supprimeCaracatresSpeciaux;
|
||||
|
||||
public class base {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG;
|
||||
package base;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
@ -7,6 +7,10 @@ import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
import outils.lectureFileToString;
|
||||
import outils.lectureXML;
|
||||
import outils.noeud;
|
||||
|
||||
public class recupeBases {
|
||||
|
||||
/**
|
||||
@ -16,8 +20,6 @@ public class recupeBases {
|
||||
String filePath = Paths.get("").toAbsolutePath().toString()+ "/base/base.xml";
|
||||
File file = new File(filePath);
|
||||
noeud nBase = null;
|
||||
|
||||
|
||||
|
||||
|
||||
if (file.exists()) {
|
||||
@ -45,4 +47,23 @@ public class recupeBases {
|
||||
}
|
||||
|
||||
|
||||
public static noeud recupereLaSauvegardeBase() {
|
||||
String filePath = Paths.get("").toAbsolutePath().toString()+ "/base/base_sauvegarde.xml";
|
||||
File file = new File(filePath);
|
||||
noeud nSauvegardeBase = null;
|
||||
|
||||
|
||||
|
||||
|
||||
if (file.exists()) {
|
||||
//lecture du fichier base.xml
|
||||
String directoryName = Paths.get("").toAbsolutePath().toString()+ "/base/base_sauvegarde.xml";
|
||||
String xmlString = lectureFileToString.lecture(directoryName);
|
||||
nSauvegardeBase = lectureXML.lectureStringToNoeud(xmlString);
|
||||
|
||||
}
|
||||
|
||||
return nSauvegardeBase;
|
||||
}
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG;
|
||||
package base;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
@ -11,6 +11,8 @@ import java.util.Date;
|
||||
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
import outils.noeud;
|
||||
|
||||
public class sauvegardeXMLBase {
|
||||
|
||||
public static enum saveType{
|
||||
@ -125,7 +127,7 @@ public class sauvegardeXMLBase {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
JOptionPane.showMessageDialog(null, e.toString(), "Erreur dans la méthode saveSauvegarde.", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG;
|
||||
package exportations;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Dimension;
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG;
|
||||
package exportations;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Dimension;
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG;
|
||||
package exportations;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
@ -7,6 +7,10 @@ import javax.swing.JLabel;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import outils.FileSaveXLSX;
|
||||
import outils.commandes;
|
||||
import outils.noeud;
|
||||
|
||||
public class exportBaseToExcel {
|
||||
|
||||
public static enum exportType {
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG;
|
||||
package gestion_version;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
@ -10,7 +10,12 @@ import java.util.regex.Pattern;
|
||||
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
import baseUFRHG.sauvegardeXMLBase.saveType;
|
||||
import base.recupeBases;
|
||||
import base.sauvegardeXMLBase;
|
||||
import base.sauvegardeXMLBase.saveType;
|
||||
import outils.commandes;
|
||||
import outils.lectureXML;
|
||||
import outils.noeud;
|
||||
|
||||
public class VersionChecker {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG;
|
||||
package importations;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@ -13,6 +13,12 @@ import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import base.recupeBases;
|
||||
import base.sauvegardeXMLBase;
|
||||
import outils.commandes;
|
||||
import outils.noeud;
|
||||
import outils.supprimeCaracatresSpeciaux;
|
||||
|
||||
public class importAllBaseToExcel {
|
||||
|
||||
public static void lecture(File file) {
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG;
|
||||
package outils;
|
||||
|
||||
|
||||
import java.io.File;
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG;
|
||||
package outils;
|
||||
|
||||
|
||||
import java.io.File;
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG;
|
||||
package outils;
|
||||
|
||||
|
||||
import java.io.File;
|
@ -1,10 +1,14 @@
|
||||
package baseUFRHG;
|
||||
package outils;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.JFrame;
|
||||
|
||||
import exportations.CreateCalcWorkbook;
|
||||
import exportations.createEmargement;
|
||||
import exportations.exportBaseToExcel;
|
||||
|
||||
public class FileSaveXLSX {
|
||||
Object[][] data = null;
|
||||
String Formation = "";
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG;
|
||||
package outils;
|
||||
|
||||
|
||||
public class TextComparator {
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG;
|
||||
package outils;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Node;
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG;
|
||||
package outils;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG;
|
||||
package outils;
|
||||
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG;
|
||||
package outils;
|
||||
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG;
|
||||
package outils;
|
||||
|
||||
public class commandes {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG;
|
||||
package outils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileInputStream;
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG;
|
||||
package outils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG;
|
||||
package outils;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
@ -1,4 +1,4 @@
|
||||
package baseUFRHG;
|
||||
package outils;
|
||||
|
||||
import java.text.Normalizer;
|
||||
|
Before Width: | Height: | Size: 472 KiB |
BIN
src/resources/Sans titre_1.jpg
Normal file
After Width: | Height: | Size: 107 KiB |
BIN
src/resources/Sans titre_10.jpg
Normal file
After Width: | Height: | Size: 89 KiB |
BIN
src/resources/Sans titre_11.jpg
Normal file
After Width: | Height: | Size: 70 KiB |
BIN
src/resources/Sans titre_12.jpg
Normal file
After Width: | Height: | Size: 67 KiB |
BIN
src/resources/Sans titre_13.jpg
Normal file
After Width: | Height: | Size: 65 KiB |
BIN
src/resources/Sans titre_14.jpg
Normal file
After Width: | Height: | Size: 90 KiB |
BIN
src/resources/Sans titre_15.jpg
Normal file
After Width: | Height: | Size: 90 KiB |
BIN
src/resources/Sans titre_16.jpg
Normal file
After Width: | Height: | Size: 80 KiB |
BIN
src/resources/Sans titre_2.jpg
Normal file
After Width: | Height: | Size: 172 KiB |
BIN
src/resources/Sans titre_3.jpg
Normal file
After Width: | Height: | Size: 285 KiB |
BIN
src/resources/Sans titre_4.jpg
Normal file
After Width: | Height: | Size: 210 KiB |
BIN
src/resources/Sans titre_5.jpg
Normal file
After Width: | Height: | Size: 246 KiB |
BIN
src/resources/Sans titre_6.jpg
Normal file
After Width: | Height: | Size: 381 KiB |
BIN
src/resources/Sans titre_7.jpg
Normal file
After Width: | Height: | Size: 66 KiB |
BIN
src/resources/Sans titre_8.jpg
Normal file
After Width: | Height: | Size: 116 KiB |
BIN
src/resources/Sans titre_9.jpg
Normal file
After Width: | Height: | Size: 77 KiB |