diff --git a/.classpath b/.classpath index 87e98ef..6f7f355 100644 --- a/.classpath +++ b/.classpath @@ -2,10 +2,14 @@ + + + + + - diff --git a/bin/.gitignore b/bin/.gitignore index ea6304a..f13ae4e 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -1,12 +1 @@ /app/ -/attributmini.png -/saut.svg -/sautmini.png -/titre.svg -/titremini.png -/voir.svg -/voirmini.png -/what.svg -/whatmini.png -/MEPTL/ -/resources/ diff --git a/bin/app/create$1.class b/bin/app/create$1.class index 5c38a40..bef065c 100644 Binary files a/bin/app/create$1.class and b/bin/app/create$1.class differ diff --git a/bin/app/create$10.class b/bin/app/create$10.class index e0c595f..7c97097 100644 Binary files a/bin/app/create$10.class and b/bin/app/create$10.class differ diff --git a/bin/app/create$11.class b/bin/app/create$11.class index f8014c3..197a2f9 100644 Binary files a/bin/app/create$11.class and b/bin/app/create$11.class differ diff --git a/bin/app/create$12.class b/bin/app/create$12.class index c544648..30534be 100644 Binary files a/bin/app/create$12.class and b/bin/app/create$12.class differ diff --git a/bin/app/create$13.class b/bin/app/create$13.class index 564b7c3..dea74e8 100644 Binary files a/bin/app/create$13.class and b/bin/app/create$13.class differ diff --git a/bin/app/create$14.class b/bin/app/create$14.class index 4f6b8ae..9aa871f 100644 Binary files a/bin/app/create$14.class and b/bin/app/create$14.class differ diff --git a/bin/app/create$15.class b/bin/app/create$15.class index c2f30be..6baeca0 100644 Binary files a/bin/app/create$15.class and b/bin/app/create$15.class differ diff --git a/bin/app/create$16.class b/bin/app/create$16.class index ad49bfa..feac377 100644 Binary files a/bin/app/create$16.class and b/bin/app/create$16.class differ diff --git a/bin/app/create$17.class b/bin/app/create$17.class index 97068d2..4bd03ee 100644 Binary files a/bin/app/create$17.class and b/bin/app/create$17.class differ diff --git a/bin/app/create$18.class b/bin/app/create$18.class index f52e08a..b904d85 100644 Binary files a/bin/app/create$18.class and b/bin/app/create$18.class differ diff --git a/bin/app/create$19.class b/bin/app/create$19.class index e2071e6..4649404 100644 Binary files a/bin/app/create$19.class and b/bin/app/create$19.class differ diff --git a/bin/app/create$2.class b/bin/app/create$2.class index ba46f0f..4dae4b1 100644 Binary files a/bin/app/create$2.class and b/bin/app/create$2.class differ diff --git a/bin/app/create$20.class b/bin/app/create$20.class index 07ecbfa..a79b3a4 100644 Binary files a/bin/app/create$20.class and b/bin/app/create$20.class differ diff --git a/bin/app/create$21.class b/bin/app/create$21.class index 6df719d..52b5815 100644 Binary files a/bin/app/create$21.class and b/bin/app/create$21.class differ diff --git a/bin/app/create$22.class b/bin/app/create$22.class index 8359d6f..d66f0d2 100644 Binary files a/bin/app/create$22.class and b/bin/app/create$22.class differ diff --git a/bin/app/create$23.class b/bin/app/create$23.class index 823da26..76d9075 100644 Binary files a/bin/app/create$23.class and b/bin/app/create$23.class differ diff --git a/bin/app/create$3.class b/bin/app/create$3.class index 9e3e189..453dbd5 100644 Binary files a/bin/app/create$3.class and b/bin/app/create$3.class differ diff --git a/bin/app/create$4.class b/bin/app/create$4.class index 5300392..71f2032 100644 Binary files a/bin/app/create$4.class and b/bin/app/create$4.class differ diff --git a/bin/app/create$5.class b/bin/app/create$5.class index 3b81f07..9dafcb8 100644 Binary files a/bin/app/create$5.class and b/bin/app/create$5.class differ diff --git a/bin/app/create$6.class b/bin/app/create$6.class index 7464512..80687cf 100644 Binary files a/bin/app/create$6.class and b/bin/app/create$6.class differ diff --git a/bin/app/create$7.class b/bin/app/create$7.class index b3bad16..27a317d 100644 Binary files a/bin/app/create$7.class and b/bin/app/create$7.class differ diff --git a/bin/app/create$8.class b/bin/app/create$8.class index 844838b..d6558f2 100644 Binary files a/bin/app/create$8.class and b/bin/app/create$8.class differ diff --git a/bin/app/create$9.class b/bin/app/create$9.class index 0c8c792..de1a144 100644 Binary files a/bin/app/create$9.class and b/bin/app/create$9.class differ diff --git a/bin/app/create.class b/bin/app/create.class index e13e9af..ddc4117 100644 Binary files a/bin/app/create.class and b/bin/app/create.class differ diff --git a/bin/app/evaluate$10.class b/bin/app/evaluate$10.class index a381919..c2725c5 100644 Binary files a/bin/app/evaluate$10.class and b/bin/app/evaluate$10.class differ diff --git a/bin/app/evaluate$11.class b/bin/app/evaluate$11.class index d2f2d6f..84f85d6 100644 Binary files a/bin/app/evaluate$11.class and b/bin/app/evaluate$11.class differ diff --git a/bin/app/evaluate$12.class b/bin/app/evaluate$12.class index a477cc0..804aed2 100644 Binary files a/bin/app/evaluate$12.class and b/bin/app/evaluate$12.class differ diff --git a/bin/app/evaluate$13.class b/bin/app/evaluate$13.class index 472b02b..6dfe196 100644 Binary files a/bin/app/evaluate$13.class and b/bin/app/evaluate$13.class differ diff --git a/bin/app/evaluate$14.class b/bin/app/evaluate$14.class index 47696b3..97f804f 100644 Binary files a/bin/app/evaluate$14.class and b/bin/app/evaluate$14.class differ diff --git a/bin/app/evaluate$15.class b/bin/app/evaluate$15.class index 3033574..abaf384 100644 Binary files a/bin/app/evaluate$15.class and b/bin/app/evaluate$15.class differ diff --git a/bin/app/evaluate$16.class b/bin/app/evaluate$16.class index 06c2de3..c90fd03 100644 Binary files a/bin/app/evaluate$16.class and b/bin/app/evaluate$16.class differ diff --git a/bin/app/evaluate$17.class b/bin/app/evaluate$17.class index 6cae3f6..05a4d66 100644 Binary files a/bin/app/evaluate$17.class and b/bin/app/evaluate$17.class differ diff --git a/bin/app/evaluate.class b/bin/app/evaluate.class index d0dfa95..f145eb3 100644 Binary files a/bin/app/evaluate.class and b/bin/app/evaluate.class differ diff --git a/bin/attributmini.png b/bin/attributmini.png new file mode 100644 index 0000000..c23113b Binary files /dev/null and b/bin/attributmini.png differ diff --git a/bin/resources/downnode.png b/bin/resources/downnode.png new file mode 100644 index 0000000..a21096f Binary files /dev/null and b/bin/resources/downnode.png differ diff --git a/bin/resources/downnodemini.png b/bin/resources/downnodemini.png new file mode 100644 index 0000000..e3a6d7e Binary files /dev/null and b/bin/resources/downnodemini.png differ diff --git a/bin/resources/evalnodemini.png b/bin/resources/evalnodemini.png new file mode 100644 index 0000000..35776fd Binary files /dev/null and b/bin/resources/evalnodemini.png differ diff --git a/bin/resources/loadpreferencemini.png b/bin/resources/loadpreferencemini.png new file mode 100644 index 0000000..ec56ead Binary files /dev/null and b/bin/resources/loadpreferencemini.png differ diff --git a/bin/resources/loadpreferences.png b/bin/resources/loadpreferences.png new file mode 100644 index 0000000..a5f939c Binary files /dev/null and b/bin/resources/loadpreferences.png differ diff --git a/bin/resources/savepreference.png b/bin/resources/savepreference.png new file mode 100644 index 0000000..a605973 Binary files /dev/null and b/bin/resources/savepreference.png differ diff --git a/bin/resources/savepreferencemini.png b/bin/resources/savepreferencemini.png new file mode 100644 index 0000000..1cf341d Binary files /dev/null and b/bin/resources/savepreferencemini.png differ diff --git a/bin/resources/upnode.png b/bin/resources/upnode.png new file mode 100644 index 0000000..6666aae Binary files /dev/null and b/bin/resources/upnode.png differ diff --git a/bin/resources/upnodemini.png b/bin/resources/upnodemini.png new file mode 100644 index 0000000..2433270 Binary files /dev/null and b/bin/resources/upnodemini.png differ diff --git a/bin/saut.svg b/bin/saut.svg new file mode 100644 index 0000000..1936afb --- /dev/null +++ b/bin/saut.svg @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bin/sautmini.png b/bin/sautmini.png new file mode 100644 index 0000000..b631cfd Binary files /dev/null and b/bin/sautmini.png differ diff --git a/bin/savepreference.png b/bin/savepreference.png new file mode 100644 index 0000000..a605973 Binary files /dev/null and b/bin/savepreference.png differ diff --git a/bin/savepreference.svg b/bin/savepreference.svg new file mode 100644 index 0000000..0b91d0b --- /dev/null +++ b/bin/savepreference.svg @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bin/savepreferencemini.png b/bin/savepreferencemini.png new file mode 100644 index 0000000..1cf341d Binary files /dev/null and b/bin/savepreferencemini.png differ diff --git a/bin/titre.svg b/bin/titre.svg new file mode 100644 index 0000000..0176d09 --- /dev/null +++ b/bin/titre.svg @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + T + T + + + + diff --git a/bin/titremini.png b/bin/titremini.png new file mode 100644 index 0000000..11b39a5 Binary files /dev/null and b/bin/titremini.png differ diff --git a/bin/voir.svg b/bin/voir.svg new file mode 100644 index 0000000..10020df --- /dev/null +++ b/bin/voir.svg @@ -0,0 +1,179 @@ + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bin/voirmini.png b/bin/voirmini.png new file mode 100644 index 0000000..96d82bb Binary files /dev/null and b/bin/voirmini.png differ diff --git a/bin/what.svg b/bin/what.svg new file mode 100644 index 0000000..d2448ef --- /dev/null +++ b/bin/what.svg @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + ? + ? + + + + diff --git a/bin/whatmini.png b/bin/whatmini.png new file mode 100644 index 0000000..b123504 Binary files /dev/null and b/bin/whatmini.png differ diff --git a/icons/downnode.png b/icons/downnode.png new file mode 100644 index 0000000..a21096f Binary files /dev/null and b/icons/downnode.png differ diff --git a/icons/downnode.svg b/icons/downnode.svg new file mode 100644 index 0000000..c4a689e --- /dev/null +++ b/icons/downnode.svg @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/icons/downnodemini.png b/icons/downnodemini.png new file mode 100644 index 0000000..e3a6d7e Binary files /dev/null and b/icons/downnodemini.png differ diff --git a/icons/evalnode.svg b/icons/evalnode.svg new file mode 100644 index 0000000..6730816 --- /dev/null +++ b/icons/evalnode.svg @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/icons/evalnodemini.png b/icons/evalnodemini.png new file mode 100644 index 0000000..35776fd Binary files /dev/null and b/icons/evalnodemini.png differ diff --git a/icons/loadpreference.svg b/icons/loadpreference.svg new file mode 100644 index 0000000..922dcd4 --- /dev/null +++ b/icons/loadpreference.svg @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/icons/loadpreferencemini.png b/icons/loadpreferencemini.png new file mode 100644 index 0000000..ec56ead Binary files /dev/null and b/icons/loadpreferencemini.png differ diff --git a/icons/loadpreferences.png b/icons/loadpreferences.png new file mode 100644 index 0000000..a5f939c Binary files /dev/null and b/icons/loadpreferences.png differ diff --git a/icons/upnode.png b/icons/upnode.png new file mode 100644 index 0000000..6666aae Binary files /dev/null and b/icons/upnode.png differ diff --git a/icons/upnode.svg b/icons/upnode.svg new file mode 100644 index 0000000..122a8ae --- /dev/null +++ b/icons/upnode.svg @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/icons/upnodemini.png b/icons/upnodemini.png new file mode 100644 index 0000000..2433270 Binary files /dev/null and b/icons/upnodemini.png differ diff --git a/src/app/create.java b/src/app/create.java index 21c15ef..5f0a206 100644 --- a/src/app/create.java +++ b/src/app/create.java @@ -205,9 +205,13 @@ public class create extends JFrame { if(nod.getAttributs().size()>0) { - if(nod.getAttributs().size()==1) sb.append("

ATTRIBUT DU NODE

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

ATTRIBUTS DU NODE

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

L'ATTRIBUT DU NODE

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

LES ATTRIBUTS DU NODE

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

PAS D'ATTRIBUT DANS CE NODE

"); + } + Enumeration key = nod.getAttributs().keys(); List Lesattributsdunode = new ArrayList(); while(key.hasMoreElements()) { @@ -258,10 +262,33 @@ public class create extends JFrame { } sb.append(""); } - - + + if(nod.getAttributs().size()>0) { + if(nod.getAttributs().get("evaluer")==null) { + sb.append("
"); + sb.append("
    "); + sb.append("
  • Les attributs d'analyseWriter
  • "); + for(int i=0; i < Lesattributsdunode.size();i++) { + if(listeAttributsAnalyseWriter.isAttributAnalyseWriter(Lesattributsdunode.get(i))) { + sb.append("
  • " + Lesattributsdunode.get(i) + "=\"" + nod.getAttributs().get(Lesattributsdunode.get(i))+"\"
  • "); + } + } + sb.append("
"); + sb.append("
"); + sb.append("
    "); + sb.append("
  • Les attributs de Writer
  • "); + for(int i=0; i < Lesattributsdunode.size();i++) { + if(!listeAttributsAnalyseWriter.isAttributAnalyseWriter(Lesattributsdunode.get(i))) { + sb.append("
  • " + Lesattributsdunode.get(i) + "=\"" + nod.getAttributs().get(Lesattributsdunode.get(i))+"\"
  • "); + } + } + sb.append("
"); + } + } + + if(!nod.retourneLesContenusEnfants("").trim().isEmpty()) { sb.append("

Contenu


" + nod.retourneLesContenusEnfants("") ); } @@ -280,19 +307,22 @@ public class create extends JFrame { * @return */ private void createPopupMenuTree(node nod) { + if(nod!=null) { - boolean avertissement = false; - if(nod.chemin().contains("setting")) avertissement=true; - System.out.println(nod.chemin()); - System.out.println(avertissement); - System.out.println(nod.getLevel()); + boolean pasCeNode = false; + + if(nod.chemin().contains("setting")) pasCeNode=true; + JMenu mnEvaluer = new JMenu("Evaluer"); mnEvaluer.add(actEvalueTrue); mnEvaluer.add(actEvalueFalse); JMenu mnManageTree = new JMenu("Arbre"); + mnManageTree.add(actUpNode); + mnManageTree.add(actDownNode); + mnManageTree.addSeparator(); mnManageTree.add(actExpandAll); mnManageTree.add(actExpandNode); mnManageTree.addSeparator(); @@ -310,12 +340,18 @@ public class create extends JFrame { mnTitre.add(actTitre1); mnTitre.add(actTitre2); mnTitre.add(actTitre3); + mnTitre.addSeparator(); + mnTitre.add(actSupprimeTitre); - JMenu mnAddMenu= new JMenu("Lien"); + JMenu mnAddMenu= new JMenu("Lien"); //addMenu mnAddMenu.add(actAddMenuTrue); mnAddMenu.add(actAddMenuFalse); + JMenu mnEvalNameNode = new JMenu("Evaluer la présence du node"); + mnEvalNameNode.setIcon(new ImageIcon(create.class.getResource("/resources/evalnodemini.png"))); + mnEvalNameNode.add(actEvalNameNodeOui); + mnEvalNameNode.add(actEvalNameNodeNon); JMenu mnNodePrincipal = new JMenu("Node niveau " + nod.getLevel()); if(nod.getLevel()==1) { @@ -326,10 +362,12 @@ public class create extends JFrame { mnNodePrincipal.addSeparator(); mnNodePrincipal.add(mnTitre); if(nod.getLevel()>1) { + mnNodePrincipal.addSeparator(); + mnNodePrincipal.add(mnEvalNameNode); mnNodePrincipal.addSeparator(); mnNodePrincipal.add(mnAddMenu); mnNodePrincipal.addSeparator(); - mnNodePrincipal.add("evalNode"); + mnNodePrincipal.add("allContent"); } if(nod.getNomElt().equals("meta:initial-creator")) { mnNodePrincipal.addSeparator(); @@ -338,12 +376,12 @@ public class create extends JFrame { //La popupMenu JPopupMenu mnPopupTree = new JPopupMenu(); - if(!avertissement) mnPopupTree.add(mnEvaluer); - if(!avertissement) { //nod.getLevel()==1 && !avertissement + if(!pasCeNode) mnPopupTree.add(mnEvaluer); + if(!pasCeNode) { //nod.getLevel()==1 && !avertissement mnPopupTree.addSeparator(); mnPopupTree.add(mnNodePrincipal); } - if(nod.getLevel()>1 && !avertissement) { + if(nod.getLevel()>1 && !pasCeNode) { mnPopupTree.addSeparator(); mnPopupTree.add(actAttribut); } @@ -352,13 +390,17 @@ public class create extends JFrame { mnPopupTree.addSeparator(); mnPopupTree.add(mnManageTree); mnPopupTree.addSeparator(); - mnPopupTree.add(actDelete); + mnPopupTree.add(actDeleteNode); tree.setComponentPopupMenu(mnPopupTree); - }else { - + } + + if(nod==null){ JMenu mnManageTree = new JMenu("Arbre"); + mnManageTree.add(actUpNode); + mnManageTree.add(actDownNode); + mnManageTree.addSeparator(); mnManageTree.add(actExpandAll); mnManageTree.add(actExpandNode); mnManageTree.addSeparator(); @@ -510,9 +552,11 @@ public class create extends JFrame { new filechooserXML(); if(commandes.fichierAnalyseValide) { constructionTree(); - textNodeSelect.setText("Le chargement de la nouvelle structure est réussi."); + textNodeSelect.setContentType("text/html"); + textNodeSelect.setText(balisestyles() + "

Le chargement du fichier d'analyseWriter est réussi.


"); }else { constructionTree(); + textNodeSelect.setContentType("text/plain"); textNodeSelect.setText(commandes.message.toString()); } System.out.println( "Open" ); @@ -870,6 +914,75 @@ public class create extends JFrame { } }; + + + /** + * Evalue la présence de ce node + */ + private AbstractAction actEvalNameNodeOui = new AbstractAction() { + + private static final long serialVersionUID = 1L; + + { + putValue( Action.NAME, "Oui, combien de point?" ); + putValue( Action.SHORT_DESCRIPTION, "Evaluer la présence de ce node" ); + } + + @Override public void actionPerformed( ActionEvent e ) { + DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent(); + + node nod = (node) selectNode.getUserObject(); + int point = 0; + if(nod.getAttributs().get("evalNameNode")!=null) { + point = Integer.valueOf(nod.getAttributs().get("evalNameNode")); + } + + String a = JOptionPane.showInputDialog(null,"Quel est le nombre de point?",point); + + if(!a.isEmpty()) { + try { + point = Integer.valueOf(a); + if(point<=0) { + nod.getAttributs().put("evalNameNode", String.valueOf(0)); + textNodeSelect.setText(balisestyles()); + textNodeSelect.setText("

Erreur la valeur doit être un nombre entier POSITIF supérieur à zéro.
Cependant,la valeur a été modifiée.
evalNameNode=0.

"); + }else { + nod.getAttributs().put("evalNameNode", String.valueOf(point)); + } + } catch (Exception e2) { + textNodeSelect.setText(balisestyles()); + textNodeSelect.setText("

Erreur la valeur doit être un nombre entier.
L'attribut n'a pas été modifiée.

"); + } + } + refeshNodeSelected(); + + } + }; + + /** + * Evalue la présence de ce node + */ + private AbstractAction actEvalNameNodeNon = new AbstractAction() { + + private static final long serialVersionUID = 1L; + + { + putValue( Action.NAME, "Supprime l'évaluation de la présence du node" ); + putValue( Action.SHORT_DESCRIPTION, "Supprime l'évaluation de la présence du node" ); + } + + @Override public void actionPerformed( ActionEvent e ) { + DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent(); + + node nod = (node) selectNode.getUserObject(); + nod.supprimeAttribut("evalNameNode"); + refeshNodeSelected(); + + } + }; + + + /** * Ajoute ou modifie le titre principal */ @@ -897,6 +1010,40 @@ public class create extends JFrame { } }; + /** + * Ajoute ou modifie le titre principal + */ + private AbstractAction actSupprimeTitre = new AbstractAction() { + + private static final long serialVersionUID = 1L; + + { + putValue( Action.NAME, "Titre principal" ); + putValue( Action.SHORT_DESCRIPTION, "Titre principal" ); + } + + @Override public void actionPerformed( ActionEvent e ) { + DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent(); + + node nod = (node) selectNode.getUserObject(); + if(nod.getAttributs().get("titre")!=null) { + nod.supprimeAttribut("titre"); + } + if(nod.getAttributs().get("titre1")!=null) { + nod.supprimeAttribut("titre1"); + } + if(nod.getAttributs().get("titre2")!=null) { + nod.supprimeAttribut("titre2"); + } + if(nod.getAttributs().get("titre3")!=null) { + nod.supprimeAttribut("titre3"); + } + refeshNodeSelected(); + } + }; + + + /** * Ajoute ou modifie le titre 1 */ @@ -1096,7 +1243,7 @@ public class create extends JFrame { /** * Supprime un node */ - private AbstractAction actDelete = new AbstractAction() { + private AbstractAction actDeleteNode = new AbstractAction() { private static final long serialVersionUID = 1L; @@ -1139,6 +1286,7 @@ public class create extends JFrame { private static final long serialVersionUID = 1L; { + putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.ALT_DOWN_MASK)); putValue( Action.NAME, "Evaluer true" ); putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/evaluertruemini.png")) ); putValue( Action.SHORT_DESCRIPTION, "Evaluer true" ); @@ -1294,12 +1442,15 @@ public class create extends JFrame { } }; - + /** + * N'évalue pas le node evaluer=false + */ private AbstractAction actEvalueFalse = new AbstractAction() { private static final long serialVersionUID = 1L; { + putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.ALT_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK)); putValue( Action.NAME, "Evaluer false" ); putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/evaluerfalsemini.png")) ); putValue( Action.SHORT_DESCRIPTION, "Evaluer false" ); @@ -1318,82 +1469,153 @@ public class create extends JFrame { } }; - private AbstractAction actExpandAll= new AbstractAction() { + /** + * Expand all + */ + private AbstractAction actExpandAll= new AbstractAction() { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - { - putValue( Action.NAME, "Tout étendre" ); - putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/expandallmini.png")) ); - putValue( Action.SHORT_DESCRIPTION, "Tout étendre" ); - } - - @Override public void actionPerformed( ActionEvent e ) { - expandAll(); - refeshNodeSelected(); - } - }; + { + putValue( Action.NAME, "Tout étendre" ); + putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/expandallmini.png")) ); + putValue( Action.SHORT_DESCRIPTION, "Tout étendre" ); + } + + @Override public void actionPerformed( ActionEvent e ) { + expandAll(); + refeshNodeSelected(); + } + }; - - private AbstractAction actCollapseAll= new AbstractAction() { + /** + * Calloapse all + */ + private AbstractAction actCollapseAll= new AbstractAction() { + + private static final long serialVersionUID = 1L; + + { + putValue( Action.NAME, "Tout réduire" ); + putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/collapseallmini.png")) ); + putValue( Action.SHORT_DESCRIPTION, "Tout réduire" ); + } + + @Override public void actionPerformed( ActionEvent e ) { + collapseAll(); + refeshNodeSelected(); + } + }; + + /** + * Expand node + */ + private AbstractAction actExpandNode= new AbstractAction() { + + private static final long serialVersionUID = 1L; + + { + putValue( Action.NAME, "Etendre ce node" ); + putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/expandnodemini.png")) ); + putValue( Action.SHORT_DESCRIPTION, "Etendre ce node" ); + } + + @Override public void actionPerformed( ActionEvent e ) { + if(tree.getSelectionPath()!=null) { + DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent(); + textNodeSelect.setContentType("text/html"); + + expandNode(selectNode); + refeshNodeSelected(); + } + } + }; + + /** + * Collapse node + */ + private AbstractAction actCollapseNode= new AbstractAction() { + + private static final long serialVersionUID = 1L; + + { + putValue( Action.NAME, "Réduire ce node" ); + putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/collapsenodemini.png")) ); + putValue( Action.SHORT_DESCRIPTION, "Réduire ce node" ); + } + + @Override public void actionPerformed( ActionEvent e ) { + if(tree.getSelectionPath()!=null) { + DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent(); + textNodeSelect.setContentType("text/html"); + collapseNode(selectNode); + refeshNodeSelected(); + } + } + }; + + /** + * Up node + */ + private AbstractAction actUpNode= new AbstractAction() { private static final long serialVersionUID = 1L; { - putValue( Action.NAME, "Tout réduire" ); - putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/collapseallmini.png")) ); - putValue( Action.SHORT_DESCRIPTION, "Tout réduire" ); - } - - @Override public void actionPerformed( ActionEvent e ) { - collapseAll(); - refeshNodeSelected(); - } - }; - - private AbstractAction actExpandNode= new AbstractAction() { - - private static final long serialVersionUID = 1L; - - { - putValue( Action.NAME, "Etendre ce node" ); - putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/expandnodemini.png")) ); - putValue( Action.SHORT_DESCRIPTION, "Etendre ce node" ); + putValue( Action.NAME, "Monter le node" ); + putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/upnodemini.png")) ); + putValue( Action.SHORT_DESCRIPTION, "Monter le node" ); } @Override public void actionPerformed( ActionEvent e ) { if(tree.getSelectionPath()!=null) { - DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent(); - textNodeSelect.setContentType("text/html"); - - expandNode(selectNode); - refeshNodeSelected(); - } + DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent(); + + int a = JOptionPane.showConfirmDialog(null,"Voulez-vous monter le node " + selectNode.toString() + "?", "Sélectionner un choix", JOptionPane.YES_NO_OPTION); + + if(a == JOptionPane.YES_NO_OPTION) { + node nod = (node) selectNode.getUserObject(); + if(!nod.chemin().contains("setting")) { + nod.getParent().upNodeEnfant(nod); + constructionTree(); + }else { + JOptionPane.showMessageDialog(null,"Vous ne devez pas déplacer ce node !", "Oh non!!!", JOptionPane.INFORMATION_MESSAGE); + } + } + } } - }; - - private AbstractAction actCollapseNode= new AbstractAction() { + }; + + private AbstractAction actDownNode= new AbstractAction() { private static final long serialVersionUID = 1L; { - putValue( Action.NAME, "Réduire ce node" ); - putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/collapsenodemini.png")) ); - putValue( Action.SHORT_DESCRIPTION, "Réduire ce node" ); + putValue( Action.NAME, "Descendre le node" ); + putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/downnodemini.png")) ); + putValue( Action.SHORT_DESCRIPTION, "Descendre le node" ); } @Override public void actionPerformed( ActionEvent e ) { if(tree.getSelectionPath()!=null) { - DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent(); - textNodeSelect.setContentType("text/html"); - - collapseNode(selectNode); - refeshNodeSelected(); - } + DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent(); + + int a = JOptionPane.showConfirmDialog(null,"Voulez-vous descendre le node " + selectNode.toString() + "?", "Sélectionner un choix", JOptionPane.YES_NO_OPTION); + + if(a == JOptionPane.YES_NO_OPTION) { + node nod = (node) selectNode.getUserObject(); + if(!nod.chemin().contains("setting")) { + nod.getParent().downNodeEnfant(nod); + constructionTree(); + }else { + JOptionPane.showMessageDialog(null,"Vous ne devez pas déplacer ce node !", "Oh non!!!", JOptionPane.INFORMATION_MESSAGE); + } + } + } } - }; - - + }; + + diff --git a/src/app/evaluate.java b/src/app/evaluate.java index 999db7a..31a008d 100644 --- a/src/app/evaluate.java +++ b/src/app/evaluate.java @@ -845,6 +845,9 @@ public class evaluate extends JFrame { } }; + /** + * Enregistre L'évaluation + */ private AbstractAction actSave = new AbstractAction() { private static final long serialVersionUID = 1L; @@ -864,7 +867,9 @@ public class evaluate extends JFrame { } }; - + /** + * Enregistre sous l'évaluation + */ private AbstractAction actSaveas = new AbstractAction() { private static final long serialVersionUID = 1L; diff --git a/src/resources/downnode.png b/src/resources/downnode.png new file mode 100644 index 0000000..a21096f Binary files /dev/null and b/src/resources/downnode.png differ diff --git a/src/resources/downnodemini.png b/src/resources/downnodemini.png new file mode 100644 index 0000000..e3a6d7e Binary files /dev/null and b/src/resources/downnodemini.png differ diff --git a/src/resources/evalnodemini.png b/src/resources/evalnodemini.png new file mode 100644 index 0000000..35776fd Binary files /dev/null and b/src/resources/evalnodemini.png differ diff --git a/src/resources/loadpreferencemini.png b/src/resources/loadpreferencemini.png new file mode 100644 index 0000000..ec56ead Binary files /dev/null and b/src/resources/loadpreferencemini.png differ diff --git a/src/resources/loadpreferences.png b/src/resources/loadpreferences.png new file mode 100644 index 0000000..a5f939c Binary files /dev/null and b/src/resources/loadpreferences.png differ diff --git a/src/resources/upnode.png b/src/resources/upnode.png new file mode 100644 index 0000000..6666aae Binary files /dev/null and b/src/resources/upnode.png differ diff --git a/src/resources/upnodemini.png b/src/resources/upnodemini.png new file mode 100644 index 0000000..2433270 Binary files /dev/null and b/src/resources/upnodemini.png differ