simtools.diagram.undo
Class UndoHandler

java.lang.Object
  extended by simtools.diagram.undo.UndoHandler
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.UndoableEditListener

public class UndoHandler
extends java.lang.Object
implements javax.swing.event.UndoableEditListener

Instances of this class listen to UndoableEditEvents and inform an instance of UndoManager, in order for the edit to be undone/redone.

Author:
Jean-Baptiste Lièvremont

Nested Class Summary
 class UndoHandler.RedoAction
          Instances of this class can be used to access redo features
 class UndoHandler.UndoAction
          Instances of this class can be used to access undo features
 
Field Summary
protected  UndoHandler.RedoAction _redoAction
           
protected  javax.swing.undo.UndoManager _undo
           
protected  UndoHandler.UndoAction _undoAction
           
 
Constructor Summary
UndoHandler(javax.swing.undo.UndoManager undo)
           
 
Method Summary
 UndoHandler.RedoAction getRedoAction()
          Get the RedoAction associated to this handler, and therefore to a given DiagramComponent.
 UndoHandler.UndoAction getUndoAction()
          Get the UndoAction associated to this handler, and therefore to a given DiagramComponent.
 void undoableEditHappened(javax.swing.event.UndoableEditEvent e)
          Inform an UndoManager that an UndoableEditEvent has happened and update the stats of related actions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_undo

protected javax.swing.undo.UndoManager _undo

_undoAction

protected UndoHandler.UndoAction _undoAction

_redoAction

protected UndoHandler.RedoAction _redoAction
Constructor Detail

UndoHandler

public UndoHandler(javax.swing.undo.UndoManager undo)
Method Detail

undoableEditHappened

public void undoableEditHappened(javax.swing.event.UndoableEditEvent e)
Inform an UndoManager that an UndoableEditEvent has happened and update the stats of related actions.

Specified by:
undoableEditHappened in interface javax.swing.event.UndoableEditListener
See Also:
UndoableEditListener.undoableEditHappened(javax.swing.event.UndoableEditEvent)

getUndoAction

public UndoHandler.UndoAction getUndoAction()
Get the UndoAction associated to this handler, and therefore to a given DiagramComponent.


getRedoAction

public UndoHandler.RedoAction getRedoAction()
Get the RedoAction associated to this handler, and therefore to a given DiagramComponent.