Search in sources :

Example 1 with UndoableCommand

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();
    }
}
Also used : UndoableCommand(dfEditor.command.UndoableCommand)

Example 2 with UndoableCommand

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;
}
Also used : UndoableCommand(dfEditor.command.UndoableCommand)

Example 3 with UndoableCommand

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();
    }
}
Also used : UndoableCommand(dfEditor.command.UndoableCommand) CustomNode(dfEditor.CustomNode)

Aggregations

UndoableCommand (dfEditor.command.UndoableCommand)3 CustomNode (dfEditor.CustomNode)1