Packagenet.systemeD.halcyon.connection
Classpublic class CompositeUndoableAction
InheritanceCompositeUndoableAction Inheritance UndoableAction
SubclassesBeginWayAction, CreatePOIAction, JoinNodeAction, MergeNodesAction, MergeWaysAction, MoveWayAction, ReplaceNodeAction, SplitWayAction, UnjoinNodeAction

A CompositeUndoableAction is an UndoableAction that is made up of multiple individual actions. You want to use one where you have multiple entities being altered in a given situation that you want to treat as one overall action (e.g. they are all done together, and should be undone in one go too). A CompositeUndoableAction will store the stack of individual actions, and when doAction is called will go through each one of them and call doAction on the individual action. Sometimes a composite action can be made without further ado, and actions pushed into this one and this one added to the relevant undo stack. But often more complex things needs to be done, so this is often extended into a more specific action.



Public Properties
 PropertyDefined by
  name : String
CompositeUndoableAction
Public Methods
 MethodDefined by
  
CompositeUndoableAction
  
clearActions():void
Clear the list of actions
CompositeUndoableAction
  
doAction():uint
Do all the actions on the list.
CompositeUndoableAction
 Inherited
mergePrevious(previous:UndoableAction):Boolean
Can this action be merged with the previous action? This is sometimes wanted, such as when moving nodes around.
UndoableAction
  
push(action:UndoableAction):void
Add an action to the list of actions that make up this CompositeUndoableAction
CompositeUndoableAction
  
toString():String
Returns the name of this composite action, along with the (recursive) description of all the sub actions
CompositeUndoableAction
  
undoAction():uint
Undo the actions on the list.
CompositeUndoableAction
  
undoFrom(index:int):void
Undo the actions from a given index.
CompositeUndoableAction
Public Constants
 ConstantDefined by
 InheritedFAIL : uint = 0
[static] Something went wrong while attempting the action
UndoableAction
 InheritedNO_CHANGE : uint = 2
[static] No entity was altered by this action
UndoableAction
 InheritedSUCCESS : uint = 1
[static] The action worked, and entities were changed
UndoableAction
Property detail
nameproperty
public var name:String
Constructor detail
CompositeUndoableAction()constructor
public function CompositeUndoableAction(name:String)

Parameters
name:String — The name you want to give to this CompositeUndoableAction - useful for debugging
Method detail
clearActions()method
public function clearActions():void

Clear the list of actions

doAction()method 
public override function doAction():uint

Do all the actions on the list. Can be overridden by an specific implementation, usually to manage the suspending and resuming of entities. If so, you'll want to call super.doAction from that implementation to actually execute the list of actions that you've added via push If any action fails while exectuing, the preceeding actions will be undone and this composite will return FAIL

Returns
uint — whether the entire stack of actions succeeded, failed or resulted in nothing changing.

See also

push()method 
public function push(action:UndoableAction):void

Add an action to the list of actions that make up this CompositeUndoableAction

Parameters
action:UndoableAction
toString()method 
public function toString():String

Returns the name of this composite action, along with the (recursive) description of all the sub actions

Returns
String
undoAction()method 
public override function undoAction():uint

Undo the actions on the list. If overridden call super.undoAction

Returns
uint
undoFrom()method 
public function undoFrom(index:int):void

Undo the actions from a given index. Used when the composite needs to be aborted when one of the individual actions fails

Parameters
index:int