2022-05-24 18:25:41 +02:00
package app ;
import java.awt.BorderLayout ;
2022-05-25 09:30:49 +02:00
import java.awt.EventQueue ;
import java.awt.Font ;
import java.awt.GridBagConstraints ;
import java.awt.GridBagLayout ;
import java.awt.Insets ;
import java.awt.Toolkit ;
import java.awt.event.ActionEvent ;
import java.awt.event.ActionListener ;
import java.io.IOException ;
2022-05-24 18:25:41 +02:00
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-05-24 18:25:41 +02:00
import javax.swing.JPanel ;
2022-05-25 09:30:49 +02:00
import javax.swing.JTextPane ;
import javax.swing.JToolBar ;
2022-05-24 18:25:41 +02:00
import javax.swing.border.EmptyBorder ;
2022-05-25 21:22:38 +02:00
import javax.swing.filechooser.FileNameExtensionFilter ;
2022-05-24 18:25:41 +02:00
import javax.xml.parsers.ParserConfigurationException ;
import org.xml.sax.SAXException ;
import MEPTL.commandes ;
import MEPTL.feedbacks ;
import MEPTL.meptl ;
import cXML.Run ;
import cXML.node ;
import net.lingala.zip4j.exception.ZipException ;
2022-05-25 15:28:58 +02:00
import javax.swing.SwingConstants ;
2022-05-25 18:21:23 +02:00
import javax.swing.Timer ;
2022-05-25 15:28:58 +02:00
import java.awt.GridLayout ;
2022-05-26 20:10:24 +02:00
import java.awt.Image ;
2022-05-25 15:28:58 +02:00
import javax.swing.JTextArea ;
import javax.swing.JScrollPane ;
import java.awt.Component ;
import javax.swing.Box ;
2022-05-25 18:21:23 +02:00
import javax.swing.JEditorPane ;
import javax.swing.JProgressBar ;
2022-05-26 20:10:24 +02:00
import javax.swing.JSeparator ;
import net.miginfocom.swing.MigLayout ;
import java.awt.Label ;
2022-05-24 18:25:41 +02:00
public class evaluate extends JFrame {
/ * *
*
* /
private static final long serialVersionUID = 1L ;
private JPanel contentPane ;
private JLabel lblPath = new JLabel ( ) ;
2022-05-25 15:28:58 +02:00
private JLabel lblFileAnalyse = new JLabel ( ) ;
2022-05-25 21:22:38 +02:00
private JLabel lblFichierCSV = new JLabel ( ) ;
2022-05-26 20:10:24 +02:00
private JLabel lblFichierSVG = new JLabel ( ) ;
2022-05-24 18:25:41 +02:00
private JCheckBox chckbxfichiersEtudaints = new JCheckBox ( ) ;
private JCheckBox chckbxZipfeedback = new JCheckBox ( ) ;
private JCheckBox chckbxnoFeedback = new JCheckBox ( ) ;
private JCheckBox chckbxNoNote = new JCheckBox ( ) ;
2022-05-25 18:21:23 +02:00
private JCheckBox chckCSVNotes = new JCheckBox ( ) ;
2022-05-26 20:10:24 +02:00
private JCheckBox chckbxNoLogo = new JCheckBox ( ) ;
JCheckBox chckbxNewLogo = new JCheckBox ( ) ;
2022-05-25 18:21:23 +02:00
private JTextPane txtpnmessages = new JTextPane ( ) ;
private JProgressBar progressBar = new JProgressBar ( ) ;
private JButton btnSelectFileAnalyse = new JButton ( ) ;
private JButton btnSelectFolder = new JButton ( ) ;
private JButton btnEvaluerLesFichiers = new JButton ( ) ;
2022-05-25 21:22:38 +02:00
private JButton btnFichierCSV = new JButton ( ) ;
2022-05-26 20:10:24 +02:00
private JButton btnAbout = new JButton ( ) ;
private JButton btnFichierSVG = new JButton ( ) ;
2022-05-25 18:21:23 +02:00
2022-05-24 18:25:41 +02:00
/ * *
* Create the frame .
* /
public evaluate ( ) {
2022-05-26 20:10:24 +02:00
ImageIcon img = new ImageIcon ( getClass ( ) . getResource ( " /evalwriter.png " ) ) ;
this . setIconImage ( img . getImage ( ) ) ;
this . setTitle ( commandes . Titre ) ;
2022-05-24 18:25:41 +02:00
setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE ) ;
2022-05-25 15:28:58 +02:00
setBounds ( 100 , 100 , 960 , 677 ) ;
2022-05-24 18:25:41 +02:00
contentPane = new JPanel ( ) ;
contentPane . setBorder ( new EmptyBorder ( 5 , 5 , 5 , 5 ) ) ;
setContentPane ( contentPane ) ;
contentPane . setLayout ( new BorderLayout ( 0 , 0 ) ) ;
JToolBar toolBar = new JToolBar ( ) ;
contentPane . add ( toolBar , BorderLayout . NORTH ) ;
2022-05-26 20:10:24 +02:00
btnSelectFileAnalyse = new JButton ( " " ) ;
btnSelectFileAnalyse . setToolTipText ( " Sélection du fichier d'analyse " ) ;
btnSelectFileAnalyse . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/fichierAnalyse.png " ) ) ) ;
toolBar . add ( btnSelectFileAnalyse ) ;
2022-05-24 18:25:41 +02:00
2022-05-26 20:10:24 +02:00
btnSelectFolder = new JButton ( " " ) ;
2022-05-25 15:28:58 +02:00
btnSelectFolder . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/open2.png " ) ) ) ;
2022-05-24 18:25:41 +02:00
btnSelectFolder . setSelectedIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/evalwriter.png " ) ) ) ;
2022-05-26 20:10:24 +02:00
btnSelectFolder . setToolTipText ( " Sélectionner le dossier contenant les fichiers des étudiants " ) ;
2022-05-24 18:25:41 +02:00
toolBar . add ( btnSelectFolder ) ;
2022-05-26 20:10:24 +02:00
toolBar . addSeparator ( ) ;
btnEvaluerLesFichiers = new JButton ( " " ) ;
btnEvaluerLesFichiers . setToolTipText ( " Evaluer les fichiers des étudiants " ) ;
2022-05-25 21:22:38 +02:00
2022-05-26 20:10:24 +02:00
btnFichierCSV = new JButton ( " " ) ;
btnFichierCSV . setToolTipText ( " Sélectionner la liste des étudiants " ) ;
2022-05-25 21:22:38 +02:00
btnFichierCSV . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/fichierCSV.png " ) ) ) ;
toolBar . add ( btnFichierCSV ) ;
2022-05-26 20:10:24 +02:00
btnFichierSVG = new JButton ( " " ) ;
btnFichierSVG . setToolTipText ( " Sélectionner le fichier Logo " ) ;
btnFichierSVG . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/fichierSVG.png " ) ) ) ;
toolBar . add ( btnFichierSVG ) ;
toolBar . addSeparator ( ) ;
JButton btnNewButton_1 = new JButton ( " " ) ;
btnNewButton_1 . setToolTipText ( " Créer un fichier d'analyse à partir d'un fichier ODF " ) ;
btnNewButton_1 . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/fichierODF.png " ) ) ) ;
toolBar . add ( btnNewButton_1 ) ;
toolBar . addSeparator ( ) ;
2022-05-25 18:21:23 +02:00
btnEvaluerLesFichiers . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/evaluate.png " ) ) ) ;
toolBar . add ( btnEvaluerLesFichiers ) ;
2022-05-24 18:25:41 +02:00
2022-05-26 20:10:24 +02:00
toolBar . addSeparator ( ) ;
btnAbout = new JButton ( " " ) ;
btnAbout . setIcon ( new ImageIcon ( evaluate . class . getResource ( " /resources/apropos.png " ) ) ) ;
btnAbout . setToolTipText ( " Informations " ) ;
toolBar . add ( btnAbout ) ;
2022-05-24 18:25:41 +02:00
JPanel panel = new JPanel ( ) ;
contentPane . add ( panel , BorderLayout . WEST ) ;
2022-05-26 20:10:24 +02:00
panel . setLayout ( new MigLayout ( " " , " [309px] " , " [71px][71px][][71px][][74.00][][] " ) ) ;
2022-05-25 15:28:58 +02:00
lblFileAnalyse = new JLabel ( " <HTML><B><U>Fichier de l'analyse</U></B> : </HTML> " ) ;
lblFileAnalyse . setHorizontalAlignment ( SwingConstants . LEFT ) ;
2022-05-25 21:22:38 +02:00
lblFileAnalyse . setFont ( new Font ( " Tahoma " , Font . BOLD , 14 ) ) ;
2022-05-26 20:10:24 +02:00
panel . add ( lblFileAnalyse , " flowy,cell 0 0,alignx left,growy " ) ;
2022-05-25 21:22:38 +02:00
2022-05-24 18:25:41 +02:00
chckbxfichiersEtudaints = new JCheckBox ( " Les fichiers ne sont pas dans des dossiers nominatifs " ) ;
chckbxfichiersEtudaints . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
chckbxfichiersEtudaints . setToolTipText ( " Cochez si les fichiers des étudiants ne sont pas dans des dossier nominatifs " ) ;
2022-05-26 20:10:24 +02:00
panel . add ( chckbxfichiersEtudaints , " flowy,cell 0 1,grow " ) ;
lblFichierCSV = new JLabel ( " <HTML><B><U>Fichier CSV liste des étudiants</U></B></HTML> : " ) ;
lblFichierCSV . setFont ( new Font ( " Tahoma " , Font . BOLD , 14 ) ) ;
panel . add ( lblFichierCSV , " flowy,cell 0 3,grow " ) ;
lblFichierSVG = new JLabel ( " <HTML><B><U>Fichier SVG</U></B> :</HTML> " ) ;
lblFichierSVG . setFont ( new Font ( " Tahoma " , Font . BOLD , 14 ) ) ;
panel . add ( lblFichierSVG , " flowy,cell 0 5,growx " ) ;
chckCSVNotes = new JCheckBox ( " Créer un fichier CSV des notes " ) ;
panel . add ( chckCSVNotes , " cell 0 3,grow " ) ;
lblPath . setHorizontalAlignment ( SwingConstants . LEFT ) ;
lblPath . setFont ( new Font ( " Tahoma " , Font . BOLD , 14 ) ) ;
lblPath . setText ( " <HTML><B><U>Dossier de l'analyse</U></B> : " + commandes . path . substring ( commandes . path . lastIndexOf ( " \\ " ) + 1 , commandes . path . length ( ) ) + " </HTML> " ) ;
panel . add ( lblPath , " cell 0 0,grow " ) ;
2022-05-24 18:25:41 +02:00
chckbxnoFeedback = new JCheckBox ( " Pas de feedback " ) ;
chckbxnoFeedback . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
2022-05-26 20:10:24 +02:00
panel . add ( chckbxnoFeedback , " cell 0 1,grow " ) ;
2022-05-24 18:25:41 +02:00
chckbxZipfeedback = new JCheckBox ( " Zip les feedbacks " ) ;
chckbxZipfeedback . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
2022-05-26 20:10:24 +02:00
panel . add ( chckbxZipfeedback , " cell 0 1,grow " ) ;
2022-05-24 18:25:41 +02:00
chckbxNoNote = new JCheckBox ( " Pas de note dans les feedbacks " ) ;
chckbxNoNote . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
2022-05-26 20:10:24 +02:00
panel . add ( chckbxNoNote , " cell 0 1,grow " ) ;
2022-05-25 18:21:23 +02:00
2022-05-26 20:10:24 +02:00
chckbxNewLogo = new JCheckBox ( " Nouveau logo " ) ;
chckbxNewLogo . setFont ( new Font ( " Tahoma " , Font . PLAIN , 11 ) ) ;
panel . add ( chckbxNewLogo , " cell 0 5 " ) ;
chckbxNoLogo = new JCheckBox ( " Pas de logo " ) ;
panel . add ( chckbxNoLogo , " cell 0 5 " ) ;
2022-05-24 18:25:41 +02:00
JPanel panel_1 = new JPanel ( ) ;
contentPane . add ( panel_1 , BorderLayout . CENTER ) ;
2022-05-25 15:28:58 +02:00
panel_1 . setLayout ( new GridLayout ( 1 , 0 , 0 , 0 ) ) ;
2022-05-24 18:25:41 +02:00
2022-05-25 15:28:58 +02:00
JScrollPane scrollPane = new JScrollPane ( ) ;
panel_1 . add ( scrollPane ) ;
2022-05-25 18:21:23 +02:00
progressBar = new JProgressBar ( ) ;
progressBar . setEnabled ( false ) ;
scrollPane . setColumnHeaderView ( progressBar ) ;
2022-05-24 18:25:41 +02:00
2022-05-25 18:21:23 +02:00
txtpnmessages = new JTextPane ( ) ;
2022-05-26 20:10:24 +02:00
txtpnmessages . setFont ( new Font ( " Tahoma " , Font . PLAIN , 12 ) ) ;
txtpnmessages . setText ( " Charger un fichier d'analyse. " ) ;
2022-05-25 18:21:23 +02:00
scrollPane . setViewportView ( txtpnmessages ) ;
2022-05-24 18:25:41 +02:00
2022-05-25 18:21:23 +02:00
CommandeListener ( ) ;
2022-05-24 18:25:41 +02:00
refreshLabel ( ) ;
setVisible ( true ) ;
}
2022-05-25 18:21:23 +02:00
/ * *
* Raffraichi les informations
* /
2022-05-24 18:25:41 +02:00
private void refreshLabel ( ) {
if ( ! commandes . fichierAnalyseValide ) {
2022-05-25 18:21:23 +02:00
txtpnmessages . setText ( MEPTL . verificationFichierAnalyse . messageErreur . toString ( ) ) ;
2022-05-24 18:25:41 +02:00
chckbxfichiersEtudaints . setEnabled ( false ) ;
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-25 15:28:58 +02:00
} else {
chckbxfichiersEtudaints . setEnabled ( true ) ;
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-25 15:28:58 +02:00
StringBuilder text = new StringBuilder ( ) ;
2022-05-25 21:22:38 +02:00
text . append ( " \ n*********************************************** " ) ;
2022-05-26 20:10:24 +02:00
text . append ( " \ n INFORMATIONS " ) ;
2022-05-25 21:22:38 +02:00
text . append ( " \ n*********************************************** " ) ;
text . append ( " \ nLe titre de l'exercice est : " + commandes . analyse_titre ) ;
2022-05-25 15:28:58 +02:00
text . append ( " \ n " ) ;
2022-05-25 21:22:38 +02:00
text . append ( " \ nLe sujet (metaSujet) est : " + commandes . analyse_metaSujet ) ;
2022-05-25 15:28:58 +02:00
text . append ( " \ n " ) ;
2022-05-25 21:22:38 +02:00
text . append ( " \ nL'auteur de l'exercice est : " + commandes . analyse_auteur ) ;
2022-05-25 15:28:58 +02:00
text . append ( " \ n " ) ;
2022-05-25 21:22:38 +02:00
2022-05-25 15:28:58 +02:00
if ( commandes . analyse_baremeABC = = true ) {
2022-05-25 21:22:38 +02:00
text . append ( " \ nLa notation est sous la forme d'un barème alphabétique ABCDE. " ) ;
text . append ( " \ n \ tLa progression est de " + String . valueOf ( commandes . analyse_progression ) ) ;
2022-05-25 15:28:58 +02:00
} else {
2022-05-25 21:22:38 +02:00
text . append ( " \ nLa notation est sous la forme d'une note numérique. " ) ;
text . append ( " \ n \ tLe barème est sur " + String . valueOf ( commandes . analyse_notefrom ) ) ;
text . append ( " \ n \ tLa progression est de " + String . valueOf ( commandes . analyse_progression ) ) ;
2022-05-25 15:28:58 +02:00
}
2022-05-26 20:10:24 +02:00
text . append ( " \ n______ " ) ;
text . append ( " \ nLe nom du fichier : " + commandes . analysis_filename ) ;
2022-05-25 21:22:38 +02:00
text . append ( " \ nLe hash de l'évaluation est : " + commandes . hash ) ;
2022-05-26 20:10:24 +02:00
text . append ( " \ n______ " ) ;
text . append ( " \ nHistoriques des modifications present : " + commandes . analyse_historiquePresent ) ;
text . append ( " \ n______ " ) ;
text . append ( " \ nVerification de la presence metaSujet : " + commandes . analyse_presenceMetaSujet ) ;
text . append ( " \ n______ " ) ;
text . append ( " \ nContrôle la date de céation : " + commandes . analyse_controleDateCreation ) ;
text . append ( " \ n______ " ) ;
text . append ( " \ nContrôle l'auteur initial du fichier : " + commandes . analyse_controle_Initial_Creator ) ;
2022-05-25 21:22:38 +02:00
text . append ( " \ n*********************************************** " ) ;
2022-05-25 18:21:23 +02:00
progressBar . setVisible ( false ) ;
txtpnmessages . setText ( text . toString ( ) ) ;
2022-05-25 15:28:58 +02:00
2022-05-24 18:25:41 +02:00
}
lblPath . setText ( " <HTML><B><U>Dossier de l'analyse</U></B> : " + commandes . path . substring ( commandes . path . lastIndexOf ( " \\ " ) + 1 , commandes . path . length ( ) ) + " </HTML> " ) ;
2022-05-26 20:10:24 +02:00
lblFileAnalyse . setText ( " <HTML><B><U>Fichier de l'analyse</U></B> : " + commandes . analysis_filename + " </HTML> " ) ;
lblFichierSVG . setText ( " <HTML><B><U>Fichier SVG</U></B> : " + commandes . nameSVG . substring ( commandes . nameSVG . lastIndexOf ( " \\ " ) + 1 , commandes . nameSVG . length ( ) ) + " </HTML> " ) ;
lblFichierCSV . setText ( " <HTML><B><U>Fichier CSV</U></B> : " + commandes . nameCSV + " </HTML> " ) ;
2022-05-25 21:22:38 +02:00
2022-05-24 18:25:41 +02:00
}
2022-05-25 18:21:23 +02:00
/ * *
* Les actionListener
* /
private void CommandeListener ( ) {
2022-05-24 18:25:41 +02:00
2022-05-25 18:21:23 +02:00
// Sélectionne un dossier pour analyser le contenu
btnSelectFolder . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
2022-05-24 18:25:41 +02:00
2022-05-25 18:21:23 +02:00
JFileChooser chooser = new JFileChooser ( ) ;
chooser . setCurrentDirectory ( new java . io . File ( commandes . path ) ) ;
2022-05-25 21:22:38 +02:00
chooser . setDialogTitle ( " Sélectionner le dossier contenant les fichiers des étudiants. " ) ;
2022-05-25 18:21:23 +02:00
chooser . setFileSelectionMode ( JFileChooser . DIRECTORIES_ONLY ) ;
chooser . setAcceptAllFileFilterUsed ( false ) ;
2022-05-24 18:25:41 +02:00
2022-05-25 18:21:23 +02:00
if ( chooser . showOpenDialog ( null ) = = JFileChooser . APPROVE_OPTION ) {
System . out . println ( " getCurrentDirectory(): " + chooser . getCurrentDirectory ( ) ) ;
System . out . println ( " getSelectedFile() : " + chooser . getSelectedFile ( ) . getAbsolutePath ( ) ) ;
commandes . path = chooser . getSelectedFile ( ) . getAbsolutePath ( ) ;
} else {
System . out . println ( " No Selection " ) ;
}
refreshLabel ( ) ;
2022-05-24 18:25:41 +02:00
}
2022-05-25 18:21:23 +02:00
} ) ;
2022-05-24 18:25:41 +02:00
2022-05-25 18:21:23 +02:00
// Sélectionne un fichier d'analyse
btnSelectFileAnalyse . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
new filechooserXML ( ) ;
refreshLabel ( ) ;
2022-05-24 18:25:41 +02:00
}
2022-05-25 18:21:23 +02:00
} ) ;
// Analyse le contenu du dossier
btnEvaluerLesFichiers . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
2022-05-26 20:10:24 +02:00
if ( commandes . fichierAnalyseValide ) {
try {
msgBox V = new msgBox ( " Je travaille dure. " , false , false , " Attendez " ) ;
Thread . sleep ( 500 ) ;
evaluerLesFichiersEtudiants ( ) ;
V . close ( ) ;
} catch ( ParserConfigurationException | SAXException | IOException | CloneNotSupportedException e1 ) {
e1 . printStackTrace ( ) ;
} catch ( InterruptedException e1 ) {
// TODO Auto-generated catch block
e1 . printStackTrace ( ) ;
}
} else {
new msgBox ( " Le fichier d'analyse n'est pas valide. " , true , false , " Avertissement " ) ;
2022-05-25 18:21:23 +02:00
}
2022-05-26 20:10:24 +02:00
2022-05-24 18:25:41 +02:00
}
2022-05-25 18:21:23 +02:00
} ) ;
2022-05-25 21:22:38 +02:00
// Sélectionne un fichier CSV
btnFichierCSV . addActionListener ( new ActionListener ( ) {
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 ( ) ;
commandes . fourniCSV = true ;
} else {
commandes . nameCSV = " " ;
commandes . fourniCSV = false ;
System . out . println ( " No Selection " ) ;
}
2022-05-26 20:10:24 +02:00
refreshLabel ( ) ;
}
} ) ;
// Bouton SVG
btnFichierSVG . addActionListener ( new ActionListener ( ) {
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 ) ;
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 . setText ( commandes . contenuFichierSVG ) ;
} else {
commandes . nameSVG = " " ;
commandes . contenuFichierSVG = " " ;
System . out . println ( " No Selection " ) ;
}
2022-05-25 21:22:38 +02:00
refreshLabel ( ) ;
2022-05-26 20:10:24 +02:00
2022-05-25 21:22:38 +02:00
}
} ) ;
2022-05-26 20:10:24 +02:00
// Bouton About
btnAbout . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
new about ( ) ;
}
} ) ;
2022-05-25 21:22:38 +02:00
2022-05-25 18:21:23 +02:00
}
2022-05-26 20:10:24 +02:00
/ * *
* Permet l ' évaluation des fichiers des étudaints .
* @throws ParserConfigurationException
* @throws SAXException
* @throws IOException
* @throws CloneNotSupportedException
* /
2022-05-25 18:21:23 +02:00
private void evaluerLesFichiersEtudiants ( ) throws ParserConfigurationException , SAXException , IOException , CloneNotSupportedException {
commandes . analyse = true ;
progressBar . setVisible ( true ) ;
if ( chckbxfichiersEtudaints . isSelected ( ) ) commandes . fichierStudentMoodle = true ;
if ( chckbxZipfeedback . isSelected ( ) ) commandes . zipfeedback = true ;
if ( chckbxnoFeedback . isSelected ( ) ) commandes . sansFeeback = true ;
if ( chckbxNoNote . isSelected ( ) ) commandes . noNote = true ;
if ( chckCSVNotes . isSelected ( ) ) commandes . ecritNoteCSV = true ;
2022-05-26 20:10:24 +02:00
if ( chckbxNewLogo . isSelected ( ) ) commandes . newLogo = true ;
if ( chckbxNoLogo . isSelected ( ) ) commandes . noLogo = true ;
2022-05-25 18:21:23 +02:00
meptl . analyseVerifieHistoriqueLesFichiersEtudiantsEtExportNoteCSV ( ) ;
2022-05-26 20:10:24 +02:00
2022-05-25 18:21:23 +02:00
txtpnmessages . setText ( commandes . message . toString ( ) ) ;
progressBar . setVisible ( false ) ;
2022-05-26 20:10:24 +02:00
2022-05-24 18:25:41 +02:00
}
2022-05-25 09:30:49 +02:00
2022-05-24 18:25:41 +02:00
}