diff --git a/aW.xml b/aW.xml index 302eec5..ba5525e 100644 --- a/aW.xml +++ b/aW.xml @@ -3,7 +3,7 @@ false gui C:\Users\pabr6\git\analyseWriter\MEPTL\analyseWriter.jar - C:\Users\pabr6\OneDrive\Documents\Second exercice avec analyseWriter - Champ auteur\analyseWriter\analyseWriter.exe + C:\Users\pabr6\OneDrive\Documents\Troisième exercices avec analyseWriter\analyseWriter\analyseWriter.exe Erreur diff --git a/analyseWriter.jar b/analyseWriter.jar index 6fb98cc..90daf37 100644 Binary files a/analyseWriter.jar and b/analyseWriter.jar differ diff --git a/bin/.gitignore b/bin/.gitignore index 933d655..1d86f31 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -1,9 +1,3 @@ -/MEPTL/ /app/ -/resources/ /calcul/ -/analyseWriter.bmp -/analyseWriter.ico -/setting.png -/setting.svg -/settingmini.png +/MEPTL/ diff --git a/bin/MEPTL/ecritureSujet.class b/bin/MEPTL/ecritureSujet.class index cd55388..643e475 100644 Binary files a/bin/MEPTL/ecritureSujet.class and b/bin/MEPTL/ecritureSujet.class differ diff --git a/bin/MEPTL/meptl.class b/bin/MEPTL/meptl.class index 776f668..534fb60 100644 Binary files a/bin/MEPTL/meptl.class and b/bin/MEPTL/meptl.class differ diff --git a/bin/analyseWriter.bmp b/bin/analyseWriter.bmp new file mode 100644 index 0000000..9d88a28 Binary files /dev/null and b/bin/analyseWriter.bmp differ diff --git a/bin/analyseWriter.ico b/bin/analyseWriter.ico new file mode 100644 index 0000000..2587dfc Binary files /dev/null and b/bin/analyseWriter.ico differ diff --git a/bin/app/afficheText.class b/bin/app/afficheText.class index 3b4ab12..2235139 100644 Binary files a/bin/app/afficheText.class and b/bin/app/afficheText.class differ diff --git a/bin/app/create$56.class b/bin/app/create$56.class index 80f5b83..519293b 100644 Binary files a/bin/app/create$56.class and b/bin/app/create$56.class differ diff --git a/bin/app/create$57.class b/bin/app/create$57.class index 4248ba6..ddfd879 100644 Binary files a/bin/app/create$57.class and b/bin/app/create$57.class differ diff --git a/bin/app/create.class b/bin/app/create.class index a6df0a8..cb14b30 100644 Binary files a/bin/app/create.class and b/bin/app/create.class differ diff --git a/bin/app/proprieteFichierAnalyse$1.class b/bin/app/proprieteFichierAnalyse$1.class index 6097fe0..247ab9e 100644 Binary files a/bin/app/proprieteFichierAnalyse$1.class and b/bin/app/proprieteFichierAnalyse$1.class differ diff --git a/bin/app/proprieteFichierAnalyse$2.class b/bin/app/proprieteFichierAnalyse$2.class index 14519fd..9e1ab04 100644 Binary files a/bin/app/proprieteFichierAnalyse$2.class and b/bin/app/proprieteFichierAnalyse$2.class differ diff --git a/bin/app/proprieteFichierAnalyse$3.class b/bin/app/proprieteFichierAnalyse$3.class index 5db167c..3889a32 100644 Binary files a/bin/app/proprieteFichierAnalyse$3.class and b/bin/app/proprieteFichierAnalyse$3.class differ diff --git a/bin/app/proprieteFichierAnalyse$4.class b/bin/app/proprieteFichierAnalyse$4.class index dbc880f..b2e3dc0 100644 Binary files a/bin/app/proprieteFichierAnalyse$4.class and b/bin/app/proprieteFichierAnalyse$4.class differ diff --git a/bin/app/proprieteFichierAnalyse.class b/bin/app/proprieteFichierAnalyse.class index ea5de65..9132f37 100644 Binary files a/bin/app/proprieteFichierAnalyse.class and b/bin/app/proprieteFichierAnalyse.class differ diff --git a/bin/resources/setting.png b/bin/resources/setting.png new file mode 100644 index 0000000..42cdf11 Binary files /dev/null and b/bin/resources/setting.png differ diff --git a/bin/resources/settingmini.png b/bin/resources/settingmini.png new file mode 100644 index 0000000..2087db5 Binary files /dev/null and b/bin/resources/settingmini.png differ diff --git a/bin/setting.png b/bin/setting.png new file mode 100644 index 0000000..42cdf11 Binary files /dev/null and b/bin/setting.png differ diff --git a/bin/setting.svg b/bin/setting.svg new file mode 100644 index 0000000..450cd87 --- /dev/null +++ b/bin/setting.svg @@ -0,0 +1,115 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/bin/settingmini.png b/bin/settingmini.png new file mode 100644 index 0000000..2087db5 Binary files /dev/null and b/bin/settingmini.png differ diff --git a/src/MEPTL/ecritureSujet.java b/src/MEPTL/ecritureSujet.java index 339b6c7..dcbbe20 100644 --- a/src/MEPTL/ecritureSujet.java +++ b/src/MEPTL/ecritureSujet.java @@ -294,7 +294,10 @@ public class ecritureSujet { return noPourPlacerEvaluer; } - + /** + * Ajoute les attribut d'analyseWriter par défaut + * @param no + */ private static void nextNodesEnfants(ArrayList no) { for(int k=0 ; k < no.size(); k++) { if(no.get(k)!=null) { diff --git a/src/MEPTL/meptl.java b/src/MEPTL/meptl.java index 1750a39..9b385b8 100644 --- a/src/MEPTL/meptl.java +++ b/src/MEPTL/meptl.java @@ -498,7 +498,8 @@ public class meptl { /** - * Lecture du fichier Writer des étudiants et fournir tous les nodes de la lecture dans un node nommé "fichier". + * Lecture du fichier Writer des étudiants et fournir tous les nodes de la lecture dans un node nommé "fichier".
+ * Permet aussi de créer un fichier d'analyse à partir d'un fichier ODF.
* @param nod Le node Writer de l'étudiant. * @param a Objet de la class Run package cXML * @param i Index de l'étudiant dans la liste EC de l'objet a. @@ -515,23 +516,22 @@ public class meptl { // ajoute les créateurs ou éditeur dans les nodes dc:creator ou meta:initial-creator // Pour permettre l'analyse avec les attributs evalNameCreator ou evalNameInitialCreator - if(!commandes.ecritCode) { - if(nodmeta.retourneEnfantsByNameExist("dc:creator")) { - if(a.getLectDossiers().getEC().getListeNomDossier().get(i)!=null) { - nodmeta.retourneFirstEnfantsByName("dc:creator").getAttributs().put("creator", a.getLectDossiers().getEC().getListeNomDossier().get(i)); - }else { - nodmeta.retourneFirstEnfantsByName("dc:creator").getAttributs().put("creator", "null"); - } - } - - if(nodmeta.retourneEnfantsByNameExist("meta:initial-creator")) { - if(a.getLectDossiers().getEC().getListeNomDossier().get(i)!=null) { - nodmeta.retourneFirstEnfantsByName("meta:initial-creator").getAttributs().put("initial-creator", a.getLectDossiers().getEC().getListeNomDossier().get(i)); - }else { - nodmeta.retourneFirstEnfantsByName("meta:initial-creator").getAttributs().put("initial-creator", "null"); - } + if(nodmeta.retourneEnfantsByNameExist("dc:creator")) { + if(a.getLectDossiers().getEC().getListeNomDossier().get(i)!=null) { + nodmeta.retourneFirstEnfantsByName("dc:creator").getAttributs().put("creator", a.getLectDossiers().getEC().getListeNomDossier().get(i)); + }else { + nodmeta.retourneFirstEnfantsByName("dc:creator").getAttributs().put("creator", "null"); } } + + if(nodmeta.retourneEnfantsByNameExist("meta:initial-creator")) { + if(a.getLectDossiers().getEC().getListeNomDossier().get(i)!=null) { + nodmeta.retourneFirstEnfantsByName("meta:initial-creator").getAttributs().put("initial-creator", a.getLectDossiers().getEC().getListeNomDossier().get(i)); + }else { + nodmeta.retourneFirstEnfantsByName("meta:initial-creator").getAttributs().put("initial-creator", "null"); + } + } + node nodstyle = new node(); @@ -575,12 +575,13 @@ public class meptl { node nodsequence = new node(); nodsequence.setNomElt("sequences"); nodsequence.addNode(a.retourneNames(nodbody, "text:sequence-decl")); - + + // le node des frames : renomme les nodes style:style avec le nom de draw:name exemple style:styledraw:name // si une draw:text-box contenant un attribut fo:min-height alors ajoute dans darw:farme l'attribut svg:height node nodframe = new node(); nodframe.setNomElt("frames"); - nodframe.addNode(a.retourneNames(nodbody, "draw:frame")); + nodframe.addNode(a.retourneNames(nodbody, "draw:frame")); //Problème place des doublons dans la liste des nodes for(int j = 0 ; j < nodframe.getNodes().size(); j++) { node nodframestyle = a.retourneFirstNodeByNameAttributValue(nodstyle, "style:style", "style:name", nodframe.getNodes().get(j).getAttributs().get("draw:style-name")); String nomObjet = nodframe.getNodes().get(j).getAttributs().get("draw:name"); @@ -593,6 +594,7 @@ public class meptl { nodframe.getNodes().get(j).getAttributs().put("svg:height", a.retourneName(nodframe.getNodes().get(j), "draw:text-box", "fo:min-height").getAttributs().get("fo:min-height")); } } + // le node section node nodsection = new node(); @@ -1927,7 +1929,7 @@ public class meptl { if(nodeStudent!=null) { retour = evaluNameCreator(retour,nodeStudent, nodeStudent.getContenu().get(0), sujet.getAttributs().get("evalNameCreator"),"Editeur"); }else { - retour = evaluNameCreator(retour,null, "Editeur inconnu", sujet.getAttributs().get("evalNameCreator"),"Editeur"); + retour = evaluNameCreator(retour,null, "Pas trouvé le champ auteur", sujet.getAttributs().get("evalNameCreator"),"Editeur"); } } diff --git a/src/app/afficheText.java b/src/app/afficheText.java index f8ad0da..e8b3f03 100644 --- a/src/app/afficheText.java +++ b/src/app/afficheText.java @@ -10,6 +10,7 @@ import java.util.stream.Collectors; import javax.swing.JEditorPane; import MEPTL.commandes; +import MEPTL.outils; import cXML.node; import calcul.calculIntervalleBaremeABCDE; import calcul.calculNotesProgression; @@ -49,15 +50,31 @@ public class afficheText extends JEditorPane { sb.append("

Parent = " + nodeParent.getNomElt() + "


"); sb.append("

Nom du node : " + nod.getNomElt() + "



"); + + //sous titre pour identifier les éléments if(nod.getNomElt().equals("style:style")) { sb.append("

Nom du style : " + nod.getAttributs().get("style:name")+ "


"); } + if(nod.getNomElt().equals("draw:frame")) { + sb.append("

Nom du frame : " + outils.withoutCodeAndPointPourRechercheContenuExact(nod.getAttributs().get("draw:name"))+ "


"); + } + if(nod.getNomElt().equals("style:master-page")) { + sb.append("

Nom du style de page : " + nod.getAttributs().get("style:display-name")+ "


"); + } + if(nod.getNomElt().equals("page")) { + sb.append("

Numero absolue de la page : " + outils.withoutCodeAndPointPourRechercheContenuExact(nod.getAttributs().get("numeroabsolue")) + + " - Numerotation de la page : " + outils.withoutCodeAndPointPourRechercheContenuExact(nod.getAttributs().get("numero"))+ "


"); + } + + + if(nod.getAttributs().get("evaluer")!=null) if(nod.getAttributs().get("evaluer").equalsIgnoreCase("true")) { sb.append("

Ce node est évalué.

"); } + if(nod.getAttributs().size()>0) { if(nod.getAttributs().size()==1) sb.append("

L'ATTRIBUT DU NODE

"); if(nod.getAttributs().size()>1) sb.append("

LES ATTRIBUTS DU NODE

"); diff --git a/src/app/create.java b/src/app/create.java index a3a0199..bf9c140 100644 --- a/src/app/create.java +++ b/src/app/create.java @@ -2302,30 +2302,33 @@ public class create extends JFrame { 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.PathFilenameAnalysis = chooser.getCurrentDirectory().getAbsolutePath(); + String cheminVersFichier = 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)); + b = new Run(cheminVersFichier); + commandes.sujet = Run.XMLContent(b.getLectDossiers().getEC().getListeContentWriter().get(0)); + + commandes.sujet = meptl.LectureFichierEtudiantSousFormeDeNode(commandes.sujet,b,0); + commandes.sujet.getAttributs().put("analysis_filename","sujet.xml"); + + commandes.sujet = ecritureSujet.nodePourEcritureSujet(commandes.sujet,b,0); commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:change-start"); commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:change-end"); commandes.sujetSauvegarde = commandes.sujet.clone(); - nodSujet = meptl.LectureFichierEtudiantSousFormeDeNode(nodSujet,b,0); - nodSujet.getAttributs().put("analysis_filename","sujet.xml"); - commandes.sujet = ecritureSujet.nodePourEcritureSujet(nodSujet,b,0); - - new verificationFichierAnalyse(); + if(commandes.fichierAnalyseValide) { constructionTree(); - textNodeSelect.afficheChargementFichierAnalyse(); + textNodeSelect.afficheChargementFichierAnalyse(); }else { textNodeSelect.setText("

Le fichier n'est pas valise

"); } @@ -2336,7 +2339,6 @@ public class create extends JFrame { } else { textNodeSelect.refreshAffichage(null); -// refeshNodeSelected(); } @@ -2379,13 +2381,14 @@ public class create extends JFrame { Run.parentAndLevel(commandes.sujet, commandes.sujet, 0); - DefaultMutableTreeNode node0 = null; - DefaultMutableTreeNode node1 = null; - DefaultMutableTreeNode node2 = null; - DefaultMutableTreeNode node3 = null; - DefaultMutableTreeNode node4 = null; - DefaultMutableTreeNode node5 = null; - DefaultMutableTreeNode node6 = null; + try { + Run.ecritureNodeEnXML(commandes.sujet, "test", commandes.PathFilenameAnalysis, ""); + } catch (IOException e) { + e.printStackTrace(); + } + + DefaultMutableTreeNode root = null; + commandes.tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); commandes.tree.setExpandsSelectedPaths(true); @@ -2396,34 +2399,10 @@ public class create extends JFrame { if(commandes.sujet.getNomElt().equals("fichier")) { - node0 = new DefaultMutableTreeNode(commandes.sujet.getNomElt(),true); - - if(commandes.sujet!=null) for(int i = 0 ; i < commandes.sujet.getNodes().size(); i++) { - node1 = new DefaultMutableTreeNode(commandes.sujet.getNodes().get(i)); - if(commandes.sujet.getNodes().get(i)!=null) for(int j = 0 ; j < commandes.sujet.getNodes().get(i).getNodes().size();j++) { - node2 = new DefaultMutableTreeNode(commandes.sujet.getNodes().get(i).getNodes().get(j)); - if(commandes.sujet.getNodes().get(i).getNodes().get(j)!=null) for(int k = 0 ; k