Package | org.robotlegs.utilities.undoablecommand |
Class | public class CommandHistory |
Inheritance | CommandHistory ![]() |
Property | Defined By | ||
---|---|---|---|
canStepBackward : Boolean [read-only]
True if there's a command to undo. | CommandHistory | ||
canStepForward : Boolean [read-only]
True if there's a command to redo. | CommandHistory | ||
currentCommand : IUndoableCommand [read-only]
Gets the command at the top of the history stack. | CommandHistory | ||
currentPosition : uint
Pointer to the current command in the history stack. | CommandHistory | ||
eventDispatcher : IEventDispatcher
Supplied event bus to fire events upon. | CommandHistory | ||
numberOfHistoryItems : uint [read-only]
Total number of items in history, irrespective of their undone/redone state. | CommandHistory |
Method | Defined By | ||
---|---|---|---|
CommandHistory | |||
fastForward(numTimes:uint = 0):uint
Redo all or some number of commands. | CommandHistory | ||
push(command:IUndoableCommand):uint
Push a new command into the current position on the history stack and execute it. | CommandHistory | ||
rewind(numTimes:uint = 0):uint
Undo all or some number of commands. | CommandHistory | ||
stepBackward():uint
Undo the previous command on the history stack and set the currentCommand to the previous command. | CommandHistory | ||
stepForward():uint
Redo/execute the next command on the history stack. | CommandHistory |
canStepBackward | property |
canStepBackward:Boolean
[read-only] True if there's a command to undo.
public function get canStepBackward():Boolean
canStepForward | property |
canStepForward:Boolean
[read-only] True if there's a command to redo.
public function get canStepForward():Boolean
currentCommand | property |
currentCommand:IUndoableCommand
[read-only] Gets the command at the top of the history stack. This command will have already been executed.
public function get currentCommand():IUndoableCommand
See also
currentPosition | property |
public var currentPosition:uint
Pointer to the current command in the history stack. First command starts at index 1. If this is 0, we are pointing to no command (null) at the start of the stack
eventDispatcher | property |
public var eventDispatcher:IEventDispatcher
Supplied event bus to fire events upon.
numberOfHistoryItems | property |
numberOfHistoryItems:uint
[read-only] Total number of items in history, irrespective of their undone/redone state.
public function get numberOfHistoryItems():uint
CommandHistory | () | Constructor |
public function CommandHistory()
fastForward | () | method |
public function fastForward(numTimes:uint = 0):uint
Redo all or some number of commands.
Parameters
numTimes:uint (default = 0 ) — number of positions to move forward.
The default, 0, fast forwards to the last item in the history (most recent).
|
uint — position in history stack after the fastForward operation completes
|
push | () | method |
public function push(command:IUndoableCommand):uint
Push a new command into the current position on the history stack and execute it. If there are commands further forward in the history stack, those commands are removed and this command becomes the new top of the command stack.
Parameters
command:IUndoableCommand |
uint — position in history stack after this operation
|
rewind | () | method |
public function rewind(numTimes:uint = 0):uint
Undo all or some number of commands.
Parameters
numTimes:uint (default = 0 ) — number of positions to move backward. The default, 0, rewinds to the start of the history (undoes all commands)
|
uint — position in history stack after the rewind operation completes
|
stepBackward | () | method |
public function stepBackward():uint
Undo the previous command on the history stack and set the currentCommand to the previous command.
Returnsuint — position in history stack after this operation
|
stepForward | () | method |
public function stepForward():uint
Redo/execute the next command on the history stack.
Returnsuint — position in history stack after this operation
|