2022-06-19 21:01:30 +02:00
package fenetres ;
2022-05-24 18:25:41 +02:00
import java.awt.BorderLayout ;
2022-12-07 20:44:00 +01:00
import java.awt.Color ;
2022-05-25 09:30:49 +02:00
import java.awt.Font ;
2023-04-01 09:54:28 +02:00
import java.awt.GridLayout ;
2022-05-25 09:30:49 +02:00
import java.awt.event.ActionEvent ;
2022-12-07 20:44:00 +01:00
import java.awt.event.ActionListener ;
import java.awt.event.InputEvent ;
2022-05-28 19:13:25 +02:00
import java.awt.event.KeyEvent ;
import javax.swing.AbstractAction ;
import javax.swing.Action ;
2022-05-25 09:30:49 +02:00
import javax.swing.ImageIcon ;
import javax.swing.JButton ;
import javax.swing.JCheckBox ;
import javax.swing.JFileChooser ;
2022-05-24 18:25:41 +02:00
import javax.swing.JFrame ;
2022-05-25 09:30:49 +02:00
import javax.swing.JLabel ;
2022-12-07 20:44:00 +01:00
import javax.swing.JMenu ;
import javax.swing.JMenuBar ;
2023-04-01 09:54:28 +02:00
import javax.swing.JMenuItem ;
2022-12-07 20:44:00 +01:00
import javax.swing.JOptionPane ;
2022-05-24 18:25:41 +02:00
import javax.swing.JPanel ;
2022-12-07 20:44:00 +01:00
import javax.swing.JScrollPane ;
2022-05-25 09:30:49 +02:00
import javax.swing.JToolBar ;
2022-05-28 19:13:25 +02:00
import javax.swing.KeyStroke ;
2022-12-07 20:44:00 +01:00
import javax.swing.SwingConstants ;
2022-12-10 11:16:34 +01:00
import javax.swing.UnsupportedLookAndFeelException ;
2022-05-24 18:25:41 +02:00
import javax.swing.border.EmptyBorder ;
2022-12-07 20:44:00 +01:00
import javax.swing.event.ChangeEvent ;
import javax.swing.event.ChangeListener ;
2022-05-25 21:22:38 +02:00
import javax.swing.filechooser.FileNameExtensionFilter ;
2022-05-24 18:25:41 +02:00
import MEPTL.commandes ;
import MEPTL.meptl ;
2024-04-09 14:50:03 +02:00
import MEPTL.verificationFichierAnalyse_node_commandesSujet ;
2023-02-05 17:46:02 +01:00
import action.actAbout ;
import action.actDocumentation ;
2023-04-01 09:54:28 +02:00
import action.actExit ;
2023-02-05 17:46:02 +01:00
import action.actLicence ;
2023-04-01 09:54:28 +02:00
import action.actOpenBaseEvaluation ;
import action.actSaveEvaluation ;
2023-02-05 17:46:02 +01:00
import action.actTutoriels ;
2022-05-27 11:40:08 +02:00
import cXML.Run ;
import cXML.node ;
2023-02-14 21:32:36 +01:00
import evaluer.evaluerLesFichiersEtudiants ;
2022-05-26 20:10:24 +02:00
import net.miginfocom.swing.MigLayout ;
2022-06-19 21:01:30 +02:00
2022-12-11 08:30:19 +01:00
/ * *
*
* @author pablo rodriguez
*
* /
2022-05-24 18:25:41 +02:00
public class evaluate extends JFrame {
2022-05-31 19:37:46 +02:00
/ * *
*
* /
private static final long serialVersionUID = 1L ;
2022-06-03 21:30:14 +02:00
2022-05-24 18:25:41 +02:00
/ * *
*
* /
2022-06-03 21:30:14 +02:00
private JToolBar toolBar ;
2022-12-16 19:29:12 +01:00
private JPanel contentPane ;
2022-12-29 20:58:04 +01:00
private static JLabel lblPath ;
private static JLabel lblFileAnalyse ;
2024-03-01 22:30:17 +01:00
// private static JLabel lblFichierCSV;
2022-12-29 20:58:04 +01:00
private static JLabel lblFichierSVG ;
private static JLabel lblChargementFichierCSV ;
private static JLabel lblImageDossierEtudiant ;
private static JLabel lblNoFeedBack ;
private static JLabel lblNoDeatail ;
private static JLabel lblnonote ;
private static JLabel lblnozip ;
private static JLabel lblVerifHistorique ;
private static JLabel lblnologo ;
private static JLabel lblCsvNote ;
2023-04-01 09:54:28 +02:00
private static JLabel lblNameEvaluation ;
2022-12-29 20:58:04 +01:00
private static JCheckBox chckbxfichiersEtudiants ;
private static JCheckBox chckbxZipfeedback ;
private static JCheckBox chckbxnoFeedback ;
private static JCheckBox chckbxNoNote ;
private static JCheckBox chckCSVNotes ;
private static JCheckBox chckbxNoLogo ;
private static JCheckBox chckbxVerif ;
private static JCheckBox chckbxNewLogo ;
private static JCheckBox chckbxNoDetail ;
2024-04-20 11:17:53 +02:00
private static JCheckBox chckPasDeProgression = new JCheckBox ( " Ne pas afficher le coef. de progression " ) ;
2022-12-11 08:30:19 +01:00
private static afficheText txtpnmessages ;
2023-04-01 09:54:28 +02:00
private JButton btnChargeEvaluation = new JButton ( ) ;
private JButton btnSaveEvaluation = new JButton ( ) ;
2022-05-25 18:21:23 +02:00
2022-12-10 11:16:34 +01:00
private static evaluate instance ;
2023-02-18 18:05:42 +01:00
public static boolean isDispose = true ;
2022-12-10 11:16:34 +01:00
2022-05-24 18:25:41 +02:00
/ * *
* Create the frame .
* /
2022-12-10 11:16:34 +01:00
public void initialize ( ) throws UnsupportedLookAndFeelException {
2023-04-01 09:54:28 +02:00
setSize ( 1600 , 900 ) ;
2022-12-10 11:16:34 +01:00
2022-05-26 20:10:24 +02:00
ImageIcon img = new ImageIcon ( getClass ( ) . getResource ( " /evalwriter.png " ) ) ;
this . setIconImage ( img . getImage ( ) ) ;
2022-06-06 18:59:42 +02:00
setTitle ( commandes . Titre + " " + commandes . version + " " + commandes . branch ) ;
2022-12-10 11:16:34 +01:00
setLocationRelativeTo ( null ) ;
2022-06-15 08:03:17 +02:00
setDefaultCloseOperation ( JFrame . DO_NOTHING_ON_CLOSE ) ;
2022-12-10 11:16:34 +01:00
// setBounds(100, 100, 980, 700);
2022-06-09 09:13:46 +02:00
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 ) ;
2022-05-27 11:40:08 +02:00
2022-06-03 21:30:14 +02:00
createMenu ( ) ;
createToolBar ( ) ;
2022-05-27 11:40:08 +02:00
2022-05-28 19:13:25 +02:00
contentPane = new JPanel ( ) ;
contentPane . setBorder ( new EmptyBorder ( 5 , 5 , 5 , 5 ) ) ;
setContentPane ( contentPane ) ;
contentPane . setLayout ( new BorderLayout ( 0 , 0 ) ) ;
2022-05-27 11:40:08 +02:00
2023-04-01 09:54:28 +02:00
JPanel panelNord = new JPanel ( ) ;
contentPane . add ( panelNord , BorderLayout . NORTH ) ;
panelNord . setLayout ( new GridLayout ( 1 , 1 , 0 , 0 ) ) ;
2022-06-03 21:30:14 +02:00
2023-04-01 09:54:28 +02:00
panelNord . add ( toolBar ) ;
2022-06-03 21:30:14 +02:00
2023-04-01 09:54:28 +02:00
JPanel panelWestBase = new JPanel ( ) ;
panelWestBase . setLayout ( new BorderLayout ( 0 , 0 ) ) ;
contentPane . add ( panelWestBase , BorderLayout . WEST ) ;
JPanel panelWestBaseNord = new JPanel ( ) ;
GridLayout gl_panelWestBaseNord = new GridLayout ( ) ;
gl_panelWestBaseNord . setRows ( 4 ) ;
panelWestBaseNord . setLayout ( gl_panelWestBaseNord ) ;
panelWestBase . add ( panelWestBaseNord , BorderLayout . NORTH ) ;
JPanel panelBoutons = new JPanel ( ) ;
panelWestBase . add ( panelBoutons , BorderLayout . WEST ) ;
panelBoutons . setLayout ( new MigLayout ( " " , " [24px][260px] " , " [][][][][][][][][][][][][][][] " ) ) ;
2022-05-28 19:13:25 +02:00
2022-12-16 17:50:51 +01:00
ImageIcon imgDossierEtudiant = new ImageIcon ( getClass ( ) . getResource ( " /dossieretudiant.png " ) ) ;
2022-05-25 15:28:58 +02:00
2023-04-01 09:54:28 +02:00
JLabel lblIconAccueilEvaluation = new JLabel ( " " ) ;
lblIconAccueilEvaluation . setVerticalAlignment ( SwingConstants . TOP ) ;
lblIconAccueilEvaluation . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/accueil evaluation.png " ) ) ) ;
lblIconAccueilEvaluation . setHorizontalAlignment ( SwingConstants . LEFT ) ;
panelWestBaseNord . add ( lblIconAccueilEvaluation , BorderLayout . NORTH ) ;
lblNameEvaluation = new JLabel ( " <html><b><u>Evalution</u> :</b></html> " ) ;
panelWestBaseNord . add ( lblNameEvaluation ) ;
lblNameEvaluation . setFont ( new Font ( " Tahoma " , Font . PLAIN , 14 ) ) ;
2022-05-25 15:28:58 +02:00
lblFileAnalyse = new JLabel ( " <HTML><B><U>Fichier de l'analyse</U></B> : </HTML> " ) ;
2023-04-01 09:54:28 +02:00
panelWestBaseNord . add ( lblFileAnalyse ) ;
2022-05-25 15:28:58 +02:00
lblFileAnalyse . setHorizontalAlignment ( SwingConstants . LEFT ) ;
2023-04-01 09:54:28 +02:00
lblFileAnalyse . setFont ( new Font ( " Tahoma " , Font . PLAIN , 14 ) ) ;
lblPath = new JLabel ( ) ;
panelWestBaseNord . add ( lblPath ) ;
lblPath . setHorizontalAlignment ( SwingConstants . LEFT ) ;
lblPath . setFont ( new Font ( " Tahoma " , Font . PLAIN , 14 ) ) ;
lblPath . setText ( " <HTML><B><U>Dossier de l'évaluation</U></B> : </HTML> " ) ;
// panelWestBaseNord.add("");
2022-05-25 21:22:38 +02:00
2022-12-05 20:50:39 +01:00
chckbxfichiersEtudiants = new JCheckBox ( " <HTML>Les fichiers des étudiants<BR><b>ne sont pas</b> dans des dossiers nominatifs<HTML> " ) ;
2022-11-13 11:57:18 +01:00
chckbxfichiersEtudiants . addChangeListener ( new ChangeListener ( ) {
2022-06-09 17:49:22 +02:00
public void stateChanged ( ChangeEvent e ) {
2022-11-13 11:57:18 +01:00
if ( chckbxfichiersEtudiants . isSelected ( ) ) {
2022-06-09 17:49:22 +02:00
commandes . fichierStudentMoodle = true ;
2022-12-16 17:50:51 +01:00
lblImageDossierEtudiant . setIcon ( new ImageIcon ( getClass ( ) . getResource ( " /resources/fichieretudiant.png " ) ) ) ;
2022-06-09 17:49:22 +02:00
} else {
commandes . fichierStudentMoodle = false ;
2022-12-16 17:50:51 +01:00
lblImageDossierEtudiant . setIcon ( new ImageIcon ( getClass ( ) . getResource ( " /resources/dossieretudiant.png " ) ) ) ;
2022-06-09 17:49:22 +02:00
}
}
} ) ;
2024-04-20 11:17:53 +02:00
panelBoutons . add ( chckPasDeProgression , " cell 1 0 " ) ;
chckPasDeProgression . setSelected ( commandes . noAfficheProgression ) ;
chckPasDeProgression . addChangeListener ( new ChangeListener ( ) {
public void stateChanged ( ChangeEvent e ) {
if ( chckPasDeProgression . isSelected ( ) ) {
commandes . noAfficheProgression = true ;
} else {
commandes . noAfficheProgression = false ;
}
}
} ) ;
2023-04-01 09:54:28 +02:00
lblImageDossierEtudiant = new JLabel ( imgDossierEtudiant ) ;
panelBoutons . add ( lblImageDossierEtudiant , " flowx,cell 0 1,alignx left,aligny center " ) ;
2022-11-13 11:57:18 +01:00
chckbxfichiersEtudiants . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
chckbxfichiersEtudiants . setToolTipText ( " Cochez si les fichiers des étudiants ne sont pas dans des dossier nominatifs " ) ;
2023-04-01 09:54:28 +02:00
panelBoutons . add ( chckbxfichiersEtudiants , " cell 1 1,growx,aligny center " ) ;
2022-12-03 11:02:05 +01:00
chckbxfichiersEtudiants . setSelected ( commandes . fichierStudentMoodle ) ;
2023-04-01 09:54:28 +02:00
ImageIcon imgDNoFeedBack = new ImageIcon ( getClass ( ) . getResource ( " /resources/feedbackstudent.png " ) ) ;
2022-05-24 18:25:41 +02:00
chckbxnoFeedback = new JCheckBox ( " Pas de feedback " ) ;
2022-06-09 17:49:22 +02:00
chckbxnoFeedback . addChangeListener ( new ChangeListener ( ) {
public void stateChanged ( ChangeEvent e ) {
if ( chckbxnoFeedback . isSelected ( ) ) {
2022-12-16 17:50:51 +01:00
lblNoFeedBack . setIcon ( new ImageIcon ( getClass ( ) . getResource ( " /resources/nofeedbackstudent.png " ) ) ) ;
2022-06-09 17:49:22 +02:00
commandes . sansFeeback = true ;
} else {
2022-12-16 17:50:51 +01:00
lblNoFeedBack . setIcon ( new ImageIcon ( getClass ( ) . getResource ( " /resources/feedbackstudent.png " ) ) ) ;
2022-06-09 17:49:22 +02:00
commandes . sansFeeback = false ;
}
}
} ) ;
2022-12-03 16:14:35 +01:00
2022-12-16 17:50:51 +01:00
lblNoFeedBack = new JLabel ( imgDNoFeedBack ) ;
2023-04-01 09:54:28 +02:00
panelBoutons . add ( lblNoFeedBack , " cell 0 2 " ) ;
2022-12-16 17:50:51 +01:00
2022-05-27 11:40:08 +02:00
chckbxnoFeedback . setToolTipText ( " Cochez si vous ne voulez pas générer des feedbacks " ) ;
2022-05-24 18:25:41 +02:00
chckbxnoFeedback . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
2023-04-01 09:54:28 +02:00
panelBoutons . add ( chckbxnoFeedback , " cell 1 2,growx,aligny top " ) ;
2022-12-03 11:02:05 +01:00
chckbxnoFeedback . setSelected ( commandes . sansFeeback ) ;
2023-04-01 09:54:28 +02:00
ImageIcon imgDNoDetail = new ImageIcon ( getClass ( ) . getResource ( " /resources/detailfeedback.png " ) ) ;
2022-12-03 11:02:05 +01:00
2022-12-03 16:14:35 +01:00
chckbxNoDetail = new JCheckBox ( " Pas de détails dans les feedbacks " ) ;
chckbxNoDetail . addChangeListener ( new ChangeListener ( ) {
2022-06-09 17:49:22 +02:00
public void stateChanged ( ChangeEvent e ) {
2022-12-03 16:14:35 +01:00
if ( chckbxNoDetail . isSelected ( ) ) {
2022-12-16 17:50:51 +01:00
lblNoDeatail . setIcon ( new ImageIcon ( getClass ( ) . getResource ( " /resources/nodetailfeedback.png " ) ) ) ;
2022-12-03 16:14:35 +01:00
commandes . noDetail = true ;
2022-06-09 17:49:22 +02:00
} else {
2022-12-16 17:50:51 +01:00
lblNoDeatail . setIcon ( new ImageIcon ( getClass ( ) . getResource ( " /resources/detailfeedback.png " ) ) ) ;
2022-12-03 16:14:35 +01:00
commandes . noDetail = false ;
2022-06-09 17:49:22 +02:00
}
}
} ) ;
2022-12-16 17:50:51 +01:00
lblNoDeatail = new JLabel ( imgDNoDetail ) ;
2023-04-01 09:54:28 +02:00
panelBoutons . add ( lblNoDeatail , " cell 0 3 " ) ;
2022-12-03 16:14:35 +01:00
chckbxNoDetail . setToolTipText ( " Cochez si vous voulez que la table synthèse dans les feedbacks " ) ;
chckbxNoDetail . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
2023-04-01 09:54:28 +02:00
panelBoutons . add ( chckbxNoDetail , " cell 1 3,growx,aligny top " ) ;
2022-12-03 16:14:35 +01:00
chckbxNoDetail . setSelected ( commandes . noDetail ) ;
2022-12-03 11:02:05 +01:00
2022-05-24 18:25:41 +02:00
2022-12-16 19:29:12 +01:00
lblnonote = new JLabel ( " " ) ;
lblnonote . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/notestudent.png " ) ) ) ;
2023-04-01 09:54:28 +02:00
panelBoutons . add ( lblnonote , " cell 0 4 " ) ;
2022-05-24 18:25:41 +02:00
chckbxNoNote = new JCheckBox ( " Pas de note dans les feedbacks " ) ;
2022-12-16 19:29:12 +01:00
chckbxNoNote . setToolTipText ( " Cochez si vous voulez pas faire apparaître les notes dans les feedbacks " ) ;
chckbxNoNote . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
chckbxNoNote . setSelected ( commandes . noNote ) ;
2023-04-01 09:54:28 +02:00
panelBoutons . add ( chckbxNoNote , " cell 1 4,grow " ) ;
2022-06-09 17:49:22 +02:00
chckbxNoNote . addChangeListener ( new ChangeListener ( ) {
public void stateChanged ( ChangeEvent e ) {
if ( chckbxNoNote . isSelected ( ) ) {
2022-12-16 19:29:12 +01:00
lblnonote . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/nonotestudent.png " ) ) ) ;
2022-06-09 17:49:22 +02:00
commandes . noNote = true ;
} else {
2022-12-16 19:29:12 +01:00
lblnonote . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/notestudent.png " ) ) ) ;
2022-06-09 17:49:22 +02:00
commandes . noNote = false ;
}
}
} ) ;
2022-12-03 11:02:05 +01:00
2022-05-25 18:21:23 +02:00
2024-04-20 11:17:53 +02:00
2022-12-16 19:29:12 +01:00
lblnozip = new JLabel ( " " ) ;
lblnozip . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/zipstudent.png " ) ) ) ;
2023-04-01 09:54:28 +02:00
panelBoutons . add ( lblnozip , " cell 0 5 " ) ;
2022-12-03 16:14:35 +01:00
chckbxZipfeedback = new JCheckBox ( " Zip les feedbacks " ) ;
2022-12-16 19:29:12 +01:00
chckbxZipfeedback . setToolTipText ( " Cochez si vous voulez placer tous les feedbacks dans une archive ZIP " ) ;
chckbxZipfeedback . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
2023-04-01 09:54:28 +02:00
panelBoutons . add ( chckbxZipfeedback , " cell 1 5,grow " ) ;
2022-12-16 19:29:12 +01:00
chckbxZipfeedback . setSelected ( commandes . zipfeedback ) ;
2022-12-03 16:14:35 +01:00
chckbxZipfeedback . addChangeListener ( new ChangeListener ( ) {
2022-06-09 17:49:22 +02:00
public void stateChanged ( ChangeEvent e ) {
2022-12-03 16:14:35 +01:00
if ( chckbxZipfeedback . isSelected ( ) ) {
2022-12-17 17:11:22 +01:00
lblnozip . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/zipstudent.png " ) ) ) ;
2022-12-03 16:14:35 +01:00
commandes . zipfeedback = true ;
2022-06-09 17:49:22 +02:00
} else {
2022-12-17 17:11:22 +01:00
lblnozip . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/nozipstudent.png " ) ) ) ;
2022-12-03 16:14:35 +01:00
commandes . zipfeedback = false ;
2022-06-09 17:49:22 +02:00
}
}
} ) ;
2022-12-17 17:11:22 +01:00
chckbxVerif = new JCheckBox ( " Vérification des historiques avant analyse " ) ;
chckbxVerif . addChangeListener ( new ChangeListener ( ) {
public void stateChanged ( ChangeEvent e ) {
if ( chckbxVerif . isSelected ( ) ) {
lblVerifHistorique . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/verifhistoriquestudent.png " ) ) ) ;
commandes . verifHisto2 = true ;
} else {
lblVerifHistorique . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/noverifhistoriquestudent.png " ) ) ) ;
commandes . verifHisto2 = false ;
}
}
} ) ;
2023-04-01 09:54:28 +02:00
lblVerifHistorique = new JLabel ( " " ) ;
lblVerifHistorique . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/noverifhistoriquestudent.png " ) ) ) ;
panelBoutons . add ( lblVerifHistorique , " cell 0 6 " ) ;
2022-12-03 11:02:05 +01:00
chckbxVerif . setToolTipText ( " Cochez si vous voulez vérifier les échanges de fichiers entre les étudiants. " ) ;
chckbxVerif . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
2023-04-01 09:54:28 +02:00
panelBoutons . add ( chckbxVerif , " flowy,cell 1 6,growx,aligny top " ) ;
2022-12-03 11:02:05 +01:00
chckbxVerif . setSelected ( commandes . verifHisto2 ) ;
2022-12-01 13:04:20 +01:00
2022-12-17 17:11:22 +01:00
2024-03-01 22:30:17 +01:00
lblChargementFichierCSV = new JLabel ( " Pas de liste des étudiants " ) ;
2023-04-01 09:54:28 +02:00
panelBoutons . add ( lblChargementFichierCSV , " cell 1 7,alignx left,aligny center " ) ;
2022-12-03 16:14:35 +01:00
2024-03-01 22:30:17 +01:00
// lblFichierCSV = new JLabel("<HTML><B><U>Fichier CSV liste des étudiants</U></B></HTML> :");
// lblFichierCSV.setFont(new Font("Tahoma", Font.BOLD, 14));
// panelBoutons.add(lblFichierCSV, "cell 1 8,grow");
2022-12-18 16:22:56 +01:00
lblCsvNote = new JLabel ( " " ) ;
lblCsvNote . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/nocsvstudent.png " ) ) ) ;
2023-04-01 09:54:28 +02:00
panelBoutons . add ( lblCsvNote , " cell 0 9 " ) ;
chckCSVNotes = new JCheckBox ( " Créer un fichier CSV des notes " ) ;
2022-12-18 16:22:56 +01:00
chckCSVNotes . setToolTipText ( " Cochez si vous voulez importer les notes dans un fichier CSV. " ) ;
2023-04-01 09:54:28 +02:00
panelBoutons . add ( chckCSVNotes , " flowx,cell 1 9,grow " ) ;
2022-12-18 16:22:56 +01:00
chckCSVNotes . setSelected ( commandes . ecritNoteCSV ) ;
2022-12-03 16:14:35 +01:00
chckCSVNotes . addChangeListener ( new ChangeListener ( ) {
2022-12-01 13:04:20 +01:00
public void stateChanged ( ChangeEvent e ) {
2022-12-03 16:14:35 +01:00
if ( chckCSVNotes . isSelected ( ) ) {
2022-12-18 16:22:56 +01:00
lblCsvNote . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/csvstudent.png " ) ) ) ;
2022-12-03 16:14:35 +01:00
commandes . ecritNoteCSV = true ;
2022-12-01 13:04:20 +01:00
} else {
2022-12-18 16:22:56 +01:00
lblCsvNote . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/nocsvstudent.png " ) ) ) ;
2022-12-03 16:14:35 +01:00
commandes . ecritNoteCSV = false ;
}
}
} ) ;
2023-04-01 09:54:28 +02:00
2022-12-03 16:14:35 +01:00
lblFichierSVG = new JLabel ( " <HTML><B><U>Fichier SVG</U></B> :</HTML> " ) ;
lblFichierSVG . setFont ( new Font ( " Tahoma " , Font . BOLD , 14 ) ) ;
2023-04-01 09:54:28 +02:00
panelBoutons . add ( lblFichierSVG , " cell 1 10,growx " ) ;
2023-02-16 21:47:23 +01:00
JLabel lblNewLogo = new JLabel ( " " ) ;
lblNewLogo . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/newlogo.png " ) ) ) ;
2023-04-01 09:54:28 +02:00
panelBoutons . add ( lblNewLogo , " cell 0 11 " ) ;
2022-05-26 20:10:24 +02:00
chckbxNewLogo = new JCheckBox ( " Nouveau logo " ) ;
2023-02-16 21:47:23 +01:00
chckbxNewLogo . setSelected ( commandes . newLogo ) ;
chckbxNewLogo . setToolTipText ( " Cochez si vous voulez remplacer le logo par celui au-dessus. " ) ;
chckbxNewLogo . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
2023-04-01 09:54:28 +02:00
panelBoutons . add ( chckbxNewLogo , " cell 1 11 " ) ;
2022-06-09 17:49:22 +02:00
chckbxNewLogo . addChangeListener ( new ChangeListener ( ) {
public void stateChanged ( ChangeEvent e ) {
if ( chckbxNewLogo . isSelected ( ) ) {
2023-02-16 21:47:23 +01:00
lblNewLogo . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/newlogo.png " ) ) ) ;
chckbxNoLogo . setSelected ( true ) ;
2022-06-09 17:49:22 +02:00
commandes . newLogo = true ;
} else {
2023-02-16 21:47:23 +01:00
lblNewLogo . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/nonewlogo.png " ) ) ) ;
2022-06-09 17:49:22 +02:00
commandes . newLogo = false ;
}
}
} ) ;
2023-04-01 09:54:28 +02:00
lblnologo = new JLabel ( " " ) ;
lblnologo . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/logo.png " ) ) ) ;
panelBoutons . add ( lblnologo , " cell 0 12 " ) ;
2022-12-17 17:11:22 +01:00
chckbxNoLogo = new JCheckBox ( " Pas de logo " ) ;
2022-05-27 11:40:08 +02:00
chckbxNoLogo . setToolTipText ( " Cochez si vous voulez pas de logo dans les feedbacks. " ) ;
chckbxNoLogo . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
2023-04-01 09:54:28 +02:00
panelBoutons . add ( chckbxNoLogo , " cell 1 12 " ) ;
2022-12-03 11:02:05 +01:00
chckbxNoLogo . setSelected ( commandes . noLogo ) ;
2022-12-17 17:11:22 +01:00
chckbxNoLogo . addChangeListener ( new ChangeListener ( ) {
public void stateChanged ( ChangeEvent e ) {
if ( chckbxNoLogo . isSelected ( ) ) {
lblnologo . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/nologo.png " ) ) ) ;
commandes . noLogo = true ;
} else {
lblnologo . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/logo.png " ) ) ) ;
commandes . noLogo = false ;
}
}
} ) ;
2022-05-24 18:25:41 +02:00
2024-03-02 21:07:58 +01:00
2022-06-03 21:30:14 +02:00
JPanel panelCentre = new JPanel ( ) ;
contentPane . add ( panelCentre , BorderLayout . CENTER ) ;
panelCentre . setLayout ( new BorderLayout ( 0 , 0 ) ) ;
2022-05-24 18:25:41 +02:00
2022-05-25 15:28:58 +02:00
JScrollPane scrollPane = new JScrollPane ( ) ;
2022-06-03 21:30:14 +02:00
panelCentre . add ( scrollPane ) ;
2022-05-25 15:28:58 +02:00
2022-05-24 18:25:41 +02:00
2022-06-11 12:10:28 +02:00
txtpnmessages = new afficheText ( ) ;
2024-03-21 09:19:25 +01:00
txtpnmessages . setForeground ( Color . BLACK ) ;
2022-06-09 09:13:46 +02:00
txtpnmessages . setFont ( new Font ( " Tahoma " , Font . PLAIN , 16 ) ) ;
2024-03-21 09:19:25 +01:00
txtpnmessages . setBackground ( Color . LIGHT_GRAY ) ;
2022-06-11 12:10:28 +02:00
txtpnmessages . setContentType ( " text/html " ) ;
txtpnmessages . setText ( baliseStyle . balise ( ) + " <hr><h1 class \" city \" >*** Charger un fichier d'analyse. ***</h1><hr> " ) ;
2022-05-25 18:21:23 +02:00
scrollPane . setViewportView ( txtpnmessages ) ;
2022-05-24 18:25:41 +02:00
2022-12-03 11:02:05 +01:00
if ( commandes . fourniCSV ) {
lblChargementFichierCSV . setBackground ( new Color ( 40 , 180 , 40 ) ) ;
2024-03-01 22:30:17 +01:00
lblChargementFichierCSV . setText ( " Liste des étudiants " ) ;
2022-12-03 11:02:05 +01:00
lblChargementFichierCSV . setOpaque ( true ) ;
2024-03-01 22:30:17 +01:00
// lblFichierCSV.setText("<HTML><B><U>Fichier CSV</U></B> : " + commandes.nameCSV + "</HTML>");
2022-12-03 11:02:05 +01:00
} else {
lblChargementFichierCSV . setOpaque ( false ) ;
2024-03-01 22:30:17 +01:00
// lblFichierCSV.setText("<HTML><B><U>Fichier CSV</U></B></HTML>");
2022-12-03 11:02:05 +01:00
}
2022-05-31 19:37:46 +02:00
this . setExtendedState ( MAXIMIZED_BOTH ) ;
2022-06-15 08:03:17 +02:00
ListenerAction ( ) ;
2022-05-24 18:25:41 +02:00
refreshLabel ( ) ;
setVisible ( true ) ;
2022-06-03 21:30:14 +02:00
}
2022-06-04 15:43:08 +02:00
2022-06-15 08:03:17 +02:00
private void ListenerAction ( ) {
2023-04-01 09:54:28 +02:00
/ * *
* Ferme la fenêtre et quitte l ' application .
* /
2022-06-15 08:03:17 +02:00
addWindowListener ( new java . awt . event . WindowAdapter ( ) {
@Override
public void windowClosing ( java . awt . event . WindowEvent windowEvent ) {
if ( JOptionPane . showConfirmDialog ( null , " Voulez-vous quitter analyseWriter? " , " Quitter " , JOptionPane . YES_NO_OPTION , JOptionPane . QUESTION_MESSAGE ) = = JOptionPane . YES_OPTION ) {
2023-04-01 09:54:28 +02:00
baseDonneesEvaluations . ferme ( ) ;
create . fermeCreate ( ) ;
ferme ( ) ;
2022-06-15 08:03:17 +02:00
}
}
} ) ;
2023-04-01 09:54:28 +02:00
2022-06-15 08:03:17 +02:00
}
2023-02-18 18:05:42 +01:00
/ * *
* Affichage de la fenêtre .
* @return
* /
2022-12-10 11:16:34 +01:00
public static evaluate getInstance ( ) {
if ( instance = = null ) {
instance = new evaluate ( ) ;
2022-12-21 17:54:28 +01:00
} else {
2023-02-18 18:05:42 +01:00
instance . setVisible ( true ) ;
2022-12-10 11:16:34 +01:00
}
2022-12-21 17:54:28 +01:00
2022-12-11 08:30:19 +01:00
if ( commandes . fichierAnalyseValide ) {
2022-12-29 20:58:04 +01:00
refreshLabel ( ) ;
2022-12-11 08:30:19 +01:00
} else {
2023-04-01 09:54:28 +02:00
txtpnmessages . setText ( baliseStyle . balise ( ) + " <hr class= \" city \" ><h1>*** Veuillez charger une évaluation ***</h1><hr> " ) ;
2022-12-11 08:30:19 +01:00
}
2023-02-18 18:05:42 +01:00
isDispose = false ;
2022-12-10 11:16:34 +01:00
return instance ;
}
2022-06-15 08:03:17 +02:00
2023-04-01 09:54:28 +02:00
public static void ferme ( ) {
if ( ! isDispose ) {
isDispose = true ;
instance . dispose ( ) ;
}
}
2022-06-03 21:30:14 +02:00
2022-12-10 11:16:34 +01:00
/ * *
* Create the application .
* /
public evaluate ( ) {
try {
initialize ( ) ;
} catch ( UnsupportedLookAndFeelException e ) {
e . printStackTrace ( ) ;
}
setVisible ( true ) ;
}
2022-06-03 21:30:14 +02:00
2023-02-18 18:05:42 +01:00
/ * *
* Création du menu principal de la fenêtre . < / br >
* /
2022-06-03 21:30:14 +02:00
private void createMenu ( ) {
JMenuBar menuBar = new JMenuBar ( ) ;
menuBar . setFont ( new Font ( " Segoe UI " , Font . BOLD , 14 ) ) ;
setJMenuBar ( menuBar ) ;
2023-04-01 09:54:28 +02:00
JMenu mnNewMenu = new JMenu ( " Base des évaluations " ) ;
2022-06-03 21:30:14 +02:00
mnNewMenu . setMnemonic ( 'F' ) ;
menuBar . add ( mnNewMenu ) ;
2023-04-01 09:54:28 +02:00
// mnNewMenu.add( new actPathBaseEvaluations() );
JMenuItem menuItem = mnNewMenu . add ( new actOpenBaseEvaluation ( ) ) ;
menuItem . setText ( " Base des évaluations " ) ;
2023-02-16 21:47:23 +01:00
mnNewMenu . addSeparator ( ) ;
2023-04-01 09:54:28 +02:00
mnNewMenu . add ( new actSaveEvaluation ( ) ) ;
// mnNewMenu.add( actSaveas );
2022-06-03 21:30:14 +02:00
mnNewMenu . addSeparator ( ) ;
2023-04-01 09:54:28 +02:00
mnNewMenu . add ( new actExit ( ) ) ;
2022-06-03 21:30:14 +02:00
2023-04-01 09:54:28 +02:00
// JMenu mnMenu_Fichier = new JMenu("Base des évaluation");
// menuBar.add(mnMenu_Fichier);
// mnMenu_Fichier.add( actOpen );
// mnMenu_Fichier.addSeparator();
// mnMenu_Fichier.add( actAboutFichierAnalyse );
// mnMenu_Fichier.add( actCodeFichierAnalyse );
// mnMenu_Fichier.add( actModifierFichierAnalyse );
2022-06-03 21:30:14 +02:00
JMenu mnMenu_Liste_Etudiant = new JMenu ( " Liste des étudiants " ) ;
menuBar . add ( mnMenu_Liste_Etudiant ) ;
mnMenu_Liste_Etudiant . add ( actChargeListeEtudiantCSV ) ;
mnMenu_Liste_Etudiant . addSeparator ( ) ;
2024-03-02 14:07:22 +01:00
mnMenu_Liste_Etudiant . add ( actDeleteListeEtudiantCSV ) ;
mnMenu_Liste_Etudiant . addSeparator ( ) ;
2022-06-03 21:30:14 +02:00
mnMenu_Liste_Etudiant . add ( actAfficheListeEtudiant ) ;
2024-03-02 14:07:22 +01:00
mnMenu_Liste_Etudiant . addSeparator ( ) ;
2024-03-02 21:07:58 +01:00
mnMenu_Liste_Etudiant . add ( actModificationListeEtudiantCSV ) ;
mnMenu_Liste_Etudiant . addSeparator ( ) ;
2022-06-03 21:30:14 +02:00
mnMenu_Liste_Etudiant . add ( actVerifCSV ) ;
2023-04-01 09:54:28 +02:00
JMenu mnMenu_Logo = new JMenu ( " Logotype " ) ;
2022-06-03 21:30:14 +02:00
menuBar . add ( mnMenu_Logo ) ;
mnMenu_Logo . add ( actChargeLogo ) ;
2023-04-01 09:54:28 +02:00
JMenu mnMenu_Evaluation = new JMenu ( " Evaluer des étudiants " ) ;
2022-06-03 21:30:14 +02:00
menuBar . add ( mnMenu_Evaluation ) ;
2023-04-01 09:54:28 +02:00
JMenuItem menuItem_1 = mnMenu_Evaluation . add ( actSelectFolder ) ;
menuItem_1 . setText ( " Dossier des étudiants " ) ;
2022-06-03 21:30:14 +02:00
mnMenu_Evaluation . addSeparator ( ) ;
2023-04-01 09:54:28 +02:00
JMenuItem menuItem_2 = mnMenu_Evaluation . add ( actEvaluate ) ;
menuItem_2 . setText ( " Evaluer les fichiers des étudiants " ) ;
2022-06-03 21:30:14 +02:00
mnMenu_Evaluation . addSeparator ( ) ;
mnMenu_Evaluation . add ( actVerifHistorique ) ;
2022-12-08 21:35:00 +01:00
JMenu mnMenu_Informations = new JMenu ( " Aides " ) ;
2022-06-03 21:30:14 +02:00
menuBar . add ( mnMenu_Informations ) ;
2022-06-19 21:01:30 +02:00
mnMenu_Informations . add ( new actAbout ( ) ) ;
2022-12-05 20:50:39 +01:00
mnMenu_Informations . addSeparator ( ) ;
2022-12-08 21:35:00 +01:00
mnMenu_Informations . add ( new actDocumentation ( ) ) ;
mnMenu_Informations . addSeparator ( ) ;
mnMenu_Informations . add ( new actTutoriels ( ) ) ;
mnMenu_Informations . addSeparator ( ) ;
mnMenu_Informations . add ( new actLicence ( ) ) ;
2022-06-03 21:30:14 +02:00
}
2023-02-18 18:05:42 +01:00
/ * *
* Création de la barre d ' outil de la fenêtre . < / br >
* /
2022-06-03 21:30:14 +02:00
private void createToolBar ( ) {
toolBar = new JToolBar ( ) ;
2023-04-01 09:54:28 +02:00
btnChargeEvaluation = toolBar . add ( new actOpenBaseEvaluation ( ) ) ;
2024-04-08 20:46:40 +02:00
btnChargeEvaluation . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
}
} ) ;
2023-04-01 09:54:28 +02:00
btnChargeEvaluation . setIcon ( new ImageIcon ( create . class . getResource ( " /resources/chargehistoriqueevaluation.png " ) ) ) ;
btnChargeEvaluation . setHideActionText ( true ) ;
toolBar . add ( btnChargeEvaluation ) ;
btnSaveEvaluation = toolBar . add ( new actSaveEvaluation ( ) ) ;
2024-03-14 20:52:22 +01:00
btnSaveEvaluation . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
}
} ) ;
2023-04-01 09:54:28 +02:00
btnSaveEvaluation . setHideActionText ( true ) ;
btnSaveEvaluation . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/saveEvaluation.png " ) ) ) ;
btnSaveEvaluation . setVisible ( true ) ;
toolBar . add ( btnSaveEvaluation ) ;
2024-03-25 09:34:24 +01:00
// JButton btnSaveEvluation = toolBar.add( new actSaveHistoriqueEvaluation() );
// btnSaveEvluation.addActionListener(new ActionListener() {
// public void actionPerformed(ActionEvent e) {
// }
// });
// btnSaveEvluation.setIcon(new ImageIcon(create.class.getResource("/resources/sauvegardehistoriqueevaluation.png")));
// btnSaveEvluation.setHideActionText(true);
// toolBar.add(btnSaveEvluation);
toolBar . addSeparator ( ) ;
2022-06-03 21:30:14 +02:00
JButton btnInformationAnalyse = toolBar . add ( actCodeFichierAnalyse ) ;
btnInformationAnalyse . setHideActionText ( true ) ;
btnInformationAnalyse . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/fichierAnalyseInfo2.png " ) ) ) ;
JButton btnAfficheCodeFichierAnalyse = toolBar . add ( actAboutFichierAnalyse ) ;
2022-11-25 16:19:31 +01:00
btnAfficheCodeFichierAnalyse . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
}
} ) ;
2022-06-03 21:30:14 +02:00
btnAfficheCodeFichierAnalyse . setHideActionText ( true ) ;
btnAfficheCodeFichierAnalyse . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/fichierAnalyseInfo.png " ) ) ) ;
toolBar . add ( btnAfficheCodeFichierAnalyse ) ;
JButton btnModifierFichierAnalyse = toolBar . add ( actModifierFichierAnalyse ) ;
2022-12-10 11:16:34 +01:00
btnModifierFichierAnalyse . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
}
} ) ;
2022-12-11 08:30:19 +01:00
btnModifierFichierAnalyse . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/versfichierAnalyse.png " ) ) ) ;
2022-06-03 21:30:14 +02:00
btnModifierFichierAnalyse . setHideActionText ( true ) ;
toolBar . add ( btnModifierFichierAnalyse ) ;
JButton btnEvaluerLesFichiers = toolBar . add ( actEvaluate ) ;
2022-11-15 09:00:37 +01:00
btnEvaluerLesFichiers . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
}
} ) ;
2022-06-03 21:30:14 +02:00
btnEvaluerLesFichiers . setHideActionText ( true ) ;
2024-03-25 09:34:24 +01:00
toolBar . addSeparator ( ) ;
2022-06-03 21:30:14 +02:00
JButton btnFichierCSV = toolBar . add ( actChargeListeEtudiantCSV ) ;
2022-11-22 10:58:30 +01:00
btnFichierCSV . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
}
} ) ;
2022-06-03 21:30:14 +02:00
btnFichierCSV . setHideActionText ( true ) ;
btnFichierCSV . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/fichierCSV.png " ) ) ) ;
toolBar . add ( btnFichierCSV ) ;
2024-03-01 22:30:17 +01:00
JButton btnFichierCSV_delete = toolBar . add ( actDeleteListeEtudiantCSV ) ;
btnFichierCSV_delete . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
}
} ) ;
btnFichierCSV_delete . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/fichierCSV_delete.png " ) ) ) ;
btnFichierCSV_delete . setHideActionText ( true ) ;
2024-03-02 21:07:58 +01:00
2022-06-03 21:30:14 +02:00
JButton btnInfoListeEtudiant = toolBar . add ( actAfficheListeEtudiant ) ;
2022-12-03 11:02:05 +01:00
btnInfoListeEtudiant . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
}
} ) ;
2022-06-03 21:30:14 +02:00
btnInfoListeEtudiant . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/fichierCSVInfo.png " ) ) ) ;
btnInfoListeEtudiant . setHideActionText ( true ) ;
toolBar . add ( btnInfoListeEtudiant ) ;
2024-03-02 21:07:58 +01:00
JButton btnFichierCSV_modifier = toolBar . add ( actModificationListeEtudiantCSV ) ;
btnFichierCSV_modifier . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
}
} ) ;
btnFichierCSV_modifier . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/fichier_csv_studen_modif.png " ) ) ) ;
btnFichierCSV_modifier . setHideActionText ( true ) ;
2022-06-03 21:30:14 +02:00
JButton btnVerificationCSVavecFichierAnalyse = toolBar . add ( actVerifCSV ) ;
2022-12-03 16:14:35 +01:00
btnVerificationCSVavecFichierAnalyse . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
}
} ) ;
2022-06-03 21:30:14 +02:00
btnVerificationCSVavecFichierAnalyse . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/fichierCSVInfoXML.png " ) ) ) ;
btnVerificationCSVavecFichierAnalyse . setHideActionText ( true ) ;
toolBar . add ( btnVerificationCSVavecFichierAnalyse ) ;
toolBar . addSeparator ( ) ;
JButton btnFichierSVG = toolBar . add ( actChargeLogo ) ;
btnFichierSVG . setHideActionText ( true ) ;
btnFichierSVG . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/fichierSVG.png " ) ) ) ;
toolBar . add ( btnFichierSVG ) ;
toolBar . addSeparator ( ) ;
JButton btnSelectFolder = toolBar . add ( actSelectFolder ) ;
2022-11-22 10:58:30 +01:00
btnSelectFolder . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
}
} ) ;
2022-06-03 21:30:14 +02:00
btnSelectFolder . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/open.png " ) ) ) ;
btnSelectFolder . setHideActionText ( true ) ;
toolBar . add ( btnSelectFolder ) ;
btnEvaluerLesFichiers . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/evaluate.png " ) ) ) ;
toolBar . add ( btnEvaluerLesFichiers ) ;
2024-03-25 09:34:24 +01:00
// JButton btnVerifHistorique = toolBar.add(actVerifHistorique);
// btnVerifHistorique.addActionListener(new ActionListener() {
// public void actionPerformed(ActionEvent e) {
// }
// });
// btnVerifHistorique.setIcon(new ImageIcon(evaluate.class.getResource("/resources/verifhistorique.png")));
// btnVerifHistorique.setHideActionText(true);
// toolBar.add(btnVerifHistorique);
2022-06-03 21:30:14 +02:00
toolBar . addSeparator ( ) ;
2022-06-19 21:01:30 +02:00
JButton btnAbout = toolBar . add ( new actAbout ( ) ) ;
2022-06-03 21:30:14 +02:00
btnAbout . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/apropos.png " ) ) ) ;
2024-04-06 13:44:21 +02:00
if ( commandes . newVersion ) btnAbout . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/apropos_new.png " ) ) ) ;
2022-06-03 21:30:14 +02:00
btnAbout . setHideActionText ( true ) ;
toolBar . add ( btnAbout ) ;
2022-12-08 21:35:00 +01:00
JButton btnTutoriels = toolBar . add ( new actDocumentation ( ) ) ;
btnTutoriels . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/documentation.png " ) ) ) ;
2022-06-09 09:13:46 +02:00
toolBar . add ( btnTutoriels ) ;
2022-06-03 21:30:14 +02:00
toolBar . addSeparator ( ) ;
2023-04-01 09:54:28 +02:00
JButton btnExit = toolBar . add ( new action . actExit ( ) ) ;
btnExit . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
}
} ) ;
2022-06-03 21:30:14 +02:00
btnExit . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/exit.png " ) ) ) ;
btnExit . setHideActionText ( true ) ;
toolBar . add ( btnExit ) ;
2023-04-01 09:54:28 +02:00
// ListenerAction();
2022-05-24 18:25:41 +02:00
}
2022-05-25 18:21:23 +02:00
/ * *
2022-12-13 15:32:28 +01:00
* Raffraichissement des informationss . < / br >
* Activation des chckBoxs . < / br >
2022-05-25 18:21:23 +02:00
* /
2022-12-29 20:58:04 +01:00
private static void refreshLabel ( ) {
2022-05-24 18:25:41 +02:00
if ( ! commandes . fichierAnalyseValide ) {
2022-11-13 11:57:18 +01:00
System . out . println ( " Erreur du fichier d'analyse " ) ;
2024-04-09 14:50:03 +02:00
if ( ! verificationFichierAnalyse_node_commandesSujet . messageErreur . toString ( ) . isEmpty ( ) ) {
txtpnmessages . setText ( verificationFichierAnalyse_node_commandesSujet . messageErreur . toString ( ) ) ;
2022-12-13 15:32:28 +01:00
}
2022-11-13 11:57:18 +01:00
chckbxfichiersEtudiants . setEnabled ( false ) ;
2022-05-24 18:25:41 +02:00
chckbxZipfeedback . setEnabled ( false ) ;
chckbxnoFeedback . setEnabled ( false ) ;
chckbxNoNote . setEnabled ( false ) ;
2022-05-25 18:21:23 +02:00
chckCSVNotes . setEnabled ( false ) ;
2022-05-26 20:10:24 +02:00
chckbxNewLogo . setEnabled ( false ) ;
chckbxNoLogo . setEnabled ( false ) ;
2022-05-27 11:40:08 +02:00
chckbxVerif . setEnabled ( false ) ;
2022-12-01 13:04:20 +01:00
chckbxNoDetail . setEnabled ( false ) ;
2024-04-20 11:17:53 +02:00
chckPasDeProgression . setEnabled ( false ) ;
2022-05-25 15:28:58 +02:00
} else {
2023-02-18 18:05:42 +01:00
chckbxfichiersEtudiants . setSelected ( commandes . fichierStudentMoodle ) ;
chckbxZipfeedback . setSelected ( commandes . zipfeedback ) ;
chckbxnoFeedback . setSelected ( commandes . sansFeeback ) ;
chckCSVNotes . setSelected ( commandes . ecritNoteCSV ) ;
chckbxNewLogo . setSelected ( commandes . newLogo ) ;
2023-02-28 21:37:14 +01:00
chckbxNoNote . setSelected ( commandes . noNote ) ;
2023-02-18 18:05:42 +01:00
chckbxVerif . setSelected ( commandes . verifHisto2 ) ;
chckbxNoDetail . setSelected ( commandes . noDetail ) ;
2024-04-20 11:17:53 +02:00
chckPasDeProgression . setSelected ( commandes . noAfficheProgression ) ;
2023-02-18 18:05:42 +01:00
2022-11-13 11:57:18 +01:00
chckbxfichiersEtudiants . setEnabled ( true ) ;
2022-05-25 15:28:58 +02:00
chckbxZipfeedback . setEnabled ( true ) ;
chckbxnoFeedback . setEnabled ( true ) ;
chckbxNoNote . setEnabled ( true ) ;
2022-05-25 18:21:23 +02:00
chckCSVNotes . setEnabled ( true ) ;
2022-05-26 20:10:24 +02:00
chckbxNewLogo . setEnabled ( true ) ;
chckbxNoLogo . setEnabled ( true ) ;
2022-05-27 11:40:08 +02:00
chckbxVerif . setEnabled ( true ) ;
2022-12-01 13:04:20 +01:00
chckbxNoDetail . setEnabled ( true ) ;
2024-04-20 11:17:53 +02:00
chckPasDeProgression . setEnabled ( true ) ;
2023-02-22 19:55:37 +01:00
if ( commandes . fourniCSV ) {
lblChargementFichierCSV . setBackground ( new Color ( 40 , 180 , 40 ) ) ;
2024-03-01 22:30:17 +01:00
lblChargementFichierCSV . setText ( " Liste des étudiants " ) ;
2023-02-22 19:55:37 +01:00
lblChargementFichierCSV . setOpaque ( true ) ;
} else {
lblChargementFichierCSV . setOpaque ( false ) ;
2024-03-01 22:30:17 +01:00
// lblFichierCSV.setText("<HTML><B><U>Fichier CSV</U></B></HTML>");
2023-02-22 19:55:37 +01:00
}
2022-05-25 15:28:58 +02:00
2022-06-11 12:10:28 +02:00
txtpnmessages . afficheChargementFichierAnalyse ( ) ;
2022-05-24 18:25:41 +02:00
}
2023-04-01 09:54:28 +02:00
String nameEvaluation = commandes . NameEvaluationCharger ;
if ( nameEvaluation . length ( ) > 44 ) nameEvaluation = nameEvaluation . substring ( 0 , 44 ) + " <br> " + nameEvaluation . substring ( 44 , nameEvaluation . length ( ) ) ;
String nameDossierAnalyse = commandes . path . substring ( commandes . path . lastIndexOf ( " \\ " ) + 1 , commandes . path . length ( ) ) ;
if ( nameDossierAnalyse . length ( ) > 44 ) nameDossierAnalyse = nameDossierAnalyse . substring ( 0 , 44 ) + " <br> " + nameDossierAnalyse . substring ( 44 , nameDossierAnalyse . length ( ) ) ;
String nameFichierAnalyse = commandes . analysis_filename ;
if ( nameFichierAnalyse . length ( ) > 44 ) nameFichierAnalyse = nameFichierAnalyse . substring ( 0 , 44 ) + " <br> " + nameFichierAnalyse . substring ( 44 , nameFichierAnalyse . length ( ) ) ;
2022-12-16 17:50:51 +01:00
2023-04-01 09:54:28 +02:00
if ( commandes . NameEvaluationCharger ! = null ) lblNameEvaluation . setText ( " <html>Évalution :<br><b> " + nameEvaluation + " </b></html> " ) ;
if ( commandes . path ! = null ) lblPath . setText ( " <html><p>Dossier de l'analyse :<br><b> " + nameDossierAnalyse + " </b></p><hr></html> " ) ;
if ( commandes . analysis_filename ! = null ) lblFileAnalyse . setText ( " <html>Fichier de l'analyse :<br><b> " + nameFichierAnalyse + " </b></html> " ) ;
if ( commandes . nameSVG ! = null ) lblFichierSVG . setText ( " <html><b><u>Fichier SVG</u></b> :<br> " + commandes . nameSVG . substring ( commandes . nameSVG . lastIndexOf ( " \\ " ) + 1 , commandes . nameSVG . length ( ) ) + " </html> " ) ;
2024-03-01 22:30:17 +01:00
// if(commandes.nameCSV!=null) lblFichierCSV.setText("<html><b><u>Fichier CSV</u></b> :<br>" + commandes.nameCSV + "</html>");
2022-05-27 11:40:08 +02:00
2022-05-24 18:25:41 +02:00
}
2022-12-14 13:37:48 +01:00
/ * *
* Getter du texteField txtmessages . < / br >
* @return
* /
public static afficheText getTxtpnmessages ( ) {
return txtpnmessages ;
}
/ * *
* Setter du texteField txtmessages . < / br >
* @param txtpnmessages
* /
public static void setTxtpnmessages ( afficheText txtpnmessages ) {
evaluate . txtpnmessages = txtpnmessages ;
}
2022-06-09 09:13:46 +02:00
/ * *
*
2022-12-03 16:14:35 +01:00
* Evaluer l ' ensemble des fichiers des étudiants . < / br >
2022-06-09 09:13:46 +02:00
* /
2022-06-04 15:43:08 +02:00
private AbstractAction actEvaluate = new AbstractAction ( ) {
private static final long serialVersionUID = 1L ;
{
putValue ( Action . LARGE_ICON_KEY , new ImageIcon ( evaluate . class . getResource ( " /resources/evaluate.png " ) ) ) ;
putValue ( Action . NAME , " Evaluer les fichiers " ) ;
putValue ( Action . SMALL_ICON , new ImageIcon ( evaluate . class . getResource ( " /resources/evaluatemini.png " ) ) ) ;
putValue ( Action . MNEMONIC_KEY , KeyEvent . VK_E ) ;
putValue ( Action . SHORT_DESCRIPTION , " Evaluer les fichiers (CTRL+E) " ) ;
putValue ( Action . ACCELERATOR_KEY , KeyStroke . getKeyStroke ( KeyEvent . VK_E , InputEvent . CTRL_DOWN_MASK ) ) ;
}
2023-02-18 18:05:42 +01:00
2022-06-04 15:43:08 +02:00
@Override
public void actionPerformed ( ActionEvent e ) {
2023-02-16 21:47:23 +01:00
if ( commandes . fichierAnalyseValide ) {
Thread t2 = new Thread ( new evaluerLesFichiersEtudiants ( txtpnmessages ) ) ;
t2 . start ( ) ;
}
2022-06-04 15:43:08 +02:00
}
} ;
2022-05-28 19:13:25 +02:00
/ * *
2023-02-18 18:05:42 +01:00
* Ouvre et affiche un fichier d ' analyse au format XML . < / br >
* /
2023-04-01 09:54:28 +02:00
@SuppressWarnings ( " unused " )
private AbstractAction actOpen = new AbstractAction ( ) {
2022-05-25 21:22:38 +02:00
2023-02-18 18:05:42 +01:00
private static final long serialVersionUID = 1L ;
2022-05-28 19:13:25 +02:00
2023-02-18 18:05:42 +01:00
{
putValue ( LARGE_ICON_KEY , new ImageIcon ( evaluate . class . getResource ( " /resources/fichierAnalyse.png " ) ) ) ;
putValue ( Action . NAME , " Ouvrir un nouveau fichier d'analyse " ) ;
putValue ( Action . SMALL_ICON , new ImageIcon ( create . class . getResource ( " /resources/fichierAnalysemini.png " ) ) ) ;
putValue ( Action . MNEMONIC_KEY , KeyEvent . VK_O ) ;
putValue ( Action . SHORT_DESCRIPTION , " Ouvrir un nouveau fichier d'analyse (CTRL+O) " ) ;
putValue ( Action . ACCELERATOR_KEY , KeyStroke . getKeyStroke ( KeyEvent . VK_O , InputEvent . CTRL_DOWN_MASK ) ) ;
}
@Override
public void actionPerformed ( ActionEvent e ) {
new ChargeFichierXML ( ) ;
refreshLabel ( ) ;
}
} ;
2022-05-28 19:13:25 +02:00
2023-02-18 18:05:42 +01:00
/ * *
* Chargement d ' un logo SVG . < / br >
* /
private AbstractAction actChargeLogo = new AbstractAction ( ) {
2022-05-28 19:13:25 +02:00
2023-02-18 18:05:42 +01:00
private static final long serialVersionUID = 1L ;
2022-05-28 19:13:25 +02:00
2023-02-18 18:05:42 +01:00
{
putValue ( Action . LARGE_ICON_KEY , new ImageIcon ( evaluate . class . getResource ( " /resources/fichierSVG.png " ) ) ) ;
putValue ( Action . NAME , " Charge un logo SVG " ) ;
putValue ( Action . SMALL_ICON , new ImageIcon ( evaluate . class . getResource ( " /resources/fichierSVGmini.png " ) ) ) ;
putValue ( Action . MNEMONIC_KEY , KeyEvent . VK_G ) ;
putValue ( Action . SHORT_DESCRIPTION , " Charge un logo SVG (CTRL+G) " ) ;
putValue ( Action . ACCELERATOR_KEY , KeyStroke . getKeyStroke ( KeyEvent . VK_G , InputEvent . CTRL_DOWN_MASK ) ) ;
}
@Override
public void actionPerformed ( ActionEvent e ) {
JFileChooser chooser = new JFileChooser ( ) ;
chooser . setDialogTitle ( " Choisir un fichier SVG " ) ;
chooser . setCurrentDirectory ( new java . io . File ( commandes . path ) ) ;
chooser . setFileSelectionMode ( JFileChooser . FILES_ONLY ) ;
FileNameExtensionFilter filter = new FileNameExtensionFilter ( " Format SVG " , " svg " ) ;
chooser . setFileFilter ( filter ) ;
chooser . setAcceptAllFileFilterUsed ( true ) ;
2022-05-26 20:10:24 +02:00
2023-02-18 18:05:42 +01:00
if ( chooser . showOpenDialog ( null ) = = JFileChooser . APPROVE_OPTION ) {
System . out . println ( " getCurrentDirectory(): " + chooser . getCurrentDirectory ( ) ) ;
System . out . println ( " getSelectedFile() : " + chooser . getSelectedFile ( ) . getAbsolutePath ( ) ) ;
commandes . nameSVG = chooser . getSelectedFile ( ) . getAbsolutePath ( ) ;
commandes . contenuFichierSVG = meptl . chargementFichierSVG ( ) ;
txtpnmessages . setContentType ( " text/plain " ) ;
txtpnmessages . setText ( commandes . contenuFichierSVG ) ;
} else {
commandes . nameSVG = " " ;
commandes . contenuFichierSVG = " " ;
System . out . println ( " No Selection " ) ;
}
refreshLabel ( ) ;
}
} ;
2022-05-28 19:13:25 +02:00
/ * *
* Sélectionne le dossier courant contenant les fichiers des étudiants
* /
private AbstractAction actSelectFolder = new AbstractAction ( ) {
private static final long serialVersionUID = 1L ;
{
2022-06-01 21:38:37 +02:00
putValue ( LARGE_ICON_KEY , new ImageIcon ( evaluate . class . getResource ( " /resources/open.png " ) ) ) ;
putValue ( Action . NAME , " Dossier d'analyse " ) ;
putValue ( Action . SMALL_ICON , new ImageIcon ( evaluate . class . getResource ( " /resources/openmini.png " ) ) ) ;
2022-05-28 19:13:25 +02:00
putValue ( Action . MNEMONIC_KEY , KeyEvent . VK_U ) ;
2022-06-01 21:38:37 +02:00
putValue ( Action . SHORT_DESCRIPTION , " Dossier d'analyse (CTRL+U) " ) ;
2022-05-28 19:13:25 +02:00
putValue ( Action . ACCELERATOR_KEY , KeyStroke . getKeyStroke ( KeyEvent . VK_U , InputEvent . CTRL_DOWN_MASK ) ) ;
}
@Override
public void actionPerformed ( ActionEvent e ) {
JFileChooser chooser = new JFileChooser ( ) ;
2022-05-26 20:10:24 +02:00
2022-05-28 19:13:25 +02:00
chooser . setCurrentDirectory ( new java . io . File ( commandes . path ) ) ;
chooser . setDialogTitle ( " Sélectionner le dossier contenant les fichiers des étudiants. " ) ;
chooser . setFileSelectionMode ( JFileChooser . DIRECTORIES_ONLY ) ;
chooser . setAcceptAllFileFilterUsed ( false ) ;
if ( chooser . showOpenDialog ( null ) = = JFileChooser . APPROVE_OPTION ) {
commandes . path = chooser . getSelectedFile ( ) . getAbsolutePath ( ) ;
} else {
System . out . println ( " No Selection " ) ;
}
2022-05-26 20:10:24 +02:00
2022-05-28 19:13:25 +02:00
refreshLabel ( ) ;
}
} ;
2022-06-01 21:38:37 +02:00
/ * *
2022-12-03 16:14:35 +01:00
* Verification de l ' historique . < / br >
2022-06-01 21:38:37 +02:00
* /
private AbstractAction actVerifHistorique = new AbstractAction ( ) {
2022-05-31 19:37:46 +02:00
private static final long serialVersionUID = 1L ;
{
2022-06-01 21:38:37 +02:00
putValue ( Action . LARGE_ICON_KEY , new ImageIcon ( evaluate . class . getResource ( " /resources/verifhistorique.png " ) ) ) ;
putValue ( Action . NAME , " Evaluer l'historique des modification " ) ;
putValue ( Action . SMALL_ICON , new ImageIcon ( evaluate . class . getResource ( " /resources/verifhistoriquemini.png " ) ) ) ;
putValue ( Action . MNEMONIC_KEY , KeyEvent . VK_H ) ;
putValue ( Action . SHORT_DESCRIPTION , " Evaluer l'historique des modification (CTRL+H) " ) ;
putValue ( Action . ACCELERATOR_KEY , KeyStroke . getKeyStroke ( KeyEvent . VK_H , InputEvent . CTRL_DOWN_MASK ) ) ;
2022-05-31 19:37:46 +02:00
}
@Override
public void actionPerformed ( ActionEvent e ) {
2022-06-01 21:38:37 +02:00
commandes . verifHisto = true ;
commandes . analyse = false ;
if ( ! commandes . path . isEmpty ( ) ) {
2024-03-25 21:18:21 +01:00
Thread t2 = new Thread ( new evaluerLesFichiersEtudiants ( txtpnmessages ) ) ;
t2 . start ( ) ;
// meptl.analyseVerifieHistoriqueLesFichiersEtudiantsEtExportNoteCSV(fenetres.evaluate.getTxtpnmessages());
txtpnmessages . setContentType ( " text/plain " ) ;
txtpnmessages . setText ( commandes . message . toString ( ) ) ;
2022-05-31 19:37:46 +02:00
} else {
2024-03-02 21:07:58 +01:00
txtpnmessages . setContentType ( " text/html " ) ;
txtpnmessages . setText ( " <html><h1>*** Veuillez sélectionner un dossier d'analyse. ***</h1></html> " ) ;
2022-05-31 19:37:46 +02:00
}
2022-06-01 21:38:37 +02:00
commandes . verifHisto = false ;
2022-05-31 19:37:46 +02:00
}
} ;
2023-02-18 18:05:42 +01:00
/ * *
*
* /
private AbstractAction actVerifCSV = new AbstractAction ( ) {
2022-06-01 21:38:37 +02:00
2023-02-18 18:05:42 +01:00
private static final long serialVersionUID = 1L ;
{
putValue ( Action . LARGE_ICON_KEY , new ImageIcon ( evaluate . class . getResource ( " /resources/fichierCSVInfoXML.png " ) ) ) ;
putValue ( Action . NAME , " Vérification des champs du CSV " ) ;
putValue ( Action . SMALL_ICON , new ImageIcon ( evaluate . class . getResource ( " /resources/fichierCSVInfoXMLmini.png " ) ) ) ;
putValue ( Action . MNEMONIC_KEY , KeyEvent . VK_U ) ;
putValue ( Action . SHORT_DESCRIPTION , " Vérification des champs du CSV (CTRL+B) " ) ;
putValue ( Action . ACCELERATOR_KEY , KeyStroke . getKeyStroke ( KeyEvent . VK_U , InputEvent . CTRL_DOWN_MASK ) ) ;
}
@Override
public void actionPerformed ( ActionEvent e ) {
if ( commandes . fichierAnalyseValide ) {
if ( commandes . fourniCSV ) {
node settingCSV = commandes . sujet . retourneFirstEnfantsByName ( " import_moodle " ) ;
if ( settingCSV . isHasAttributs ( ) ) {
String email = " inconnu " ;
String name = " inconnu " ;
String firstname = " inconnu " ;
String id = " inconnu " ;
2024-03-02 14:07:22 +01:00
txtpnmessages . setContentType ( " text/html " ) ;
2023-02-18 18:05:42 +01:00
boolean avertissement = false ;
if ( settingCSV . getAttributs ( ) . get ( " email " ) ! = null ) {
email = settingCSV . getAttributs ( ) . get ( " email " ) ;
}
if ( settingCSV . getAttributs ( ) . get ( " name " ) ! = null ) {
name = settingCSV . getAttributs ( ) . get ( " name " ) ;
}
if ( settingCSV . getAttributs ( ) . get ( " firstname " ) ! = null ) {
firstname = settingCSV . getAttributs ( ) . get ( " firstname " ) ;
}
if ( settingCSV . getAttributs ( ) . get ( " id " ) ! = null ) {
id = settingCSV . getAttributs ( ) . get ( " id " ) ;
}
if ( commandes . nodeCSV . getNodes ( ) . get ( 0 ) . getAttributs ( ) . get ( firstname ) = = null ) {
2024-03-02 14:07:22 +01:00
txtpnmessages . setText ( " <html><h1>*** AVERTISSEMENT - Il n'y a pas le champ " + firstname + " dans le fichier CSV. ***</h1></html> " ) ;
2023-02-18 18:05:42 +01:00
avertissement = true ;
}
if ( commandes . nodeCSV . getNodes ( ) . get ( 0 ) . getAttributs ( ) . get ( name ) = = null ) {
2024-03-02 14:07:22 +01:00
txtpnmessages . setText ( " <html><h1>*** AVERTISSEMENT - Il n'y a pas le champ " + name + " dans le fichier CSV. ***</h1></html> " ) ;
2023-02-18 18:05:42 +01:00
avertissement = true ;
}
if ( commandes . nodeCSV . getNodes ( ) . get ( 0 ) . getAttributs ( ) . get ( id ) = = null ) {
2024-03-02 14:07:22 +01:00
txtpnmessages . setText ( " <html><h1>*** AVERTISSEMENT - Il n'y a pas le champ " + id + " dans le fichier CSV. ***</h1></html> " ) ;
2023-02-18 18:05:42 +01:00
avertissement = true ;
}
if ( commandes . nodeCSV . getNodes ( ) . get ( 0 ) . getAttributs ( ) . get ( email ) = = null ) {
2024-03-02 14:07:22 +01:00
txtpnmessages . setText ( " <html><h1>*** AVERTISSEMENT - Il n'y a pas le champ " + email + " dans le fichier CSV. ***</h1></html> " ) ;
2023-02-18 18:05:42 +01:00
avertissement = true ;
}
if ( ! avertissement ) {
2024-03-02 14:07:22 +01:00
txtpnmessages . setText ( " <html><h1>*** Le fichier CSV contenant la liste des étudiants peut être utilisé avec les paramètres du fichier d'analyse ***</h1></html> " ) ;
2023-02-18 18:05:42 +01:00
}
2022-06-01 21:38:37 +02:00
} else {
2024-03-02 14:07:22 +01:00
txtpnmessages . setText ( " <html><h1>*** Le fichier CSV contenant la liste des étudiants est vide ***</h1></html> " ) ;
2023-02-18 18:05:42 +01:00
}
2022-06-01 21:38:37 +02:00
} else {
2024-03-02 14:07:22 +01:00
txtpnmessages . setText ( " <html><h1>*** Veuillez charger un fichier CSV contenant la liste des étudiants ***</h1></html> " ) ;
2023-02-18 18:05:42 +01:00
new msgBox ( " Le fichier CSV contenant la liste des étudiants n'est pas chargé. " , true , false , " Avertissement " ) ;
2022-06-01 21:38:37 +02:00
}
2023-02-18 18:05:42 +01:00
} else {
2024-03-02 14:07:22 +01:00
txtpnmessages . setText ( " <html><h1>*** Veuillez charger une évaluation ***</h1></html> " ) ;
2023-02-18 18:05:42 +01:00
new msgBox ( " Le fichier d'analyse n'est pas valide. " , true , false , " Avertissement " ) ;
}
}
} ;
2022-05-28 19:13:25 +02:00
/ * *
2022-12-03 16:14:35 +01:00
* Information sur le fichier d ' analyse . < / br >
2022-05-28 19:13:25 +02:00
* /
private AbstractAction actAboutFichierAnalyse = new AbstractAction ( ) {
private static final long serialVersionUID = 1L ;
{
2022-06-01 21:38:37 +02:00
putValue ( Action . NAME , " Informations du fichier d'analyse " ) ;
putValue ( Action . SMALL_ICON , new ImageIcon ( evaluate . class . getResource ( " /resources/fichierAnalyseInfo2mini.png " ) ) ) ;
2022-05-28 19:13:25 +02:00
putValue ( Action . MNEMONIC_KEY , KeyEvent . VK_K ) ;
2022-06-01 21:38:37 +02:00
putValue ( Action . SHORT_DESCRIPTION , " Informations du fichier d'analyse (CTRL+K) " ) ;
2022-05-28 19:13:25 +02:00
putValue ( Action . ACCELERATOR_KEY , KeyStroke . getKeyStroke ( KeyEvent . VK_K , InputEvent . CTRL_DOWN_MASK ) ) ;
}
@Override public void actionPerformed ( ActionEvent e ) {
if ( commandes . fichierAnalyseValide ) {
2022-06-11 12:10:28 +02:00
txtpnmessages . afficheChargementFichierAnalyse ( ) ;
2022-05-28 19:13:25 +02:00
} else {
2023-04-01 09:54:28 +02:00
txtpnmessages . setText ( baliseStyle . balise ( ) + " <hr class= \" city \" ><h1>*** Veuillez charger une évaluation ***</h1><hr> " ) ;
2022-05-28 19:13:25 +02:00
}
2022-11-25 16:19:31 +01:00
2022-05-28 19:13:25 +02:00
}
} ;
2022-06-04 15:43:08 +02:00
2022-12-03 16:14:35 +01:00
2022-06-04 15:43:08 +02:00
/ * *
*
* /
2023-02-18 18:05:42 +01:00
@SuppressWarnings ( " unused " )
2022-06-06 09:50:45 +02:00
private AbstractAction actSavePreference = new AbstractAction ( ) {
2022-06-01 21:38:37 +02:00
2022-06-04 15:43:08 +02:00
private static final long serialVersionUID = 1L ;
2022-06-01 21:38:37 +02:00
2022-06-04 15:43:08 +02:00
{
putValue ( Action . NAME , " Enregistrer prefrences " ) ;
putValue ( Action . SMALL_ICON , new ImageIcon ( create . class . getResource ( " /resources/savepreferencemini.png " ) ) ) ;
putValue ( Action . LARGE_ICON_KEY , new ImageIcon ( create . class . getResource ( " /resources/savepreference.png " ) ) ) ;
putValue ( Action . MNEMONIC_KEY , KeyEvent . VK_W ) ;
putValue ( Action . SHORT_DESCRIPTION , " Enregistrer prefrences " ) ;
putValue ( Action . ACCELERATOR_KEY , KeyStroke . getKeyStroke ( KeyEvent . VK_W , KeyEvent . ALT_DOWN_MASK ) ) ;
}
@Override public void actionPerformed ( ActionEvent e ) {
if ( commandes . fichierAnalyseValide ) {
} else {
JOptionPane . showMessageDialog ( null , " Charger un fichier Writer (.odt) ou un fichier d'évaluaton (.xml). " ) ;
}
System . out . println ( " Configuration " ) ;
}
} ;
2022-05-28 19:13:25 +02:00
2022-12-05 20:50:39 +01:00
2022-12-07 20:44:00 +01:00
2022-12-08 21:35:00 +01:00
2022-05-28 19:13:25 +02:00
/ * *
2023-02-18 18:05:42 +01:00
2022-05-28 19:13:25 +02:00
* Affiche le code XMl du fichier d ' analyse
* /
private AbstractAction actCodeFichierAnalyse = new AbstractAction ( ) {
private static final long serialVersionUID = 1L ;
{
2022-06-01 21:38:37 +02:00
putValue ( Action . NAME , " Affiche le code XML " ) ;
putValue ( Action . SMALL_ICON , new ImageIcon ( evaluate . class . getResource ( " /resources/fichierAnalyseInfomini.png " ) ) ) ;
putValue ( Action . LARGE_ICON_KEY , new ImageIcon ( evaluate . class . getResource ( " /resources/fichierAnalyseInfo.png " ) ) ) ;
2022-05-28 19:13:25 +02:00
putValue ( Action . MNEMONIC_KEY , KeyEvent . VK_J ) ;
putValue ( Action . SHORT_DESCRIPTION , " Affiche le code XML (CTRL+J) " ) ;
putValue ( Action . ACCELERATOR_KEY , KeyStroke . getKeyStroke ( KeyEvent . VK_J , InputEvent . CTRL_DOWN_MASK ) ) ;
}
@Override public void actionPerformed ( ActionEvent e ) {
2022-06-09 09:13:46 +02:00
txtpnmessages . setContentType ( " text/plain " ) ;
2022-05-27 15:02:18 +02:00
if ( commandes . fichierAnalyseValide ) {
txtpnmessages . setText ( Run . ecritureNode ( commandes . sujet , 0 ) . toString ( ) ) ;
} else {
2023-04-01 09:54:28 +02:00
txtpnmessages . setText ( " *** Veuillez charger une évaluation *** " ) ;
2022-05-27 15:02:18 +02:00
}
2022-05-28 19:13:25 +02:00
System . out . println ( " Affiche le code XML du fichier d'analyse. " ) ;
}
} ;
/ * *
* Affiche le code XMl du fichier d ' analyse
* /
private AbstractAction actModifierFichierAnalyse = new AbstractAction ( ) {
2022-05-25 18:21:23 +02:00
2022-05-28 19:13:25 +02:00
private static final long serialVersionUID = 1L ;
{
2022-06-01 21:38:37 +02:00
putValue ( Action . NAME , " Modifier le fichier d'analyse " ) ;
putValue ( Action . SMALL_ICON , new ImageIcon ( evaluate . class . getResource ( " /resources/fichierAnalyseModifmini.png " ) ) ) ;
putValue ( Action . LARGE_ICON_KEY , new ImageIcon ( evaluate . class . getResource ( " /resources/fichierAnalyseModif.png " ) ) ) ;
2022-05-28 19:13:25 +02:00
putValue ( Action . MNEMONIC_KEY , KeyEvent . VK_M ) ;
putValue ( Action . SHORT_DESCRIPTION , " Modifier le fichier d'analyse (CTRL+M) " ) ;
putValue ( Action . ACCELERATOR_KEY , KeyStroke . getKeyStroke ( KeyEvent . VK_M , InputEvent . CTRL_DOWN_MASK ) ) ;
}
@Override public void actionPerformed ( ActionEvent e ) {
2022-06-19 21:01:30 +02:00
create . getInstance ( ) ;
2022-12-10 11:16:34 +01:00
evaluate . getInstance ( ) . dispose ( ) ;
2023-02-18 18:05:42 +01:00
evaluate . isDispose = true ;
2022-05-28 19:13:25 +02:00
}
} ;
/ * *
2022-12-03 11:02:05 +01:00
* Charge la liste des étudiants sous la forme d ' un fichier XML .
2022-05-28 19:13:25 +02:00
* /
private AbstractAction actChargeListeEtudiantCSV = new AbstractAction ( ) {
private static final long serialVersionUID = 1L ;
{
2022-06-01 21:38:37 +02:00
putValue ( Action . NAME , " Charge la liste des étudiants " ) ;
putValue ( Action . SMALL_ICON , new ImageIcon ( evaluate . class . getResource ( " /resources/fichierCSVmini.png " ) ) ) ;
putValue ( Action . LARGE_ICON_KEY , new ImageIcon ( evaluate . class . getResource ( " /resources/fichierCSV.png " ) ) ) ;
2022-05-28 19:13:25 +02:00
putValue ( Action . MNEMONIC_KEY , KeyEvent . VK_L ) ;
putValue ( Action . SHORT_DESCRIPTION , " Charge la liste des étudiants (CTRL+L) " ) ;
putValue ( Action . ACCELERATOR_KEY , KeyStroke . getKeyStroke ( KeyEvent . VK_L , InputEvent . CTRL_DOWN_MASK ) ) ;
}
@Override public void actionPerformed ( ActionEvent e ) {
JFileChooser chooser = new JFileChooser ( ) ;
chooser . setDialogTitle ( " Choisir un fichier CSV " ) ;
chooser . setCurrentDirectory ( new java . io . File ( commandes . path ) ) ;
chooser . setFileSelectionMode ( JFileChooser . FILES_ONLY ) ;
FileNameExtensionFilter filter = new FileNameExtensionFilter ( " Format CSV " , " csv " ) ;
chooser . setFileFilter ( filter ) ;
chooser . setAcceptAllFileFilterUsed ( true ) ;
if ( chooser . showOpenDialog ( null ) = = JFileChooser . APPROVE_OPTION ) {
System . out . println ( " getCurrentDirectory(): " + chooser . getCurrentDirectory ( ) ) ;
System . out . println ( " getSelectedFile() : " + chooser . getSelectedFile ( ) . getAbsolutePath ( ) ) ;
commandes . nameCSV = chooser . getSelectedFile ( ) . getAbsolutePath ( ) ;
2022-12-03 16:14:35 +01:00
2024-03-01 22:30:17 +01:00
int nbrStudent = 0 ;
if ( commandes . nodeCSV = = null ) {
commandes . nodeCSV = new node ( " fileCSV " ) ;
} else {
if ( commandes . nodeCSV . getNomElt ( ) = = null ) commandes . nodeCSV . setNomElt ( " fileCSV " ) ;
2024-03-24 21:00:03 +01:00
if ( commandes . nodeCSV . getNomElt ( ) . isBlank ( ) ) commandes . nodeCSV . setNomElt ( " fileCSV " ) ;
2024-03-01 22:30:17 +01:00
nbrStudent = commandes . nodeCSV . getNbrEnfants ( ) ;
2022-05-31 19:37:46 +02:00
}
2022-12-03 16:14:35 +01:00
2024-03-01 22:30:17 +01:00
meptl . chargementFichierCSV ( ) ;
2022-12-03 16:14:35 +01:00
2024-03-01 22:30:17 +01:00
if ( commandes . nodeCSV . getNbrEnfants ( ) > = 1 ) {
commandes . fourniCSV = true ;
}
2022-12-03 16:14:35 +01:00
2024-03-01 22:30:17 +01:00
if ( commandes . nodeCSV . getNbrEnfants ( ) = = nbrStudent ) {
txtpnmessages . setContentType ( " text/html " ) ;
txtpnmessages . setText ( " <html><h1>*** Aucun étudiant a été ajouté à la liste ***</h1></html> " ) ;
} else {
if ( commandes . fourniCSV ) {
txtpnmessages . setContentType ( " text/html " ) ;
txtpnmessages . setText ( baliseStyle . balise ( ) + meptl . afficheNodeCSV ( ) . toString ( ) ) ;
System . out . println ( " Affiche la liste des étudiants déjà en mémoire. " ) ;
} else {
txtpnmessages . setContentType ( " text/html " ) ;
txtpnmessages . setText ( " <html><h1>*** Veuillez sélectionner un fichier CSV contenant la liste des étudiants. ***</h1></html> " ) ;
}
}
System . out . println ( " Charge la liste des étudiants. " ) ;
}
2022-12-03 16:14:35 +01:00
2022-11-22 10:58:30 +01:00
if ( commandes . fourniCSV ) {
lblChargementFichierCSV . setBackground ( new Color ( 40 , 180 , 40 ) ) ;
2024-03-01 22:30:17 +01:00
lblChargementFichierCSV . setText ( " Liste des étudiants " ) ;
2022-11-22 10:58:30 +01:00
lblChargementFichierCSV . setOpaque ( true ) ;
2024-03-01 22:30:17 +01:00
// lblFichierCSV.setText("<HTML><B><U>Fichier CSV</U></B> : " + commandes.nameCSV + "</HTML>");
2022-11-22 10:58:30 +01:00
} else {
lblChargementFichierCSV . setOpaque ( false ) ;
2024-03-01 22:30:17 +01:00
lblChargementFichierCSV . setText ( " Pas de liste des étudiants " ) ;
// lblFichierCSV.setText("<HTML><B><U>Fichier CSV</U></B></HTML>");
2022-11-22 10:58:30 +01:00
}
2022-05-28 19:13:25 +02:00
}
} ;
2024-03-01 22:30:17 +01:00
2022-05-28 19:13:25 +02:00
/ * *
2024-03-01 22:30:17 +01:00
* Supprime la liste des étudiants sous la forme d ' un fichier XML .
* /
private AbstractAction actDeleteListeEtudiantCSV = new AbstractAction ( ) {
private static final long serialVersionUID = 1L ;
{
putValue ( Action . NAME , " Supprime la liste des étudiants " ) ;
2024-03-02 14:07:22 +01:00
putValue ( Action . SMALL_ICON , new ImageIcon ( evaluate . class . getResource ( " /resources/fichierCSV_deletemini.png " ) ) ) ;
2024-03-01 22:30:17 +01:00
putValue ( Action . LARGE_ICON_KEY , new ImageIcon ( evaluate . class . getResource ( " /resources/fichierCSV_delete.png " ) ) ) ;
putValue ( Action . MNEMONIC_KEY , KeyEvent . VK_L ) ;
putValue ( Action . SHORT_DESCRIPTION , " Supprime la liste des étudiants " ) ;
}
@Override public void actionPerformed ( ActionEvent e ) {
if ( JOptionPane . showConfirmDialog ( null , " Voulez-vous supprimer la liste des étudiant ? " , " Supprimer " , JOptionPane . YES_NO_OPTION , JOptionPane . QUESTION_MESSAGE ) = = JOptionPane . YES_OPTION ) {
commandes . nodeCSV = meptl . supprimeFichierCSV ( ) ;
commandes . fourniCSV = false ;
txtpnmessages . setContentType ( " text/html " ) ;
txtpnmessages . setText ( " <html><h1>***Suppression de la liste des étudiants ***</h1></html> " ) ;
System . out . println ( " Suppression de la liste des étudiants. " ) ;
lblChargementFichierCSV . setOpaque ( false ) ;
lblChargementFichierCSV . setText ( " Pas de liste des étudiants " ) ;
}
}
} ;
2023-02-18 18:05:42 +01:00
2024-03-02 21:07:58 +01:00
/ * *
* Supprime la liste des étudiants sous la forme d ' un fichier XML .
* /
private AbstractAction actModificationListeEtudiantCSV = new AbstractAction ( ) {
private static final long serialVersionUID = 1L ;
{
putValue ( Action . NAME , " Modification de la liste des étudiants " ) ;
putValue ( Action . SMALL_ICON , new ImageIcon ( evaluate . class . getResource ( " /resources/fichier_csv_studen_modifmini.png " ) ) ) ;
putValue ( Action . LARGE_ICON_KEY , new ImageIcon ( evaluate . class . getResource ( " /resources/fichier_csv_studen_modif.png " ) ) ) ;
putValue ( Action . MNEMONIC_KEY , KeyEvent . VK_L ) ;
putValue ( Action . SHORT_DESCRIPTION , " Modification de la liste des étudiants " ) ;
}
@Override public void actionPerformed ( ActionEvent e ) {
txtpnmessages . setContentType ( " text/html " ) ;
if ( commandes . fourniCSV ) {
node nodImportCSV = commandes . sujet . retourneFirstEnfantsByName ( " import_moodle " ) ;
String name = nodImportCSV . getAttributs ( ) . get ( " name " ) ;
String email = nodImportCSV . getAttributs ( ) . get ( " email " ) ;
String firstname = nodImportCSV . getAttributs ( ) . get ( " firstname " ) ;
String id = nodImportCSV . getAttributs ( ) . get ( " id " ) ;
String numStudent = JOptionPane . showInputDialog ( " <html><p>Quel est le numéro de l'étudiant ?</p></html> " ) ;
2024-03-04 14:14:53 +01:00
node nodeStudent = commandes . nodeCSV . retourneFirstNodeByNameAndAttributValueExactStrict ( " student " , id , numStudent ) ;
2024-03-02 21:07:58 +01:00
if ( nodeStudent ! = null ) {
txtpnmessages . setText ( " <html><h1>Etudiant trouvé</h1><hr><p>Nom : " + nodeStudent . getAttributs ( ) . get ( name ) + " </p> "
+ " <p>Prenom : " + nodeStudent . getAttributs ( ) . get ( firstname ) + " </p> "
+ " <p>Email : " + nodeStudent . getAttributs ( ) . get ( email ) + " </p> "
+ " <p>Numéro étudiant : " + nodeStudent . getAttributs ( ) . get ( id ) + " </p></html> " ) ;
2024-03-04 14:14:53 +01:00
new modifStudent ( nodeStudent , nodImportCSV ) . setVisible ( true ) ;
2024-03-02 21:07:58 +01:00
System . out . println ( " etudiant trouvé. " ) ;
} else {
txtpnmessages . setText ( " <html><h1>*** L'étudiant n'a pas été trouvé. ***</html> " ) ;
}
} else {
txtpnmessages . setText ( " <html><h1>*** Veuillez charger une liste d'étudiant à partir d'un fichier au format CSV. ***</html> " ) ;
}
}
} ;
2024-03-01 22:30:17 +01:00
/ * *
2022-05-28 19:13:25 +02:00
* Affiche le code XMl du fichier d ' analyse
* /
private AbstractAction actAfficheListeEtudiant = new AbstractAction ( ) {
private static final long serialVersionUID = 1L ;
{
2022-06-01 21:38:37 +02:00
putValue ( Action . NAME , " Affiche la liste des étudiants " ) ;
putValue ( Action . SMALL_ICON , new ImageIcon ( evaluate . class . getResource ( " /resources/fichierCSVInfomini.png " ) ) ) ;
putValue ( Action . LARGE_ICON_KEY , new ImageIcon ( evaluate . class . getResource ( " /resources/fichierCSVInfo.png " ) ) ) ;
2022-05-28 19:13:25 +02:00
putValue ( Action . MNEMONIC_KEY , KeyEvent . VK_L ) ;
putValue ( Action . SHORT_DESCRIPTION , " Affiche la liste des étudiants (ALT+L) " ) ;
putValue ( Action . ACCELERATOR_KEY , KeyStroke . getKeyStroke ( KeyEvent . VK_L , InputEvent . ALT_DOWN_MASK ) ) ;
}
@Override public void actionPerformed ( ActionEvent e ) {
if ( commandes . fourniCSV ) {
2024-03-01 22:30:17 +01:00
txtpnmessages . setContentType ( " text/html " ) ;
txtpnmessages . setText ( baliseStyle . balise ( ) + meptl . afficheNodeCSV ( ) . toString ( ) ) ;
2022-12-03 16:14:35 +01:00
System . out . println ( " Affiche la liste des étudiants déjà en mémoire. " ) ;
2022-05-28 19:13:25 +02:00
} else {
2024-03-02 21:07:58 +01:00
txtpnmessages . setContentType ( " text/html " ) ;
txtpnmessages . setText ( " <html><h1>*** Veuillez sélectionner un fichier CSV contenant la liste des étudiants. ***</h1></html> " ) ;
2022-05-28 19:13:25 +02:00
}
}
} ;
2022-06-03 21:30:14 +02:00
2022-05-25 09:30:49 +02:00
2023-02-18 18:05:42 +01:00
2022-05-24 18:25:41 +02:00
}
2022-06-03 21:30:14 +02:00