use of dfEditor.command.UndoableCommand in project darkFunction-Editor by darkFunction.
the class RemoveDirCommand method undo.
public void undo() {
while (commandStack.size() > 0) {
UndoableCommand command = commandStack.pop();
command.undo();
}
}
use of dfEditor.command.UndoableCommand in project darkFunction-Editor by darkFunction.
the class RemoveDirCommand method execute.
public boolean execute() {
if (!node.isLeaf())
remove(node);
//aNode);
UndoableCommand command = new RemoveNodeCommand(tree, node);
commandStack.push(command);
command.execute();
return true;
}
use of dfEditor.command.UndoableCommand in project darkFunction-Editor by darkFunction.
the class RemoveDirCommand method remove.
private void remove(CustomNode aNode) {
while (aNode.getChildCount() > 0) {
CustomNode childNode = (CustomNode) aNode.getLastChild();
UndoableCommand command;
if (childNode.isLeaf()) {
command = new RemoveGraphicCommand(tree, panel, childNode);
} else {
remove(childNode);
command = new RemoveNodeCommand(tree, childNode);
}
commandStack.push(command);
command.execute();
}
}
Aggregations