diff --git a/analyseWriter.jar b/analyseWriter.jar index 26b2038..58f5be0 100644 Binary files a/analyseWriter.jar and b/analyseWriter.jar differ diff --git a/bin/app/create$1.class b/bin/app/create$1.class index b22c265..3d712c4 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 6d8cb8a..dcf5947 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 b30f641..40a0235 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 9497ff9..189616a 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 3426d18..983d05f 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 acf0523..537ac53 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 117173a..983ab88 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 7654d2d..3466bad 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 4ad486c..0e017c0 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 7b413b0..11998ee 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 5c5b497..3f3e7eb 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 83d976a..eb9d9c9 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 71ed88d..d3de12c 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 2c4f1a1..9cd73ec 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 2c7cc73..c7e6b61 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 9bbd2c3..a096c02 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 d46faad..793befc 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 215e479..d317b94 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 7292541..84099c0 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 0b693f0..1db2dc0 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 26825a3..db0ea37 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 058c38d..b320b77 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 f631585..b37d174 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 cb004d5..d5c455c 100644 Binary files a/bin/app/create.class and b/bin/app/create.class differ diff --git a/bin/attribut.svg b/bin/attribut.svg index 070cd9c..a082190 100644 --- a/bin/attribut.svg +++ b/bin/attribut.svg @@ -1,22 +1,22 @@ + width="48" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + id="base" + inkscape:pagecheckerboard="0" /> @@ -67,7 +68,6 @@ image/svg+xml - @@ -97,9 +97,10 @@ sodipodi:nodetypes="cc" /> + transform="matrix(0.47671987,0,0,0.47671987,73.577485,58.485926)" + style="fill:#00ff00"> + transform="matrix(0.49287049,0,0,0.49287049,52.99201,100.44212)" + style="fill:#008080"> + id="g891" + style="fill:#ff0000"> + style="fill:#ff0000;fill-rule:evenodd;stroke:#000000;stroke-width:1.21339;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none" /> + id="g858" + style="fill:#2ad4ff"> + style="fill:#2ad4ff;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none" /> + id="g852" + style="fill:#cd87de"> + id="g870" + style="fill:#ffd42a"> + style="fill:#ffd42a;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none" /> diff --git a/bin/poids.svg b/bin/poids.svg new file mode 100644 index 0000000..f901afb --- /dev/null +++ b/bin/poids.svg @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bin/poidsmini.png b/bin/poidsmini.png new file mode 100644 index 0000000..899fcf8 Binary files /dev/null and b/bin/poidsmini.png differ diff --git a/icons/attribut.svg b/icons/attribut.svg index 070cd9c..a082190 100644 --- a/icons/attribut.svg +++ b/icons/attribut.svg @@ -1,22 +1,22 @@ + width="48" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + id="base" + inkscape:pagecheckerboard="0" /> @@ -67,7 +68,6 @@ image/svg+xml - @@ -97,9 +97,10 @@ sodipodi:nodetypes="cc" /> + transform="matrix(0.47671987,0,0,0.47671987,73.577485,58.485926)" + style="fill:#00ff00"> + transform="matrix(0.49287049,0,0,0.49287049,52.99201,100.44212)" + style="fill:#008080"> + id="g891" + style="fill:#ff0000"> + style="fill:#ff0000;fill-rule:evenodd;stroke:#000000;stroke-width:1.21339;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none" /> + id="g858" + style="fill:#2ad4ff"> + style="fill:#2ad4ff;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none" /> + id="g852" + style="fill:#cd87de"> + id="g870" + style="fill:#ffd42a"> + style="fill:#ffd42a;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none" /> diff --git a/icons/attributmini.png b/icons/attributmini.png new file mode 100644 index 0000000..c23113b Binary files /dev/null and b/icons/attributmini.png differ diff --git a/icons/saut.svg b/icons/saut.svg new file mode 100644 index 0000000..1936afb --- /dev/null +++ b/icons/saut.svg @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/icons/sautmini.png b/icons/sautmini.png new file mode 100644 index 0000000..b631cfd Binary files /dev/null and b/icons/sautmini.png differ diff --git a/icons/titre.svg b/icons/titre.svg new file mode 100644 index 0000000..0176d09 --- /dev/null +++ b/icons/titre.svg @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + T + T + + + + diff --git a/icons/titremini.png b/icons/titremini.png new file mode 100644 index 0000000..11b39a5 Binary files /dev/null and b/icons/titremini.png differ diff --git a/src/app/create.java b/src/app/create.java index 5f2fc8e..e40991a 100644 --- a/src/app/create.java +++ b/src/app/create.java @@ -12,7 +12,6 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.io.File; import java.io.IOException; -import java.util.ArrayList; import java.util.Enumeration; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -42,13 +41,9 @@ import javax.swing.JTree; import javax.swing.KeyStroke; import javax.swing.SwingConstants; import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.event.TreeExpansionEvent; -import javax.swing.event.TreeExpansionListener; -import javax.swing.event.TreeWillExpandListener; import javax.swing.filechooser.FileNameExtensionFilter; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeCellRenderer; -import javax.swing.tree.ExpandVetoException; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; import javax.swing.tree.TreeSelectionModel; @@ -64,7 +59,7 @@ import cXML.Run; import cXML.node; import java.awt.event.InputEvent; -import java.awt.event.ActionListener; +import javax.swing.tree.DefaultTreeModel; @@ -167,6 +162,24 @@ public class create extends JFrame { // Construction et injection de la barre de menu setJMenuBar( this.createMenuBar() ); + tree.setModel(new DefaultTreeModel( + new DefaultMutableTreeNode("Charger un fichier d'analyse") { + { + DefaultMutableTreeNode node_1; + add(new DefaultMutableTreeNode("node fichier")); + node_1 = new DefaultMutableTreeNode("node style"); + node_1.add(new DefaultMutableTreeNode("paragraphe")); + node_1.add(new DefaultMutableTreeNode("caractère")); + add(node_1); + node_1 = new DefaultMutableTreeNode("strcturepage"); + node_1.add(new DefaultMutableTreeNode("page")); + node_1.add(new DefaultMutableTreeNode("page")); + node_1.add(new DefaultMutableTreeNode("page")); + node_1.add(new DefaultMutableTreeNode("page")); + add(node_1); + } + } + )); tree.setVisibleRowCount(30); // Ajoute le menu contextuel de la tree @@ -563,6 +576,13 @@ public class create extends JFrame { */ 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()); + JMenu mnEvaluer = new JMenu("Evaluer"); mnEvaluer.add(actEvalueTrue); mnEvaluer.add(actEvalueFalse); @@ -574,23 +594,54 @@ public class create extends JFrame { mnManageTree.add(actCollapseAll); mnManageTree.add(actCollapseNode); - JMenu mnNodePrincipal = new JMenu("Node niveau 1"); - mnNodePrincipal.add(actCoefficient); - mnNodePrincipal.addSeparator(); - mnNodePrincipal.add("Insère une ligne avant le titre"); - mnNodePrincipal.addSeparator(); - mnNodePrincipal.add("Ajoute un Titre principal"); - mnNodePrincipal.add("Ajoute un Titre 1"); - mnNodePrincipal.add("Ajoute un Titre 2"); - mnNodePrincipal.add("Ajoute un Titre 3"); + JMenu mnSaut = new JMenu("Saut de ligne avant"); + mnSaut.setIcon( new ImageIcon(create.class.getResource("/resources/sautmini.png"))); + mnSaut.add(actsauttrue); + mnSaut.add(actsautfalse); + + JMenu mnTitre = new JMenu("Titre"); + mnTitre.setIcon( new ImageIcon(create.class.getResource("/resources/titremini.png"))); + mnTitre.add(actTitrePrincipal); + mnTitre.add(actTitre1); + mnTitre.add(actTitre2); + mnTitre.add(actTitre3); - JPopupMenu mnPopupTree = new JPopupMenu(); - mnPopupTree.add(mnEvaluer); + JMenu mnAddMenu= new JMenu("Lien"); + mnAddMenu.add(actAddMenuTrue); + mnAddMenu.add(actAddMenuFalse); + + + JMenu mnNodePrincipal = new JMenu("Node niveau " + nod.getLevel()); if(nod.getLevel()==1) { + mnNodePrincipal.add(actCoefficient); + mnNodePrincipal.addSeparator(); + } + mnNodePrincipal.add(mnSaut); + mnNodePrincipal.addSeparator(); + mnNodePrincipal.add(mnTitre); + if(nod.getLevel()>1) { + mnNodePrincipal.addSeparator(); + mnNodePrincipal.add(mnAddMenu); + mnNodePrincipal.addSeparator(); + mnNodePrincipal.add("evalNode"); + } + if(nod.getNomElt().equals("meta:initial-creator")) { + mnNodePrincipal.addSeparator(); + mnNodePrincipal.add("evalNameInitialCreator"); + } + + //La popupMenu + JPopupMenu mnPopupTree = new JPopupMenu(); + if(!avertissement) mnPopupTree.add(mnEvaluer); + if(!avertissement) { //nod.getLevel()==1 && !avertissement mnPopupTree.addSeparator(); mnPopupTree.add(mnNodePrincipal); } + if(nod.getLevel()>1 && !avertissement) { + mnPopupTree.addSeparator(); + mnPopupTree.add(actAttribut); + } mnPopupTree.addSeparator(); mnPopupTree.add(actNodeFichier); mnPopupTree.addSeparator(); @@ -793,6 +844,30 @@ public class create extends JFrame { } }; + /** + * + */ + private AbstractAction actAttribut = new AbstractAction() { + + private static final long serialVersionUID = 1L; + + { + putValue( Action.NAME, "Evaluer les attributs" ); + putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/attributmini.png")) ); + putValue( Action.LARGE_ICON_KEY, new ImageIcon(create.class.getResource("/resources/attributmini.png")) ); + putValue( Action.SHORT_DESCRIPTION, "Evaluer les attributs" ); + + } + + @Override public void actionPerformed( ActionEvent e ) { + if(commandes.sujet.getNomElt().equals("fichier")) { + new proprieteFichierAnalyse(); + + } + System.out.println( "ouvre la fenêtre propriété du fichier d'analyse" ); + } + }; + /** * Affiche la fenêtre d'information sur analyseWriter @@ -1053,7 +1128,7 @@ public class create extends JFrame { /** - * + * Ajoute ou modifie le poid d'un node */ private AbstractAction actCoefficient = new AbstractAction() { @@ -1096,6 +1171,187 @@ public class create extends JFrame { } }; + + /** + * Ajoute ou modifie le titre principal + */ + private AbstractAction actTitrePrincipal = 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(); + String titre = ""; + if(nod.getAttributs().get("titre")!=null) { + titre = nod.getAttributs().get("titre"); + } + + String a = JOptionPane.showInputDialog(null,"Quel est le titre?",titre); + nod.titre(a); + refeshNodeSelected(); + } + }; + + /** + * Ajoute ou modifie le titre 1 + */ + private AbstractAction actTitre1 = new AbstractAction() { + + private static final long serialVersionUID = 1L; + + { + putValue( Action.NAME, "Titre 1" ); + putValue( Action.SHORT_DESCRIPTION, "Titre 1" ); + } + + @Override public void actionPerformed( ActionEvent e ) { + DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent(); + + node nod = (node) selectNode.getUserObject(); + String titre = ""; + if(nod.getAttributs().get("titre1")!=null) { + titre = nod.getAttributs().get("titre1"); + } + + String a = JOptionPane.showInputDialog(null,"Quel est le titre?",titre); + nod.titre1(a); + refeshNodeSelected(); + } + }; + + + /** + * Ajoute ou modifie le titre 2 + */ + private AbstractAction actTitre2 = new AbstractAction() { + + private static final long serialVersionUID = 1L; + + { + putValue( Action.NAME, "Titre 2" ); + putValue( Action.SHORT_DESCRIPTION, "Titre 2" ); + } + + @Override public void actionPerformed( ActionEvent e ) { + DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent(); + + node nod = (node) selectNode.getUserObject(); + String titre = ""; + if(nod.getAttributs().get("titre2")!=null) { + titre = nod.getAttributs().get("titre2"); + } + + String a = JOptionPane.showInputDialog(null,"Quel est le titre?",titre); + nod.titre2(a); + refeshNodeSelected(); + } + }; + + + /** + * Ajoute ou modifie le titre 3 + */ + private AbstractAction actTitre3 = new AbstractAction() { + + private static final long serialVersionUID = 1L; + + { + putValue( Action.NAME, "Titre 3" ); + putValue( Action.SHORT_DESCRIPTION, "Titre 3" ); + } + + @Override public void actionPerformed( ActionEvent e ) { + DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent(); + + node nod = (node) selectNode.getUserObject(); + String titre = ""; + if(nod.getAttributs().get("titre3")!=null) { + titre = nod.getAttributs().get("titre3"); + } + + String a = JOptionPane.showInputDialog(null,"Quel est le titre?",titre); + nod.titre3(a); + refeshNodeSelected(); + } + }; + + + /** + * Ajoute ou modifie un saut de ligne à true. + */ + private AbstractAction actsauttrue = new AbstractAction() { + + private static final long serialVersionUID = 1L; + + { + putValue( Action.NAME, "true" ); + putValue( Action.SHORT_DESCRIPTION, "true" ); + } + + @Override public void actionPerformed( ActionEvent e ) { + DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent(); + textNodeSelect.setContentType("text/html"); + + node nod = (node) selectNode.getUserObject(); + TreeNode[] chemin = selectNode.getPath(); + boolean avertissement=false; + for(int i = 0 ; i < chemin.length; i++) { + if(chemin[i].toString().contains("setting")) avertissement = true; + System.out.println(chemin[i].toString()); + } + + if(!avertissement) { + nod.saut(true); + refeshNodeSelected(); + }else { + JOptionPane.showMessageDialog(null, "Ce node ne peut pas être évaluer." ); + } + + } + }; + + + /** + * Ajoute ou modifie un saut de ligne à true. + */ + private AbstractAction actsautfalse = new AbstractAction() { + + private static final long serialVersionUID = 1L; + + { + putValue( Action.NAME, "false" ); + putValue( Action.SHORT_DESCRIPTION, "false" ); + } + + @Override public void actionPerformed( ActionEvent e ) { + DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent(); + textNodeSelect.setContentType("text/html"); + + node nod = (node) selectNode.getUserObject(); + TreeNode[] chemin = selectNode.getPath(); + boolean avertissement=false; + for(int i = 0 ; i < chemin.length; i++) { + if(chemin[i].toString().contains("setting")) avertissement = true; + System.out.println(chemin[i].toString()); + } + + if(!avertissement) { + nod.saut(false); + refeshNodeSelected(); + }else { + JOptionPane.showMessageDialog(null, "Ce node ne peut pas être évaluer." ); + } + + } + }; + /** @@ -1178,7 +1434,7 @@ public class create extends JFrame { }; /** - * Evalue le node est tous ces enfants + * evaluer =true */ private AbstractAction actEvalueTrue = new AbstractAction() { @@ -1200,7 +1456,6 @@ public class create extends JFrame { boolean avertissement=false; for(int i = 0 ; i < chemin.length; i++) { if(chemin[i].toString().contains("setting")) avertissement = true; - System.out.println(chemin[i].toString()); } if(!avertissement) { @@ -1215,6 +1470,76 @@ public class create extends JFrame { } }; + /** + + /** + * addMenu=true + */ + private AbstractAction actAddMenuTrue = new AbstractAction() { + + private static final long serialVersionUID = 1L; + + { + putValue( Action.NAME, "true" ); + putValue( Action.SHORT_DESCRIPTION, "true" ); + } + + @Override public void actionPerformed( ActionEvent e ) { + + DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent(); + textNodeSelect.setContentType("text/html"); + + node nod = (node) selectNode.getUserObject(); + TreeNode[] chemin = selectNode.getPath(); + boolean avertissement=false; + for(int i = 0 ; i < chemin.length; i++) { + if(chemin[i].toString().contains("setting")) avertissement = true; + } + + if(!avertissement) { + nod.evaluerTrue(); + nod.addMenu(true); + refeshNodeSelected(); + }else { + JOptionPane.showMessageDialog(null, "Ce node ne peut pas être évaluer." ); + } + } + }; + + /** + * addMenu=false + */ + private AbstractAction actAddMenuFalse = new AbstractAction() { + + private static final long serialVersionUID = 1L; + + { + putValue( Action.NAME, "false" ); + putValue( Action.SHORT_DESCRIPTION, "false" ); + } + + @Override public void actionPerformed( ActionEvent e ) { + + DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent(); + textNodeSelect.setContentType("text/html"); + + node nod = (node) selectNode.getUserObject(); + TreeNode[] chemin = selectNode.getPath(); + boolean avertissement=false; + for(int i = 0 ; i < chemin.length; i++) { + if(chemin[i].toString().contains("setting")) avertissement = true; + } + + if(!avertissement) { + nod.evaluerTrue(); + nod.addMenu(false); + refeshNodeSelected(); + }else { + JOptionPane.showMessageDialog(null, "Ce node ne peut pas être évaluer." ); + } + } + }; + // public static void expandOrCollapsePath (JTree tree,TreePath treePath,int level,int currentLevel,boolean expand) { diff --git a/src/app/proprieteFichierAnalyse.java b/src/app/proprieteFichierAnalyse.java index d65c1ee..05fdfc1 100644 --- a/src/app/proprieteFichierAnalyse.java +++ b/src/app/proprieteFichierAnalyse.java @@ -5,6 +5,8 @@ import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JLabel; +import javax.swing.JOptionPane; + import java.awt.Font; import javax.swing.JTextField; @@ -19,6 +21,7 @@ import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import net.miginfocom.swing.MigLayout; import java.awt.Toolkit; +import javax.swing.ImageIcon; public class proprieteFichierAnalyse extends JFrame { @@ -46,6 +49,19 @@ public class proprieteFichierAnalyse extends JFrame { private JTextField textFieldlink_help; private JLabel lblNewLabel_12; private JTextField textFieldlink_sujet; + private JButton btnAideTitre; + private JButton btnAideAuteur; + private JButton btnAideMetaSujet; + private JButton btnAidePresenceMetaSujet; + private JButton btnAideBaremeABC; + private JButton btnAideNoteFrom; + private JButton btnAideProgression; + private JButton btnAideHistoriquePresent; + private JButton btnAideDateCreation; + private JButton btnAideControleDateCreation; + private JButton btnAideInitial_Creator; + private JButton btnAidecontrole_Initial_Creator; + private JButton btnVoirBaremeABC; /** @@ -69,7 +85,7 @@ public class proprieteFichierAnalyse extends JFrame { */ public proprieteFichierAnalyse() { setIconImage(Toolkit.getDefaultToolkit().getImage(proprieteFichierAnalyse.class.getResource("/resources/evalwriter.ico"))); - setBounds(0, 0, 600, 560); + setBounds(0, 0, 630, 639); setResizable(false); setTitle("Propriété du fichier d'analyse"); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); @@ -80,7 +96,7 @@ public class proprieteFichierAnalyse extends JFrame { contentPane = new JPanel(); contentPane.setBorder(null); setContentPane(contentPane); - contentPane.setLayout(new MigLayout("", "[260px][260px,grow]", "[18px][18px][18px][30px][18px][18px][18px][30px][45px][18px][18px][18px][][][][][]")); + contentPane.setLayout(new MigLayout("", "[260px][260px][10,grow 20]", "[18px][18px][18px][30px][18px][18px][18px][30px][45px][18px][18px][18px][][][][18px:24px:48px,grow]")); JLabel lblNewLabel = new JLabel("Titre de l'exercice"); lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 12)); @@ -94,6 +110,10 @@ public class proprieteFichierAnalyse extends JFrame { textFieldTitre.setText(commandes.sujet.getAttributs().get("titre")); } + btnAideTitre = new JButton(""); + btnAideTitre.setIcon(new ImageIcon(proprieteFichierAnalyse.class.getResource("/resources/whatmini.png"))); + contentPane.add(btnAideTitre, "cell 2 0"); + JLabel lblNewLabel_1 = new JLabel("Auteur"); lblNewLabel_1.setFont(new Font("Tahoma", Font.PLAIN, 12)); contentPane.add(lblNewLabel_1, "cell 0 1,alignx left,aligny center"); @@ -106,6 +126,10 @@ public class proprieteFichierAnalyse extends JFrame { textFieldAuteur.setText(commandes.sujet.getAttributs().get("auteur")); } + btnAideAuteur = new JButton(""); + btnAideAuteur.setIcon(new ImageIcon(proprieteFichierAnalyse.class.getResource("/resources/whatmini.png"))); + contentPane.add(btnAideAuteur, "cell 2 1"); + JLabel lblNewLabel_2 = new JLabel("metaSujet"); lblNewLabel_2.setFont(new Font("Tahoma", Font.PLAIN, 12)); contentPane.add(lblNewLabel_2, "cell 0 2,alignx left,aligny center"); @@ -118,6 +142,10 @@ public class proprieteFichierAnalyse extends JFrame { textFieldMetaSujet.setText(commandes.sujet.getAttributs().get("metaSujet")); } + btnAideMetaSujet = new JButton(""); + btnAideMetaSujet.setIcon(new ImageIcon(proprieteFichierAnalyse.class.getResource("/resources/whatmini.png"))); + contentPane.add(btnAideMetaSujet, "cell 2 2"); + JLabel lblNewLabel_3 = new JLabel("

Propriété personnalisé obligatoire dans les
fichiers des étudiants.

" ); lblNewLabel_3.setFont(new Font("Tahoma", Font.PLAIN, 12)); contentPane.add(lblNewLabel_3, "cell 0 3,alignx left,aligny center"); @@ -130,6 +158,10 @@ public class proprieteFichierAnalyse extends JFrame { comboBoxPresenceMetaSujet.setSelectedItem(commandes.sujet.getAttributs().get("presenceMetaSujet").toLowerCase()); } + btnAidePresenceMetaSujet = new JButton(""); + btnAidePresenceMetaSujet.setIcon(new ImageIcon(proprieteFichierAnalyse.class.getResource("/resources/whatmini.png"))); + contentPane.add(btnAidePresenceMetaSujet, "cell 2 3"); + JLabel lblNewLabel_4 = new JLabel("Barème alphabétique ABCDE"); lblNewLabel_4.setFont(new Font("Tahoma", Font.PLAIN, 12)); contentPane.add(lblNewLabel_4, "cell 0 4,alignx left"); @@ -141,6 +173,10 @@ public class proprieteFichierAnalyse extends JFrame { if(commandes.sujet.getAttributs().get("baremeABC")!=null){ comboBoxBaremeABC.setSelectedItem(commandes.sujet.getAttributs().get("baremeABC").toLowerCase()); } + + btnAideBaremeABC = new JButton(""); + btnAideBaremeABC.setIcon(new ImageIcon(proprieteFichierAnalyse.class.getResource("/resources/whatmini.png"))); + contentPane.add(btnAideBaremeABC, "flowx,cell 2 4"); @@ -156,6 +192,10 @@ public class proprieteFichierAnalyse extends JFrame { textFieldNoteFrom.setText(commandes.sujet.getAttributs().get("noteFrom")); } + btnAideNoteFrom = new JButton(""); + btnAideNoteFrom.setIcon(new ImageIcon(proprieteFichierAnalyse.class.getResource("/resources/whatmini.png"))); + contentPane.add(btnAideNoteFrom, "flowx,cell 2 5"); + JLabel lblNewLabel_5 = new JLabel("Coef. de progression"); lblNewLabel_5.setFont(new Font("Tahoma", Font.PLAIN, 12)); contentPane.add(lblNewLabel_5, "cell 0 6,alignx left"); @@ -167,6 +207,10 @@ public class proprieteFichierAnalyse extends JFrame { textFieldProgression.setText(commandes.sujet.getAttributs().get("progression")); } + btnAideProgression = new JButton(""); + btnAideProgression.setIcon(new ImageIcon(proprieteFichierAnalyse.class.getResource("/resources/whatmini.png"))); + contentPane.add(btnAideProgression, "cell 2 6"); + JLabel lblNewLabel_6 = new JLabel("Le suivi des modifications activé dans les
fichiers des étudiants."); lblNewLabel_6.setFont(new Font("Tahoma", Font.PLAIN, 12)); contentPane.add(lblNewLabel_6, "cell 0 7,alignx left"); @@ -179,6 +223,10 @@ public class proprieteFichierAnalyse extends JFrame { comboBoxhistoriquePresent.setSelectedItem(commandes.sujet.getAttributs().get("historiquePresent").toLowerCase()); } + btnAideHistoriquePresent = new JButton(""); + btnAideHistoriquePresent.setIcon(new ImageIcon(proprieteFichierAnalyse.class.getResource("/resources/whatmini.png"))); + contentPane.add(btnAideHistoriquePresent, "cell 2 7"); + JLabel lblNewLabel_7 = new JLabel("Date de création du fichier transmis
aux étudiants."); lblNewLabel_7.setFont(new Font("Tahoma", Font.PLAIN, 12)); @@ -192,6 +240,10 @@ public class proprieteFichierAnalyse extends JFrame { textFieldDateCreation.setText(commandes.sujet.getAttributs().get("creationDate")); } + btnAideDateCreation = new JButton(""); + btnAideDateCreation.setIcon(new ImageIcon(proprieteFichierAnalyse.class.getResource("/resources/whatmini.png"))); + contentPane.add(btnAideDateCreation, "cell 2 8"); + lblNewLabel_8 = new JLabel("La date de création dans les fichers des étudiants doit être le même que celui du fichier fourni."); lblNewLabel_8.setFont(new Font("Tahoma", Font.PLAIN, 12)); contentPane.add(lblNewLabel_8, "cell 0 9,alignx trailing"); @@ -204,6 +256,10 @@ public class proprieteFichierAnalyse extends JFrame { comboBoxcontroleDateCreation.setSelectedItem(commandes.sujet.getAttributs().get("controleDateCreation").toLowerCase()); } + btnAideControleDateCreation = new JButton(""); + btnAideControleDateCreation.setIcon(new ImageIcon(proprieteFichierAnalyse.class.getResource("/resources/whatmini.png"))); + contentPane.add(btnAideControleDateCreation, "cell 2 9,aligny top"); + lblNewLabel_9 = new JLabel("Auteur du fichier fourni aux étudiants."); lblNewLabel_9.setFont(new Font("Tahoma", Font.PLAIN, 12)); contentPane.add(lblNewLabel_9, "cell 0 10,alignx left"); @@ -216,6 +272,10 @@ public class proprieteFichierAnalyse extends JFrame { textFieldInitial_Creator.setText(commandes.sujet.getAttributs().get("Initial_Creator")); } + btnAideInitial_Creator = new JButton(""); + btnAideInitial_Creator.setIcon(new ImageIcon(proprieteFichierAnalyse.class.getResource("/resources/whatmini.png"))); + contentPane.add(btnAideInitial_Creator, "cell 2 10"); + lblNewLabel_10 = new JLabel("L'auteur des fichiers des étudiants doit être celui du fichier fourni."); lblNewLabel_10.setFont(new Font("Tahoma", Font.PLAIN, 12)); contentPane.add(lblNewLabel_10, "cell 0 11,alignx trailing"); @@ -228,6 +288,10 @@ public class proprieteFichierAnalyse extends JFrame { comboBoxcontrole_Initial_Creator.setSelectedItem(commandes.sujet.getAttributs().get("controle_Initial_Creator").toLowerCase()); } + btnAidecontrole_Initial_Creator = new JButton(""); + btnAidecontrole_Initial_Creator.setIcon(new ImageIcon(proprieteFichierAnalyse.class.getResource("/resources/whatmini.png"))); + contentPane.add(btnAidecontrole_Initial_Creator, "cell 2 11"); + lblNewLabel_11 = new JLabel("Lien URL de l'aide"); lblNewLabel_11.setFont(new Font("Tahoma", Font.PLAIN, 12)); contentPane.add(lblNewLabel_11, "cell 0 12,alignx left"); @@ -253,7 +317,23 @@ public class proprieteFichierAnalyse extends JFrame { JButton btnNewButton = new JButton("Valide"); btnNewButton.setFont(new Font("Tahoma", Font.PLAIN, 12)); - contentPane.add(btnNewButton, "cell 1 16,growx,aligny top"); + contentPane.add(btnNewButton, "cell 1 15,grow"); + + btnVoirBaremeABC = new JButton(""); + btnVoirBaremeABC.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + double progression = Double.valueOf(textFieldProgression.getText()); + double intervalle1 = Math.pow(0.2, 1/progression) ; + double intervalle2 = Math.pow(0.4, 1/progression) ; + double intervalle3 = Math.pow(0.6, 1/progression) ; + double intervalle4 = Math.pow(0.8, 1/progression) ; + String message = "0% → E → " + Math.round(intervalle1*100) + "% → D → " + Math.round(intervalle2*100) + "% → C → " + + Math.round(intervalle3*100) + "% → B → " + Math.round(intervalle4*100) + "% → A → 100%"; + JOptionPane.showMessageDialog(null, message); + } + }); + btnVoirBaremeABC.setIcon(new ImageIcon(proprieteFichierAnalyse.class.getResource("/resources/voirmini.png"))); + contentPane.add(btnVoirBaremeABC, "cell 2 4"); btnNewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { commandes.sujet.getAttributs().put("titre", textFieldTitre.getText() ); diff --git a/src/resources/attributmini.png b/src/resources/attributmini.png new file mode 100644 index 0000000..c23113b Binary files /dev/null and b/src/resources/attributmini.png differ diff --git a/src/resources/sautmini.png b/src/resources/sautmini.png new file mode 100644 index 0000000..b631cfd Binary files /dev/null and b/src/resources/sautmini.png differ diff --git a/src/resources/titremini.png b/src/resources/titremini.png new file mode 100644 index 0000000..11b39a5 Binary files /dev/null and b/src/resources/titremini.png differ diff --git a/src/resources/voirmini.png b/src/resources/voirmini.png new file mode 100644 index 0000000..96d82bb Binary files /dev/null and b/src/resources/voirmini.png differ diff --git a/src/resources/whatmini.png b/src/resources/whatmini.png new file mode 100644 index 0000000..b123504 Binary files /dev/null and b/src/resources/whatmini.png differ