42 lines
1.4 KiB
Java
42 lines
1.4 KiB
Java
package fenetres.create_act;
|
|
|
|
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 nodeAC.nodeAC;
|
|
|
|
public class actDownNode extends AbstractAction{
|
|
|
|
/**
|
|
*
|
|
*/
|
|
private static final long serialVersionUID = 1L;
|
|
{
|
|
putValue( Action.NAME, "Descendre le nodeAC" );
|
|
putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/downnodemini.png")) );
|
|
putValue( Action.SHORT_DESCRIPTION, "Descendre le nodeAC" );
|
|
}
|
|
@Override
|
|
public void actionPerformed(ActionEvent e) {
|
|
if(fenetres.create.getTree().getSelectionPath()!=null) {
|
|
int a = JOptionPane.showConfirmDialog(null,"Voulez-vous descendre le nodeAC " + fenetres.create.getSelectNode().toString() + "?", "Sélectionner un choix", JOptionPane.YES_NO_OPTION);
|
|
|
|
if(a == JOptionPane.YES_NO_OPTION) {
|
|
nodeAC nod = (nodeAC) fenetres.create.getSelectNode().getUserObject();
|
|
if(!nod.chemin().contains("setting")) {
|
|
nod.getParent().downNodeEnfant(nod);
|
|
fenetres.create.constructionTree();
|
|
}else {
|
|
JOptionPane.showMessageDialog(null,"Vous ne devez pas déplacer ce nodeAC !", "Oh non!!!", JOptionPane.INFORMATION_MESSAGE);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|