Packagenet.systemeD.halcyon.connection
Classpublic class UndoableAction
SubclassesCompositeUndoableAction, UndoableEntityAction

UndoableAction is the base class from which other actions types inherit. An undoable action is an object that can be added to a list of actions, for example the MainUndoStack or any other list of actions.

See also

CompositeUndoableAction
UndoableEntityAction


Public Methods
 MethodDefined by
  
doAction():uint
The doAction function is called when it is time to execute this action or combination of actions.
UndoableAction
  
mergePrevious(previous:UndoableAction):Boolean
Can this action be merged with the previous action? This is sometimes wanted, such as when moving nodes around.
UndoableAction
  
undoAction():uint
The undoAction function is called in order to undo this action or combination of actions.
UndoableAction
Public Constants
 ConstantDefined by
  FAIL : uint = 0
[static] Something went wrong while attempting the action
UndoableAction
  NO_CHANGE : uint = 2
[static] No entity was altered by this action
UndoableAction
  SUCCESS : uint = 1
[static] The action worked, and entities were changed
UndoableAction
Method detail
doAction()method
public function doAction():uint

The doAction function is called when it is time to execute this action or combination of actions. It is usually triggered by either MainUndoStack.addAction or by MainUndoStack.redo. This should be overridden.

Returns
uint — whether the action succeed, failed or nothing happened
mergePrevious()method 
public function mergePrevious(previous:UndoableAction):Boolean

Can this action be merged with the previous action? This is sometimes wanted, such as when moving nodes around. This is overridden when needed.

Parameters
previous:UndoableAction

Returns
Boolean

See also

undoAction()method 
public function undoAction():uint

The undoAction function is called in order to undo this action or combination of actions. It is usually triggered by MainUndoStack.undo. This should be overridden.

Returns
uint — whether undoing the action succeed, failed or nothing happened
Constant detail
FAILconstant
public static const FAIL:uint = 0

Something went wrong while attempting the action

NO_CHANGEconstant 
public static const NO_CHANGE:uint = 2

No entity was altered by this action

SUCCESSconstant 
public static const SUCCESS:uint = 1

The action worked, and entities were changed