Compare commits

...

1 Commits

Author SHA1 Message Date
pablo rodriguez
c0cdd64fb1 maj V1.0.9
ajout des colonnes option_6 et option_7
mise à jour de la base vers la version V1.0.9
2024-08-31 23:25:38 +02:00
4 changed files with 104 additions and 18 deletions

View File

@ -39,11 +39,12 @@ public class Window_renommerColonne extends JFrame {
private JPanel contentPane;
private JTextField txtNomOption_1;
private JTextField txtNomOption_5;
private JTextField txtNomOption_2;
private JLabel lblOption_3;
private JTextField txtNomOption_3;
private JLabel lblAtelierPreRentreeSalle;
private JTextField txtNomOption_4;
private JTextField txtNomOption_2;
private JTextField txtNomOption_6;
private JTextField txtNomOption_7;
private JLabel lblAtelierPreRentreeSalle;
private JButton btnEnregistrer;
private JLabel lblImage;
private JLabel lblAuteurVersion;
@ -52,8 +53,13 @@ public class Window_renommerColonne extends JFrame {
private JCheckBox chckbxOption_3 = new JCheckBox("activé");
private JCheckBox chckbxOption_4 = new JCheckBox("activé");
private JCheckBox chckbxOption_5 = new JCheckBox("activé");
private JCheckBox chckbxOption_6 = new JCheckBox("activé");
private JCheckBox chckbxOption_7 = new JCheckBox("activé");
private JComboBox<String> cFormations;
/**
* Lancement de l'affichage de la fenêtre.
*/
@ -95,7 +101,6 @@ public class Window_renommerColonne extends JFrame {
setResizable(false);
setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
getContentPane().setLayout(null);
@ -144,6 +149,20 @@ public class Window_renommerColonne extends JFrame {
txtNomOption_5.setBounds(842, 471, 244, 34);
contentPane.add(txtNomOption_5);
txtNomOption_6 = new JTextField();
txtNomOption_6.setText((String) null);
txtNomOption_6.setFont(new Font("Tahoma", Font.BOLD, 14));
txtNomOption_6.setColumns(32);
txtNomOption_6.setBounds(842, 522, 244, 34);
contentPane.add(txtNomOption_6);
txtNomOption_7 = new JTextField();
txtNomOption_7.setText((String) null);
txtNomOption_7.setFont(new Font("Tahoma", Font.BOLD, 14));
txtNomOption_7.setColumns(32);
txtNomOption_7.setBounds(842, 581, 244, 34);
contentPane.add(txtNomOption_7);
JLabel lblNewLabel = new JLabel("<html><p>Les colonnes ci-dessous peuvent être renommées ou désactivées.</p><p>Si vous choisissez de les renommer, les changements seront appliqués sur la formation sélectionnée. En revanche, si vous les désactivez, elles ne s'afficheront pas dans le gestionnaire, mais resteront présentes dans les classeurs exportés au format Ms Excel.</p><br><p>Il est important de noter que renommer ou désactiver ces colonnes n'entraînera pas la perte des données qui y sont enregistrées.</p></html>");
lblNewLabel.setForeground(Color.BLUE);
lblNewLabel.setFont(new Font("Arial", Font.BOLD, 14));
@ -165,7 +184,7 @@ public class Window_renommerColonne extends JFrame {
txtNomOption_2.setText(nFormation.getAttributes("nomColonne_Option_2"));
contentPane.add(txtNomOption_2);
lblOption_3 = new JLabel("<html>Le nom de la colonne : <br>\r\nOption_3</html>");
JLabel lblOption_3 = new JLabel("<html>Le nom de la colonne : <br>\r\nOption_3</html>");
lblOption_3.setHorizontalAlignment(SwingConstants.LEFT);
lblOption_3.setFont(new Font("Arial", Font.BOLD, 14));
lblOption_3.setBounds(10, 581, 220, 34);
@ -231,9 +250,22 @@ public class Window_renommerColonne extends JFrame {
nomColonnesFeuille.put("Enabled_Colonne_Option_5", "false");
}
nomColonnesFeuille.put("nomColonne_Option_6", txtNomOption_6.getText());
if(chckbxOption_6.isSelected()) {
nomColonnesFeuille.put("Enabled_Colonne_Option_6", "true");
}else {
nomColonnesFeuille.put("Enabled_Colonne_Option_6", "false");
}
nomColonnesFeuille.put("nomColonne_Option_7", txtNomOption_7.getText());
if(chckbxOption_7.isSelected()) {
nomColonnesFeuille.put("Enabled_Colonne_Option_7", "true");
}else {
nomColonnesFeuille.put("Enabled_Colonne_Option_7", "false");
}
if(!NomDeColonneInscriptionTable.colitionNomDesColonnes(nomColonnesFeuille, cFormations.getSelectedItem().toString())) {
NomDeColonneInscriptionTable.modifierLesNoms(nomColonnesFeuille, cFormations.getSelectedItem().toString());
dispose();
}
}
@ -295,6 +327,11 @@ public class Window_renommerColonne extends JFrame {
txtNomOption_5.setText(commandes.nomColonne_default_Option_5);
chckbxOption_5.setSelected(commandes.enabled_default_Colonne_Option_5);
txtNomOption_6.setText(commandes.nomColonne_default_Option_6);
chckbxOption_6.setSelected(commandes.enabled_default_Colonne_Option_6);
txtNomOption_7.setText(commandes.nomColonne_default_Option_7);
chckbxOption_7.setSelected(commandes.enabled_default_Colonne_Option_7);
}
});
@ -307,11 +344,6 @@ public class Window_renommerColonne extends JFrame {
chckbxOption_1.setSelected(Boolean.valueOf(nFormation.getAttributes("Enabled_Colonne_Option_1")));
contentPane.add(chckbxOption_1);
chckbxOption_5.setFont(new Font("Arial", Font.BOLD, 14));
chckbxOption_5.setBounds(1092, 469, 82, 23);
chckbxOption_5.setSelected(Boolean.valueOf(nFormation.getAttributes("Enabled_Colonne_Option_5")));
contentPane.add(chckbxOption_5);
chckbxOption_2.setFont(new Font("Arial", Font.BOLD, 14));
chckbxOption_2.setBounds(501, 520, 82, 23);
chckbxOption_2.setSelected(Boolean.valueOf(nFormation.getAttributes("Enabled_Colonne_Option_2")));
@ -327,6 +359,23 @@ public class Window_renommerColonne extends JFrame {
chckbxOption_4.setSelected(Boolean.valueOf(nFormation.getAttributes("Enabled_Colonne_Option_4")));
contentPane.add(chckbxOption_4);
chckbxOption_5.setFont(new Font("Arial", Font.BOLD, 14));
chckbxOption_5.setBounds(1092, 469, 82, 23);
chckbxOption_5.setSelected(Boolean.valueOf(nFormation.getAttributes("Enabled_Colonne_Option_5")));
contentPane.add(chckbxOption_5);
chckbxOption_6.setSelected(false);
chckbxOption_6.setFont(new Font("Arial", Font.BOLD, 14));
chckbxOption_6.setBounds(1092, 522, 82, 23);
chckbxOption_6.setSelected(Boolean.valueOf(nFormation.getAttributes("Enabled_Colonne_Option_6")));
contentPane.add(chckbxOption_6);
chckbxOption_7 = new JCheckBox("activé");
chckbxOption_7.setSelected(false);
chckbxOption_7.setFont(new Font("Arial", Font.BOLD, 14));
chckbxOption_7.setBounds(1092, 580, 82, 23);
chckbxOption_7.setSelected(Boolean.valueOf(nFormation.getAttributes("Enabled_Colonne_Option_7")));
contentPane.add(chckbxOption_7);
JLabel lblNewLabel_1 = new JLabel("<html>Formations</html>");
lblNewLabel_1.setForeground(Color.RED);
@ -334,6 +383,17 @@ public class Window_renommerColonne extends JFrame {
lblNewLabel_1.setBounds(10, 416, 220, 34);
contentPane.add(lblNewLabel_1);
JLabel lblOption_6 = new JLabel("<html>Renommer la colonne :<br>Option_6</html>");
lblOption_6.setHorizontalAlignment(SwingConstants.LEFT);
lblOption_6.setFont(new Font("Arial", Font.BOLD, 14));
lblOption_6.setBounds(612, 522, 220, 34);
contentPane.add(lblOption_6);
JLabel lblOption_7 = new JLabel("<html>Renommer la colonne :<br>Option_7</html>");
lblOption_7.setHorizontalAlignment(SwingConstants.LEFT);
lblOption_7.setFont(new Font("Arial", Font.BOLD, 14));
lblOption_7.setBounds(612, 581, 220, 34);
contentPane.add(lblOption_7);
}
@ -345,12 +405,15 @@ public class Window_renommerColonne extends JFrame {
chckbxOption_3.setSelected(Boolean.valueOf(nFormation.getAttributes("Enabled_Colonne_Option_3")));
chckbxOption_4.setSelected(Boolean.valueOf(nFormation.getAttributes("Enabled_Colonne_Option_4")));
chckbxOption_5.setSelected(Boolean.valueOf(nFormation.getAttributes("Enabled_Colonne_Option_5")));
chckbxOption_6.setSelected(Boolean.valueOf(nFormation.getAttributes("Enabled_Colonne_Option_6")));
chckbxOption_7.setSelected(Boolean.valueOf(nFormation.getAttributes("Enabled_Colonne_Option_7")));
txtNomOption_1.setText(nFormation.getAttributes("nomColonne_Option_1"));
txtNomOption_2.setText(nFormation.getAttributes("nomColonne_Option_2"));
txtNomOption_3.setText(nFormation.getAttributes("nomColonne_Option_3"));
txtNomOption_4.setText(nFormation.getAttributes("nomColonne_Option_4"));
txtNomOption_5.setText(nFormation.getAttributes("nomColonne_Option_5"));
txtNomOption_6.setText(nFormation.getAttributes("nomColonne_Option_6"));
txtNomOption_7.setText(nFormation.getAttributes("nomColonne_Option_7"));
}
}

View File

@ -7,6 +7,8 @@ import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import base.sauvegardeXMLBase.saveType;
import outils.commandes;
import outils.lectureFileToString;
import outils.lectureXML;
import outils.noeud;
@ -28,6 +30,9 @@ public class recupeBases {
String xmlString = lectureFileToString.lecture(directoryName);
nBase = lectureXML.lectureStringToNoeud(xmlString);
if(commandes.version.equals("1.0.9")) maj_V109(nBase);
} else {
// création d'une nouvelle base
nBase = base.createBase();
@ -58,8 +63,26 @@ public class recupeBases {
String xmlString = lectureFileToString.lecture(directoryName);
nSauvegardeBase = lectureXML.lectureStringToNoeud(xmlString);
}
return nSauvegardeBase;
}
/**
* Mise à jour de la base à partir de la version 1.0.9
*/
private static void maj_V109(noeud nBase){
if(!nBase.getAttributes().get("version").equals("1.0.9")) {
nBase.getAttributes().put("version", "1.0.9");
nBase.getAttributes().put("Enabled_Colonne_Option_6", "false");
nBase.getAttributes().put("Enabled_Colonne_Option_7", "false");
nBase.getAttributes().put("nomColonne_Option_6", "Option_6");
nBase.getAttributes().put("nomColonne_Option_7", "Option_7");
for (noeud nFormation : nBase.getChildren().get(0).getChildren()) {
nFormation.getAttributes().put("Enabled_Colonne_Option_6", "false");
nFormation.getAttributes().put("Enabled_Colonne_Option_7", "false");
nFormation.getAttributes().put("nomColonne_Option_6", "Option_6");
nFormation.getAttributes().put("nomColonne_Option_7", "Option_7");
}
sauvegardeXMLBase.save(nBase, saveType.WITH_MESSAGE, "Mise à jour de la base vers la version 1.0.9");
}
}
}

View File

@ -85,8 +85,6 @@ public class VersionChecker {
commandes.newVersion = true;
commandes.nameNewVersion = match;
}
}
@ -290,7 +288,8 @@ public class VersionChecker {
}
if(newVersion) {
return Integer.valueOf(VersionForgeSplit[0])*1000000 + Integer.valueOf(VersionForgeSplit[1])*1000 + Integer.valueOf(VersionForgeSplit[2]);
commandes.version_nombre = Integer.valueOf(VersionForgeSplit[0])*1000000 + Integer.valueOf(VersionForgeSplit[1])*1000 + Integer.valueOf(VersionForgeSplit[2]);
return commandes.version_nombre;
}
return 0;

View File

@ -11,7 +11,8 @@ import java.util.List;
public class commandes {
public static noeud nBase = null; // La base de données sous forme de noeud.
public static String version = "1.0.8"; // La version actuelle
public static String version = "1.0.9"; // La version actuelle
public static int version_nombre = 0;
public static String dateversion = "30 aout 2024"; // La version actuelle
// Les colonnes obligatoires à l'inscription des étudaints.