This commit is contained in:
pablo rodriguez 2024-12-10 15:06:27 +01:00
parent c7e1531abb
commit c3cd9e86c1
64 changed files with 1940 additions and 191 deletions

4
bin/.gitignore vendored
View File

@ -1,3 +1,7 @@
/fenetres/
/xml/
/AnalyseCalc/
/menu/
/actions/
/list/
/resources/

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -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());
}
}
}

49
src/actions/actCopy.java Normal file
View File

@ -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()+"<hr><h2>Le node est copié dans le presse papier.</h2><hr>");
}
}

View File

@ -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 = "<p><span style=\"color: red;\">Ce paragraphe ne possède pas de formatage direct.</span></p><br>";
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 = "<p><span style=\"color: red;\">Ce paragraphe possède un formatage direct ayant le style <u>"+namestyle+"</u>.</span></p><br>";
}else {
texteInsert = "<p><span style=\"color: red;\">Ce paragraphe ne possède pas un formatage direct.<br>"
+ "Son style est <u>"+ namestyle +"</u>.</span></p><br>";
}
};
CustomInputDialogSimplePointCaseCoche.showCustominputDialog(nod,"evalFormatageDirect",
"<html><p>Si le node dans le fichier de l'étudiant par comparaison avec ce node,<br>"
+ "contient une surcharge des formats de paragraphe et/ou de<br>"
+ "caractères, <i>(style:name=Px)</i>, ou ne contient pas de surcharge au<br>"
+ "style du paragraphe, alors l'étudiant aura les points ci-dessous.</p><br>"
+ texteInsert
+ "<p>Cochez la case pour placer ou supprimer la méthode sur tous les"
+ "<br>nodes frères.</p><br>"
+ "<p>Cliquez sur le bouton supprimer pour retirer la méthode<br>"
+ "d'évaluation evalFormatageDirect.</p></html>",
new ImageIcon(create.class.getResource("/resources/evalformatagedirect.png")));
create.getTextNodeSelect().refreshAffichage(nod);
}
}

View File

@ -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);
}
}

View File

@ -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",
"<html><p>Si ce node contient le texte de la propriété définie par l'utilisateur, <br>"
+ "alors l'étudiant obtiendra les points ci-dessous.</p><br>"
+ "<p>Cliquez sur le bouton supprimer pour retirer la méthode<br>"
+ "d'évaluation evalTextUserDefined</p></html>",
new ImageIcon(create.class.getResource("/resources/evaltextuserdefined.png")));
create.getTextNodeSelect().refreshAffichage(nod);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}
}

View File

@ -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;
@ -134,4 +139,54 @@ public class actNewFichierAnalyse extends AbstractAction{
}
public static void placeIsDoublonInStructure(node nod) {
Enumeration<node> 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<String> listTextesInPage = new ArrayList<String>();
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<String> listTextesInPage = new ArrayList<String>();
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));
}
}
}
}
}

139
src/actions/actPaste.java Normal file
View File

@ -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;i<nodePaste.getEnfants().size();i++) {
if(nodePaste.getEnfants().get(i)!=null) {
MiseInformationDansLeNodeCopierColler(nodePaste.getEnfants().get(i), nodePaste);
}
}
}
}
/**
*
* @param nod
* @param parent
* @return
*/
private static DefaultMutableTreeNode addNodeMutable(node nod, DefaultMutableTreeNode parent) {
if(nod!=null) {
DefaultMutableTreeNode node1 = null;
for(int i = 0 ; i < nod.getEnfants().size(); i++) {
// Le node setting ne doit pas s'afficher dans le JTree
if(!nod.getEnfants().get(i).getNameNode().equals("setting")) {
node1 = new DefaultMutableTreeNode(nod.getEnfants().get(i));
addNodeMutable(nod.getEnfants().get(i), node1);
parent.add(node1);
}
}
}
return parent;
}
}

View File

@ -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 actRechercheContenuPlusProcheVoisinfalse extends AbstractAction{
/**
*
*/
private static final long serialVersionUID = 1L;
{
putValue( Action.NAME, "Plus proche voisin : false" );
putValue( Action.SHORT_DESCRIPTION, "Ne recherche pas par le contenu du plus proche voisin." );
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.getAttributs().put("recherche_contenu_plus_proche_voisin", "false");
create.getTextNodeSelect().refreshAffichage(nod);
}
}

View File

@ -0,0 +1,32 @@
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 actRechercheContenuPlusProcheVoisintrue extends AbstractAction{
/**
*
*/
private static final long serialVersionUID = 1L;
{
putValue( Action.NAME, "true" );
putValue( Action.SHORT_DESCRIPTION, "Recherche par le contenu du plus proche voisin.");
putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/truemini.png")));
}
@Override
public void actionPerformed(ActionEvent e) {
node nod = (node) create.getSelectNode().getUserObject();
nod.getAttributs().put("recherche_contenu_plus_proche_voisin", "true");
create.getTextNodeSelect().refreshAffichage(nod);
}
}

View File

@ -0,0 +1,32 @@
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 actRechercheContenufalse extends AbstractAction{
/**
*
*/
private static final long serialVersionUID = 1L;
{
putValue( Action.NAME, "false" );
putValue( Action.SHORT_DESCRIPTION, "Ne recherche pas par le contenu exact le node dans le fichier de l'étudiant." );
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.getAttributs().put("recherche_contenu_exact", "false");
create.getTextNodeSelect().refreshAffichage(nod);
}
}

View File

@ -0,0 +1,32 @@
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 actRechercheContenutrue extends AbstractAction{
/**
*
*/
private static final long serialVersionUID = 1L;
{
putValue( Action.NAME, "Recherche par le contenu du node : true" );
putValue( Action.SHORT_DESCRIPTION, "Recherche par le contenu le node dans le fichier de l'étudiant." );
putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/truemini.png")));
}
@Override
public void actionPerformed(ActionEvent e) {
node nod = (node) create.getSelectNode().getUserObject();
nod.getAttributs().put("recherche_contenu_exact", "true");
create.getTextNodeSelect().refreshAffichage(nod);
}
}

View File

@ -0,0 +1,33 @@
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 actmarquenodefalse 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("marquenode");
}
create.getTextNodeSelect().refreshAffichage(nod);
}
}

View File

@ -0,0 +1,35 @@
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 actmarquenodetrue 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++) {
nod.getEnfants().get(i).getAttributs().put("saut", "true");
nod.getEnfants().get(i).getAttributs().put("marquenode", "** node ** " + nod.getEnfants().get(i).getNameNode() );
}
create.getTextNodeSelect().refreshAffichage(nod);
}
}

View File

@ -0,0 +1,40 @@
package actions;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import fenetres.create;
import xml.node;
public class actsautmultiplefalse 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();
boolean informations = false;
if(JOptionPane.showConfirmDialog(null,"Voulez-vous retirer les informations sur le node (contenu du node)?", "Information", JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE)==JOptionPane.YES_OPTION) {
informations=true;
}
for(int i = 0 ; i < nod.getEnfants().size();i++) {
nod.getEnfants().get(i).getAttributs().put("saut", "false");
if(informations)nod.getEnfants().get(i).getAttributs().remove("information");
}
create.getTextNodeSelect().refreshAffichage(nod);
}
}

View File

@ -0,0 +1,58 @@
package actions;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import fenetres.create;
import xml.node;
public class actsautmultipletrue 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();
boolean informations = false;
if(JOptionPane.showConfirmDialog(null,"Voulez-vous placer l'information du node juste après le saut?", "Information", JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE)==JOptionPane.YES_OPTION) {
informations=true;
}
for(int i = 0 ; i < nod.getEnfants().size();i++) {
nod.getEnfants().get(i).getAttributs().put("saut", "true");
if(informations) {
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);
}
}
//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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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("<html><h2>"+nameMethod+"<h2></html>");
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
}
}
}

View File

@ -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("<html><h2>"+nameMethod+"<h2></html>");
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<node> 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);
}
}
}
}

View File

@ -9,23 +9,27 @@ public class baliseStyle {
public static String balise() {
return "<style type=\"text/css\">"
+ "h1 {margin-bottom: 0.25cm;font-size: 20pt;font-family:\"Arial\";text-align:center;font-weight: bold;}"
+ "h2 {margin-bottom: 0.25cm;font-size: 16pt;font-family:\"Arial\";text-align:center;font-weight: bold;}"
+ "h3 {margin-bottom: 0.25cm;font-size: 16pt;font-family:\"Arial\";text-align:left;font-weight: bold;}"
+ "h4 {text-align:left;font-family: \"Arial\"; font-size: 16pt; font-weight: bold; line-height: 110%;}"
+ "p {font-family:\"Arial\";font-size: 14pt;margin-bottom: 0cm; margin-top: 0cm; line-height: 0%; background: transparent; margin-left: 0cm; white-space: pre;}"
+ "h1 {color:#010100;margin-bottom: 0.25cm;font-size: 24pt;font-family:\"Arial\";text-align:center;font-weight: bold;}"
+ "h2 {color:#010100;margin-bottom: 0.25cm;font-size: 18pt;font-family:\"Arial\";text-align:center;font-weight: bold;}"
+ "h3 {color:#010100;margin-bottom: 0.25cm;font-size: 18pt;font-family:\"Arial\";text-align:left;font-weight: bold;}"
+ "h4 {color:#010100;text-align:left;font-family: \"Arial\"; font-size: 18pt; font-weight: bold; line-height: 110%;}"
+ "p {color:#010100;font-family:\"Arial\";font-size: 18pt;margin-bottom: 0cm; margin-top: 0cm; line-height: 0%; background: transparent; margin-left: 0cm; white-space: pre;}"
+ "hr { display: block; margin-top: 0.5em; margin-bottom: 8em; margin-left: 2em; margin-right: 2em; border-style: inset; border-width: 4px;}"
+ "spanpablo { float: right; width: 8em; font-size: 250%; font-family: algerian, courier; line-height: 80%; margin-right: 1%; color: red; text-align: center}"
+ ".p1{color:blue;font-family:\"Arial\";font-size: 14pt;margin-bottom: 0cm; margin-top: 0cm; line-height: 0%; background: transparent; margin-left: 0cm; white-space: pre;}"
+ "bleu{color:blue;font-family:\"Arial\";font-size: 14pt;margin-bottom: 0cm; margin-top: 0cm; line-height: 0%; background: #AAAAAA; margin-left: 0cm; white-space: pre;}"
+ ".city { background-color: transparent;color: #008B8B;padding: 10px;}"
+ ".rouge { background-color: #8B0000;color: white;padding: 10px;}"
+ "li.p2{color:green;font-family:\"Arial\";font-size: 14pt;margin-bottom: 0cm; margin-top: 0cm; line-height: 0%; background: transparent; margin-left: 0cm; white-space: pre;}"
+ "li.p4{color:#FF8C00;font-family:\"Arial\";font-size: 14pt;margin-bottom: 0cm; margin-top: 0cm; line-height: 0%; background: transparent; margin-left: 0cm; white-space: pre;}"
+ "li.p2{color:green;font-family:\"Arial\";font-size: 15pt;margin-bottom: 0cm; margin-top: 0cm; line-height: 0%; background: transparent; margin-left: 0cm; white-space: pre;}"
+ ".red {color:#FF0505}"
+ "li.p4{color:#1122EE;font-family:\"Arial\";font-size: 15pt;margin-bottom: 0cm; margin-top: 0cm; line-height: 0%; background: transparent; margin-left: 0cm; white-space: pre;}"
+ "li.p3{color:red;font-family:\"Arial\";font-size: 14pt;margin-bottom: 0cm; margin-top: 0cm; line-height: 0%; background: transparent; margin-left: 0cm; white-space: pre;}"
+ "li.p5{color:#55BB11;font-family:\"Arial\";font-size: 16pt;margin-bottom: 0cm; margin-top: 0cm; line-height: 0%; background: transparent; margin-left: 0cm; white-space: pre;}"
+ "p.p4{margin-left: 0px; margin-bottom: 0cm; margin-top: 4px; line-height: 115%}"
+ "p.p5 {color: navy;text-indent: 30px;}"
+ ".center { display: block;margin-left: auto;margin-right: auto;width: 50%}"
+ ".tabulation { display: inline-block; margin-left: 40px;}"
+ "table, th, td { border:1px solid black;}"
+ "</style>";
}

View File

@ -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());
@ -203,63 +204,59 @@ public final class create extends JFrame {
JScrollPane rightScrollPane = new JScrollPane();
textNodeSelect.setBackground(Color.LIGHT_GRAY);
textNodeSelect.setFont(new Font("Monospaced", Font.PLAIN, 15));
textNodeSelect.setBackground(Color.LIGHT_GRAY);
textNodeSelect.setFont(new Font("Monospaced", Font.PLAIN, 15));
ScrollPaneTableBouton = new JScrollPane( );
panelDroiteBoutons.setBackground(Color.LIGHT_GRAY);
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]"));
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);
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 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);
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));
leftScrollPane.setViewportView(tree);
tree.setFont(new Font("Tahoma", Font.PLAIN, 16));
getContentPane().add(splitPane1, BorderLayout.CENTER);
getContentPane().add(splitPane1, BorderLayout.CENTER);
if(commandes.fichierAnalyseValide) {
tree.setVisible(true);
constructionTree();
}else {
tree.setVisible(false);
}
if(commandes.fichierAnalyseValide) {
tree.setVisible(true);
constructionTree();
}else {
tree.setVisible(false);
}
this.setExtendedState(MAXIMIZED_BOTH);
rightScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
this.setExtendedState(MAXIMIZED_BOTH);
rightScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
positionScrollDebut();
ListenerAction();
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 {
}
}
}

View File

@ -0,0 +1,56 @@
package list;
import xml.node;
public class listeDesNodesAllContent {
/**
* Retourne TRUE si on peut évaluer le contenu du node.</br>
* @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;
}
}
}

View File

@ -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;
}
}
}

View File

@ -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;
}
}
}

View File

@ -0,0 +1,16 @@
package list;
import xml.node;
public class listeDesNodesPourEvaluerPage {
/**
* Retourne TRUE si c'est une page.</br>
* @param nod
* @return
*/
public static Boolean isPage(node nod) {
if(nod.getNameNode().equals("page")) return true;
return false;
}
}

View File

@ -0,0 +1,32 @@
package list;
import xml.node;
public class listeDesNodesRechercheByContenu {
/**
* Retourne TRUE si on peut utiliser la recherche par contenu textuel.</br>
* La rechercher par contenu se réalise par les méthodes suivantes:</br>
* 1-Recherche par le contenu exact (ignore la case, et les espace au début et fin).</br>
* 2-Recherche par le contenu du plus proche voisin.</br>
* 3-Recherche par l'index;</br>
* @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;
}
}

View File

@ -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;
}

View File

@ -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.</br>
* @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);
}
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

26
src/menu/mnArbre.java Normal file
View File

@ -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;
}
}

View File

@ -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;
}
}

20
src/menu/mnEvaluer.java Normal file
View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

21
src/menu/mnSaut.java Normal file
View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

26
src/menu/mnTitre.java Normal file
View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

BIN
src/resources/copy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
src/resources/evaluer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 931 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 B

BIN
src/resources/paste.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -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.</br>
* @return
*/
public ArrayList<node> retourneAllBroters(){
return this.parent.getEnfants();
}
public node retournePreviousBrother() {
if(this.parent!=null) {
int indexOfThis = this.parent.enfants.indexOf(this);