diff --git a/analyseWriter.jar b/analyseWriter.jar index f77b11b..fd51137 100644 Binary files a/analyseWriter.jar and b/analyseWriter.jar differ diff --git a/bin/.gitignore b/bin/.gitignore index 6b0e9b3..75cdbd6 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -1,3 +1,2 @@ -/MEPTL/ /app/ /resources/ diff --git a/bin/MEPTL/commandes.class b/bin/MEPTL/commandes.class index 6ed088a..0115844 100644 Binary files a/bin/MEPTL/commandes.class and b/bin/MEPTL/commandes.class differ diff --git a/bin/app/about$1.class b/bin/app/about$1.class index ebca2c8..b84c663 100644 Binary files a/bin/app/about$1.class and b/bin/app/about$1.class differ diff --git a/bin/app/about.class b/bin/app/about.class index f4f7596..9d34a22 100644 Binary files a/bin/app/about.class and b/bin/app/about.class differ diff --git a/bin/app/evaluate$1.class b/bin/app/evaluate$1.class index c56dd8b..8cccf22 100644 Binary files a/bin/app/evaluate$1.class and b/bin/app/evaluate$1.class differ diff --git a/bin/app/evaluate$2.class b/bin/app/evaluate$2.class index cfc3e0f..8548c94 100644 Binary files a/bin/app/evaluate$2.class and b/bin/app/evaluate$2.class differ diff --git a/bin/app/evaluate.class b/bin/app/evaluate.class index 92c2ded..8419358 100644 Binary files a/bin/app/evaluate.class and b/bin/app/evaluate.class differ diff --git a/bin/exit.svg b/bin/exit.svg new file mode 100644 index 0000000..024f1b8 --- /dev/null +++ b/bin/exit.svg @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + diff --git a/bin/fichierAnalyseInfo.png b/bin/fichierAnalyseInfo.png new file mode 100644 index 0000000..e65ccfb Binary files /dev/null and b/bin/fichierAnalyseInfo.png differ diff --git a/bin/fichierCSVInfo.png b/bin/fichierCSVInfo.png new file mode 100644 index 0000000..c5de141 Binary files /dev/null and b/bin/fichierCSVInfo.png differ diff --git a/bin/fichier_analyseXML info.svg b/bin/fichier_analyseXML info.svg new file mode 100644 index 0000000..883da90 --- /dev/null +++ b/bin/fichier_analyseXML info.svg @@ -0,0 +1,270 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + XML + + + + + + + + diff --git a/bin/fichier_csv_student_info.svg b/bin/fichier_csv_student_info.svg new file mode 100644 index 0000000..214aa04 --- /dev/null +++ b/bin/fichier_csv_student_info.svg @@ -0,0 +1,283 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + CSV + + + + + + + + diff --git a/icons/fichierAnalyseInfo2.png b/icons/fichierAnalyseInfo2.png new file mode 100644 index 0000000..5931716 Binary files /dev/null and b/icons/fichierAnalyseInfo2.png differ diff --git a/icons/fichier_analyseXML info1.svg b/icons/fichier_analyseXML info1.svg new file mode 100644 index 0000000..2a2ca4c --- /dev/null +++ b/icons/fichier_analyseXML info1.svg @@ -0,0 +1,350 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + XML + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/MEPTL/commandes.java b/src/MEPTL/commandes.java index 44e72a6..9953cff 100644 --- a/src/MEPTL/commandes.java +++ b/src/MEPTL/commandes.java @@ -57,7 +57,8 @@ public class commandes { public static String contenuFichierSVG =""; // Le nouveau logo public static String path =""; public static String pathDestination =""; //Pour le mode console uniquement - public static String version ="3.6.1"; // La version actuelle + public static String version ="4.0.0"; // La version actuelle + public static String nomDeLaBranch = "Origin"; //Branche de développement public static String Command =""; //récupère le texte de la commande dans la console //** setting valeur par défaut diff --git a/src/app/about.java b/src/app/about.java index 741e532..76e5018 100644 --- a/src/app/about.java +++ b/src/app/about.java @@ -8,8 +8,12 @@ import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.SwingConstants; +import javax.swing.filechooser.FileView; import MEPTL.commandes; +import javax.swing.JButton; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; public class about extends JFrame { @@ -50,7 +54,7 @@ public class about extends JFrame { setResizable(false); setTitle(commandes.Titre); setLocation(100, 100); - setSize(383,415); + setSize(418,415); // setBounds(100, 100, 426, 486); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); getContentPane().setLayout(null); @@ -67,30 +71,30 @@ public class about extends JFrame { lblNewLabelTitre.setBounds(10, 10, 357, 90); contentPane.add(lblNewLabelTitre); - JLabel lblNewLabelVersion = new JLabel("Version : " + commandes.version + ""); + JLabel lblNewLabelVersion = new JLabel("Version : " + commandes.version + " "+ commandes.nomDeLaBranch + ""); lblNewLabelVersion.setFont(new Font("Tahoma", Font.PLAIN, 16)); - lblNewLabelVersion.setBounds(20, 90, 240, 20); + lblNewLabelVersion.setBounds(20, 100, 240, 20); contentPane.add(lblNewLabelVersion); JLabel lblNewLabelAnnee = new JLabel("Année : " + commandes.Annee + ""); lblNewLabelAnnee.setFont(new Font("Tahoma", Font.PLAIN, 16)); - lblNewLabelAnnee.setBounds(20, 110, 240, 20); + lblNewLabelAnnee.setBounds(20, 120, 240, 20); contentPane.add(lblNewLabelAnnee); JLabel lblCredit = new JLabel("Crédit"); lblCredit.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 14)); - lblCredit.setBounds(20, 230, 60, 20); + lblCredit.setBounds(20, 254, 60, 20); getContentPane().add(lblCredit); JLabel lblNewLabelAuteur = new JLabel("Auteur : P. Rodriguez"); lblNewLabelAuteur.setFont(new Font("Tahoma", Font.PLAIN, 14)); - lblNewLabelAuteur.setBounds(20, 250, 240, 20); + lblNewLabelAuteur.setBounds(20, 271, 240, 20); contentPane.add(lblNewLabelAuteur); JLabel lblInformationEnseignant = new JLabel("Enseignants d'informatique à l'université d'Artois"); lblInformationEnseignant.setFont(new Font("Tahoma", Font.PLAIN, 12)); - lblInformationEnseignant.setBounds(20, 270, 296, 20); + lblInformationEnseignant.setBounds(20, 285, 296, 20); getContentPane().add(lblInformationEnseignant); JLabel lblCommentaire = new JLabel("Outil permettant l’évaluation des fichiers réalisés avec un traitement de texte au format ODF.

" @@ -98,16 +102,31 @@ public class about extends JFrame { lblCommentaire.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblCommentaire.setHorizontalAlignment(SwingConstants.LEFT); lblCommentaire.setVerticalAlignment(SwingConstants.TOP); - lblCommentaire.setBounds(20, 144, 326, 75); + lblCommentaire.setBounds(20, 155, 326, 88); getContentPane().add(lblCommentaire); - JLabel lblLicence = new JLabel("Licence : GNU GLP 3.0"); - lblLicence.setFont(new Font("Tahoma", Font.PLAIN, 16)); - lblLicence.setBounds(20, 305, 296, 35); + JLabel lblLicence = new JLabel("Licence : GNU GLP 3.0 "); + lblLicence.setFont(new Font("Tahoma", Font.PLAIN, 14)); + lblLicence.setBounds(20, 316, 296, 35); getContentPane().add(lblLicence); + JButton btnNewButton = new JButton("Vérifier la version"); + btnNewButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + try { + String url = "https://forge.chapril.org/pablo/analyseWriter/releases"; + java.awt.Desktop.getDesktop().browse(java.net.URI.create(url)); + } + catch (java.io.IOException e1) { + System.out.println(e1.getMessage()); + } + + } + }); + btnNewButton.setBounds(246, 101, 138, 23); + getContentPane().add(btnNewButton); + } - } diff --git a/src/app/evaluate.java b/src/app/evaluate.java index 664c8df..1084375 100644 --- a/src/app/evaluate.java +++ b/src/app/evaluate.java @@ -22,6 +22,7 @@ import javax.xml.parsers.ParserConfigurationException; import org.xml.sax.SAXException; import MEPTL.commandes; +import MEPTL.ecritureSujet; import MEPTL.meptl; import cXML.Run; import cXML.node; @@ -61,7 +62,9 @@ public class evaluate extends JFrame { private JButton btnFichierSVG = new JButton(); private JButton btnExit = new JButton(); private JButton btnInformationAnalyse = new JButton(); - private JButton btnInfoListeEtudiant; + private JButton btnNewFichierAnalyse = new JButton(); + private JButton btnInfoListeEtudiant = new JButton(); + private JButton btnAfficheCodeFichierAnalyse = new JButton(); /** * Create the frame. @@ -88,9 +91,14 @@ public class evaluate extends JFrame { btnInformationAnalyse = new JButton(""); btnInformationAnalyse.setToolTipText("Information sur l'analyse"); - btnInformationAnalyse.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierAnalyseInfo.png"))); + btnInformationAnalyse.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierAnalyseInfo2.png"))); toolBar.add(btnInformationAnalyse); + btnAfficheCodeFichierAnalyse = new JButton(""); + btnAfficheCodeFichierAnalyse.setToolTipText("Afficher le code XML du fichier d'analyse"); + btnAfficheCodeFichierAnalyse.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierAnalyseInfo.png"))); + toolBar.add(btnAfficheCodeFichierAnalyse); + btnSelectFolder = new JButton(""); btnSelectFolder.setIcon(new ImageIcon(evaluate.class.getResource("/resources/open2.png"))); btnSelectFolder.setSelectedIcon(new ImageIcon(evaluate.class.getResource("/resources/evalwriter.png"))); @@ -121,10 +129,10 @@ public class evaluate extends JFrame { 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); + btnNewFichierAnalyse = new JButton(""); + btnNewFichierAnalyse.setToolTipText("Créer un fichier d'analyse à partir d'un fichier ODF"); + btnNewFichierAnalyse.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierODF.png"))); + toolBar.add(btnNewFichierAnalyse); toolBar.addSeparator(); @@ -347,6 +355,7 @@ public class evaluate extends JFrame { } }); + // Analyse le contenu du dossier btnEvaluerLesFichiers.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -471,7 +480,72 @@ public class evaluate extends JFrame { } }); + + // création d'un nouveau fichier d'analyse + btnNewFichierAnalyse.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + JFileChooser chooser = new JFileChooser(); + chooser.setDialogTitle("Choisir un fichier ODF"); + + chooser.setCurrentDirectory(new java.io.File(commandes.path)); + chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); + FileNameExtensionFilter filter = new FileNameExtensionFilter("Format ODF", "odt"); + 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.path = chooser.getCurrentDirectory().getAbsolutePath(); + commandes.PathFilenameAnalysis = chooser.getSelectedFile().getAbsolutePath(); + commandes.nameSujet = chooser.getSelectedFile().getName(); + + Run b = null; + try { + b = new Run(commandes.PathFilenameAnalysis); + node nodSujet = Run.XMLContent(b.getLectDossiers().getEC().getListeContentWriter().get(0)); + nodSujet = meptl.LectureFichierEtudiantSousFormeDeNode(nodSujet,b,0); + nodSujet.getAttributs().put("analysis_filename","sujet.xml"); + nodSujet = ecritureSujet.nodePourEcritureSujet(nodSujet,b,0); + Run.ecritureNodeEnXML(nodSujet, "sujet",commandes.path,"Sujet"); + txtpnmessages.setText(Run.ecritureNode(nodSujet, 0).toString() + + "\n\n" + +"\n*************************" + +"\nLe fichier sujet.xml a été généré dans le dossier :" + +"\n" + commandes.path + +"\n*************************"); + commandes.fichierAnalyseValide=true; + + } catch (ParserConfigurationException | SAXException | IOException | CloneNotSupportedException e1) { + e1.printStackTrace(); + } + + } else { + commandes.nameSujet = ""; + commandes.PathFilenameAnalysis = ""; + System.out.println("No Selection "); + commandes.fichierAnalyseValide=false; + refreshLabel(); + } + + commandes.ecritCode = true; + + } + }); + + // Affiche le code XML du node sujet + btnAfficheCodeFichierAnalyse.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + if(commandes.fichierAnalyseValide) { + txtpnmessages.setText(Run.ecritureNode(commandes.sujet, 0).toString()); + }else { + txtpnmessages.setText("*** Veuillez charger un fichier d'analyse ***"); + } + } + }); + } diff --git a/src/resources/fichierAnalyseInfo2.png b/src/resources/fichierAnalyseInfo2.png new file mode 100644 index 0000000..5931716 Binary files /dev/null and b/src/resources/fichierAnalyseInfo2.png differ