2023-02-05 17:46:02 +01:00
|
|
|
package action;
|
2022-06-19 21:01:30 +02:00
|
|
|
|
|
|
|
import java.awt.event.ActionEvent;
|
|
|
|
|
|
|
|
import javax.swing.AbstractAction;
|
|
|
|
import javax.swing.Action;
|
2022-12-12 11:49:47 +01:00
|
|
|
import javax.swing.ImageIcon;
|
2022-11-30 18:34:33 +01:00
|
|
|
import javax.swing.tree.DefaultMutableTreeNode;
|
|
|
|
import javax.swing.tree.DefaultTreeModel;
|
|
|
|
import javax.swing.tree.TreePath;
|
2022-06-19 21:01:30 +02:00
|
|
|
|
|
|
|
import MEPTL.commandes;
|
|
|
|
import cXML.node;
|
2022-12-12 11:49:47 +01:00
|
|
|
import fenetres.create;
|
2022-06-19 21:01:30 +02:00
|
|
|
|
|
|
|
public class actEvaluerStyleTrue extends AbstractAction{
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
{
|
|
|
|
putValue( Action.NAME, "Evaluer le style." );
|
2022-12-12 11:49:47 +01:00
|
|
|
putValue( Action.SHORT_DESCRIPTION, "Evaluer le style:name de ce node dans le fichier de l'étudiant");
|
2024-04-07 09:17:57 +02:00
|
|
|
putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/evaluerstyletruemini.png")));
|
2022-06-19 21:01:30 +02:00
|
|
|
}
|
|
|
|
@Override
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
node nod = (node) fenetres.create.getSelectNode().getUserObject();
|
|
|
|
nod.getAttributs().put("analyseStyle", "true");
|
|
|
|
|
|
|
|
//***************************************************************************************************************
|
|
|
|
//** Place l'attribut EvaluerATraversAnalyseStyle=true au style qui doit être évaluer à travers d'analyseStyle **
|
|
|
|
//** S'il y a des attributs évaluer avec ‽ alors change par ‼ **
|
|
|
|
//***************************************************************************************************************
|
2023-01-01 12:43:53 +01:00
|
|
|
String nameStyle = nod.getAttributs().get("text:style-name");
|
|
|
|
|
|
|
|
node nodStyle = commandes.sujet.retourneFirstNodeByNameAndAttributValueExactStrict("style:style", "style:name", nameStyle);
|
|
|
|
|
|
|
|
|
2022-06-19 21:01:30 +02:00
|
|
|
if(nodStyle!=null) {
|
|
|
|
nodStyle.getAttributs().put("EvaluerATraversAnalyseStyle", "true");
|
2022-12-20 20:57:12 +01:00
|
|
|
nodStyle.evaluerTrue();
|
2022-06-19 21:01:30 +02:00
|
|
|
nodStyle.changeLesCodesEvaluateursVersCodeATraversAnalyseStyle();
|
|
|
|
}
|
|
|
|
|
2022-11-30 18:34:33 +01:00
|
|
|
TreePath path = fenetres.create.getTree().getSelectionPath();
|
|
|
|
|
|
|
|
DefaultTreeModel model = (DefaultTreeModel) fenetres.create.getTree().getModel();
|
|
|
|
DefaultMutableTreeNode root = (DefaultMutableTreeNode) model.getRoot();
|
|
|
|
model.reload(root);
|
|
|
|
|
|
|
|
fenetres.create.getTree().setSelectionPath(path);
|
|
|
|
fenetres.create.getTree().expandPath(path);
|
|
|
|
|
|
|
|
|
2022-06-19 21:01:30 +02:00
|
|
|
fenetres.create.getTextNodeSelect().refreshAffichage(nod);
|
|
|
|
}
|
2023-02-05 16:09:48 +01:00
|
|
|
|
2022-06-19 21:01:30 +02:00
|
|
|
}
|