2022-06-19 21:01:30 +02:00
package fenetres ;
2022-06-02 15:47:54 +02:00
2023-02-14 21:32:36 +01:00
import java.awt.Color ;
2023-02-14 09:20:58 +01:00
import java.awt.Font ;
import java.awt.event.ActionEvent ;
import java.awt.event.ActionListener ;
import javax.swing.DefaultComboBoxModel ;
import javax.swing.ImageIcon ;
import javax.swing.JButton ;
import javax.swing.JComboBox ;
2022-06-02 15:47:54 +02:00
import javax.swing.JFrame ;
import javax.swing.JLabel ;
2022-06-02 22:19:32 +02:00
import javax.swing.JOptionPane ;
2023-02-14 09:20:58 +01:00
import javax.swing.JPanel ;
import javax.swing.JTextArea ;
2022-06-02 15:47:54 +02:00
import javax.swing.JTextField ;
import MEPTL.commandes ;
2022-06-03 21:30:14 +02:00
import MEPTL.meptl ;
2022-06-11 12:10:28 +02:00
import calcul.calculNotesProgression ;
2022-06-13 17:43:41 +02:00
import calcul.formatDateWriter ;
2022-06-02 15:47:54 +02:00
import net.miginfocom.swing.MigLayout ;
2022-06-19 21:01:30 +02:00
public final class proprieteFichierAnalyse extends JFrame {
2022-06-02 15:47:54 +02:00
/ * *
*
* /
private static final long serialVersionUID = 1L ;
private JPanel contentPane ;
private JTextField textFieldTitre ;
private JTextField textFieldAuteur ;
private JTextField textFieldMetaSujet ;
private JTextField textFieldNoteFrom ;
private JTextField textFieldProgression ;
private JTextField textFieldDateCreation ;
2022-12-01 14:40:55 +01:00
private JTextArea textAreaCommentaire ;
2022-06-02 15:47:54 +02:00
private JComboBox < String > comboBoxPresenceMetaSujet ;
private JComboBox < String > comboBoxBaremeABC ;
private JComboBox < String > comboBoxhistoriquePresent ;
private JComboBox < String > comboBoxcontrole_Initial_Creator ;
private JComboBox < String > comboBoxcontroleDateCreation ;
2023-02-11 09:43:12 +01:00
private JComboBox < String > comboBoxcontrole_modificationDateMini ;
2022-06-02 15:47:54 +02:00
private JLabel lblNewLabel_8 ;
private JLabel lblNewLabel_9 ;
private JTextField textFieldInitial_Creator ;
private JLabel lblNewLabel_10 ;
private JLabel lblNewLabel_11 ;
private JTextField textFieldlink_help ;
private JLabel lblNewLabel_12 ;
private JTextField textFieldlink_sujet ;
2022-06-02 22:19:32 +02:00
private JButton btnAideTitre ;
private JButton btnAideAuteur ;
private JButton btnAideMetaSujet ;
private JButton btnAidePresenceMetaSujet ;
private JButton btnAideBaremeABC ;
private JButton btnAideNoteFrom ;
private JButton btnAideProgression ;
private JButton btnAideHistoriquePresent ;
private JButton btnAideDateCreation ;
private JButton btnAideControleDateCreation ;
private JButton btnAideInitial_Creator ;
private JButton btnAidecontrole_Initial_Creator ;
2022-12-07 20:44:00 +01:00
private JButton btnAidecontrole_URLAide ;
2023-02-11 09:43:12 +01:00
private JButton btnAidecontrole_dateModificationMini ;
2022-12-07 20:44:00 +01:00
private JButton btnAidecontrole_URLSujet ;
private JButton btnAidecontrole_Commentaire ;
2022-06-02 22:19:32 +02:00
private JButton btnVoirBaremeABC ;
2022-06-06 09:50:45 +02:00
private JButton btnVoirBaremeNumeric ;
2022-06-19 21:01:30 +02:00
private static proprieteFichierAnalyse instance ;
2022-12-01 14:40:55 +01:00
private JLabel lblNewLabel_13 ;
2023-02-11 09:43:12 +01:00
private JLabel lblNewLabel_14 ;
private JTextField textField_dateModificationMini ;
private JLabel lblNewLabel_15 ;
2023-02-14 21:32:36 +01:00
private JLabel lblNewLabel_16 ;
private JLabel lblNewLabel_17 ;
private JLabel lblNewLabel_18 ;
private JLabel lblNewLabel_19 ;
private JLabel lblNewLabel_20 ;
2023-02-11 09:43:12 +01:00
2022-12-01 14:40:55 +01:00
2022-06-02 15:47:54 +02:00
/ * *
* Create the frame .
* /
2022-06-19 21:01:30 +02:00
public proprieteFichierAnalyse ( ) {
2022-12-07 20:44:00 +01:00
ImageIcon img = new ImageIcon ( getClass ( ) . getResource ( " /evalwriter.png " ) ) ;
setTitle ( " Propriétés du fichier d'analyse - " + commandes . version + " " + commandes . branch ) ;
setIconImage ( img . getImage ( ) ) ;
2023-02-14 21:32:36 +01:00
setBounds ( 0 , 0 , 1220 , 680 ) ;
2022-12-07 20:44:00 +01:00
2022-06-02 15:47:54 +02:00
setDefaultCloseOperation ( JFrame . DISPOSE_ON_CLOSE ) ;
int screenWidth = ( int ) java . awt . GraphicsEnvironment . getLocalGraphicsEnvironment ( ) . getMaximumWindowBounds ( ) . getWidth ( ) ;
int screenHeight = ( int ) java . awt . GraphicsEnvironment . getLocalGraphicsEnvironment ( ) . getMaximumWindowBounds ( ) . getHeight ( ) ;
setLocation ( ( ( screenWidth ) - getWidth ( ) ) / 2 , ( screenHeight - getHeight ( ) ) / 2 ) ;
contentPane = new JPanel ( ) ;
setContentPane ( contentPane ) ;
2023-02-14 21:32:36 +01:00
contentPane . setLayout ( new MigLayout ( " " , " [260px][260px,grow][10,grow 20][2px:12px:24px][260px][260px][10,grow 20] " , " [18px][18px][18px][30px][18px][18px][64px:64px:100px][18px][18px][16px:16px:16px][18px][18px][18px][][] " ) ) ;
lblNewLabel_17 = new JLabel ( " INFORMATIONS " ) ;
lblNewLabel_17 . setForeground ( new Color ( 0 , 0 , 255 ) ) ;
lblNewLabel_17 . setFont ( new Font ( " Tahoma " , Font . BOLD , 16 ) ) ;
contentPane . add ( lblNewLabel_17 , " cell 0 0,alignx left,aligny bottom " ) ;
lblNewLabel_16 = new JLabel ( " <html>VERIFICATIONS FICHIER TRANSMIS</html> " ) ;
lblNewLabel_16 . setForeground ( new Color ( 255 , 0 , 0 ) ) ;
lblNewLabel_16 . setFont ( new Font ( " Tahoma " , Font . BOLD , 16 ) ) ;
contentPane . add ( lblNewLabel_16 , " cell 4 0,alignx left,aligny bottom " ) ;
btnAideMetaSujet = new JButton ( " " ) ;
btnAideMetaSujet . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
JOptionPane . showInternalMessageDialog ( null , " <html>La propriété personnalisé Sujet apparaît dans les feedbacks.<br> "
+ " Elle est placée sous la note des étudiants.<br> "
+ " Si la donnée personnalisé Sujet dans les fichiers des étudiants est présente,<br> "
+ " alors il peut y avoir comparaison avec cet valeur (voir la valeur logique suivante).</html> " ) ;
}
} ) ;
2022-06-02 15:47:54 +02:00
JLabel lblNewLabel = new JLabel ( " Titre de l'exercice " ) ;
lblNewLabel . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
2023-02-14 21:32:36 +01:00
contentPane . add ( lblNewLabel , " cell 0 1,alignx left,aligny center " ) ;
2022-06-02 15:47:54 +02:00
textFieldTitre = new JTextField ( ) ;
textFieldTitre . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
2023-02-14 21:32:36 +01:00
contentPane . add ( textFieldTitre , " cell 1 1,grow " ) ;
2022-06-02 15:47:54 +02:00
textFieldTitre . setColumns ( 10 ) ;
2022-06-02 22:19:32 +02:00
btnAideTitre = new JButton ( " " ) ;
2022-06-13 17:43:41 +02:00
btnAideTitre . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
JOptionPane . showInternalMessageDialog ( null , " <html>Le titre de l'exercice apparaît<br>dans les feedbacks des étudiants.</html> " ) ;
}
} ) ;
2022-06-02 22:19:32 +02:00
btnAideTitre . setIcon ( new ImageIcon ( proprieteFichierAnalyse . class . getResource ( " /resources/whatmini.png " ) ) ) ;
2023-02-14 21:32:36 +01:00
contentPane . add ( btnAideTitre , " cell 2 1,aligny top " ) ;
2022-06-02 22:19:32 +02:00
2023-02-14 21:32:36 +01:00
JLabel lblNewLabel_2 = new JLabel ( " La propriété Sujet dans le fichier transmis. " ) ;
lblNewLabel_2 . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
contentPane . add ( lblNewLabel_2 , " cell 4 1,alignx left,aligny center " ) ;
2023-02-14 09:20:58 +01:00
2023-02-14 21:32:36 +01:00
// Meta
textFieldMetaSujet = new JTextField ( ) ;
textFieldMetaSujet . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
contentPane . add ( textFieldMetaSujet , " cell 5 1,grow " ) ;
textFieldMetaSujet . setColumns ( 10 ) ;
btnAideMetaSujet . setIcon ( new ImageIcon ( proprieteFichierAnalyse . class . getResource ( " /resources/whatmini.png " ) ) ) ;
contentPane . add ( btnAideMetaSujet , " cell 6 1,aligny top " ) ;
2023-02-14 09:20:58 +01:00
2022-06-02 15:47:54 +02:00
JLabel lblNewLabel_1 = new JLabel ( " Auteur " ) ;
lblNewLabel_1 . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
2023-02-14 21:32:36 +01:00
contentPane . add ( lblNewLabel_1 , " cell 0 2,alignx left,aligny center " ) ;
2022-06-02 15:47:54 +02:00
textFieldAuteur = new JTextField ( ) ;
textFieldAuteur . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
2023-02-14 21:32:36 +01:00
contentPane . add ( textFieldAuteur , " cell 1 2,grow " ) ;
2022-06-02 15:47:54 +02:00
textFieldAuteur . setColumns ( 10 ) ;
2022-06-02 22:19:32 +02:00
btnAideAuteur = new JButton ( " " ) ;
2022-06-13 17:43:41 +02:00
btnAideAuteur . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
JOptionPane . showInternalMessageDialog ( null , " <html>L'auteur de l'exercice apparaît<br>dans les feedbacks des étudiants.</html> " ) ;
}
} ) ;
2022-06-02 22:19:32 +02:00
btnAideAuteur . setIcon ( new ImageIcon ( proprieteFichierAnalyse . class . getResource ( " /resources/whatmini.png " ) ) ) ;
2023-02-14 21:32:36 +01:00
contentPane . add ( btnAideAuteur , " cell 2 2,aligny top " ) ;
JLabel lblNewLabel_3 = new JLabel ( " <HTML><p>Propriété personnalisé Sujet obligatoire<br>dans les fichiers des étudiants.</p></HTML> " ) ;
lblNewLabel_3 . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
contentPane . add ( lblNewLabel_3 , " cell 4 2,alignx left,aligny center " ) ;
comboBoxPresenceMetaSujet = new JComboBox < String > ( ) ;
comboBoxPresenceMetaSujet . setFont ( new Font ( " Tahoma " , Font . BOLD , 12 ) ) ;
comboBoxPresenceMetaSujet . setModel ( new DefaultComboBoxModel < String > ( new String [ ] { " false " , " true " } ) ) ;
contentPane . add ( comboBoxPresenceMetaSujet , " cell 5 2,growx,aligny top " ) ;
btnAidePresenceMetaSujet = new JButton ( " " ) ;
btnAidePresenceMetaSujet . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
JOptionPane . showInternalMessageDialog ( null , " <html>Si la donnée personnalisé Sujet dans les fichiers des étudiants ne correspond pas,<br> "
+ " à la valeur au-dessus alors le fichier n'est pas le fichier du sujet.<br> "
+ " La note de l'étudiant sera nulle. "
+ " <br><br>L'étudiant doit utiliser le fichier remis par l'enseignant.<br> "
+ " Cette technique peut être utilisée durant les contrôles.<br></html> " ) ;
}
} ) ;
btnAidePresenceMetaSujet . setIcon ( new ImageIcon ( proprieteFichierAnalyse . class . getResource ( " /resources/whatmini.png " ) ) ) ;
contentPane . add ( btnAidePresenceMetaSujet , " cell 6 2,aligny top " ) ;
lblNewLabel_11 = new JLabel ( " Lien URL de l'aide " ) ;
lblNewLabel_11 . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
contentPane . add ( lblNewLabel_11 , " cell 0 4,alignx left " ) ;
textFieldlink_help = new JTextField ( ) ;
textFieldlink_help . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
contentPane . add ( textFieldlink_help , " cell 1 4,grow " ) ;
textFieldlink_help . setColumns ( 10 ) ;
btnAidecontrole_URLAide = new JButton ( " " ) ;
btnAidecontrole_URLAide . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
JOptionPane . showInternalMessageDialog ( null , " <html>Si vous indiquez une URL alors elle apparaîtra dans "
+ " le feedback des étudiants.<html> " ) ;
}
} ) ;
btnAidecontrole_URLAide . setIcon ( new ImageIcon ( proprieteFichierAnalyse . class . getResource ( " /resources/whatmini.png " ) ) ) ;
contentPane . add ( btnAidecontrole_URLAide , " cell 2 4,aligny top " ) ;
2022-06-02 22:19:32 +02:00
2023-02-14 09:20:58 +01:00
JLabel lblNewLabel_7 = new JLabel ( " <html>La date de création du fichier transmis aux étudiants.</html> " ) ;
lblNewLabel_7 . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
2023-02-14 21:32:36 +01:00
contentPane . add ( lblNewLabel_7 , " cell 4 4,alignx left " ) ;
2023-02-14 09:20:58 +01:00
textFieldDateCreation = new JTextField ( ) ;
textFieldDateCreation . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
2023-02-14 21:32:36 +01:00
contentPane . add ( textFieldDateCreation , " cell 5 4,grow " ) ;
2023-02-14 09:20:58 +01:00
textFieldDateCreation . setColumns ( 10 ) ;
btnAideDateCreation = new JButton ( " " ) ;
btnAideDateCreation . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
JOptionPane . showInternalMessageDialog ( null , " <html>Ne modifier pas cette date.<br> "
+ " Sauf, si vous avez remis aux étudiants un nouveau fichier.</html> " ) ;
}
} ) ;
btnAideDateCreation . setIcon ( new ImageIcon ( proprieteFichierAnalyse . class . getResource ( " /resources/whatmini.png " ) ) ) ;
2023-02-14 21:32:36 +01:00
contentPane . add ( btnAideDateCreation , " cell 6 4,aligny top " ) ;
2023-02-14 09:20:58 +01:00
2023-02-14 21:32:36 +01:00
// URL Aide
lblNewLabel_12 = new JLabel ( " Lien URL du sujet " ) ;
lblNewLabel_12 . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
contentPane . add ( lblNewLabel_12 , " cell 0 5,alignx left " ) ;
2022-06-02 15:47:54 +02:00
2023-02-14 21:32:36 +01:00
// URL Sujet Ligne 13
textFieldlink_sujet = new JTextField ( ) ;
contentPane . add ( textFieldlink_sujet , " cell 1 5,grow " ) ;
textFieldlink_sujet . setColumns ( 10 ) ;
btnAidecontrole_URLSujet = new JButton ( " " ) ;
btnAidecontrole_URLSujet . addActionListener ( new ActionListener ( ) {
2022-06-13 17:43:41 +02:00
public void actionPerformed ( ActionEvent e ) {
2023-02-14 21:32:36 +01:00
JOptionPane . showInternalMessageDialog ( null , " <html>Si vous indiquez une URL alors elle apparaîtra dans "
+ " le feedback des étudiants.<html> " ) ;
2022-06-13 17:43:41 +02:00
}
} ) ;
2023-02-14 21:32:36 +01:00
btnAidecontrole_URLSujet . setIcon ( new ImageIcon ( proprieteFichierAnalyse . class . getResource ( " /resources/whatmini.png " ) ) ) ;
contentPane . add ( btnAidecontrole_URLSujet , " cell 2 5,aligny top " ) ;
2022-06-02 22:19:32 +02:00
2023-02-14 21:32:36 +01:00
lblNewLabel_8 = new JLabel ( " <html>La date de création dans les fichers des étudiants doit être le même que celui du fichier transmis.</html> " ) ;
2023-02-14 09:20:58 +01:00
lblNewLabel_8 . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
2023-02-14 21:32:36 +01:00
contentPane . add ( lblNewLabel_8 , " cell 4 5,alignx trailing " ) ;
2023-02-14 09:20:58 +01:00
comboBoxcontroleDateCreation = new JComboBox < String > ( ) ;
comboBoxcontroleDateCreation . setModel ( new DefaultComboBoxModel < String > ( new String [ ] { " false " , " true " } ) ) ;
comboBoxcontroleDateCreation . setFont ( new Font ( " Tahoma " , Font . BOLD , 12 ) ) ;
2023-02-14 21:32:36 +01:00
contentPane . add ( comboBoxcontroleDateCreation , " cell 5 5,growx,aligny top " ) ;
2023-02-14 09:20:58 +01:00
btnAideControleDateCreation = new JButton ( " " ) ;
btnAideControleDateCreation . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
JOptionPane . showInternalMessageDialog ( null , " <html>Si VRAI alors la date de création du fichier de l'étudiant doit être identique à celle-ci.<br> "
+ " Si ce n'est pas le cas alors l'étudiant aura une note nulle.<br><br> "
+ " L'étudiant doit utiliser le fichier remis par l'enseignant.<br><br> "
+ " Cette technique peut être utilisée durant les contrôles.<br> "
+ " Elle permettra de rechercher les fichiers réïnitialisés pour effacer l'historique.</html> " ) ;
}
} ) ;
btnAideControleDateCreation . setIcon ( new ImageIcon ( proprieteFichierAnalyse . class . getResource ( " /resources/whatmini.png " ) ) ) ;
2023-02-14 21:32:36 +01:00
contentPane . add ( btnAideControleDateCreation , " cell 6 5,aligny top " ) ;
2022-06-02 15:47:54 +02:00
2023-02-14 21:32:36 +01:00
// Commentaire exercice Ligne 14
lblNewLabel_13 = new JLabel ( " Commentaire sur l'exercice " ) ;
lblNewLabel_13 . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
contentPane . add ( lblNewLabel_13 , " cell 0 6,alignx left " ) ;
2022-06-02 15:47:54 +02:00
2023-02-14 21:32:36 +01:00
textAreaCommentaire = new JTextArea ( ) ;
textAreaCommentaire . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
contentPane . add ( textAreaCommentaire , " cell 1 6,grow " ) ;
btnAidecontrole_Commentaire = new JButton ( " " ) ;
btnAidecontrole_Commentaire . addActionListener ( new ActionListener ( ) {
2022-06-13 17:43:41 +02:00
public void actionPerformed ( ActionEvent e ) {
2023-02-14 21:32:36 +01:00
JOptionPane . showInternalMessageDialog ( null , " <html>Si vous tapez un commentaire, "
+ " il apparaîtra dans les feedbacks des étudiants.<html> " ) ;
2022-06-13 17:43:41 +02:00
}
} ) ;
2023-02-14 21:32:36 +01:00
btnAidecontrole_Commentaire . setIcon ( new ImageIcon ( proprieteFichierAnalyse . class . getResource ( " /resources/whatmini.png " ) ) ) ;
contentPane . add ( btnAidecontrole_Commentaire , " cell 2 6,aligny top " ) ;
lblNewLabel_18 = new JLabel ( " NOTATIONS " ) ;
lblNewLabel_18 . setForeground ( new Color ( 0 , 128 , 128 ) ) ;
lblNewLabel_18 . setFont ( new Font ( " Tahoma " , Font . BOLD , 16 ) ) ;
contentPane . add ( lblNewLabel_18 , " cell 0 7,aligny bottom " ) ;
2022-06-02 22:19:32 +02:00
2023-02-14 09:20:58 +01:00
lblNewLabel_9 = new JLabel ( " Auteur du fichier transmis aux étudiants. " ) ;
lblNewLabel_9 . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
2023-02-14 21:32:36 +01:00
contentPane . add ( lblNewLabel_9 , " cell 4 7,alignx left " ) ;
2023-02-14 09:20:58 +01:00
textFieldInitial_Creator = new JTextField ( ) ;
textFieldInitial_Creator . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
2023-02-14 21:32:36 +01:00
contentPane . add ( textFieldInitial_Creator , " cell 5 7,grow " ) ;
2023-02-14 09:20:58 +01:00
textFieldInitial_Creator . setColumns ( 10 ) ;
btnAideInitial_Creator = new JButton ( " " ) ;
btnAideInitial_Creator . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
JOptionPane . showInternalMessageDialog ( null , " <html>Le premier auteur du fichier (créateur).<br> "
+ " Ne modifier pas, sauf si vous avez fourni un nouveau fichier aux étudiants avec un autre créateur.<html> " ) ;
}
} ) ;
btnAideInitial_Creator . setIcon ( new ImageIcon ( proprieteFichierAnalyse . class . getResource ( " /resources/whatmini.png " ) ) ) ;
2023-02-14 21:32:36 +01:00
contentPane . add ( btnAideInitial_Creator , " cell 6 7,aligny top " ) ;
2022-06-02 15:47:54 +02:00
JLabel lblNewLabel_4 = new JLabel ( " Barème alphabétique ABCDE " ) ;
lblNewLabel_4 . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
2023-02-14 21:32:36 +01:00
contentPane . add ( lblNewLabel_4 , " cell 0 8,alignx left " ) ;
2022-06-02 15:47:54 +02:00
comboBoxBaremeABC = new JComboBox < String > ( ) ;
comboBoxBaremeABC . setModel ( new DefaultComboBoxModel < String > ( new String [ ] { " false " , " true " } ) ) ;
comboBoxBaremeABC . setFont ( new Font ( " Tahoma " , Font . BOLD , 12 ) ) ;
2023-02-14 21:32:36 +01:00
contentPane . add ( comboBoxBaremeABC , " cell 1 8,growx " ) ;
2022-06-02 22:19:32 +02:00
2023-02-14 21:32:36 +01:00
lblNewLabel_10 = new JLabel ( " <html>L'auteur des fichiers des étudiants doit être celui du fichier transmis.</html> " ) ;
lblNewLabel_10 . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
contentPane . add ( lblNewLabel_10 , " cell 4 8,alignx trailing " ) ;
2023-02-14 09:20:58 +01:00
comboBoxcontrole_Initial_Creator = new JComboBox < String > ( ) ;
comboBoxcontrole_Initial_Creator . setModel ( new DefaultComboBoxModel < String > ( new String [ ] { " false " , " true " } ) ) ;
comboBoxcontrole_Initial_Creator . setFont ( new Font ( " Tahoma " , Font . BOLD , 12 ) ) ;
2023-02-14 21:32:36 +01:00
contentPane . add ( comboBoxcontrole_Initial_Creator , " cell 5 8,growx,aligny top " ) ;
2023-02-14 09:20:58 +01:00
btnAidecontrole_Initial_Creator = new JButton ( " " ) ;
btnAidecontrole_Initial_Creator . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
JOptionPane . showInternalMessageDialog ( null , " <html>Si vrai alors le créateur du fichier des étudiants doit correspondre avec cet auteur.<br> "
+ " Si ce n'est pas le cas, l'étudiant aura une note nulle.<br><br> "
+ " Cette technique peut être utilisée pour les contrôles.<html> " ) ;
}
} ) ;
btnAidecontrole_Initial_Creator . setIcon ( new ImageIcon ( proprieteFichierAnalyse . class . getResource ( " /resources/whatmini.png " ) ) ) ;
2023-02-14 21:32:36 +01:00
contentPane . add ( btnAidecontrole_Initial_Creator , " cell 6 8,aligny top " ) ;
2022-06-02 15:47:54 +02:00
JLabel lblNoteFrom = new JLabel ( " Barème " ) ;
lblNoteFrom . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
2023-02-14 21:32:36 +01:00
contentPane . add ( lblNoteFrom , " cell 0 9,alignx left " ) ;
2022-06-02 15:47:54 +02:00
2023-02-14 21:32:36 +01:00
comboBoxBaremeABC . addActionListener ( new ActionListener ( ) {
@Override
2022-06-13 17:43:41 +02:00
public void actionPerformed ( ActionEvent e ) {
2023-02-14 21:32:36 +01:00
String resultat = ( String ) comboBoxBaremeABC . getSelectedItem ( ) ;
if ( resultat . equals ( " true " ) ) {
lblNoteFrom . setEnabled ( false ) ;
textFieldNoteFrom . setEnabled ( false ) ;
textFieldNoteFrom . setEditable ( false ) ;
} else {
lblNoteFrom . setEnabled ( true ) ;
textFieldNoteFrom . setEnabled ( true ) ;
textFieldNoteFrom . setEditable ( true ) ;
}
2022-06-13 17:43:41 +02:00
}
} ) ;
2023-02-14 21:32:36 +01:00
btnAideBaremeABC = new JButton ( " " ) ;
btnAideBaremeABC . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
JOptionPane . showMessageDialog ( null , " <html>Permet d'utiliser une notation alphabétique à 5 niveaux (de A à E).<br> "
+ " Si le coefficient de progression est de 1 alors la largeur des intervalles est de 20%. " ) ;
}
} ) ;
btnAideBaremeABC . setIcon ( new ImageIcon ( proprieteFichierAnalyse . class . getResource ( " /resources/whatmini.png " ) ) ) ;
contentPane . add ( btnAideBaremeABC , " flowx,cell 2 8,aligny top " ) ;
textFieldNoteFrom = new JTextField ( ) ;
textFieldNoteFrom . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
contentPane . add ( textFieldNoteFrom , " cell 1 9,grow " ) ;
textFieldNoteFrom . setColumns ( 10 ) ;
btnAideNoteFrom = new JButton ( " " ) ;
btnAideNoteFrom . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
JOptionPane . showMessageDialog ( null , " <html>La notation par défaut est numérique.<br> "
+ " La note maximale est par défaut de 20 points.<br> "
+ " La note maximale doit être une valeur supérieur strictement 0 point.<br><br> "
+ " Si le coefficient de progression est de 1 alors un exercice à 50% correct<br> "
+ " aura la note (maximale/2). " ) ;
}
} ) ;
btnAideNoteFrom . setIcon ( new ImageIcon ( proprieteFichierAnalyse . class . getResource ( " /resources/whatmini.png " ) ) ) ;
contentPane . add ( btnAideNoteFrom , " flowx,cell 2 9,aligny top " ) ;
if ( ! commandes . sujet . getContenu ( ) . isEmpty ( ) ) {
if ( commandes . sujet . getContenu ( ) . get ( 0 ) ! = null ) {
String textCommentaire = commandes . sujet . getContenu ( ) . get ( 0 ) . replace ( " -NewLine- " , " \ n " ) ;
textAreaCommentaire . setText ( textCommentaire ) ;
2023-02-14 09:20:58 +01:00
}
2023-02-14 21:32:36 +01:00
}
lblNewLabel_19 = new JLabel ( " <html>VERIFICATION AVEC SUIVI DES MODIFIACTIONS</html> " ) ;
lblNewLabel_19 . setForeground ( new Color ( 255 , 128 , 0 ) ) ;
lblNewLabel_19 . setFont ( new Font ( " Tahoma " , Font . BOLD , 16 ) ) ;
lblNewLabel_19 . setToolTipText ( " " ) ;
contentPane . add ( lblNewLabel_19 , " cell 4 10 " ) ;
lblNewLabel_20 = new JLabel ( " <html>L'activation du suivi des modifications permettra de vérifier les échnages des fichiers entres les étudiants et les copiés et collés dans les fichiers.</html> " ) ;
lblNewLabel_20 . setFont ( new Font ( " Tahoma " , Font . PLAIN , 10 ) ) ;
lblNewLabel_20 . setForeground ( new Color ( 232 , 116 , 0 ) ) ;
contentPane . add ( lblNewLabel_20 , " cell 5 10 " ) ;
2023-02-14 09:20:58 +01:00
JLabel lblNewLabel_5 = new JLabel ( " Coefficient de progression " ) ;
2022-06-02 15:47:54 +02:00
lblNewLabel_5 . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
2023-02-14 21:32:36 +01:00
contentPane . add ( lblNewLabel_5 , " cell 0 11,alignx left " ) ;
2022-06-02 15:47:54 +02:00
textFieldProgression = new JTextField ( ) ;
2023-02-14 21:32:36 +01:00
contentPane . add ( textFieldProgression , " cell 1 11,grow " ) ;
2022-06-02 15:47:54 +02:00
textFieldProgression . setColumns ( 10 ) ;
2022-06-02 22:19:32 +02:00
btnAideProgression = new JButton ( " " ) ;
2022-06-13 17:43:41 +02:00
btnAideProgression . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
JOptionPane . showMessageDialog ( null , " <html>Le coefficient de progression permet de régler la difficulté de l'exercice.<br><br> "
+ " Le coefficient de progression d'affiche dans les feedbacks des étudiants.<br><br> "
+ " Le coefficient de progression doit être compris entre ]0 et 10[.<br> "
+ " Un coef. inférieur à 1 signifie qu'il est facile d'atteindre la note maximale<br> "
+ " Un coef. supérieur à 1 signifie qu'il est difficile d'atteindre la note maximale. " ) ;
}
} ) ;
2022-06-02 22:19:32 +02:00
btnAideProgression . setIcon ( new ImageIcon ( proprieteFichierAnalyse . class . getResource ( " /resources/whatmini.png " ) ) ) ;
2023-02-14 21:32:36 +01:00
contentPane . add ( btnAideProgression , " cell 2 11,aligny top " ) ;
JLabel lblNewLabel_6 = new JLabel ( " <html>Le suivi des modifications doit être activé dans les fichiers des étudiants.</html> " ) ;
lblNewLabel_6 . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
contentPane . add ( lblNewLabel_6 , " cell 4 11,alignx left " ) ;
comboBoxhistoriquePresent = new JComboBox < String > ( ) ;
comboBoxhistoriquePresent . setModel ( new DefaultComboBoxModel < String > ( new String [ ] { " false " , " true " } ) ) ;
comboBoxhistoriquePresent . setFont ( new Font ( " Tahoma " , Font . BOLD , 12 ) ) ;
contentPane . add ( comboBoxhistoriquePresent , " cell 5 11,growx,aligny top " ) ;
btnAideHistoriquePresent = new JButton ( " " ) ;
btnAideHistoriquePresent . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
JOptionPane . showInternalMessageDialog ( null , " <html>Si VRAI alors le suivi des modifications doit être activé dans les fichiers des étudiants.<br> "
+ " Si ce n'est pas le cas alors l'étudiant aura une note nulle.<br><br> "
+ " L'étudiant doit utiliser le fichier remis par l'enseignant.<br> "
+ " L'enseignant aura activé le suivi des modifications et protégé le suivi par un mot de passe.<br><br> "
+ " Cette technique peut être utilisée durant les contrôles.<br> "
+ " Elle permettra de rechercher les fichiers échangés entre les étudiants en comparant les modifications.</html> " ) ;
}
} ) ;
btnAideHistoriquePresent . setIcon ( new ImageIcon ( proprieteFichierAnalyse . class . getResource ( " /resources/whatmini.png " ) ) ) ;
contentPane . add ( btnAideHistoriquePresent , " cell 6 11,aligny top " ) ;
2023-02-16 11:23:19 +01:00
// Bouton de calcul de la base numérique
btnVoirBaremeNumeric = new JButton ( " " ) ;
btnVoirBaremeNumeric . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
double progression = Double . valueOf ( textFieldProgression . getText ( ) ) ;
double noteFrom = Double . valueOf ( textFieldNoteFrom . getText ( ) ) ;
calculNotesProgression C = new calculNotesProgression ( progression , noteFrom ) ;
JOptionPane . showMessageDialog ( null , C . getMessageHTMLColonne ( ) ) ;
}
} ) ;
btnVoirBaremeNumeric . setIcon ( new ImageIcon ( proprieteFichierAnalyse . class . getResource ( " /resources/voirmini.png " ) ) ) ;
contentPane . add ( btnVoirBaremeNumeric , " cell 2 9 " ) ;
2023-02-14 21:32:36 +01:00
2023-02-16 11:23:19 +01:00
btnVoirBaremeABC = new JButton ( " " ) ;
btnVoirBaremeABC . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
double progression = Double . valueOf ( textFieldProgression . getText ( ) ) ;
calcul . calculIntervalleBaremeABCDE C = new calcul . calculIntervalleBaremeABCDE ( progression ) ;
JOptionPane . showMessageDialog ( null , C . getMessageHTMLColonne ( ) ) ;
}
} ) ;
btnVoirBaremeABC . setIcon ( new ImageIcon ( proprieteFichierAnalyse . class . getResource ( " /resources/voirmini.png " ) ) ) ;
contentPane . add ( btnVoirBaremeABC , " cell 2 8 " ) ;
2023-02-14 21:32:36 +01:00
2023-02-16 11:23:19 +01:00
// Bouton pour validation
JButton btnNewButton = new JButton ( " Valider " ) ;
btnNewButton . setFont ( new Font ( " Tahoma " , Font . BOLD , 14 ) ) ;
contentPane . add ( btnNewButton , " cell 1 13,grow " ) ;
btnNewButton . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
if ( verifCoefProgression ( ) & & verifBareme ( ) & & formatDateWriter . isCorrect ( textFieldDateCreation . getText ( ) )
& & VerificationDateDuControle ( ) ) {
commandes . sujet . getAttributs ( ) . put ( " titre " , textFieldTitre . getText ( ) ) ;
commandes . sujet . getAttributs ( ) . put ( " auteur " , textFieldAuteur . getText ( ) ) ;
commandes . sujet . getAttributs ( ) . put ( " metaSujet " , textFieldMetaSujet . getText ( ) ) ;
commandes . sujet . getAttributs ( ) . put ( " presenceMetaSujet " , comboBoxPresenceMetaSujet . getSelectedItem ( ) . toString ( ) ) ;
commandes . sujet . getAttributs ( ) . put ( " baremeABC " , comboBoxBaremeABC . getSelectedItem ( ) . toString ( ) ) ;
commandes . sujet . getAttributs ( ) . put ( " notefrom " , textFieldNoteFrom . getText ( ) ) ;
commandes . sujet . getAttributs ( ) . put ( " progression " , textFieldProgression . getText ( ) ) ;
commandes . sujet . getAttributs ( ) . put ( " historiquePresent " , comboBoxhistoriquePresent . getSelectedItem ( ) . toString ( ) ) ;
commandes . sujet . getAttributs ( ) . put ( " creationDate " , textFieldDateCreation . getText ( ) ) ;
commandes . sujet . getAttributs ( ) . put ( " modificationDateMini " , textField_dateModificationMini . getText ( ) ) ;
commandes . sujet . getAttributs ( ) . put ( " controleDateCreation " , comboBoxcontroleDateCreation . getSelectedItem ( ) . toString ( ) ) ;
commandes . sujet . getAttributs ( ) . put ( " controleDateModificationMini " , comboBoxcontrole_modificationDateMini . getSelectedItem ( ) . toString ( ) ) ;
commandes . sujet . getAttributs ( ) . put ( " Initial_Creator " , textFieldInitial_Creator . getText ( ) ) ;
commandes . sujet . getAttributs ( ) . put ( " controle_Initial_Creator " , comboBoxcontrole_Initial_Creator . getSelectedItem ( ) . toString ( ) ) ;
commandes . sujet . getAttributs ( ) . put ( " link_help " , textFieldlink_help . getText ( ) ) ;
commandes . sujet . getAttributs ( ) . put ( " link_sujet " , textFieldlink_sujet . getText ( ) ) ;
String textCommentaire = textAreaCommentaire . getText ( ) . replace ( " \ n " , " -NewLine- " ) ;
if ( ! commandes . sujet . getContenu ( ) . isEmpty ( ) ) {
commandes . sujet . getContenu ( ) . remove ( 0 ) ;
commandes . sujet . getContenu ( ) . add ( 0 , textCommentaire ) ;
}
meptl . chargementParametresFichierAnalyse ( ) ;
fenetres . create . getTextNodeSelect ( ) . afficheChargementFichierAnalyse ( ) ;
dispose ( ) ;
}
}
} ) ;
lblNewLabel_14 = new JLabel ( " <html>La date et heure du début du contrôle.<br>C'est la date de modification qui doit être la plus ancienne dans le fichier des étudiants.</html> " ) ;
lblNewLabel_14 . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
contentPane . add ( lblNewLabel_14 , " cell 4 13,alignx left " ) ;
textField_dateModificationMini = new JTextField ( ) ;
textField_dateModificationMini . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
contentPane . add ( textField_dateModificationMini , " cell 5 13,grow " ) ;
textField_dateModificationMini . setColumns ( 10 ) ;
btnAidecontrole_dateModificationMini = new JButton ( " " ) ;
btnAidecontrole_dateModificationMini . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
JOptionPane . showInternalMessageDialog ( null , " <html>Si vous indiquez une date, alors toutes les dates "
+ " <br>de modification dans un fichier doivent être postérieures à la date indiquée.<html> " ) ;
}
} ) ;
btnAidecontrole_dateModificationMini . setIcon ( new ImageIcon ( proprieteFichierAnalyse . class . getResource ( " /resources/whatmini.png " ) ) ) ;
contentPane . add ( btnAidecontrole_dateModificationMini , " cell 6 13,aligny top " ) ;
lblNewLabel_15 = new JLabel ( " <html>La date des modifications doit être postérieures à la date du début du contrôle.</html> " ) ;
lblNewLabel_15 . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
contentPane . add ( lblNewLabel_15 , " cell 4 14,alignx left " ) ;
comboBoxcontrole_modificationDateMini = new JComboBox < String > ( ) ;
comboBoxcontrole_modificationDateMini . setModel ( new DefaultComboBoxModel < String > ( new String [ ] { " false " , " true " } ) ) ;
comboBoxcontrole_modificationDateMini . setFont ( new Font ( " Tahoma " , Font . BOLD , 12 ) ) ;
contentPane . add ( comboBoxcontrole_modificationDateMini , " cell 5 14,growx " ) ;
btnAidecontrole_dateModificationMini = new JButton ( " " ) ;
btnAidecontrole_dateModificationMini . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
JOptionPane . showInternalMessageDialog ( null , " <html>Si vrai, alors les dates "
+ " des modifications dans un fichier<br>doivent être postérieures à la date indiquée.<html> " ) ;
}
} ) ;
btnAidecontrole_dateModificationMini . setIcon ( new ImageIcon ( proprieteFichierAnalyse . class . getResource ( " /resources/whatmini.png " ) ) ) ;
contentPane . add ( btnAidecontrole_dateModificationMini , " cell 6 14 " ) ;
2023-02-14 21:32:36 +01:00
2022-06-02 15:47:54 +02:00
if ( commandes . sujet . getAttributs ( ) . get ( " creationDate " ) ! = null ) {
textFieldDateCreation . setText ( commandes . sujet . getAttributs ( ) . get ( " creationDate " ) ) ;
}
if ( commandes . sujet . getAttributs ( ) . get ( " controleDateCreation " ) ! = null ) {
comboBoxcontroleDateCreation . setSelectedItem ( commandes . sujet . getAttributs ( ) . get ( " controleDateCreation " ) . toLowerCase ( ) ) ;
}
if ( commandes . sujet . getAttributs ( ) . get ( " Initial_Creator " ) ! = null ) {
textFieldInitial_Creator . setText ( commandes . sujet . getAttributs ( ) . get ( " Initial_Creator " ) ) ;
}
if ( commandes . sujet . getAttributs ( ) . get ( " controle_Initial_Creator " ) ! = null ) {
comboBoxcontrole_Initial_Creator . setSelectedItem ( commandes . sujet . getAttributs ( ) . get ( " controle_Initial_Creator " ) . toLowerCase ( ) ) ;
}
2023-02-11 09:43:12 +01:00
if ( commandes . sujet . getAttributs ( ) . get ( " modificationDateMini " ) ! = null ) {
textField_dateModificationMini . setText ( commandes . sujet . getAttributs ( ) . get ( " modificationDateMini " ) ) ;
}
if ( commandes . sujet . getAttributs ( ) . get ( " controleDateModificationMini " ) ! = null ) {
comboBoxcontrole_modificationDateMini . setSelectedItem ( commandes . sujet . getAttributs ( ) . get ( " controleDateModificationMini " ) . toLowerCase ( ) ) ;
}
2023-02-14 21:32:36 +01:00
if ( commandes . sujet . getAttributs ( ) . get ( " metaSujet " ) ! = null ) {
textFieldMetaSujet . setText ( commandes . sujet . getAttributs ( ) . get ( " metaSujet " ) ) ;
}
2022-06-02 15:47:54 +02:00
if ( commandes . sujet . getAttributs ( ) . get ( " link_help " ) ! = null ) {
textFieldlink_help . setText ( commandes . sujet . getAttributs ( ) . get ( " link_help " ) ) ;
}
2022-12-07 20:44:00 +01:00
if ( commandes . sujet . getAttributs ( ) . get ( " link_sujet " ) ! = null ) {
textFieldlink_sujet . setText ( commandes . sujet . getAttributs ( ) . get ( " link_sujet " ) ) ;
}
2023-02-14 21:32:36 +01:00
if ( commandes . sujet . getAttributs ( ) . get ( " notefrom " ) ! = null ) {
textFieldNoteFrom . setText ( commandes . sujet . getAttributs ( ) . get ( " notefrom " ) ) ;
2022-12-01 14:40:55 +01:00
}
2023-02-14 21:32:36 +01:00
if ( commandes . sujet . getAttributs ( ) . get ( " progression " ) ! = null ) {
textFieldProgression . setText ( commandes . sujet . getAttributs ( ) . get ( " progression " ) ) ;
}
if ( commandes . sujet . getAttributs ( ) . get ( " historiquePresent " ) ! = null ) {
comboBoxhistoriquePresent . setSelectedItem ( commandes . sujet . getAttributs ( ) . get ( " historiquePresent " ) . toLowerCase ( ) ) ;
}
if ( commandes . sujet . getAttributs ( ) . get ( " titre " ) ! = null ) {
textFieldTitre . setText ( commandes . sujet . getAttributs ( ) . get ( " titre " ) ) ;
}
if ( commandes . sujet . getAttributs ( ) . get ( " auteur " ) ! = null ) {
textFieldAuteur . setText ( commandes . sujet . getAttributs ( ) . get ( " auteur " ) ) ;
}
if ( commandes . sujet . getAttributs ( ) . get ( " presenceMetaSujet " ) ! = null ) {
comboBoxPresenceMetaSujet . setSelectedItem ( commandes . sujet . getAttributs ( ) . get ( " presenceMetaSujet " ) . toLowerCase ( ) ) ;
}
if ( commandes . sujet . getAttributs ( ) . get ( " baremeABC " ) ! = null ) {
comboBoxBaremeABC . setSelectedItem ( commandes . sujet . getAttributs ( ) . get ( " baremeABC " ) . toLowerCase ( ) ) ;
}
2022-07-07 15:48:56 +02:00
/ * *
* Fermeture de la fenêtre .
* /
addWindowListener ( new java . awt . event . WindowAdapter ( ) {
@Override
public void windowClosing ( java . awt . event . WindowEvent windowEvent ) {
if ( JOptionPane . showConfirmDialog ( null , " Voulez-vous quitter cette fenêtre? " , " Quitter " , JOptionPane . YES_NO_OPTION , JOptionPane . QUESTION_MESSAGE ) = = JOptionPane . YES_OPTION ) {
dispose ( ) ;
} ;
}
} ) ;
2022-06-02 15:47:54 +02:00
Refresh ( ) ;
this . setVisible ( true ) ;
}
2022-06-16 17:41:16 +02:00
/ * *
* Lorsque le combobox du barème ABC est sélectionner .
* /
2022-06-02 15:47:54 +02:00
private void Refresh ( ) {
2022-06-13 17:43:41 +02:00
if ( comboBoxBaremeABC . getSelectedItem ( ) . equals ( " true " ) ) {
2022-06-02 15:47:54 +02:00
textFieldNoteFrom . setEditable ( false ) ;
} else {
textFieldNoteFrom . setEditable ( true ) ;
}
}
2022-06-13 17:43:41 +02:00
/ * *
* Retourn true si pas d ' erreur dans le coefficient de progression
* @return
* /
private boolean verifCoefProgression ( ) {
double progression ;
try {
progression = Double . valueOf ( textFieldProgression . getText ( ) ) ;
} catch ( Exception e ) {
JOptionPane . showMessageDialog ( null , " Le coef. de progression doit être une valeur numérique. " ) ;
return false ;
}
if ( progression < 0 ) {
JOptionPane . showMessageDialog ( null , " Le coef. de progression doit être positif. " ) ;
return false ;
}
if ( progression > 100 ) {
JOptionPane . showMessageDialog ( null , " Le coef. de progression doit être inférieur strictement à 10. " ) ;
return false ;
}
return true ;
}
/ * *
* Retourne true si pas d ' erreur dans le barème . < br >
* @return
* /
private boolean verifBareme ( ) {
double bareme ;
try {
bareme = Double . valueOf ( textFieldNoteFrom . getText ( ) ) ;
} catch ( Exception e ) {
JOptionPane . showMessageDialog ( null , " Le barème doit être une valeur numérique. " ) ;
return false ;
}
if ( bareme < 0 ) {
JOptionPane . showMessageDialog ( null , " Le barème doit être positif. " ) ;
return false ;
}
return true ;
}
2023-02-11 15:49:22 +01:00
/ * *
* Ouverture de la fenêtre , une seule instance . < / br >
* @return
* /
2022-06-19 21:01:30 +02:00
public static proprieteFichierAnalyse getInstance ( ) {
if ( instance = = null ) {
instance = new proprieteFichierAnalyse ( ) ;
}
2022-07-07 15:48:56 +02:00
instance . actualise ( ) ;
2022-06-19 21:01:30 +02:00
instance . setVisible ( true ) ;
return instance ;
}
2022-06-13 17:43:41 +02:00
2023-02-11 15:49:22 +01:00
/ * *
* Vérification de l ' ensemble textField_dateModificationMini et comboBoxcontrole_modificationDateMini . < / br >
* La date de début de contrôle . < / br >
* @return
* /
private boolean VerificationDateDuControle ( ) {
2023-02-12 17:12:11 +01:00
if ( textField_dateModificationMini . getText ( ) . isBlank ( ) & & comboBoxcontrole_modificationDateMini . getSelectedItem ( ) . equals ( " false " ) ) {
2023-02-11 15:49:22 +01:00
return true ;
}
if ( formatDateWriter . isCorrect ( textField_dateModificationMini . getText ( ) ) ) {
return true ;
}
JOptionPane . showMessageDialog ( null , " La date du début du contrôle n'est pas correcte. " ) ;
return false ;
}
2022-07-07 15:48:56 +02:00
2023-02-11 15:49:22 +01:00
/ * *
* Actualisation des zone de texte et des combos à l ' ouverture de la fenêtre . < / br >
* /
2022-07-07 15:48:56 +02:00
public void actualise ( ) {
if ( commandes . sujet . getAttributs ( ) . get ( " titre " ) ! = null ) {
textFieldTitre . setText ( commandes . sujet . getAttributs ( ) . get ( " titre " ) ) ;
} else {
textFieldTitre . setText ( " " ) ;
}
if ( commandes . sujet . getAttributs ( ) . get ( " auteur " ) ! = null ) {
textFieldAuteur . setText ( commandes . sujet . getAttributs ( ) . get ( " auteur " ) ) ;
} else {
textFieldAuteur . setText ( " " ) ;
}
if ( commandes . sujet . getAttributs ( ) . get ( " metaSujet " ) ! = null ) {
textFieldMetaSujet . setText ( commandes . sujet . getAttributs ( ) . get ( " metaSujet " ) ) ;
} else {
textFieldMetaSujet . setText ( " " ) ;
}
if ( commandes . sujet . getAttributs ( ) . get ( " notefrom " ) ! = null ) {
textFieldNoteFrom . setText ( commandes . sujet . getAttributs ( ) . get ( " notefrom " ) ) ;
} else {
textFieldNoteFrom . setText ( " " ) ;
}
if ( commandes . sujet . getAttributs ( ) . get ( " progression " ) ! = null ) {
textFieldProgression . setText ( commandes . sujet . getAttributs ( ) . get ( " progression " ) ) ;
} else {
textFieldProgression . setText ( " " ) ;
}
if ( commandes . sujet . getAttributs ( ) . get ( " creationDate " ) ! = null ) {
textFieldDateCreation . setText ( commandes . sujet . getAttributs ( ) . get ( " creationDate " ) ) ;
} else {
textFieldDateCreation . setText ( " " ) ;
}
2023-02-11 09:43:12 +01:00
if ( commandes . sujet . getAttributs ( ) . get ( " modificationDateMini " ) ! = null ) {
textField_dateModificationMini . setText ( commandes . sujet . getAttributs ( ) . get ( " modificationDateMini " ) ) ;
} else {
textField_dateModificationMini . setText ( " " ) ;
}
2022-07-07 15:48:56 +02:00
if ( commandes . sujet . getAttributs ( ) . get ( " presenceMetaSujet " ) ! = null ) {
comboBoxPresenceMetaSujet . setSelectedItem ( commandes . sujet . getAttributs ( ) . get ( " presenceMetaSujet " ) . toLowerCase ( ) ) ;
} else {
comboBoxPresenceMetaSujet . setSelectedItem ( String . valueOf ( commandes . analyse_presenceMetaSujet ) ) ;
}
if ( commandes . sujet . getAttributs ( ) . get ( " baremeABC " ) ! = null ) {
comboBoxBaremeABC . setSelectedItem ( commandes . sujet . getAttributs ( ) . get ( " baremeABC " ) . toLowerCase ( ) ) ;
} else {
comboBoxBaremeABC . setSelectedItem ( String . valueOf ( commandes . analyse_baremeABC ) ) ;
}
if ( commandes . sujet . getAttributs ( ) . get ( " historiquePresent " ) ! = null ) {
comboBoxhistoriquePresent . setSelectedItem ( commandes . sujet . getAttributs ( ) . get ( " historiquePresent " ) . toLowerCase ( ) ) ;
} else {
comboBoxhistoriquePresent . setSelectedItem ( String . valueOf ( commandes . analyse_historiquePresent ) ) ;
}
if ( commandes . sujet . getAttributs ( ) . get ( " controle_Initial_Creator " ) ! = null ) {
comboBoxcontrole_Initial_Creator . setSelectedItem ( commandes . sujet . getAttributs ( ) . get ( " controle_Initial_Creator " ) . toLowerCase ( ) ) ;
} else {
comboBoxcontrole_Initial_Creator . setSelectedItem ( String . valueOf ( commandes . analyse_controle_Initial_Creator ) ) ;
}
if ( commandes . sujet . getAttributs ( ) . get ( " controleDateCreation " ) ! = null ) {
comboBoxcontroleDateCreation . setSelectedItem ( commandes . sujet . getAttributs ( ) . get ( " controleDateCreation " ) . toLowerCase ( ) ) ;
} else {
comboBoxcontroleDateCreation . setSelectedItem ( String . valueOf ( commandes . analyse_controleDateCreation ) ) ;
}
2023-02-11 09:43:12 +01:00
if ( commandes . sujet . getAttributs ( ) . get ( " controleDateModificationMini " ) ! = null ) {
comboBoxcontrole_modificationDateMini . setSelectedItem ( commandes . sujet . getAttributs ( ) . get ( " controleDateModificationMini " ) . toLowerCase ( ) ) ;
} else {
comboBoxcontrole_modificationDateMini . setSelectedItem ( String . valueOf ( commandes . analyse_controleDateModificationMini ) ) ;
}
2022-07-07 15:48:56 +02:00
}
2022-06-02 15:47:54 +02:00
}