maj V1.0.8
This commit is contained in:
parent
a636b33596
commit
9c6f141916
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -482,9 +482,7 @@ public class Window_demarre extends JFrame {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -569,16 +567,12 @@ public class Window_demarre extends JFrame {
|
||||
Image resizedImage = image.getScaledInstance(newWidth, newHeight, Image.SCALE_SMOOTH);
|
||||
|
||||
|
||||
if(randomNumber==7
|
||||
|| randomNumber==10 || randomNumber==11 || randomNumber==12
|
||||
|| randomNumber==14 || randomNumber==18 || randomNumber==21
|
||||
|| randomNumber==22 || randomNumber==23 || randomNumber==25
|
||||
|| randomNumber==27 || randomNumber==28 || randomNumber ==42
|
||||
) {
|
||||
if(commandes.imageTropClaire(randomNumber)) {
|
||||
lblAuteurVersion.setForeground(new Color(0, 0, 0));
|
||||
}else {
|
||||
lblAuteurVersion.setForeground(new Color(255, 255, 255));
|
||||
}
|
||||
|
||||
lblFondImage.setIcon(new ImageIcon(resizedImage));
|
||||
}
|
||||
|
||||
|
@ -278,15 +278,12 @@ public class Window_gestionnaire extends JFrame {
|
||||
gbc_lblProfil.gridx = 7;
|
||||
gbc_lblProfil.gridy = 0;
|
||||
panelFiltre.add(lblProfil, gbc_lblProfil);
|
||||
|
||||
|
||||
|
||||
|
||||
cYears = new JComboBox<String>();
|
||||
cYears.setVisible(true);
|
||||
cYears.setSelectedItem(defautYear);
|
||||
|
||||
|
||||
|
||||
JLabel lblNonEtudiant = new JLabel("Nom de l'étudiant ");
|
||||
lblNonEtudiant.setFont(new Font("Tahoma", Font.BOLD, 12));
|
||||
|
@ -253,8 +253,8 @@ public class Window_parametreImportationInscription extends JFrame {
|
||||
nomColonnesFeuille.put("Excel_Individu_-_Email", txtNomColonneExcel_MailUnivEtudiant.getText());
|
||||
nomColonnesFeuille.put("Excel_Feuille_Inscription", txtNomFeuille.getText());
|
||||
|
||||
if(!NomDeColonneInscriptionTable.colitionNomDesColonnes(nomColonnesFeuille)) {
|
||||
NomDeColonneInscriptionTable.modifierLesNoms(nomColonnesFeuille);
|
||||
if(!NomDeColonneInscriptionTable.colitionNomDesColonnes(nomColonnesFeuille,null)) {
|
||||
NomDeColonneInscriptionTable.modifierLesNoms(nomColonnesFeuille,null);
|
||||
dispose();
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@ import java.util.Random;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
@ -21,6 +22,7 @@ import javax.swing.border.EmptyBorder;
|
||||
|
||||
import base.NomDeColonneInscriptionTable;
|
||||
import outils.commandes;
|
||||
import outils.noeud;
|
||||
|
||||
/**
|
||||
* Fenêtre permettant de changer les paramètres (nom de la feuille, noms des colonnes).
|
||||
@ -50,6 +52,7 @@ 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 JComboBox<String> cFormations;
|
||||
|
||||
/**
|
||||
* Lancement de l'affichage de la fenêtre.
|
||||
@ -99,30 +102,49 @@ public class Window_renommerColonne extends JFrame {
|
||||
JLabel lblOption_1 = new JLabel("<html>Renommer la colonne :<br>\r\nOption_1</html>");
|
||||
lblOption_1.setHorizontalAlignment(SwingConstants.LEFT);
|
||||
lblOption_1.setFont(new Font("Arial", Font.BOLD, 14));
|
||||
lblOption_1.setBounds(10, 428, 231, 34);
|
||||
lblOption_1.setBounds(10, 469, 231, 34);
|
||||
contentPane.add(lblOption_1);
|
||||
|
||||
cFormations = new JComboBox<String>();
|
||||
cFormations.setBounds(168, 416, 918, 34);
|
||||
for(noeud nChild : commandes.nBase.getChildren()) {
|
||||
for(noeud nFormation : nChild.getChildren()) {
|
||||
cFormations.addItem(nFormation.getName());
|
||||
}
|
||||
}
|
||||
cFormations.setSelectedIndex(0);
|
||||
cFormations.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
majFiltres();
|
||||
}
|
||||
});
|
||||
|
||||
noeud nFormation = commandes.nBase.findNoeud(cFormations.getSelectedItem().toString());
|
||||
|
||||
contentPane.add(cFormations);
|
||||
|
||||
txtNomOption_1 = new JTextField();
|
||||
txtNomOption_1.setText(commandes.nomColonne_Option_1);
|
||||
txtNomOption_1.setText(nFormation.getAttributes("nomColonne_Option_1"));
|
||||
txtNomOption_1.setFont(new Font("Tahoma", Font.BOLD, 14));
|
||||
txtNomOption_1.setBounds(251, 428, 244, 34);
|
||||
txtNomOption_1.setBounds(251, 469, 244, 34);
|
||||
contentPane.add(txtNomOption_1);
|
||||
txtNomOption_1.setColumns(32);
|
||||
|
||||
JLabel lblOption_5 = new JLabel("<html>Renommer la colonne :<br>Option_5</html>");
|
||||
lblOption_5.setHorizontalAlignment(SwingConstants.LEFT);
|
||||
lblOption_5.setFont(new Font("Arial", Font.BOLD, 14));
|
||||
lblOption_5.setBounds(612, 428, 220, 34);
|
||||
lblOption_5.setBounds(612, 471, 220, 34);
|
||||
contentPane.add(lblOption_5);
|
||||
|
||||
txtNomOption_5 = new JTextField();
|
||||
txtNomOption_5.setText(commandes.nomColonne_Option_5);
|
||||
txtNomOption_5.setText(nFormation.getAttributes("nomColonne_Option_5"));
|
||||
txtNomOption_5.setFont(new Font("Tahoma", Font.BOLD, 14));
|
||||
txtNomOption_5.setColumns(32);
|
||||
txtNomOption_5.setBounds(842, 428, 244, 34);
|
||||
txtNomOption_5.setBounds(842, 471, 244, 34);
|
||||
contentPane.add(txtNomOption_5);
|
||||
|
||||
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 à toutes les formations de la base de données. 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, mais simplement leur masquage.</p></html>");
|
||||
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));
|
||||
lblNewLabel.setVerticalAlignment(SwingConstants.TOP);
|
||||
@ -133,46 +155,46 @@ public class Window_renommerColonne extends JFrame {
|
||||
JLabel lbllOption_2 = new JLabel("<html>Le nom de la colonne :<br>Option_2</html>");
|
||||
lbllOption_2.setHorizontalAlignment(SwingConstants.LEFT);
|
||||
lbllOption_2.setFont(new Font("Arial", Font.BOLD, 14));
|
||||
lbllOption_2.setBounds(10, 481, 231, 34);
|
||||
lbllOption_2.setBounds(10, 522, 231, 34);
|
||||
contentPane.add(lbllOption_2);
|
||||
|
||||
txtNomOption_2 = new JTextField();
|
||||
txtNomOption_2.setFont(new Font("Tahoma", Font.BOLD, 14));
|
||||
txtNomOption_2.setColumns(32);
|
||||
txtNomOption_2.setBounds(251, 481, 244, 34);
|
||||
txtNomOption_2.setText(commandes.nomColonne_Option_2);
|
||||
txtNomOption_2.setBounds(251, 522, 244, 34);
|
||||
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>");
|
||||
lblOption_3.setHorizontalAlignment(SwingConstants.LEFT);
|
||||
lblOption_3.setFont(new Font("Arial", Font.BOLD, 14));
|
||||
lblOption_3.setBounds(10, 540, 220, 34);
|
||||
lblOption_3.setBounds(10, 581, 220, 34);
|
||||
contentPane.add(lblOption_3);
|
||||
|
||||
txtNomOption_3 = new JTextField();
|
||||
txtNomOption_3.setFont(new Font("Tahoma", Font.BOLD, 14));
|
||||
txtNomOption_3.setColumns(32);
|
||||
txtNomOption_3.setBounds(251, 539, 244, 34);
|
||||
txtNomOption_3.setText(commandes.nomColonne_Option_3);
|
||||
txtNomOption_3.setBounds(251, 580, 244, 34);
|
||||
txtNomOption_3.setText(nFormation.getAttributes("nomColonne_Option_3"));
|
||||
contentPane.add(txtNomOption_3);
|
||||
|
||||
lblAtelierPreRentreeSalle = new JLabel("<html>Le nom de la colonne :<br>\r\nOption_4</html>");
|
||||
lblAtelierPreRentreeSalle.setHorizontalAlignment(SwingConstants.LEFT);
|
||||
lblAtelierPreRentreeSalle.setFont(new Font("Arial", Font.BOLD, 14));
|
||||
lblAtelierPreRentreeSalle.setBounds(10, 593, 231, 34);
|
||||
lblAtelierPreRentreeSalle.setBounds(10, 634, 231, 34);
|
||||
contentPane.add(lblAtelierPreRentreeSalle);
|
||||
|
||||
txtNomOption_4 = new JTextField();
|
||||
txtNomOption_4.setText(commandes.nomColonne_Option_4);
|
||||
txtNomOption_4.setText(nFormation.getAttributes("nomColonne_Option_4"));
|
||||
txtNomOption_4.setFont(new Font("Tahoma", Font.BOLD, 14));
|
||||
txtNomOption_4.setColumns(32);
|
||||
txtNomOption_4.setBounds(251, 593, 244, 34);
|
||||
txtNomOption_4.setBounds(251, 634, 244, 34);
|
||||
contentPane.add(txtNomOption_4);
|
||||
|
||||
btnEnregistrer = new JButton("Enregistrer");
|
||||
btnEnregistrer.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
HashMap<String, String> nomColonnesFeuille = new HashMap<String,String>();
|
||||
HashMap<String, String> nomColonnesFeuille = new HashMap<String,String>();
|
||||
|
||||
nomColonnesFeuille.put("nomColonne_Option_1", txtNomOption_1.getText());
|
||||
if(chckbxOption_1.isSelected()) {
|
||||
@ -209,8 +231,8 @@ public class Window_renommerColonne extends JFrame {
|
||||
nomColonnesFeuille.put("Enabled_Colonne_Option_5", "false");
|
||||
}
|
||||
|
||||
if(!NomDeColonneInscriptionTable.colitionNomDesColonnes(nomColonnesFeuille)) {
|
||||
NomDeColonneInscriptionTable.modifierLesNoms(nomColonnesFeuille);
|
||||
if(!NomDeColonneInscriptionTable.colitionNomDesColonnes(nomColonnesFeuille, cFormations.getSelectedItem().toString())) {
|
||||
NomDeColonneInscriptionTable.modifierLesNoms(nomColonnesFeuille, cFormations.getSelectedItem().toString());
|
||||
dispose();
|
||||
}
|
||||
|
||||
@ -239,16 +261,13 @@ public class Window_renommerColonne extends JFrame {
|
||||
lblAuteurVersion.setHorizontalAlignment(SwingConstants.LEFT);
|
||||
lblAuteurVersion.setFont(new Font("Arial", Font.BOLD, 14));
|
||||
lblAuteurVersion.setBounds(20, 11, 325, 53);
|
||||
if(randomNumber==7
|
||||
|| randomNumber==10 || randomNumber==11 || randomNumber==12
|
||||
|| randomNumber==14 || randomNumber==18 || randomNumber==21
|
||||
|| randomNumber==22 || randomNumber==23 || randomNumber==25
|
||||
|| randomNumber==27 || randomNumber==28
|
||||
) {
|
||||
|
||||
if(commandes.imageTropClaire(randomNumber)) {
|
||||
lblAuteurVersion.setForeground(new Color(0, 0, 0));
|
||||
}else {
|
||||
lblAuteurVersion.setForeground(new Color(255, 255, 255));
|
||||
}
|
||||
|
||||
contentPane.add(lblAuteurVersion);
|
||||
|
||||
lblImage = new JLabel("");
|
||||
@ -261,20 +280,21 @@ public class Window_renommerColonne extends JFrame {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
NomDeColonneInscriptionTable.chargementParDefaut();
|
||||
|
||||
txtNomOption_1.setText(commandes.nomColonne_Option_1);
|
||||
chckbxOption_1.setSelected(commandes.enabled_Colonne_Option_1);
|
||||
txtNomOption_1.setText(commandes.nomColonne_default_Option_1);
|
||||
chckbxOption_1.setSelected(commandes.enabled_default_Colonne_Option_1);
|
||||
|
||||
txtNomOption_2.setText(commandes.nomColonne_Option_2);
|
||||
chckbxOption_2.setSelected(commandes.enabled_Colonne_Option_2);
|
||||
txtNomOption_2.setText(commandes.nomColonne_default_Option_2);
|
||||
chckbxOption_2.setSelected(commandes.enabled_default_Colonne_Option_2);
|
||||
|
||||
txtNomOption_3.setText(commandes.nomColonne_Option_3);
|
||||
chckbxOption_3.setSelected(commandes.enabled_Colonne_Option_3);
|
||||
txtNomOption_3.setText(commandes.nomColonne_default_Option_3);
|
||||
chckbxOption_3.setSelected(commandes.enabled_default_Colonne_Option_3);
|
||||
|
||||
txtNomOption_4.setText(commandes.nomColonne_Option_4);
|
||||
chckbxOption_4.setSelected(commandes.enabled_Colonne_Option_4);
|
||||
txtNomOption_4.setText(commandes.nomColonne_default_Option_4);
|
||||
chckbxOption_4.setSelected(commandes.enabled_default_Colonne_Option_4);
|
||||
|
||||
txtNomOption_5.setText(commandes.nomColonne_default_Option_5);
|
||||
chckbxOption_5.setSelected(commandes.enabled_default_Colonne_Option_5);
|
||||
|
||||
txtNomOption_5.setText(commandes.nomColonne_Option_5);
|
||||
chckbxOption_5.setSelected(commandes.enabled_Colonne_Option_5);
|
||||
}
|
||||
});
|
||||
|
||||
@ -283,30 +303,54 @@ public class Window_renommerColonne extends JFrame {
|
||||
contentPane.add(btnValeurParDfaut);
|
||||
|
||||
chckbxOption_1.setFont(new Font("Arial", Font.BOLD, 14));
|
||||
chckbxOption_1.setBounds(501, 426, 82, 23);
|
||||
chckbxOption_1.setSelected(commandes.enabled_Colonne_Option_1);
|
||||
chckbxOption_1.setBounds(501, 467, 82, 23);
|
||||
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, 426, 82, 23);
|
||||
chckbxOption_5.setSelected(commandes.enabled_Colonne_Option_5);
|
||||
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, 479, 82, 23);
|
||||
chckbxOption_2.setSelected(commandes.enabled_Colonne_Option_2);
|
||||
chckbxOption_2.setBounds(501, 520, 82, 23);
|
||||
chckbxOption_2.setSelected(Boolean.valueOf(nFormation.getAttributes("Enabled_Colonne_Option_2")));
|
||||
contentPane.add(chckbxOption_2);
|
||||
|
||||
chckbxOption_3.setFont(new Font("Arial", Font.BOLD, 14));
|
||||
chckbxOption_3.setBounds(501, 539, 82, 23);
|
||||
chckbxOption_3.setSelected(commandes.enabled_Colonne_Option_3);
|
||||
chckbxOption_3.setBounds(501, 580, 82, 23);
|
||||
chckbxOption_3.setSelected(Boolean.valueOf(nFormation.getAttributes("Enabled_Colonne_Option_3")));
|
||||
contentPane.add(chckbxOption_3);
|
||||
|
||||
chckbxOption_4.setFont(new Font("Arial", Font.BOLD, 14));
|
||||
chckbxOption_4.setBounds(501, 591, 82, 23);
|
||||
chckbxOption_4.setSelected(commandes.enabled_Colonne_Option_4);
|
||||
chckbxOption_4.setBounds(501, 632, 82, 23);
|
||||
chckbxOption_4.setSelected(Boolean.valueOf(nFormation.getAttributes("Enabled_Colonne_Option_4")));
|
||||
contentPane.add(chckbxOption_4);
|
||||
|
||||
|
||||
JLabel lblNewLabel_1 = new JLabel("<html>Formations</html>");
|
||||
lblNewLabel_1.setForeground(Color.RED);
|
||||
lblNewLabel_1.setFont(new Font("Arial", Font.BOLD, 18));
|
||||
lblNewLabel_1.setBounds(10, 416, 220, 34);
|
||||
contentPane.add(lblNewLabel_1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void majFiltres() {
|
||||
noeud nFormation = commandes.nBase.findNoeud(cFormations.getSelectedItem().toString());
|
||||
|
||||
chckbxOption_1.setSelected(Boolean.valueOf(nFormation.getAttributes("Enabled_Colonne_Option_1")));
|
||||
chckbxOption_2.setSelected(Boolean.valueOf(nFormation.getAttributes("Enabled_Colonne_Option_2")));
|
||||
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")));
|
||||
|
||||
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"));
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -108,16 +108,16 @@ public class NomDeColonneInscriptionTable {
|
||||
commandes.nomColonne_Option_1 = "Option_1";
|
||||
commandes.enabled_Colonne_Option_1 = false;
|
||||
|
||||
commandes.nomColonne_Option_2 = "Atelier-rentree_horaire";
|
||||
commandes.nomColonne_Option_2 = "Option_2";
|
||||
commandes.enabled_Colonne_Option_2 = true;
|
||||
|
||||
commandes.nomColonne_Option_3 = "Atelier_pre-rentree_enseignant";
|
||||
commandes.nomColonne_Option_3 = "Option_3";
|
||||
commandes.enabled_Colonne_Option_3 = true;
|
||||
|
||||
commandes.nomColonne_Option_4 = "Atelier_pre-rentree_salle";
|
||||
commandes.nomColonne_Option_4 = "Option_4";
|
||||
commandes.enabled_Colonne_Option_4 = true;
|
||||
|
||||
commandes.nomColonne_Option_5 = "Information";
|
||||
commandes.nomColonne_Option_5 = "Option_5";
|
||||
commandes.enabled_Colonne_Option_5 = false;
|
||||
|
||||
}
|
||||
@ -126,7 +126,14 @@ public class NomDeColonneInscriptionTable {
|
||||
* Apporte les modification dans la base avec les nouveaux nons des colonnes ou de la feuille.
|
||||
* @param nomColonne
|
||||
*/
|
||||
public static void modifierLesNoms(HashMap<String, String> nomColonne) {
|
||||
public static void modifierLesNoms(HashMap<String, String> nomColonne, String nomFormation) {
|
||||
|
||||
noeud nB = commandes.nBase;
|
||||
if(nomFormation!=null) {
|
||||
if(nB.isHasChild(nomFormation)) {
|
||||
nB = commandes.nBase.findNoeud(nomFormation);
|
||||
}
|
||||
}
|
||||
|
||||
if(nomColonne.containsKey("Excel_Formation")) {
|
||||
commandes.nomColonneExcel_Formation = nomColonne.get("Excel_Formation");
|
||||
@ -165,11 +172,13 @@ public class NomDeColonneInscriptionTable {
|
||||
commandes.nomColonneMailUnivEtudiant = supprimeCaracatresSpeciaux.TousLesCaracteresSpeciaux(commandes.nomColonneExcel_MailUnivEtudiant);
|
||||
}
|
||||
|
||||
|
||||
if(nomColonne.containsKey("Excel_Feuille_Inscription")) commandes.nomFeuilleExcel_Inscription = nomColonne.get("Excel_Feuille_Inscription");
|
||||
|
||||
// Les colonnes options
|
||||
if(nomColonne.containsKey("nomColonne_Option_1")) {
|
||||
commandes.nomColonne_Option_1 = supprimeCaracatresSpeciaux.TousLesCaracteresSpeciaux(nomColonne.get("nomColonne_Option_1"));
|
||||
commandes.enabled_Colonne_Option_1 =Boolean.valueOf(nomColonne.get("Enabled_Colonne_Option_1"));
|
||||
commandes.enabled_Colonne_Option_1 = Boolean.valueOf(nomColonne.get("Enabled_Colonne_Option_1"));
|
||||
}
|
||||
if(nomColonne.containsKey("nomColonne_Option_2")) {
|
||||
commandes.nomColonne_Option_2 = supprimeCaracatresSpeciaux.TousLesCaracteresSpeciaux(nomColonne.get("nomColonne_Option_2"));
|
||||
@ -228,42 +237,49 @@ public class NomDeColonneInscriptionTable {
|
||||
commandes.nBase.setAttribut("Excel_Individu_-_Email", commandes.nomColonneExcel_MailUnivEtudiant);
|
||||
// ecriture nom de la feuille
|
||||
commandes.nBase.setAttribut("Excel_Feuille_Inscription", commandes.nomFeuilleExcel_Inscription);
|
||||
|
||||
// Les colonnes Option
|
||||
String oldNameOption_1 = commandes.nBase.getAttributes("nomColonne_Option_1");
|
||||
String oldNameOption_1 = nB.getAttributes("nomColonne_Option_1");
|
||||
commandes.nBase.setAttribut("nomColonne_Option_1", commandes.nomColonne_Option_1);
|
||||
commandes.nBase.setAttribut("Enabled_Colonne_Option_1",String.valueOf(commandes.enabled_Colonne_Option_1));
|
||||
String oldNameOption_2 = commandes.nBase.getAttributes("nomColonne_Option_2");
|
||||
nB.setAttribut("nomColonne_Option_1", commandes.nomColonne_Option_1) ;
|
||||
|
||||
String oldNameOption_2 = nB.getAttributes("nomColonne_Option_2");
|
||||
commandes.nBase.setAttribut("nomColonne_Option_2", commandes.nomColonne_Option_2);
|
||||
commandes.nBase.setAttribut("Enabled_Colonne_Option_2",String.valueOf(commandes.enabled_Colonne_Option_2));
|
||||
String oldNameOption_3 = commandes.nBase.getAttributes("nomColonne_Option_3");
|
||||
nB.setAttribut("nomColonne_Option_2", commandes.nomColonne_Option_2);
|
||||
|
||||
String oldNameOption_3 = nB.getAttributes("nomColonne_Option_3");
|
||||
commandes.nBase.setAttribut("nomColonne_Option_3", commandes.nomColonne_Option_3);
|
||||
commandes.nBase.setAttribut("Enabled_Colonne_Option_3",String.valueOf(commandes.enabled_Colonne_Option_3));
|
||||
String oldNameOption_4 = commandes.nBase.getAttributes("nomColonne_Option_4");
|
||||
nB.setAttribut("nomColonne_Option_3", commandes.nomColonne_Option_3);
|
||||
|
||||
String oldNameOption_4 = nB.getAttributes("nomColonne_Option_4");
|
||||
commandes.nBase.setAttribut("nomColonne_Option_4", commandes.nomColonne_Option_4);
|
||||
commandes.nBase.setAttribut("Enabled_Colonne_Option_4",String.valueOf(commandes.enabled_Colonne_Option_4));
|
||||
String oldNameOption_5 = commandes.nBase.getAttributes("nomColonne_Option_5");
|
||||
nB.setAttribut("nomColonne_Option_4", commandes.nomColonne_Option_4);
|
||||
|
||||
String oldNameOption_5 = nB.getAttributes("nomColonne_Option_5");
|
||||
commandes.nBase.setAttribut("nomColonne_Option_5", commandes.nomColonne_Option_5);
|
||||
commandes.nBase.setAttribut("Enabled_Colonne_Option_5",String.valueOf(commandes.enabled_Colonne_Option_5));
|
||||
nB.setAttribut("nomColonne_Option_5", commandes.nomColonne_Option_5);
|
||||
|
||||
|
||||
if( commandes.nBase.getFirstChild()!=null) {
|
||||
for(noeud formation : commandes.nBase.getFirstChild().getChildren()) {
|
||||
for(noeud nStudent : formation.getChildren()) {
|
||||
nStudent.changeAttributName(oldNameFormation, commandes.nomColonneFormation);
|
||||
nStudent.changeAttributName(oldNameNomEtudiant, commandes.nomColonneNomEtudiant);
|
||||
nStudent.changeAttributName(oldNamePrenomEtudiant, commandes.nomColonnePrenomEtudiant);
|
||||
nStudent.changeAttributName(oldNameCodeEtudiant, commandes.nomColonneCodeEtudiant);
|
||||
nStudent.changeAttributName(oldNameProfilEtudiant, commandes.nomColonneProfilEtudiant);
|
||||
nStudent.changeAttributName(oldNameBacEtudiant, commandes.nomColonneBacEtudiant);
|
||||
nStudent.changeAttributName(oldNamePortableEtudiant, commandes.nomColonnePortableEtudiant);
|
||||
nStudent.changeAttributName(oldNameMailPersoEtudiant, commandes.nomColonneMailPersoEtudiant);
|
||||
nStudent.changeAttributName(oldNameMailUnivEtudiant, commandes.nomColonneMailUnivEtudiant);
|
||||
nStudent.changeAttributName(oldNameOption_1, commandes.nomColonne_Option_1);
|
||||
nStudent.changeAttributName(oldNameOption_2, commandes.nomColonne_Option_2);
|
||||
nStudent.changeAttributName(oldNameOption_3, commandes.nomColonne_Option_3);
|
||||
nStudent.changeAttributName(oldNameOption_4, commandes.nomColonne_Option_4);
|
||||
nStudent.changeAttributName(oldNameOption_5, commandes.nomColonne_Option_5);
|
||||
}
|
||||
if(!nB.isRoot()) {
|
||||
for(noeud nStudent : nB.getChildren()) {
|
||||
nStudent.changeAttributName(oldNameFormation, commandes.nomColonneFormation);
|
||||
nStudent.changeAttributName(oldNameNomEtudiant, commandes.nomColonneNomEtudiant);
|
||||
nStudent.changeAttributName(oldNamePrenomEtudiant, commandes.nomColonnePrenomEtudiant);
|
||||
nStudent.changeAttributName(oldNameCodeEtudiant, commandes.nomColonneCodeEtudiant);
|
||||
nStudent.changeAttributName(oldNameProfilEtudiant, commandes.nomColonneProfilEtudiant);
|
||||
nStudent.changeAttributName(oldNameBacEtudiant, commandes.nomColonneBacEtudiant);
|
||||
nStudent.changeAttributName(oldNamePortableEtudiant, commandes.nomColonnePortableEtudiant);
|
||||
nStudent.changeAttributName(oldNameMailPersoEtudiant, commandes.nomColonneMailPersoEtudiant);
|
||||
nStudent.changeAttributName(oldNameMailUnivEtudiant, commandes.nomColonneMailUnivEtudiant);
|
||||
nStudent.changeAttributName(oldNameOption_1, commandes.nomColonne_Option_1);
|
||||
nStudent.changeAttributName(oldNameOption_2, commandes.nomColonne_Option_2);
|
||||
nStudent.changeAttributName(oldNameOption_3, commandes.nomColonne_Option_3);
|
||||
nStudent.changeAttributName(oldNameOption_4, commandes.nomColonne_Option_4);
|
||||
nStudent.changeAttributName(oldNameOption_5, commandes.nomColonne_Option_5);
|
||||
}
|
||||
}
|
||||
|
||||
@ -282,9 +298,8 @@ public class NomDeColonneInscriptionTable {
|
||||
* @param nomColonne
|
||||
* @return
|
||||
*/
|
||||
public static boolean colitionNomDesColonnes(HashMap<String, String> nomColonne) {
|
||||
boolean result = false;
|
||||
StringBuilder message = new StringBuilder();
|
||||
public static boolean colitionNomDesColonnes(HashMap<String, String> nomColonne, String nomFormation) {
|
||||
|
||||
commandes.listNomDesColonnes.clear();
|
||||
|
||||
commandes.listNomDesColonnes.add("Groupe_Principal");
|
||||
@ -309,13 +324,8 @@ public class NomDeColonneInscriptionTable {
|
||||
commandes.listNomDesColonnes.add("Num_convention_2");
|
||||
commandes.listNomDesColonnes.add("Periode_2");
|
||||
|
||||
verificationCollisition(nomColonne, message, result);
|
||||
return verificationCollisition(nomColonne, nomFormation);
|
||||
|
||||
if(result) {
|
||||
JOptionPane.showMessageDialog(null, "<html>"+ message.toString() + "<p>Recommencer votre saisie.</p></html>");
|
||||
}
|
||||
|
||||
return result ;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -325,26 +335,44 @@ public class NomDeColonneInscriptionTable {
|
||||
* @param message
|
||||
* @param result
|
||||
*/
|
||||
private static void verificationCollisition(HashMap<String, String> nomColonne, StringBuilder message, boolean result) {
|
||||
|
||||
for(Map.Entry<String, String> entry : commandes.nBase.getAttributes().entrySet()) {
|
||||
commandes.listNomDesColonnes.add(entry.getValue());
|
||||
private static boolean verificationCollisition(HashMap<String, String> nomColonne, String nomFormation) {
|
||||
Boolean colonneEnDoublon=false;
|
||||
noeud nB = commandes.nBase;
|
||||
if(nomFormation!=null) {
|
||||
if(nB.isHasChild(nomFormation)) {
|
||||
nB = commandes.nBase.findNoeud(nomFormation);
|
||||
}
|
||||
}
|
||||
|
||||
HashMap<String, String> A = new HashMap<String, String>(nB.getAttributes());
|
||||
if(nomFormation!=null) A.putAll(nomColonne);
|
||||
|
||||
// Remplissage de la listNomDesColonnes et vérification
|
||||
for (Map.Entry<String, String> entry : nomColonne.entrySet()) {
|
||||
if(!commandes.listNomDesColonnes.contains(supprimeCaracatresSpeciaux.TousLesCaracteresSpeciaux(entry.getValue()))) {
|
||||
commandes.listNomDesColonnes.add(supprimeCaracatresSpeciaux.TousLesCaracteresSpeciaux(entry.getValue()));
|
||||
}else {
|
||||
message.append("<p>Le nom de la colonne " + entry.getKey() + " = "+ entry.getValue() + " est en double.</p>");
|
||||
result =true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
for(Map.Entry<String, String> entry : A.entrySet()) {
|
||||
if(entry.getValue().equals("true")) continue;
|
||||
if(entry.getValue().equals("false")) continue;
|
||||
if(entry.getKey().equals("version")) continue;
|
||||
if(entry.getKey().equals("date_derniere_modification")) continue;
|
||||
if(entry.getKey().equals("defaut_Year")) continue;
|
||||
if(entry.getKey().equals("date_creation")) continue;
|
||||
if(entry.getKey().contains("Excel_")) continue;
|
||||
if(entry.getKey().contains("pattern_")) continue;
|
||||
if(entry.getKey().contains("nombre_")) continue;
|
||||
if(entry.getKey().contains("Verouillage_")) continue;
|
||||
|
||||
|
||||
String nameColumn = supprimeCaracatresSpeciaux.TousLesCaracteresSpeciaux(entry.getValue());
|
||||
if(!commandes.listNomDesColonnes.contains(nameColumn)) {
|
||||
commandes.listNomDesColonnes.add(nameColumn);
|
||||
}else {
|
||||
StringBuilder message = new StringBuilder();
|
||||
message.append("<p>Le nom de la colonne " +entry.getKey() + "=" + entry.getValue() + " est en double.</p>");
|
||||
message.append("<p>Il n'y a pas de modification.</p>");
|
||||
JOptionPane.showMessageDialog(null, "<html>"+ message.toString() + "<p>Recommencer votre saisie.</p></html>");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return colonneEnDoublon;
|
||||
}
|
||||
}
|
||||
|
@ -58,20 +58,47 @@ public class commandes {
|
||||
public static String nomColonne_Option_1 = "Option_1";
|
||||
public static boolean enabled_Colonne_Option_1 = true;
|
||||
|
||||
public static String nomColonne_Option_2 = "Atelier-rentree_horaire";
|
||||
public static String nomColonne_Option_2 = "Option_2";
|
||||
public static boolean enabled_Colonne_Option_2 = true;
|
||||
|
||||
public static String nomColonne_Option_3 = "Atelier_pre-rentree_enseignant";
|
||||
public static String nomColonne_Option_3 = "Option_3";
|
||||
public static boolean enabled_Colonne_Option_3 = true;
|
||||
|
||||
public static String nomColonne_Option_4 = "Atelier_pre-rentree_salle";
|
||||
public static String nomColonne_Option_4 = "Option_4";
|
||||
public static boolean enabled_Colonne_Option_4 = true;
|
||||
|
||||
public static String nomColonne_Option_5 = "Information";
|
||||
public static String nomColonne_Option_5 = "Option_5";
|
||||
public static boolean enabled_Colonne_Option_5 = true;
|
||||
|
||||
public static String nomColonne_Option_6 = "Option_6";
|
||||
public static boolean enabled_Colonne_Option_6 = true;
|
||||
|
||||
public static String nomColonne_Option_7 = "Option_7";
|
||||
public static boolean enabled_Colonne_Option_7 = true;
|
||||
|
||||
public static String nomColonne_default_Option_1 = "Option_1";
|
||||
public static boolean enabled_default_Colonne_Option_1 = true;
|
||||
|
||||
public static String nomColonne_default_Option_2 = "Option_2";
|
||||
public static boolean enabled_default_Colonne_Option_2 = true;
|
||||
|
||||
public static String nomColonne_default_Option_3 = "Option_3";
|
||||
public static boolean enabled_default_Colonne_Option_3 = true;
|
||||
|
||||
public static String nomColonne_default_Option_4 = "Option_4";
|
||||
public static boolean enabled_default_Colonne_Option_4 = true;
|
||||
|
||||
public static String nomColonne_default_Option_5 = "Option_5";
|
||||
public static boolean enabled_default_Colonne_Option_5 = true;
|
||||
|
||||
public static String nomColonne_default_Option_6 = "Option_6";
|
||||
public static boolean enabled_default_Colonne_Option_6 = true;
|
||||
|
||||
public static String nomColonne_default_Option_7 = "Option_7";
|
||||
public static boolean enabled_default_Colonne_Option_7 = true;
|
||||
|
||||
// Nombre d'image d'acceuil
|
||||
public static int nombreImage = 42;
|
||||
public static int nombreImage = 43;
|
||||
|
||||
// Nombre maximal de fichier dans l'archive
|
||||
public static int nombreMaxSauvegardeArchive = 300;
|
||||
@ -79,5 +106,20 @@ public class commandes {
|
||||
// Nombre de minute entre deux sauvegardes dans l'archive
|
||||
public static int nombreMinuteEntreDeuxSauvegarde = 5 ;
|
||||
|
||||
// Si l'image est trop claire permet d'afficher le texte auteur en noir plutôt que du blanc
|
||||
public static boolean imageTropClaire(int randomNumber) {
|
||||
if(randomNumber==7
|
||||
|| randomNumber==10 || randomNumber==11 || randomNumber==12
|
||||
|| randomNumber==14 || randomNumber==18 || randomNumber==21
|
||||
|| randomNumber==22 || randomNumber==23 || randomNumber==25
|
||||
|| randomNumber==26 || randomNumber==27 || randomNumber==28
|
||||
|| randomNumber ==42
|
||||
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -259,6 +259,7 @@ public class noeud implements Cloneable{
|
||||
public void changeAttributName(String oldName, String newName) {
|
||||
if(oldName!=null) {
|
||||
if(attributes.get(oldName)==null) {
|
||||
this.attributes.put(newName, "");
|
||||
return;
|
||||
}
|
||||
String value = attributes.get(oldName);
|
||||
@ -543,6 +544,27 @@ public class noeud implements Cloneable{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne TRUE si le noeud contient un enfant nommé nameChild.
|
||||
* @param nameChild
|
||||
* @return
|
||||
*/
|
||||
public Boolean isHasChild(String nameChild) {
|
||||
for (noeud child : children) {
|
||||
if(child.getName().equals(nameChild)) return true;
|
||||
if(child.isHasChild(nameChild)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne TRUE si le noeud est le noeud racine.
|
||||
* @return
|
||||
*/
|
||||
public Boolean isRoot() {
|
||||
if(this.Parent==null) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le noeud frère suivant de ce noeud.<br>
|
||||
@ -914,7 +936,7 @@ public class noeud implements Cloneable{
|
||||
*/
|
||||
public noeud getRoot() {
|
||||
if(this.Parent!=null) {
|
||||
return Parent.getRoot();
|
||||
return this.Parent.getRoot();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
BIN
src/resources/Sans titre_43.jpg
Normal file
BIN
src/resources/Sans titre_43.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 545 KiB |
Loading…
Reference in New Issue
Block a user