Undo Action

Undo/Redo action is activated on the Diagrammer because it is used as a diagramming tool. It erases the last change done to the diagrammer and reverts it to an older state

The opposite of undo is redo. The redo action reverses the undo or advances the buffer to a more current state.

In the Diagrammer, the Undo action is activated by pressing Ctrl+Z. The Redo Action is activated by pressing Ctrl+Y

The user/the developer can choose the list of the events that can be reverted via the UndoRedoActionData.as. This data has only one property considredEvents which is an array in which we can list the events. These actions, since they are activated by default, has the following default events:

The following code shows how can the user use the UndoRedoAction.


function undo(event:MouseEvent):void
{
	diagrammer.messageAction(UndoAction.ID,'undo');
}
function redo(event:MouseEvent):void
{
	diagrammer.messageAction(RedoAction.ID,'redo');
}