2022-06-19 21:01:30 +02:00
|
|
|
package fenetres.create_act;
|
|
|
|
|
|
|
|
import java.awt.event.ActionEvent;
|
|
|
|
import java.awt.event.InputEvent;
|
|
|
|
import java.awt.event.KeyEvent;
|
|
|
|
|
|
|
|
import javax.swing.AbstractAction;
|
|
|
|
import javax.swing.Action;
|
|
|
|
import javax.swing.ImageIcon;
|
|
|
|
import javax.swing.KeyStroke;
|
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 cXML.node;
|
|
|
|
import fenetres.create;
|
|
|
|
|
|
|
|
public class actEvalueTrue extends AbstractAction{
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
{
|
|
|
|
putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.ALT_DOWN_MASK));
|
|
|
|
putValue( Action.NAME, "Evaluer true" );
|
|
|
|
putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/evaluertruemini.png")) );
|
|
|
|
putValue( Action.SHORT_DESCRIPTION, "Evaluer ce node par l'application" );
|
|
|
|
}
|
|
|
|
@Override
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
node nod = (node) fenetres.create.getSelectNode().getUserObject();
|
|
|
|
nod.evaluerTrue();
|
|
|
|
if(nod.getLevel()==1) {
|
|
|
|
nod.addMenu(true);
|
|
|
|
}
|
2022-11-30 18:34:33 +01:00
|
|
|
|
|
|
|
TreePath path = fenetres.create.getTree().getSelectionPath();
|
|
|
|
|
|
|
|
// fenetres.create.getTextNodeSelect().refreshAffichage(nod);
|
|
|
|
// fenetres.create.getTree().repaint();
|
|
|
|
|
|
|
|
|
|
|
|
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-12-02 10:26:56 +01:00
|
|
|
|
|
|
|
fenetres.create.getTextNodeSelect().refreshAffichage(nod);
|
2022-11-30 18:34:33 +01:00
|
|
|
|
2022-06-19 21:01:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|