diff --git a/bin/.gitignore b/bin/.gitignore index 926549c..4280b7b 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -1,3 +1,7 @@ /fenetres/ /xml/ /AnalyseCalc/ +/menu/ +/actions/ +/list/ +/resources/ diff --git a/bin/actions/actNewFichierAnalyse.class b/bin/actions/actNewFichierAnalyse.class index a3826eb..c2eef8a 100644 Binary files a/bin/actions/actNewFichierAnalyse.class and b/bin/actions/actNewFichierAnalyse.class differ diff --git a/bin/fenetres/baliseStyle.class b/bin/fenetres/baliseStyle.class index 23c16a4..82932e7 100644 Binary files a/bin/fenetres/baliseStyle.class and b/bin/fenetres/baliseStyle.class differ diff --git a/bin/fenetres/create$1.class b/bin/fenetres/create$1.class index 857f436..9b41d32 100644 Binary files a/bin/fenetres/create$1.class and b/bin/fenetres/create$1.class differ diff --git a/bin/fenetres/create$2.class b/bin/fenetres/create$2.class index 0b9e6d3..75d6ad5 100644 Binary files a/bin/fenetres/create$2.class and b/bin/fenetres/create$2.class differ diff --git a/bin/fenetres/create.class b/bin/fenetres/create.class index 9c56bdd..24c6de0 100644 Binary files a/bin/fenetres/create.class and b/bin/fenetres/create.class differ diff --git a/bin/list/listeEvalNameNode.class b/bin/list/listeEvalNameNode.class index 18a25dd..16f74f9 100644 Binary files a/bin/list/listeEvalNameNode.class and b/bin/list/listeEvalNameNode.class differ diff --git a/src/actions/actAllContent.java b/src/actions/actAllContent.java new file mode 100644 index 0000000..cee502d --- /dev/null +++ b/src/actions/actAllContent.java @@ -0,0 +1,39 @@ +package actions; + +import java.awt.event.ActionEvent; +import java.awt.event.KeyEvent; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.ImageIcon; +import javax.swing.KeyStroke; + +import fenetres.allContent; +import fenetres.create; +import list.listeDesNodesAllContent; +import xml.node; + + +public class actAllContent extends AbstractAction{ + + /** + * + */ + private static final long serialVersionUID = 1L; + { + putValue( Action.NAME, "Evaluer le contenu du node" ); + putValue( Action.SHORT_DESCRIPTION, "Evaluer le contenu du node (SHIFT+A)" ); + putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/allcontentmini.png")) ); + putValue( Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.SHIFT_DOWN_MASK) ); + putValue( Action.LARGE_ICON_KEY, new ImageIcon(create.class.getResource("/resources/allcontentmini.png")) ); + } + + @Override + public void actionPerformed(ActionEvent e) { + node nod = (node) create.getSelectNode().getUserObject(); + if(listeDesNodesAllContent.isAllContent(nod)) { + new allContent(nod,create.getTextNodeSelect()); + } + } + +} diff --git a/src/actions/actCopy.java b/src/actions/actCopy.java new file mode 100644 index 0000000..417a943 --- /dev/null +++ b/src/actions/actCopy.java @@ -0,0 +1,49 @@ +package actions; + +import java.awt.Toolkit; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.StringSelection; +import java.awt.event.ActionEvent; +import java.awt.event.KeyEvent; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.ImageIcon; +import javax.swing.KeyStroke; + +import fenetres.baliseStyle; +import fenetres.create; +import xml.node; + + + +public class actCopy extends AbstractAction{ + + /** + * + */ + private static final long serialVersionUID = 1L; + { + putValue( Action.NAME, "Copier" ); + putValue( Action.SMALL_ICON, new ImageIcon( getClass().getResource("/resources/copy.png") ) ); + putValue( Action.SHORT_DESCRIPTION, "Copier (CTRL+C)" ); + putValue( Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.CTRL_DOWN_MASK ) ); + } + + @Override + public void actionPerformed(ActionEvent e) { + node nod = (node) create.getSelectNode().getUserObject(); + + Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard(); + + String textNodes = nod.ecritureXML().toString(); //Run.ecritureNode(nod, 0).toString().replace("\t","").replace("\r", "").replace("\n", ""); + StringSelection texto = new StringSelection(textNodes); + + cb.setContents(texto, null); + + System.out.println(texto.toString()); + + create.getTextNodeSelect().setText(baliseStyle.balise()+"

Le node est copié dans le presse papier.


"); + } + +} diff --git a/src/actions/actEvalFormatageDirect.java b/src/actions/actEvalFormatageDirect.java new file mode 100644 index 0000000..2cd01da --- /dev/null +++ b/src/actions/actEvalFormatageDirect.java @@ -0,0 +1,59 @@ +package actions; + +import java.awt.event.ActionEvent; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.ImageIcon; + +import fenetres.CustomInputDialogSimplePointCaseCoche; +import fenetres.create; +import xml.node; + + +public class actEvalFormatageDirect extends AbstractAction{ + { + putValue( Action.NAME, "Formatage direct du paragraphe ?" ); + putValue( Action.SHORT_DESCRIPTION, "Evaluer la présence ou l'absence du formatage direct du paragraphe." ); + putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/evalformatagedirectmini.png")) ); + } + /** + * + */ + private static final long serialVersionUID = 1L; + + @Override + public void actionPerformed(ActionEvent e) { + node nod = (node) create.getSelectNode().getUserObject(); + String namestyle =""; + String texteInsert = "

Ce paragraphe ne possède pas de formatage direct.


"; + + if(nod.getAttributs().get("text:style-name")!=null) { + namestyle = nod.getAttributs().get("text:style-name"); + Pattern p = Pattern.compile("^P[0-9]{1,}$"); + Matcher m = p.matcher(namestyle); + if(m.find()) { + texteInsert = "

Ce paragraphe possède un formatage direct ayant le style "+namestyle+".


"; + }else { + texteInsert = "

Ce paragraphe ne possède pas un formatage direct.
" + + "Son style est "+ namestyle +".


"; + } + }; + + CustomInputDialogSimplePointCaseCoche.showCustominputDialog(nod,"evalFormatageDirect", + "

Si le node dans le fichier de l'étudiant par comparaison avec ce node,
" + + "contient une surcharge des formats de paragraphe et/ou de
" + + "caractères, (style:name=Px), ou ne contient pas de surcharge au
" + + "style du paragraphe, alors l'étudiant aura les points ci-dessous.


" + + texteInsert + + "

Cochez la case pour placer ou supprimer la méthode sur tous les" + + "
nodes frères.


" + + "

Cliquez sur le bouton supprimer pour retirer la méthode
" + + "d'évaluation evalFormatageDirect.

", + new ImageIcon(create.class.getResource("/resources/evalformatagedirect.png"))); + create.getTextNodeSelect().refreshAffichage(nod); + } + +} diff --git a/src/actions/actEvalTextUserDefinedNon.java b/src/actions/actEvalTextUserDefinedNon.java new file mode 100644 index 0000000..01953b4 --- /dev/null +++ b/src/actions/actEvalTextUserDefinedNon.java @@ -0,0 +1,31 @@ +package actions; + +import java.awt.event.ActionEvent; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.ImageIcon; + +import fenetres.create; +import xml.node; + + +public class actEvalTextUserDefinedNon extends AbstractAction{ + + /** + * + */ + private static final long serialVersionUID = 1L; + { + putValue( Action.NAME, "Supprime évaluer la valeur de la propriété personnalisé" ); + putValue( Action.SHORT_DESCRIPTION, "Supprime l'évaluation de la valeur personnalisé."); + putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/falsemini.png"))); + } + @Override + public void actionPerformed(ActionEvent e) { + node nod = (node) create.getSelectNode().getUserObject(); + nod.supprimeAttribut("evalTextUserDefined"); + create.getTextNodeSelect().refreshAffichage(nod); + } + +} diff --git a/src/actions/actEvalTextUserDefinedOui.java b/src/actions/actEvalTextUserDefinedOui.java new file mode 100644 index 0000000..b1a55fc --- /dev/null +++ b/src/actions/actEvalTextUserDefinedOui.java @@ -0,0 +1,37 @@ +package actions; + +import java.awt.event.ActionEvent; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.ImageIcon; + +import fenetres.CustomInputDialogSimplePoint; +import fenetres.create; +import xml.node; + + +public class actEvalTextUserDefinedOui extends AbstractAction{ + + /** + * + */ + private static final long serialVersionUID = 1L; + { + putValue( Action.NAME, "Oui, combien de point?" ); + putValue( Action.SHORT_DESCRIPTION, "Evaluer la valeur de la propriété personnalisé"); + putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/evaltextuserdefinedmini.png"))); + } + + @Override + public void actionPerformed(ActionEvent e) { + node nod = (node) create.getSelectNode().getUserObject(); + CustomInputDialogSimplePoint.showCustominputDialog(nod,"evalTextUserDefined", + "

Si ce node contient le texte de la propriété définie par l'utilisateur,
" + + "alors l'étudiant obtiendra les points ci-dessous.


" + + "

Cliquez sur le bouton supprimer pour retirer la méthode
" + + "d'évaluation evalTextUserDefined

", + new ImageIcon(create.class.getResource("/resources/evaltextuserdefined.png"))); + create.getTextNodeSelect().refreshAffichage(nod); + } + } diff --git a/src/actions/actInsereInformationFalse.java b/src/actions/actInsereInformationFalse.java new file mode 100644 index 0000000..eb8e45b --- /dev/null +++ b/src/actions/actInsereInformationFalse.java @@ -0,0 +1,31 @@ +package actions; + +import java.awt.event.ActionEvent; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.ImageIcon; + +import fenetres.create; +import xml.node; + + +public class actInsereInformationFalse extends AbstractAction{ + { + putValue( Action.NAME, "false" ); + putValue( Action.SHORT_DESCRIPTION, "false" ); + putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/falsemini.png"))); + } + /** + * + */ + private static final long serialVersionUID = 1L; + + @Override + public void actionPerformed(ActionEvent e) { + node nod = (node) create.getSelectNode().getUserObject(); + nod.getAttributs().remove("information"); + create.getTextNodeSelect().refreshAffichage(nod); + } + +} diff --git a/src/actions/actInsereInformationMultipleFalse.java b/src/actions/actInsereInformationMultipleFalse.java new file mode 100644 index 0000000..5283259 --- /dev/null +++ b/src/actions/actInsereInformationMultipleFalse.java @@ -0,0 +1,34 @@ +package actions; + +import java.awt.event.ActionEvent; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.ImageIcon; + +import fenetres.create; +import xml.node; + + + +public class actInsereInformationMultipleFalse extends AbstractAction{ + { + putValue( Action.NAME, "false" ); + putValue( Action.SHORT_DESCRIPTION, "false" ); + putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/falsemini.png"))); + } + /** + * + */ + private static final long serialVersionUID = 1L; + + @Override + public void actionPerformed(ActionEvent e) { + node nod = (node) create.getSelectNode().getUserObject(); + for(int i = 0 ; i < nod.getEnfants().size();i++) { + nod.getEnfants().get(i).getAttributs().remove("information"); + } + create.getTextNodeSelect().refreshAffichage(nod); + } + +} \ No newline at end of file diff --git a/src/actions/actInsereInformationMultipleTrue.java b/src/actions/actInsereInformationMultipleTrue.java new file mode 100644 index 0000000..a44ef8a --- /dev/null +++ b/src/actions/actInsereInformationMultipleTrue.java @@ -0,0 +1,43 @@ +package actions; + +import java.awt.event.ActionEvent; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.ImageIcon; + +import fenetres.create; +import list.listeDesNodesInfos; +import xml.node; + + + +public class actInsereInformationMultipleTrue extends AbstractAction{ + { + putValue( Action.NAME, "true" ); + putValue( Action.SHORT_DESCRIPTION, "true" ); + putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/truemini.png"))); + } + /** + * + */ + private static final long serialVersionUID = 1L; + + @Override + public void actionPerformed(ActionEvent e) { + node nod = (node) create.getSelectNode().getUserObject(); + + for(int i = 0 ; i < nod.getEnfants().size();i++) { + if(listeDesNodesInfos.isInfo(nod.getEnfants().get(i))) { + String content = nod.getEnfants().get(i).getContenuAvecTousLesContenusDesEnfants(); + if(!content.isEmpty()) if(content.replaceAll(" ", "").length()==0) content=content.replaceAll(" ", ""); + if(content.length()>300) content = content.substring(0, 299); + content = nod.getEnfants().get(i).getNameNode() + " : " + content; + nod.getEnfants().get(i).getAttributs().put("information", content); + } + } + + create.getTextNodeSelect().refreshAffichage(nod); + } + +} diff --git a/src/actions/actInsereInformationTrue.java b/src/actions/actInsereInformationTrue.java new file mode 100644 index 0000000..a10dafb --- /dev/null +++ b/src/actions/actInsereInformationTrue.java @@ -0,0 +1,38 @@ +package actions; + +import java.awt.event.ActionEvent; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.ImageIcon; + +import fenetres.create; +import list.listeDesNodesInfos; +import xml.node; + + +public class actInsereInformationTrue extends AbstractAction{ + { + putValue( Action.NAME, "true" ); + putValue( Action.SHORT_DESCRIPTION, "true" ); + putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/truemini.png"))); + } + /** + * + */ + private static final long serialVersionUID = 1L; + + @Override + public void actionPerformed(ActionEvent e) { + node nod = (node) create.getSelectNode().getUserObject(); + if(listeDesNodesInfos.isInfo(nod)) { + String content = nod.getContenuAvecTousLesContenusDesEnfants(); + if(!content.isEmpty()) if(content.replaceAll(" ", "").length()==0) content=content.replaceAll(" ", ""); + if(content.length()>300) content = content.substring(0, 299); + content = nod.getNameNode() + " : " + content; + nod.getAttributs().put("information", content); + create.getTextNodeSelect().refreshAffichage(nod); + } + } + +} diff --git a/src/actions/actNewFichierAnalyse.java b/src/actions/actNewFichierAnalyse.java index 4545b4a..f8a49da 100644 --- a/src/actions/actNewFichierAnalyse.java +++ b/src/actions/actNewFichierAnalyse.java @@ -4,6 +4,11 @@ import java.awt.event.ActionEvent; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Enumeration; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import javax.swing.AbstractAction; import javax.swing.Action; @@ -133,5 +138,55 @@ public class actNewFichierAnalyse extends AbstractAction{ commandes.ecritCode = true; } + + public static void placeIsDoublonInStructure(node nod) { + Enumeration pages = Collections.enumeration(nod.getEnfants()); + while(pages.hasMoreElements()) { + node nodLaPage = pages.nextElement(); + Pattern p = Pattern.compile("^text:p$|^text:h$|^text:span$|^text:list$|^text:list-item$|^text:line-break$|^text:span$|^text:tab$|^text:s$"); //le node qui peuvent rechercher par le contenu textuel + ArrayList listTextesInPage = new ArrayList(); + for(int i = 0 ; i < nodLaPage.getEnfants().size();i++) { + Matcher m = p.matcher(nodLaPage.getEnfants().get(i).getNameNode()); + if(m.find()) { + String content = nodLaPage.getEnfants().get(i).getContenuAvecTousLesContenusDesEnfants(); + if(listTextesInPage.contains(content)) { + nodLaPage.getEnfants().get(i).getAttributs().put("isDoublon", "true"); + }else { + nodLaPage.getEnfants().get(i).getAttributs().remove("isDoublon"); + listTextesInPage.add(content); + } + if(nodLaPage.getEnfants().get(i).getEnfants().size()>0) { + placeIsDoublon(nodLaPage.getEnfants().get(i)); + } + } + } + } + } + + + /** + * + * @param nod + */ + private static void placeIsDoublon(node nod) { + Pattern p = Pattern.compile("^text:p$|^text:h$|^text:list$|^text:list-item$|^text:line-break$|^text:span$|^text:tab$|^text:s$"); //le node qui peuvent rechercher par le contenu textuel + ArrayList listTextesInPage = new ArrayList(); + for(int i = 0 ; i < nod.getEnfants().size();i++) { + Matcher m = p.matcher(nod.getEnfants().get(i).getNameNode()); + if(m.find()) { + String content = nod.getEnfants().get(i).getContenuAvecTousLesContenusDesEnfants(); + if(listTextesInPage.contains(content)) { + nod.getEnfants().get(i).getAttributs().put("isDoublon", "true"); + }else { + nod.getEnfants().get(i).getAttributs().remove("isDoublon"); + listTextesInPage.add(content); + } + if(nod.getEnfants().get(i).getEnfants().size()>0) { + placeIsDoublon(nod.getEnfants().get(i)); + } + } + } + } + } diff --git a/src/actions/actPaste.java b/src/actions/actPaste.java new file mode 100644 index 0000000..5f2b81d --- /dev/null +++ b/src/actions/actPaste.java @@ -0,0 +1,139 @@ +package actions; + +import java.awt.Toolkit; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.UnsupportedFlavorException; +import java.awt.event.ActionEvent; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.io.IOException; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.ImageIcon; +import javax.swing.JOptionPane; +import javax.swing.KeyStroke; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.TreePath; + +import calc.commandes; +import fenetres.create; +import xml.node; + + + +public class actPaste extends AbstractAction{ + + /** + * + */ + private static final long serialVersionUID = 1L; + { + putValue( Action.NAME, "Coller" ); + putValue( Action.SMALL_ICON, new ImageIcon( getClass().getResource("/resources/paste.png") ) ); + putValue( Action.MNEMONIC_KEY, KeyEvent.VK_V ); + putValue( Action.SHORT_DESCRIPTION, "Coller (CTRL+V)" ); + putValue( Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_DOWN_MASK) ); + } + @Override + public void actionPerformed(ActionEvent e) { + String initial = ""; + + Clipboard c = Toolkit.getDefaultToolkit().getSystemClipboard(); + String paste; + try { + paste = "" + c.getContents(null).getTransferData(DataFlavor.stringFlavor).toString().replace("\t","").replace("\r", "").replace("\n", ""); + if (!paste.equals(initial)) { + node nodCopy = new node(paste); + + if(!nodCopy.getNameNode().isEmpty()) { + TreePath path = create.getTree().getSelectionPath(); + + node nod = (node) create.getSelectNode().getUserObject(); + DefaultMutableTreeNode nodeMu = create.getSelectNode(); + + MiseInformationDansLeNodeCopierColler(nodCopy,nod); + nod.getEnfants().add(nodCopy); + actNewFichierAnalyse.placeIsDoublonInStructure(commandes.sujet.retourneFirstEnfant("style:style")); + actNewFichierAnalyse.placeIsDoublonInStructure(commandes.sujet.retourneFirstEnfant("page")); + + + DefaultMutableTreeNode node1 = new DefaultMutableTreeNode(nodCopy); + nodeMu.add(node1); + + nodeMu = addNodeMutable(nodCopy,node1); + + DefaultTreeModel model = (DefaultTreeModel) create.getTree().getModel(); + DefaultMutableTreeNode root = (DefaultMutableTreeNode) model.getRoot(); + model.reload(root); + + create.getTree().setSelectionPath(path); + create.getTree().expandPath(path); + + }else { + JOptionPane.showMessageDialog(null, "Le collage n'est pas réalisé."); + } + + } + } catch (UnsupportedFlavorException | IOException e1) { + JOptionPane.showConfirmDialog(null, e1.toString()); + e1.printStackTrace(); + } + + try { + Thread.sleep(40); + } catch (InterruptedException ex) { + } + + } + + /** + * + * @param nodePaste + * @param nodeParent + * @return + */ + private static void MiseInformationDansLeNodeCopierColler(node nodePaste, node nodeParent) { + if(nodePaste!=null) { + + nodePaste.setParent(nodeParent); + nodePaste.setLevel(nodeParent.getLevel()+1); + + for(int i=0;i300) content = content.substring(0, 299); + + content = nod.getEnfants().get(i).getNameNode() + " : " + content; + nod.getEnfants().get(i).getAttributs().put("information", content); + } + } + + //Pour le node page + if(informations) { + String content = nod.getContenuAvecTousLesContenusDesEnfants(); + if(!content.isEmpty()) if(content.replaceAll(" ", "").length()==0) content=content.replaceAll(" ", ""); + if(content.length()>300) content = content.substring(0, 299); + + content = nod.getNameNode() + " : " + content; + nod.getAttributs().put("information", content); + } + + create.getTextNodeSelect().refreshAffichage(nod); + } + +} diff --git a/src/actions/addTitreToutesLesPagesFalse.java b/src/actions/addTitreToutesLesPagesFalse.java new file mode 100644 index 0000000..48d6f61 --- /dev/null +++ b/src/actions/addTitreToutesLesPagesFalse.java @@ -0,0 +1,40 @@ +package actions; + +import java.awt.event.ActionEvent; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.ImageIcon; + +import fenetres.create; +import xml.node; + + +public class addTitreToutesLesPagesFalse extends AbstractAction { + { + putValue( Action.NAME, "Supprime tous les titres des pages" ); + putValue( Action.SHORT_DESCRIPTION, "Supprime tous les titres des pages." ); + putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/falsemini.png")) ); + } + /** + * + */ + private static final long serialVersionUID = 1L; + + @Override + public void actionPerformed(ActionEvent e) { + node nod = (node) create.getSelectNode().getUserObject(); + + if(nod.getNameNode().equals("structurepage")) { + for(int i = 0 ; i< nod.getEnfants().size();i++) { + nod.getEnfants().get(i).getAttributs().remove("titre"); + nod.getEnfants().get(i).getAttributs().remove("titre2"); + nod.getEnfants().get(i).getAttributs().remove("titre3"); + nod.getEnfants().get(i).getAttributs().remove("titre1"); + } + } + create.getTextNodeSelect().refreshAffichage(nod); + } + +} + diff --git a/src/actions/addTitreToutesLesPagesTrue.java b/src/actions/addTitreToutesLesPagesTrue.java new file mode 100644 index 0000000..f9916c4 --- /dev/null +++ b/src/actions/addTitreToutesLesPagesTrue.java @@ -0,0 +1,40 @@ +package actions; + +import java.awt.event.ActionEvent; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.ImageIcon; + +import fenetres.create; +import xml.node; + + +public class addTitreToutesLesPagesTrue extends AbstractAction{ + { + putValue( Action.NAME, "Ajoute un titre 1 à toutes les pages" ); + putValue( Action.SHORT_DESCRIPTION, "Ajoute un titre 1 à toutes les pages."); + putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/truemini.png"))); + } + /** + * + */ + private static final long serialVersionUID = 1L; + + @Override + public void actionPerformed(ActionEvent e) { + node nod = (node) create.getSelectNode().getUserObject(); //analyseCalc.fenetres.create.getSelectNode().getUserObject(); + + if(nod.getNameNode().equals("structurepage")) { + for(int i = 0 ; i< nod.getEnfants().size();i++) { + nod.getEnfants().get(i).getAttributs().remove("titre"); + nod.getEnfants().get(i).getAttributs().remove("titre2"); + nod.getEnfants().get(i).getAttributs().remove("titre3"); + nod.getEnfants().get(i).getAttributs().put("titre1", "page" + String.valueOf(i+1)); + } + } + create.getTextNodeSelect().refreshAffichage(nod); + + } + +} diff --git a/src/fenetres/CustomInputDialogSimplePoint.java b/src/fenetres/CustomInputDialogSimplePoint.java new file mode 100644 index 0000000..0e467df --- /dev/null +++ b/src/fenetres/CustomInputDialogSimplePoint.java @@ -0,0 +1,67 @@ +package fenetres; + +import java.awt.Color; +import java.awt.Font; + +import javax.swing.ImageIcon; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JTextField; +import javax.swing.SwingConstants; + +import xml.node; + + +public class CustomInputDialogSimplePoint { + public static void showCustominputDialog(node nod, String nameMethod, String explication, ImageIcon icon) { + Integer initialValue = 0; + + if (nod.getAttributs().get(nameMethod) != null) { + initialValue = Integer.parseInt(nod.getAttributs().get(nameMethod)); + } + + JLabel lblTitre = new JLabel("

"+nameMethod+"

"); + lblTitre.setForeground(new Color(50,50,200)); + + JLabel lblExpliaction = new JLabel(explication); + lblExpliaction.setFont(new Font("Tahoma", Font.BOLD, 12)); + lblExpliaction.setForeground(Color.blue); + + JTextField textField = new JTextField(String.valueOf(initialValue), 4); + textField.setFont(new Font("Tahoma", Font.BOLD, 14)); + textField.setHorizontalAlignment(SwingConstants.LEFT); + + Object[] message = { + lblTitre, + lblExpliaction, + "Quel est le nombre de points?", textField + }; + + String[] options = {"Ajouter", "Supprimer"}; + + int optionSelected = JOptionPane.showOptionDialog( + null, + message, + "Ajouter ou supprimer la méthode " + nameMethod, + JOptionPane.DEFAULT_OPTION, + JOptionPane.INFORMATION_MESSAGE, + icon, + options, + options[0]); + + if (optionSelected == 0) { // Bouton "Ajouter" sélectionné + try { + Integer inputValue = Integer.parseInt(textField.getText()); + nod.getAttributs().put(nameMethod, String.valueOf(inputValue)); + } catch (NumberFormatException e) { + JOptionPane.showMessageDialog(null, "Veuillez saisir un entier valide.", "Erreur", JOptionPane.ERROR_MESSAGE); + } + } else if (optionSelected == 1) { // Bouton "Supprimer" sélectionné + nod.supprimeAttribut(nameMethod); + } else { // Si la boîte de dialogue est annulée ou fermée + + } + + + } +} diff --git a/src/fenetres/CustomInputDialogSimplePointCaseCoche.java b/src/fenetres/CustomInputDialogSimplePointCaseCoche.java new file mode 100644 index 0000000..6795a9e --- /dev/null +++ b/src/fenetres/CustomInputDialogSimplePointCaseCoche.java @@ -0,0 +1,94 @@ +package fenetres; + +import java.awt.Color; +import java.awt.Font; +import java.util.ArrayList; + +import javax.swing.ImageIcon; +import javax.swing.JCheckBox; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JTextField; +import javax.swing.SwingConstants; + +import xml.node; + + + +public class CustomInputDialogSimplePointCaseCoche { + public static void showCustominputDialog(node nod, String nameMethod, String explication, ImageIcon icon) { + Integer initialValue = 0; + + if (nod.getAttributs().get(nameMethod) != null) { + initialValue = Integer.parseInt(nod.getAttributs().get(nameMethod)); + } + + JLabel lblTitre = new JLabel("

"+nameMethod+"

"); + lblTitre.setForeground(new Color(50,50,200)); + + JLabel lblExpliaction = new JLabel(explication); + lblExpliaction.setFont(new Font("Tahoma", Font.BOLD, 12)); + lblExpliaction.setForeground(Color.blue); + + JTextField textField = new JTextField(String.valueOf(initialValue), 4); + textField.setFont(new Font("Tahoma", Font.BOLD, 14)); + textField.setHorizontalAlignment(SwingConstants.LEFT); + + JCheckBox caseFrere = new JCheckBox("Placer la méthode sur tous les nodes frères."); + caseFrere.setFont(new Font("Tahoma", Font.BOLD, 12)); + caseFrere.setSelected(false); + + Object[] message = { + lblTitre, + lblExpliaction, + caseFrere, + "Quel est le nombre de points?", textField + }; + + String[] options = {"Ajouter", "Supprimer"}; + + int optionSelected = JOptionPane.showOptionDialog( + null, + message, + "Ajouter ou supprimer la méthode " + nameMethod, + JOptionPane.DEFAULT_OPTION, + JOptionPane.INFORMATION_MESSAGE, + icon, + options, + options[0]); + + if (optionSelected == 0) { // Bouton "Ajouter" sélectionné + try { + Integer inputValue = Integer.parseInt(textField.getText()); + if(!caseFrere.isSelected()) { + nod.getAttributs().put(nameMethod, String.valueOf(inputValue)); + }else { + ajouteAToutesLesFeres(nod, inputValue,nameMethod); + } + + } catch (NumberFormatException e) { + JOptionPane.showMessageDialog(null, "Veuillez saisir un entier valide.", "Erreur", JOptionPane.ERROR_MESSAGE); + } + } else if (optionSelected == 1) { // Bouton "Supprimer" sélectionné + if(!caseFrere.isSelected()) { + nod.supprimeAttribut(nameMethod); + }else { + ajouteAToutesLesFeres(nod,0,nameMethod); + } + + } else { // Si la boîte de dialogue est annulée ou fermée + + } + } + + private static void ajouteAToutesLesFeres(node nod,Integer point,String nameMethod) { + ArrayList nodFeres = nod.retourneAllBroters(); + for(int i=0; i < nodFeres.size();i++) { + if(point>0) { + nodFeres.get(i).getAttributs().put(nameMethod, String.valueOf(point)); + }else { + nodFeres.get(i).supprimeAttribut(nameMethod); + } + } + } +} diff --git a/src/fenetres/baliseStyle.java b/src/fenetres/baliseStyle.java index 14316a3..3de37e4 100644 --- a/src/fenetres/baliseStyle.java +++ b/src/fenetres/baliseStyle.java @@ -9,23 +9,27 @@ public class baliseStyle { public static String balise() { return ""; } diff --git a/src/fenetres/create.java b/src/fenetres/create.java index f743c5f..4d25367 100644 --- a/src/fenetres/create.java +++ b/src/fenetres/create.java @@ -80,6 +80,7 @@ import actions.actUpNode; import actions.actsautfalse; import actions.actsauttrue; import calc.commandes; +import menu.CreatePopupMenu; import net.miginfocom.swing.MigLayout; import xml.node; @@ -179,7 +180,7 @@ public final class create extends JFrame { toolBarPrincipal.setLayout(layout); getContentPane().add(toolBarPrincipal,BorderLayout.NORTH); - this.createPopupMenuTree(null); + //this.CreatePopupMenu(null); JPanel panelLeft = new JPanel(); panelLeft.setLayout(new BorderLayout()); @@ -202,64 +203,60 @@ public final class create extends JFrame { panelLeft.add(leftScrollPane,BorderLayout.CENTER); JScrollPane rightScrollPane = new JScrollPane(); - - textNodeSelect.setBackground(Color.LIGHT_GRAY); - textNodeSelect.setFont(new Font("Monospaced", Font.PLAIN, 15)); - - ScrollPaneTableBouton = new JScrollPane( ); - panelDroiteBoutons.setBackground(Color.LIGHT_GRAY); - panelDroiteBoutons.setBorder(null); - panelDroiteBoutons.setLayout(new MigLayout("", "[40px:n,fill][40px:n,fill][40px:n,fill][40px:n,fill][40px:n,fill][40px:n,fill]", "[20px][40px][40px][60px][60px][60px][60px][60px][60px][60px][60px][60px][60px]")); + textNodeSelect.setBackground(Color.LIGHT_GRAY); + textNodeSelect.setFont(new Font("Monospaced", Font.PLAIN, 15)); + + ScrollPaneTableBouton = new JScrollPane( ); + panelDroiteBoutons.setBackground(Color.LIGHT_GRAY); + + panelDroiteBoutons.setBorder(null); + panelDroiteBoutons.setLayout(new MigLayout("", "[40px:n,fill][40px:n,fill][40px:n,fill][40px:n,fill][40px:n,fill][40px:n,fill]", "[20px][40px][40px][60px][60px][60px][60px][60px][60px][60px][60px][60px][60px]")); + + rightScrollPane.setViewportView(panelDroiteBoutons); + ScrollPaneTableBouton.setViewportView(textNodeSelect); + + JSplitPane splitPane2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, rightScrollPane, ScrollPaneTableBouton ); + splitPane2.setBounds(10, 10, 1364, 783); + splitPane2.setDividerLocation(0.4); + splitPane2.setOneTouchExpandable(true); + SplitPaneUI spui = splitPane2.getUI(); + if (spui instanceof BasicSplitPaneUI) { + ((BasicSplitPaneUI) spui).getDivider().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + if (arg0.getClickCount() == 2) { + Dimension size1 = rightScrollPane.getPreferredSize(); + int dividerLocation = splitPane2.getOrientation() == JSplitPane.HORIZONTAL_SPLIT ? + size1.width : size1.height; + splitPane2.setDividerLocation(dividerLocation); + } + } + }); + } + + JSplitPane splitPane1 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, panelLeft, splitPane2 ); + splitPane1.setBounds(10, 10, 1364, 783); //10, 10, 1364, 783 + splitPane1.setDividerLocation(0.25); - rightScrollPane.setViewportView(panelDroiteBoutons); - ScrollPaneTableBouton.setViewportView(textNodeSelect); - - JSplitPane splitPane2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, rightScrollPane, ScrollPaneTableBouton ); - splitPane2.setBounds(10, 10, 1364, 783); - splitPane2.setDividerLocation(0.4); - splitPane2.setOneTouchExpandable(true); - SplitPaneUI spui = splitPane2.getUI(); - if (spui instanceof BasicSplitPaneUI) { - ((BasicSplitPaneUI) spui).getDivider().addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - if (arg0.getClickCount() == 2) { - Dimension size1 = rightScrollPane.getPreferredSize(); - int dividerLocation = splitPane2.getOrientation() == JSplitPane.HORIZONTAL_SPLIT ? - size1.width : size1.height; - splitPane2.setDividerLocation(dividerLocation); - } - } - }); - } - - JSplitPane splitPane1 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, panelLeft, splitPane2 ); - splitPane1.setBounds(10, 10, 1364, 783); //10, 10, 1364, 783 - splitPane1.setDividerLocation(0.25); - + + leftScrollPane.setViewportView(tree); + tree.setFont(new Font("Tahoma", Font.PLAIN, 16)); + + getContentPane().add(splitPane1, BorderLayout.CENTER); + + if(commandes.fichierAnalyseValide) { + tree.setVisible(true); + constructionTree(); + }else { + tree.setVisible(false); + } - leftScrollPane.setViewportView(tree); - tree.setFont(new Font("Tahoma", Font.PLAIN, 16)); - - getContentPane().add(splitPane1, BorderLayout.CENTER); - - if(commandes.fichierAnalyseValide) { - tree.setVisible(true); - constructionTree(); - }else { - tree.setVisible(false); - } - - - this.setExtendedState(MAXIMIZED_BOTH); - rightScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); - - - - positionScrollDebut(); - - ListenerAction(); + this.setExtendedState(MAXIMIZED_BOTH); + rightScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); + + positionScrollDebut(); + ListenerAction(); } @@ -278,11 +275,23 @@ public final class create extends JFrame { public void mouseClicked(MouseEvent e) { if(tree.getSelectionPath()!=null) { selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent(); - node nod = (node) selectNode.getUserObject(); - createPopupMenuTree(nod); - textNodeSelect.refreshAffichage(nod); + node nod = (node) selectNode.getUserObject(); //node sélectionné. + new CreatePopupMenu(nod); // création du popup menu. + textNodeSelect.setEditable(true); + textNodeSelect.refreshAffichage(nod); //affiche des informations sur le node. + textNodeSelect.setEditable(false); +// refreshTree(); //repaint l'arbre. + if(tree.isCollapsed(tree.getSelectionPath())){ + tree.expandPath(tree.getSelectionPath()); //Etend le node sélectionné. + }else { + tree.collapsePath(tree.getSelectionPath()); + } + } +// selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent(); +// node nod = (node) selectNode.getUserObject(); +// createPopupMenuTree(nod); +// textNodeSelect.refreshAffichage(nod); } - } }); @@ -304,7 +313,7 @@ public final class create extends JFrame { * Création du menu contextuel du tree * @return */ - private void createPopupMenuTree(node nod) { + private void CreatePopupMenu2(node nod) { if(nod!=null) { @@ -655,124 +664,7 @@ public final class create extends JFrame { JButton buttonExit = toolBarPrincipal.add( new actExit() ); buttonExit.setHideActionText( true ); -// toolBarPrincipal = new JToolBar(); -// toolBarPrincipal.setFloatable(false); -// toolBarPrincipal.setRollover(true); -// -// toolBarPrincipal.setName("outils principaux"); -// -// JButton btnChargeEvaluation = toolBarPrincipal.add( new actOpenBaseEvaluation() ); -// btnChargeEvaluation.setIcon(new ImageIcon(create.class.getResource("/resources/BaseEvaluations.png"))); -// btnChargeEvaluation.setHideActionText(true); -// toolBarPrincipal.add(btnChargeEvaluation); -// -// JButton btnSaveEvaluation = toolBarPrincipal.add( new actSaveEvaluation() ); -// btnSaveEvaluation.setIcon(new ImageIcon(create.class.getResource("/resources/saveEvaluation.png"))); -// btnSaveEvaluation.setHideActionText(true); -// toolBarPrincipal.add(btnSaveEvaluation); -// -// toolBarPrincipal.addSeparator(); -// -// JButton buttonLoadFile = toolBarPrincipal.add( new actOpen() ); -// buttonLoadFile.setIcon(new ImageIcon(create.class.getResource("/resources/fichierAnalyse.png"))); -// buttonLoadFile.setHideActionText(true); -// toolBarPrincipal.add(buttonLoadFile); -// -// JButton btnNewFichierAnalyse = toolBarPrincipal.add( new actNewFichierAnalyse() ); -// btnNewFichierAnalyse.setIcon(new ImageIcon(create.class.getResource("/resources/fichierODF.png"))); -// btnNewFichierAnalyse.setHideActionText(true); -// toolBarPrincipal.add(btnNewFichierAnalyse); -// -// toolBarPrincipal.addSeparator(); -// -// buttonEvaluate = toolBarPrincipal.add( new actEvaluer() ); -// buttonEvaluate.setIcon(new ImageIcon(create.class.getResource("/resources/evaluate.png"))); -// -// toolBarPrincipal.addSeparator(); -// -// JButton btnAfficheInformationFichierAnalyse = toolBarPrincipal.add( new actAfficheInformationFichierAnalyse() ); -// btnAfficheInformationFichierAnalyse.setIcon(new ImageIcon(create.class.getResource("/resources/fichierAnalyseInfo.png"))); -// btnAfficheInformationFichierAnalyse.setHideActionText(true); -// toolBarPrincipal.add(btnAfficheInformationFichierAnalyse); -// -// JButton btnNodeFichier = toolBarPrincipal.add( new actNodeFichier() ); -// btnNodeFichier.setIcon(new ImageIcon(create.class.getResource("/resources/nodeFichier.png"))); -// btnNodeFichier.setHideActionText(true); -// toolBarPrincipal.add(btnNodeFichier); -// -// JButton btnSetting = toolBarPrincipal.add( new actSetting()); -// btnSetting.setIcon(new ImageIcon(create.class.getResource("/resources/setting.png"))); -// toolBarPrincipal.add(btnSetting); -// -// -// toolBarPrincipal.addSeparator(); -// -// JButton btnEvaluerTrue = toolBarPrincipal.add( new actEvalueTrue() ); -// btnEvaluerTrue.setIcon(new ImageIcon(create.class.getResource("/resources/evaluertrue.png"))); -// btnEvaluerTrue.setHideActionText(true); -// toolBarPrincipal.add(btnEvaluerTrue); -// -// JButton btnEvaluerFalse = toolBarPrincipal.add(new actEvalueFalse() ); -// btnEvaluerFalse.setIcon(new ImageIcon(create.class.getResource("/resources/evaluerfalse.png"))); -// btnEvaluerFalse.setHideActionText(true); -// toolBarPrincipal.add(btnEvaluerFalse); -// -// JButton btnEvaluerTouteLaBrancheEtLesEnfantTrue = toolBarPrincipal.add( new actEvaluerTousEnfantsTrue() ); -// btnEvaluerTouteLaBrancheEtLesEnfantTrue.setIcon(new ImageIcon(create.class.getResource("/resources/evaluertouslesenfants.png"))); -// btnEvaluerTouteLaBrancheEtLesEnfantTrue.setHideActionText(true); -// toolBarPrincipal.add(btnEvaluerTouteLaBrancheEtLesEnfantTrue); -// -// JButton btnEvaluerTouteLaBrancheEtLesEnfantFalse = toolBarPrincipal.add( new actEvaluerTousEnfantsFalse() ); -// btnEvaluerTouteLaBrancheEtLesEnfantFalse.setIcon(new ImageIcon(create.class.getResource("/resources/evaluertouslesenfantsfaux.png"))); -// btnEvaluerTouteLaBrancheEtLesEnfantTrue.setHideActionText(true); -// toolBarPrincipal.add(btnEvaluerTouteLaBrancheEtLesEnfantFalse); -// -// toolBarPrincipal.addSeparator(); -// -// -// JButton btnAttribut = new JButton(new actAttribut()); -// btnAttribut.setText(""); -// btnAttribut.setIcon(new ImageIcon(create.class.getResource("/resources/attribut.png"))); -// toolBarPrincipal.add(btnAttribut); -// -// toolBarPrincipal.addSeparator(); -// -// JButton btnTotalPoint = new JButton(new actTotalPoint()); -// btnTotalPoint.setToolTipText("Nombre de point total dans l'exercice."); -// btnTotalPoint.setText(""); -// btnTotalPoint.setIcon(new ImageIcon(create.class.getResource("/resources/totalpoint.png"))); -// toolBarPrincipal.add(btnTotalPoint); -// -// JButton btnTotalPointNode = toolBarPrincipal.add( new actTotalPointNode() ); -// btnTotalPointNode.setIcon(new ImageIcon(create.class.getResource("/resources/totalpointnode.png"))); -// btnTotalPointNode.setHideActionText(true); -// toolBarPrincipal.add(btnTotalPointNode); -// -// toolBarPrincipal.addSeparator(); -// -// -// tglbtnTousLesNodes = new JToggleButton(""); -// tglbtnTousLesNodes.setAction(new actTousLesNodesEvaluer()); -// tglbtnTousLesNodes.setIcon(new ImageIcon(create.class.getResource("/resources/lesnodesevaluer.png"))); -// toolBarPrincipal.add(tglbtnTousLesNodes); -// -// toolBarPrincipal.addSeparator(); -// -// JButton btnAbout = toolBarPrincipal.add( new actAbout() ); -// btnAbout.setIcon(new ImageIcon(create.class.getResource("/resources/apropos.png"))); -// btnAbout.setHideActionText( true ); -// toolBarPrincipal.add(btnAbout); -// -// -// JButton btnNewButton = toolBarPrincipal.add( new actTutoriels()); -// btnNewButton.setIcon(new ImageIcon(create.class.getResource("/resources/tutoriel.png"))); -// btnNewButton.setHideActionText(true); -// toolBarPrincipal.add(btnNewButton); -// -// toolBarPrincipal.addSeparator(); -// -// JButton buttonExit = toolBarPrincipal.add( new actExit() ); -// buttonExit.setHideActionText( true ); + } @@ -993,6 +885,8 @@ public final class create extends JFrame { } } + + } diff --git a/src/list/listeDesNodesAllContent.java b/src/list/listeDesNodesAllContent.java new file mode 100644 index 0000000..495130d --- /dev/null +++ b/src/list/listeDesNodesAllContent.java @@ -0,0 +1,56 @@ +package list; + +import xml.node; + +public class listeDesNodesAllContent { + /** + * Retourne TRUE si on peut évaluer le contenu du node.
+ * @param nod + * @return + */ + public static boolean isAllContent(node nod) { + + String nameNode = nod.getNameNode(); + + if(nameNode.contains("style:")) return false; + + switch (nameNode) { + case "fichier":return false; + case "number:text":return false; + case "text:page-count":return false; + case "OU":return false; + case "text:conditional-text":return false; + case "text:bookmark":return false; + case "style:tab-stop":return false; + case "style:text-properties":return false; + case "style:paragraph-properties":return false; + case "style:style":return false; + case "style:default-style\"":return false; + case "saut:automatique":return false; + case "style:tab-stops":return false; + case "sequences":return false; + case "text:sequence-dec":return false; + case "numerotationchapitre":return false; + case "text:outline-level-style":return false; + case "style:list-level-properties":return false; + case "style:list-level-label-alignment":return false; + case "frames":return false; + case "style:graphic-properties":return false; + case "office:meta":return false; + case "meta:document-statistic":return false; + case "draw:contour-polygon":return false; + case "text:s":return false; + case "text:database-display":return false; + case "sections":return false; + case "tableaux":return false; + case "biblio":return false; + case "tablematieres":return false; + case "tableillustrations":return false; + + default: return true; + } + + + + } +} diff --git a/src/list/listeDesNodesFormatageDirect.java b/src/list/listeDesNodesFormatageDirect.java new file mode 100644 index 0000000..95333df --- /dev/null +++ b/src/list/listeDesNodesFormatageDirect.java @@ -0,0 +1,22 @@ +package list; + +import xml.node; + +public class listeDesNodesFormatageDirect { + + + public static boolean isFormatageDirect(node nod) { + + String nameNode = nod.getNameNode(); + + switch (nameNode) { + case "text:p": return true; + case "text:h": return true; + + default: + return false; + } + + } + +} diff --git a/src/list/listeDesNodesInfos.java b/src/list/listeDesNodesInfos.java new file mode 100644 index 0000000..6167476 --- /dev/null +++ b/src/list/listeDesNodesInfos.java @@ -0,0 +1,27 @@ +package list; + +import xml.node; + +public class listeDesNodesInfos { + + public static boolean isInfo(node nod) { + + String nameNode = nod.getNameNode(); + + switch (nameNode) { + case "text:p": return true; + case "text:h": return true; + case "text:list": return true; + case "text:list-item": return true; + case "page": return true; + case "text:span": return true; + case "text:index-title": return true; + + default: + return false; + } + + + } + +} diff --git a/src/list/listeDesNodesPourEvaluerPage.java b/src/list/listeDesNodesPourEvaluerPage.java new file mode 100644 index 0000000..fe1d57e --- /dev/null +++ b/src/list/listeDesNodesPourEvaluerPage.java @@ -0,0 +1,16 @@ +package list; + +import xml.node; + +public class listeDesNodesPourEvaluerPage { + + /** + * Retourne TRUE si c'est une page.
+ * @param nod + * @return + */ + public static Boolean isPage(node nod) { + if(nod.getNameNode().equals("page")) return true; + return false; + } +} \ No newline at end of file diff --git a/src/list/listeDesNodesRechercheByContenu.java b/src/list/listeDesNodesRechercheByContenu.java new file mode 100644 index 0000000..9267a85 --- /dev/null +++ b/src/list/listeDesNodesRechercheByContenu.java @@ -0,0 +1,32 @@ +package list; + +import xml.node; + +public class listeDesNodesRechercheByContenu { + + /** + * Retourne TRUE si on peut utiliser la recherche par contenu textuel.
+ * La rechercher par contenu se réalise par les méthodes suivantes:
+ * 1-Recherche par le contenu exact (ignore la case, et les espace au début et fin).
+ * 2-Recherche par le contenu du plus proche voisin.
+ * 3-Recherche par l'index;
+ * @param nod + * @return + */ + public static Boolean isRechercheByContenu(node nod) { + if(nod.getNameNode().contains("text:p")) return true; + if(nod.getNameNode().contains("text:line-break")) return true; + if(nod.getNameNode().contains("text:h")) return true; + if(nod.getNameNode().contains("text:span")) return true; + if(nod.getNameNode().equals("draw:text-box")) return true; + if(nod.getNameNode().equals("text:soft-page-break")) return true; + if(nod.getNameNode().contains("text:list")) return true; + if(nod.getNameNode().contains("text:section")) return true; + if(nod.getNameNode().equals("table:table-cell")) return true; + if(nod.getNameNode().equals("table:table-row")) return true; + if(nod.getNameNode().equals("draw:frame")) return true; + return false; + } + + +} \ No newline at end of file diff --git a/src/list/listeEvalNameNode.java b/src/list/listeEvalNameNode.java index 45f1754..e4d32c2 100644 --- a/src/list/listeEvalNameNode.java +++ b/src/list/listeEvalNameNode.java @@ -1,6 +1,6 @@ package list; -import nodeAC.nodeAC; +import xml.node; public class listeEvalNameNode { @@ -9,11 +9,13 @@ public class listeEvalNameNode { * @param nod * @return */ - public static boolean isNodeEvalNameNode(nodeAC nod) { + public static boolean isNodeEvalNameNode(node nod) { - if(nod.getNomElt().contains("meta:")) return true; - if(nod.getNomElt().contains("dc:")) return true; - if(nod.getNomElt().contains("text:")) return true; + if(nod.getNameNode().contains("meta:")) return true; + if(nod.getNameNode().contains("dc:")) return true; + if(nod.getNameNode().contains("text:")) return true; + if(nod.getNameNode().contains("draw:")) return true; + if(nod.getNameNode().contains("style:tab-stop")) return true; return false; } diff --git a/src/menu/CreatePopupMenu.java b/src/menu/CreatePopupMenu.java new file mode 100644 index 0000000..5741dbb --- /dev/null +++ b/src/menu/CreatePopupMenu.java @@ -0,0 +1,102 @@ +package menu; + +import javax.swing.JPopupMenu; + +import actions.actAttribut; +import actions.actCoefficient; +import actions.actCopy; +import actions.actDeleteNode; +import actions.actPaste; +import fenetres.create; +import list.listeDesNodesAllContent; +import list.listeDesNodesPourEvaluerPage; +import list.listeDesNodesRechercheByContenu; +import list.listeEvalNameNode; +import xml.node; + + + +public class CreatePopupMenu extends JPopupMenu{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** + * Création de la popupmenu.
+ * @param nod + */ + public CreatePopupMenu(node nod ) { + + if(nod!=null) { + + + //************************************************************** + //** La popupMenu qui s'affiche sur le tree pour les niveau 1 ** + //************************************************************** + JPopupMenu mnPopupTree = new JPopupMenu(); + mnPopupTree.add( mnEvaluer.menu()); + if(nod.getLevel()==1 ) { + mnPopupTree.addSeparator(); + mnPopupTree.add(new actCoefficient()); + mnPopupTree.addSeparator(); + mnPopupTree.add(MnGroupePourFeedbackNiveau1.menu(nod)); + if(nod.getNameNode().equals("structurepage")) { + mnPopupTree.addSeparator(); + mnPopupTree.add( MnGroupeMethodeEvaluer.menu(nod)); + } + } + + //******************************************** + //** Pour les nodes de niveau supérieur à 1 ** + //******************************************** + if(nod.getLevel()>1 ) { + + // Le groupe représentation dans le feedback + mnPopupTree.addSeparator(); + mnPopupTree.add(MnGroupePourFeedback.menu(nod)); + + // Le groupe méthode de recherche + if(listeDesNodesRechercheByContenu.isRechercheByContenu(nod)) { + mnPopupTree.addSeparator(); + mnPopupTree.add(mnGroupeRechercheContenu.menu(nod)); + } + + + // Le groupe méthode évaluer le node + if(listeEvalNameNode.isNodeEvalNameNode(nod)||listeDesNodesAllContent.isAllContent(nod)|| + listeDesNodesPourEvaluerPage.isPage(nod) ) { + mnPopupTree.addSeparator(); + mnPopupTree.add(MnGroupeMethodeEvaluer.menu(nod)); + } + + + // Le groupe accès aux attributs + mnPopupTree.addSeparator(); + mnPopupTree.add(new actAttribut()); + + } + + // Le groupe Arbre + mnPopupTree.addSeparator(); + mnPopupTree.add(mnArbre.menu()); + mnPopupTree.addSeparator(); + mnPopupTree.add(new actCopy()); + mnPopupTree.addSeparator(); + mnPopupTree.add(new actPaste()); + mnPopupTree.addSeparator(); + mnPopupTree.add(new actDeleteNode()); + + + //************************************* + //** Applique le popMenu sur la tree ** + //************************************* + create.getTree().setComponentPopupMenu(mnPopupTree); + + } + } + + + +} diff --git a/src/menu/MnGroupeMethodeEvaluer.java b/src/menu/MnGroupeMethodeEvaluer.java new file mode 100644 index 0000000..cc0c518 --- /dev/null +++ b/src/menu/MnGroupeMethodeEvaluer.java @@ -0,0 +1,68 @@ +package menu; + +import javax.swing.ImageIcon; +import javax.swing.JMenu; + +import actions.actAllContent; +import actions.actEvalFormatageDirect; +import actions.actEvalInitialCreator; +import actions.actEvalNameNodeOui; +import actions.actevalNameCreator; +import fenetres.create; +import list.listeDesNodesAllContent; +import list.listeDesNodesFormatageDirect; +import list.listeEvalNameNode; +import xml.node; + + +public class MnGroupeMethodeEvaluer { + public static JMenu menu(node nod) { + JMenu mnGroupeMethodeEvaluer = new JMenu("Evaluer le node"); + + //Image pour evaluer le node + mnGroupeMethodeEvaluer.setIcon( new ImageIcon(create.class.getResource("/resources/evaluatemini.png"))); + + + + // Pour la méthode AllContent + if(listeDesNodesAllContent.isAllContent(nod) ) { +// mnGroupeMethodeEvaluer.addSeparator(); + mnGroupeMethodeEvaluer.add(new actAllContent()); + } + + // Pour la méthode evalFormatageDirect + if(listeDesNodesFormatageDirect.isFormatageDirect(nod)) { + mnGroupeMethodeEvaluer.addSeparator(); + mnGroupeMethodeEvaluer.add(new actEvalFormatageDirect()); + + } + + // Pour la méthode evalNameNode + if(listeEvalNameNode.isNodeEvalNameNode(nod)) { + mnGroupeMethodeEvaluer.addSeparator(); + mnGroupeMethodeEvaluer.add(new actEvalNameNodeOui()); + } + + + + if(nod.getNameNode().equals("meta:initial-creator")) { + mnGroupeMethodeEvaluer.addSeparator(); + mnGroupeMethodeEvaluer.add(new actEvalInitialCreator()); + } + if(nod.getNameNode().equals("dc:creator")) { + mnGroupeMethodeEvaluer.addSeparator(); + mnGroupeMethodeEvaluer.add(new actevalNameCreator()); + } + + + if(nod.getNameNode().equals("text:user-defined") ) { //nod.getNomElt().equals("meta:user-defined") + mnGroupeMethodeEvaluer.addSeparator(); + mnGroupeMethodeEvaluer.add(mnEvalTextUserDefined.menu()); + } + + + + return mnGroupeMethodeEvaluer; + + } +} diff --git a/src/menu/MnGroupePourFeedback.java b/src/menu/MnGroupePourFeedback.java new file mode 100644 index 0000000..2e1aad2 --- /dev/null +++ b/src/menu/MnGroupePourFeedback.java @@ -0,0 +1,36 @@ +package menu; + +import javax.swing.ImageIcon; +import javax.swing.JMenu; + +import fenetres.create; +import list.listeDesNodesInfos; +import list.listeDesNodesPourEvaluerPage; +import xml.node; + + + +public class MnGroupePourFeedback { + public static JMenu menu(node nod) { + JMenu mnPourFeedback = new JMenu("Représentation dans le feedback"); + mnPourFeedback.setIcon(new ImageIcon(create.class.getResource("/resources/feedbackmini.png"))); + mnPourFeedback.add(mnSaut.menu()); + if(listeDesNodesInfos.isInfo(nod)) { + mnPourFeedback.addSeparator(); + mnPourFeedback.add(mnInsereInformation.menu()); + } + mnPourFeedback.addSeparator(); + mnPourFeedback.add(mnTitre.menu()); + mnPourFeedback.addSeparator(); + mnPourFeedback.add(mnAddMenuNiveauSup1.menu()); + if(listeDesNodesPourEvaluerPage.isPage(nod)) { + mnPourFeedback.addSeparator(); + mnPourFeedback.add(mnInsereInformationMultiple.menu()); + mnPourFeedback.addSeparator(); + mnPourFeedback.add(mnSautMultiple.menu()); + mnPourFeedback.addSeparator(); + mnPourFeedback.add(mnMarqueNode.menu()); + } + return mnPourFeedback; + } +} diff --git a/src/menu/MnGroupePourFeedbackNiveau1.java b/src/menu/MnGroupePourFeedbackNiveau1.java new file mode 100644 index 0000000..0f5dc47 --- /dev/null +++ b/src/menu/MnGroupePourFeedbackNiveau1.java @@ -0,0 +1,27 @@ +package menu; + +import javax.swing.ImageIcon; +import javax.swing.JMenu; + +import fenetres.create; +import xml.node; + + +public class MnGroupePourFeedbackNiveau1 { + public static JMenu menu(node nod) { + JMenu mnNiveau1 = new JMenu("Représentation dans le feedback"); + mnNiveau1.setIcon( new ImageIcon(create.class.getResource("/resources/feedbackmini.png"))); ///resources/attributanalysewritermini.png + mnNiveau1.add(mnSautNiveau1.menu()); + mnNiveau1.addSeparator(); + mnNiveau1.add(mnTitreNiveau1.menu()); + if(nod.getLevel()>1) { + mnNiveau1.addSeparator(); + mnNiveau1.add(mnAddMenuNiveau1.menu()); + } + if(nod.getNameNode().equals("structurepage")) { + mnNiveau1.addSeparator(); + mnNiveau1.add(mnaddTitreToutesLesPages.menu()); + } + return mnNiveau1; + } +} diff --git a/src/menu/mnAddMenuNiveau1.java b/src/menu/mnAddMenuNiveau1.java new file mode 100644 index 0000000..28bd562 --- /dev/null +++ b/src/menu/mnAddMenuNiveau1.java @@ -0,0 +1,19 @@ +package menu; + +import javax.swing.ImageIcon; +import javax.swing.JMenu; + +import actions.actAddMenuFalse; +import actions.actAddMenuTrue; +import fenetres.create; + + +public class mnAddMenuNiveau1 { + public static JMenu menu(){ + JMenu mnAddMenuNiveau1= new JMenu("Lien"); //addMenu + mnAddMenuNiveau1.setIcon( new ImageIcon(create.class.getResource("/resources/addmenumini.png"))); + mnAddMenuNiveau1.add(new actAddMenuTrue()); + mnAddMenuNiveau1.add(new actAddMenuFalse()); + return mnAddMenuNiveau1; + } +} diff --git a/src/menu/mnAddMenuNiveauSup1.java b/src/menu/mnAddMenuNiveauSup1.java new file mode 100644 index 0000000..14405ec --- /dev/null +++ b/src/menu/mnAddMenuNiveauSup1.java @@ -0,0 +1,20 @@ +package menu; + +import javax.swing.ImageIcon; +import javax.swing.JMenu; + +import actions.actAddMenuFalse; +import actions.actAddMenuTrue; +import fenetres.create; + + + +public class mnAddMenuNiveauSup1 { + public static JMenu menu() { + JMenu mnAddMenuNiveauSup1= new JMenu("Lien"); //addMenu + mnAddMenuNiveauSup1.setIcon( new ImageIcon(create.class.getResource("/resources/addmenumini.png"))); + mnAddMenuNiveauSup1.add(new actAddMenuTrue()); + mnAddMenuNiveauSup1.add(new actAddMenuFalse()); + return mnAddMenuNiveauSup1; + } +} diff --git a/src/menu/mnArbre.java b/src/menu/mnArbre.java new file mode 100644 index 0000000..d0b8f68 --- /dev/null +++ b/src/menu/mnArbre.java @@ -0,0 +1,26 @@ +package menu; + +import javax.swing.JMenu; + +import actions.actCollapseAll; +import actions.actCollapseNode; +import actions.actDownNode; +import actions.actExpandAll; +import actions.actExpandNode; +import actions.actUpNode; + + +public class mnArbre { + public static JMenu menu() { + JMenu mnManageTree = new JMenu("Arbre"); + mnManageTree.add(new actUpNode()); + mnManageTree.add(new actDownNode()); + mnManageTree.addSeparator(); + mnManageTree.add(new actExpandAll()); + mnManageTree.add(new actExpandNode()); + mnManageTree.addSeparator(); + mnManageTree.add(new actCollapseAll()); + mnManageTree.add(new actCollapseNode()); + return mnManageTree; + } +} \ No newline at end of file diff --git a/src/menu/mnEvalTextUserDefined.java b/src/menu/mnEvalTextUserDefined.java new file mode 100644 index 0000000..f05fc33 --- /dev/null +++ b/src/menu/mnEvalTextUserDefined.java @@ -0,0 +1,21 @@ +package menu; + +import javax.swing.ImageIcon; +import javax.swing.JMenu; + +import actions.actEvalTextUserDefinedNon; +import actions.actEvalTextUserDefinedOui; +import fenetres.create; + + +public class mnEvalTextUserDefined { + + public static JMenu menu(){ + JMenu mnEvalTextUserDefined = new JMenu("Evaluer la valeur de la propriété"); + mnEvalTextUserDefined.setIcon(new ImageIcon(create.class.getResource("/resources/evaltextuserdefinedmini.png"))); + mnEvalTextUserDefined.add(new actEvalTextUserDefinedOui()); + mnEvalTextUserDefined.add(new actEvalTextUserDefinedNon()); + return mnEvalTextUserDefined; + } + +} diff --git a/src/menu/mnEvaluer.java b/src/menu/mnEvaluer.java new file mode 100644 index 0000000..fc49fab --- /dev/null +++ b/src/menu/mnEvaluer.java @@ -0,0 +1,20 @@ +package menu; + +import javax.swing.ImageIcon; +import javax.swing.JMenu; + +import actions.actEvalueFalse; +import actions.actEvalueTrue; +import fenetres.create; + + + +public class mnEvaluer { + public static JMenu menu(){ + JMenu mnEvaluer = new JMenu("Evaluer"); + mnEvaluer.setIcon( new ImageIcon(create.class.getResource("/resources/evaluermini.png"))); + mnEvaluer.add(new actEvalueTrue()); + mnEvaluer.add(new actEvalueFalse()); + return mnEvaluer; + } +} diff --git a/src/menu/mnGroupeRechercheContenu.java b/src/menu/mnGroupeRechercheContenu.java new file mode 100644 index 0000000..9485324 --- /dev/null +++ b/src/menu/mnGroupeRechercheContenu.java @@ -0,0 +1,26 @@ +package menu; + +import javax.swing.ImageIcon; +import javax.swing.JMenu; + +import fenetres.create; +import list.listeDesNodesRechercheByContenu; +import xml.node; + + +public class mnGroupeRechercheContenu { + public static JMenu menu(node nod) { + JMenu mnGroupeRechercheContenu = new JMenu("Recherche le node"); + mnGroupeRechercheContenu.setIcon( new ImageIcon(create.class.getResource("/resources/recherchemini.png"))); + + if(listeDesNodesRechercheByContenu.isRechercheByContenu(nod)) { + if(nod.getContenuAvecTousLesContenusDesEnfants().length()>0) { + mnGroupeRechercheContenu.add(mnRechercheContenuExact.menu()); + mnGroupeRechercheContenu.addSeparator(); + mnGroupeRechercheContenu.add(mnRechercheContenuPlusProcheVoisin.menu()); + } + + } + return mnGroupeRechercheContenu; + } +} \ No newline at end of file diff --git a/src/menu/mnInsereInformation.java b/src/menu/mnInsereInformation.java new file mode 100644 index 0000000..182d01f --- /dev/null +++ b/src/menu/mnInsereInformation.java @@ -0,0 +1,18 @@ +package menu; + +import javax.swing.ImageIcon; +import javax.swing.JMenu; + +import actions.actInsereInformationFalse; +import actions.actInsereInformationTrue; +import fenetres.create; + +public class mnInsereInformation { + public static JMenu menu() { + JMenu mnInsereInformation = new JMenu("Insère l'information contenu du node"); + mnInsereInformation.setIcon( new ImageIcon(create.class.getResource("/resources/informationmini.png"))); + mnInsereInformation.add(new actInsereInformationTrue()); + mnInsereInformation.add(new actInsereInformationFalse()); + return mnInsereInformation; + } +} diff --git a/src/menu/mnInsereInformationMultiple.java b/src/menu/mnInsereInformationMultiple.java new file mode 100644 index 0000000..10ffa88 --- /dev/null +++ b/src/menu/mnInsereInformationMultiple.java @@ -0,0 +1,20 @@ +package menu; + +import javax.swing.ImageIcon; +import javax.swing.JMenu; + +import actions.actInsereInformationMultipleFalse; +import actions.actInsereInformationMultipleTrue; +import fenetres.create; + + + +public class mnInsereInformationMultiple { + public static JMenu menu() { + JMenu mnInsereInformationMultiple = new JMenu("Insère les informations contenus de tous les nodes enfants"); + mnInsereInformationMultiple.setIcon( new ImageIcon(create.class.getResource("/resources/informationmultiplemini.png"))); + mnInsereInformationMultiple.add(new actInsereInformationMultipleTrue()); + mnInsereInformationMultiple.add(new actInsereInformationMultipleFalse()); + return mnInsereInformationMultiple; + } +} diff --git a/src/menu/mnMarqueNode.java b/src/menu/mnMarqueNode.java new file mode 100644 index 0000000..1bf0844 --- /dev/null +++ b/src/menu/mnMarqueNode.java @@ -0,0 +1,20 @@ +package menu; + +import javax.swing.ImageIcon; +import javax.swing.JMenu; + +import actions.actmarquenodefalse; +import actions.actmarquenodetrue; +import fenetres.create; + + +public class mnMarqueNode { + + public static JMenu menu() { + JMenu mnMarqueNode = new JMenu("Marque le node évalué dans le feedback"); + mnMarqueNode.setIcon( new ImageIcon(create.class.getResource("/resources/marquenodemini.png"))); + mnMarqueNode.add(new actmarquenodetrue()); + mnMarqueNode.add(new actmarquenodefalse()); + return mnMarqueNode; + } +} diff --git a/src/menu/mnRechercheContenuExact.java b/src/menu/mnRechercheContenuExact.java new file mode 100644 index 0000000..b23eb20 --- /dev/null +++ b/src/menu/mnRechercheContenuExact.java @@ -0,0 +1,19 @@ +package menu; + +import javax.swing.ImageIcon; +import javax.swing.JMenu; + +import actions.actRechercheContenufalse; +import actions.actRechercheContenutrue; +import fenetres.create; + + +public class mnRechercheContenuExact { + public static JMenu menu(){ + JMenu mnRechercheContenu = new JMenu("Recherche par le contenu exact"); + mnRechercheContenu.setIcon(new ImageIcon(create.class.getResource("/resources/recherchecontenumini.png"))); + mnRechercheContenu.add( new actRechercheContenutrue()); + mnRechercheContenu.add( new actRechercheContenufalse()); + return mnRechercheContenu; + } +} diff --git a/src/menu/mnRechercheContenuPlusProcheVoisin.java b/src/menu/mnRechercheContenuPlusProcheVoisin.java new file mode 100644 index 0000000..fb6005f --- /dev/null +++ b/src/menu/mnRechercheContenuPlusProcheVoisin.java @@ -0,0 +1,20 @@ +package menu; + +import javax.swing.ImageIcon; +import javax.swing.JMenu; + +import actions.actRechercheContenuPlusProcheVoisinfalse; +import actions.actRechercheContenuPlusProcheVoisintrue; +import fenetres.create; + + + +public class mnRechercheContenuPlusProcheVoisin { + public static JMenu menu(){ + JMenu mnRechercheContenuPlusProcheVoisin2 = new JMenu("Recherche par le plus proche voisin"); + mnRechercheContenuPlusProcheVoisin2.setIcon(new ImageIcon(create.class.getResource("/resources/recherchecontenuplusprochevoisinmini.png"))); + mnRechercheContenuPlusProcheVoisin2.add( new actRechercheContenuPlusProcheVoisintrue()); + mnRechercheContenuPlusProcheVoisin2.add(new actRechercheContenuPlusProcheVoisinfalse()); + return mnRechercheContenuPlusProcheVoisin2; + } +} \ No newline at end of file diff --git a/src/menu/mnSaut.java b/src/menu/mnSaut.java new file mode 100644 index 0000000..62e54a5 --- /dev/null +++ b/src/menu/mnSaut.java @@ -0,0 +1,21 @@ +package menu; + +import javax.swing.ImageIcon; +import javax.swing.JMenu; + +import actions.actsautfalse; +import actions.actsauttrue; +import fenetres.create; + + + +public class mnSaut { + + public static JMenu menu() { + JMenu mnSaut = new JMenu("Saut de ligne avant"); + mnSaut.setIcon( new ImageIcon(create.class.getResource("/resources/sautmini.png"))); + mnSaut.add(new actsauttrue()); + mnSaut.add(new actsautfalse()); + return mnSaut; + } +} \ No newline at end of file diff --git a/src/menu/mnSautMultiple.java b/src/menu/mnSautMultiple.java new file mode 100644 index 0000000..7caeb06 --- /dev/null +++ b/src/menu/mnSautMultiple.java @@ -0,0 +1,20 @@ +package menu; + +import javax.swing.ImageIcon; +import javax.swing.JMenu; + +import actions.actsautmultiplefalse; +import actions.actsautmultipletrue; +import fenetres.create; + + + +public class mnSautMultiple { + public static JMenu menu() { + JMenu mnSautMultiple = new JMenu("Saut de ligne entre les nodes"); + mnSautMultiple.setIcon( new ImageIcon(create.class.getResource("/resources/sautmultiplemini.png"))); + mnSautMultiple.add(new actsautmultipletrue()); + mnSautMultiple.add(new actsautmultiplefalse()); + return mnSautMultiple; + } +} diff --git a/src/menu/mnSautNiveau1.java b/src/menu/mnSautNiveau1.java new file mode 100644 index 0000000..c5dbc7c --- /dev/null +++ b/src/menu/mnSautNiveau1.java @@ -0,0 +1,20 @@ +package menu; + +import javax.swing.ImageIcon; +import javax.swing.JMenu; + +import actions.actsautfalse; +import actions.actsauttrue; +import fenetres.create; + + + +public class mnSautNiveau1 { + public static JMenu menu(){ + JMenu mnSautNiveau1 = new JMenu("Saut de ligne avant"); + mnSautNiveau1.setIcon( new ImageIcon(create.class.getResource("/resources/sautmini.png"))); + mnSautNiveau1.add(new actsauttrue()); + mnSautNiveau1.add(new actsautfalse()); + return mnSautNiveau1; + } +} diff --git a/src/menu/mnTitre.java b/src/menu/mnTitre.java new file mode 100644 index 0000000..3446f4e --- /dev/null +++ b/src/menu/mnTitre.java @@ -0,0 +1,26 @@ +package menu; + +import javax.swing.ImageIcon; +import javax.swing.JMenu; + +import actions.actSupprimeTitre; +import actions.actTitre1; +import actions.actTitre2; +import actions.actTitre3; +import actions.actTitrePrincipal; +import fenetres.create; + + +public class mnTitre { + public static JMenu menu() { + JMenu mnTitre = new JMenu("Titre"); + mnTitre.setIcon( new ImageIcon(create.class.getResource("/resources/titremini.png"))); + mnTitre.add(new actTitrePrincipal()); + mnTitre.add(new actTitre1()); + mnTitre.add(new actTitre2()); + mnTitre.add(new actTitre3()); + mnTitre.addSeparator(); + mnTitre.add(new actSupprimeTitre()); + return mnTitre; + } +} \ No newline at end of file diff --git a/src/menu/mnTitreNiveau1.java b/src/menu/mnTitreNiveau1.java new file mode 100644 index 0000000..f74eeda --- /dev/null +++ b/src/menu/mnTitreNiveau1.java @@ -0,0 +1,26 @@ +package menu; + +import javax.swing.ImageIcon; +import javax.swing.JMenu; + +import actions.actSupprimeTitre; +import actions.actTitre1; +import actions.actTitre2; +import actions.actTitre3; +import actions.actTitrePrincipal; +import fenetres.create; + + +public class mnTitreNiveau1 { + public static JMenu menu() { + JMenu mnTitreNiveau1 = new JMenu("Titre"); + mnTitreNiveau1.setIcon( new ImageIcon(create.class.getResource("/resources/titremini.png"))); + mnTitreNiveau1.add(new actTitrePrincipal()); + mnTitreNiveau1.add(new actTitre1()); + mnTitreNiveau1.add(new actTitre2()); + mnTitreNiveau1.add(new actTitre3()); + mnTitreNiveau1.addSeparator(); + mnTitreNiveau1.add(new actSupprimeTitre()); + return mnTitreNiveau1; + } +} diff --git a/src/menu/mnaddTitreToutesLesPages.java b/src/menu/mnaddTitreToutesLesPages.java new file mode 100644 index 0000000..d12f989 --- /dev/null +++ b/src/menu/mnaddTitreToutesLesPages.java @@ -0,0 +1,18 @@ +package menu; + +import javax.swing.ImageIcon; +import javax.swing.JMenu; + +import actions.addTitreToutesLesPagesFalse; +import actions.addTitreToutesLesPagesTrue; +import fenetres.create; + +public class mnaddTitreToutesLesPages { + public static JMenu menu() { + JMenu mnaddTitreToutesLesPages = new JMenu("Ajoute un titre à toutes les pages"); + mnaddTitreToutesLesPages.setIcon( new ImageIcon(create.class.getResource("/resources/ajoutetitretouteslespagesmini.png"))); + mnaddTitreToutesLesPages.add(new addTitreToutesLesPagesTrue()); + mnaddTitreToutesLesPages.add(new addTitreToutesLesPagesFalse()); + return mnaddTitreToutesLesPages; + } +} diff --git a/src/resources/copy.png b/src/resources/copy.png new file mode 100644 index 0000000..ce5258f Binary files /dev/null and b/src/resources/copy.png differ diff --git a/src/resources/evaluer.png b/src/resources/evaluer.png new file mode 100644 index 0000000..e06ad32 Binary files /dev/null and b/src/resources/evaluer.png differ diff --git a/src/resources/evaluermini.png b/src/resources/evaluermini.png new file mode 100644 index 0000000..59d6087 Binary files /dev/null and b/src/resources/evaluermini.png differ diff --git a/src/resources/paste.png b/src/resources/paste.png new file mode 100644 index 0000000..69e6b34 Binary files /dev/null and b/src/resources/paste.png differ diff --git a/src/xml/node.java b/src/xml/node.java index b2ab30a..22e8608 100644 --- a/src/xml/node.java +++ b/src/xml/node.java @@ -18,6 +18,7 @@ import java.util.regex.Pattern; + public class node implements Cloneable{ private String nameNode = ""; @@ -237,6 +238,15 @@ private boolean nodeClose = false; return null; } + /** + * Retourne tous les frères du node, lui compris.
+ * @return + */ + public ArrayList retourneAllBroters(){ + return this.parent.getEnfants(); + } + + public node retournePreviousBrother() { if(this.parent!=null) { int indexOfThis = this.parent.enfants.indexOf(this);