package fenetres; import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; import javax.swing.JEditorPane; import javax.swing.text.DefaultCaret; import MEPTL.commandes; import cXML.node; import calcul.calculIntervalleBaremeABCDE; import calcul.calculNotesProgression; import evaluer.evaluation; import list.descriptionNode; import list.listeAttributsAnalyseWriter; public class afficheText extends JEditorPane { /** * */ private static final long serialVersionUID = 1L; /** * Raffraichie l'affichage de la fenête create lorsque selection d'un node. * @param nod */ public void refreshAffichage(node nod) { //Important pour l'affichage car affiche le texte toujours au début en haut de l'affichage. DefaultCaret caret = (DefaultCaret) this.getCaret(); caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE); if(nod!=null) { setContentType("text/html"); node nodeParent = nod.getParent(); String imageAllContent = ""; String imageTitre = ""; String imageSaut = ""; String imageaddmenu = ""; String imagerechercheIndex = ""; String imagerechercheContenuExact = ""; String imagereanalyseStyle = ""; String imagereEvaleNode = ""; String imagereRechercheAncragePage= ""; String imagereRecherchePlusProcheVoisin= ""; String imagerePremierAuteur= ""; String imagereDernierEditeur= ""; String imageAtraversAnalyseStyle= ""; String imageEntetePasActive= ""; String imagePiedPagePasActive= ""; String imageEvalNameSequence= ""; String imageEvalNamePage= ""; String imagePoids= ""; String imageEvalNumeroPage= ""; String imageEvalNumeroAbsoluePage= ""; String imageEvalTextUserDefined= ""; String imageEnteteActive= ""; String imagePiedPageActive= ""; String imageOU= ""; String imageEvalPlacement= ""; String imageMarqueNode= ""; String imageEvalNameLegacyStyle= ""; String imageInformation= ""; String imageDernierEnfant= ""; String imagePremierEnfant= ""; String imageIsDoublon= ""; String imageEvalAncrageNumeroAbsoluPage= ""; String imageEvalFormatageDirect= ""; String imageEvalSautPageColonne= ""; String imageEvalPasParagrapheVide= ""; String imageEvalNombreDePageMaxi= ""; String imageEvalNombreDePageMini= ""; String imageEvalLegacyStyleParentPresent= ""; String imageEvalTabAlignGauche= ""; String imageEvalTabStyleLeader= ""; StringBuilder sb = new StringBuilder(); sb.append(baliseStyle.balise()); if(nodeParent!=null) sb.append("
Node parent = " + nodeParent.getNomElt() + "
"); sb.append("Niveau = " + nod.getLevel() + "
Ce node est évalué.
"); } if(nod.getAttributs().size()>0) { if(nod.getAttributs().size()==1) sb.append("Les attributs d'analyseWriter
"); for(int i=0; i < Lesattributsdunode.size();i++) { if(listeAttributsAnalyseWriter.isAttributAnalyseWriter(Lesattributsdunode.get(i))) { if(Lesattributsdunode.get(i).equals("allContent")) { Pattern p = Pattern.compile("[1-9]$|[0-9]{2,}$"); Matcher m = p.matcher(nod.getAttributs().get(Lesattributsdunode.get(i))); if(m.find()) { sb.append("Les attributs de Writer
"); for(int i=0; i < Lesattributsdunode.size();i++) { if(!listeAttributsAnalyseWriter.isAttributAnalyseWriter(Lesattributsdunode.get(i))) { if(!nod.getAttributs().get(Lesattributsdunode.get(i)).contains("‼")&&!nod.getAttributs().get(Lesattributsdunode.get(i)).contains("‽")) { sb.append("Les attributs d'analyseWriter
"); for(int i=0; i < Lesattributsdunode.size();i++) { if(listeAttributsAnalyseWriter.isAttributAnalyseWriter(Lesattributsdunode.get(i))) { sb.append("Les attributs de Writer
"); for(int i=0; i < Lesattributsdunode.size();i++) { if(!listeAttributsAnalyseWriter.isAttributAnalyseWriter(Lesattributsdunode.get(i))) { if(!nod.getAttributs().get(Lesattributsdunode.get(i)).contains("‼")&&!nod.getAttributs().get(Lesattributsdunode.get(i)).contains("‽")) { sb.append("Parent = " + nodeParent.getNomElt() + "
Uniquement les nodes évalués
"); sb.append("TOTAL POINT = " + String.valueOf(pointTotalNode) + "
"); setText(""+sb.toString()+""); } /** * Affiche le nombre de point et la répartition dans les nodes principaux. * @param liste */ public void afficheListeDesPointsDansToutExercice(ArrayListDans le node "+ A[0] + ".
"
+ "Le nombre de point brut est de " + A[1] + "
"
+ "Le poids est de " + A[2]+ " soit un total de " + f.format(NbrPointApresPonderation) + "
Fichier d'analyse créé avec la version : " + v + "
" + "Nom du fichier d'analyse : "+ commandes.nameSujet + "
" + "Nom de l'évaluation : "+ commandes.NameEvaluationCharger + "
Le sujet (metaSujet) est : " + commandes.analyse_metaSujet+"
"); text.append("L'auteur de l'exercice est : " + commandes.analyse_auteur+"
"); if(commandes.sujet.getAttributs().get("date")!=null) { dateEnregistrementFichierAnalyse = calcul.formatDateWriter.DateEnClairFR(calcul.formatDateWriter.DateLibreOffice(commandes.sujet.getAttributs().get("date"))); text.append("Date d'enregistrement du fichier d'analyse : " + dateEnregistrementFichierAnalyse +"
"); } text.append("La notation est sous la forme d'une note alphabétique ABCDE.
"); text.append("La progression est de " + String.valueOf(commandes.analyse_progression)+ "
"); calcul.calculIntervalleBaremeABCDE C = new calculIntervalleBaremeABCDE(commandes.analyse_progression); text.append("" + C.getMessageLigne() + "
"); }else { text.append("La notation est sous la forme d'une note numérique.
"); text.append("Le barème est sur " + String.valueOf(commandes.analyse_notefrom)+ "
"); text.append("La progression est de " + String.valueOf(commandes.analyse_progression) + "
"); calculNotesProgression C = new calculNotesProgression(commandes.analyse_progression, commandes.analyse_notefrom); text.append("" + C.getMessageLigne() + "
"); } text.append("La distance de Lenvenhein : " + String.valueOf(commandes.tolerance_text)+ ".
"); text.append("Le nom du fichier d'analyse est : " + commandes.analysis_filename + "
"); text.append("Le hash de l'évaluation est : " + commandes.hash + "
"); text.append("Historiques des modifications present : " + commandes.analyse_historiquePresent + "
"); text.append("Verification de la presence metaSujet : " + commandes.analyse_presenceMetaSujet + "
"); text.append("Contrôle la date de création : " + commandes.analyse_controleDateCreation+ "
"); text.append("Contrôle la date minimale des modifications : " + commandes.analyse_controleDateModificationMini+ "
"); text.append("Contrôle l'auteur initial du fichier : " + commandes.analyse_controle_Initial_Creator + "
"); text.append("Exclure le nom du créateur dans l'analyse des historiques : " + commandes.analyse_exclure_name_creator + "
"); text.append("Le nom du créateur à exclure dans l'analyse des historiques est : " + commandes.analyse_auteur_exclure_historique + "
"); text.append("Dossier de l'analyse contenant les fichiers des étudiants, feedbacks et notes :
"); text.append(""+commandes.path+"
"); text.append("Fichier d'analyse :
"); text.append("Chemin : "+commandes.PathFilenameAnalysis+"
"); text.append("Nom du fichier : "+commandes.analysis_filename+"
"); text.append("Date d'enregistrement du fichier d'analyse : " + dateEnregistrementFichierAnalyse +"
"); text.append("La base de données des évaluations :
"); text.append("La base de données des évaluations se trouve : " + commandes.PathBaseEvaluations +"
" + "La base de données se nomme : " + commandes.NameBaseEvaluations +"
"); setContentType("text/html"); setText(text.toString()); } /** * * @param TextErreur */ public void afficheErreur(String TextErreur) { setText(TextErreur); } }