y.view.hierarchy
Class Graph2DHierarchyUndoManager

java.lang.Object
  |
  +--y.view.Graph2DUndoManager
        |
        +--y.view.hierarchy.Graph2DHierarchyUndoManager
All Implemented Interfaces:
EventListener, Graph2D.BackupRealizersHandler, GraphListener, HierarchyListener

public class Graph2DHierarchyUndoManager
extends Graph2DUndoManager
implements HierarchyListener

This class provides undoability and redoability support for a hierarchy of graphs. Like its base class Graph2DUndoManager it must be registered as a GraphListener and Graph2D.BackupRealizersHandler to make this class aware of Graph2D changes.

Additionally this class acts as HierarchyListener and must therefore be registered with HierarchyManager.


Constructor Summary
Graph2DHierarchyUndoManager(HierarchyManager hierarchy)
          Creates a new instance of Graph2DHierarchyUndoManager.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener l)
          Adds a PropertyChangeListener to the listener list.
 Graph getActiveGraph()
          Getter for property activeGraph.
 void hierarchyChange(HierarchyEvent ev)
          HierarchyListener implementation.
 void onGraphEvent(GraphEvent e)
          Graph2DListener implementation.Structural changes of the graph will be converted to undoable commands and stored in a command stream for later execution.
 void redo()
          Causes the next command in line to be redone.
 void removePropertyChangeListener(PropertyChangeListener l)
          Removes a PropertyChangeListener from the listener list.
 void setActiveGraph(Graph activeGraph)
          Setter for property activeGraph.
 void undo()
          Causes the next command in line to be undone.
 
Methods inherited from class y.view.Graph2DUndoManager
backupRealizers, backupRealizers, canRedo, canUndo, getActiveToken, getMaximumUndoDepth, getRedoAction, getUndoAction, getViewContainer, isActive, isActiveToken, push, resetQueue, sanatize, setExchangeRealizersOnBackup, setExchangeRealizersOnBackup, setMaximumUndoDepth, setViewContainer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Graph2DHierarchyUndoManager

public Graph2DHierarchyUndoManager(HierarchyManager hierarchy)
Creates a new instance of Graph2DHierarchyUndoManager.

Method Detail

hierarchyChange

public void hierarchyChange(HierarchyEvent ev)
HierarchyListener implementation. This class keeps track of hierarchy changes.

Specified by:
hierarchyChange in interface HierarchyListener

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)
Adds a PropertyChangeListener to the listener list. Changes of the "activeGraph" property will be propagated.


removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)
Removes a PropertyChangeListener from the listener list.


getActiveGraph

public Graph getActiveGraph()
Getter for property activeGraph.


setActiveGraph

public void setActiveGraph(Graph activeGraph)
Setter for property activeGraph.


onGraphEvent

public void onGraphEvent(GraphEvent e)
Description copied from class: Graph2DUndoManager
Graph2DListener implementation.Structural changes of the graph will be converted to undoable commands and stored in a command stream for later execution.

Specified by:
onGraphEvent in interface GraphListener
Overrides:
onGraphEvent in class Graph2DUndoManager

redo

public void redo()
Description copied from class: Graph2DUndoManager
Causes the next command in line to be redone.

Overrides:
redo in class Graph2DUndoManager

undo

public void undo()
Description copied from class: Graph2DUndoManager
Causes the next command in line to be undone.

Overrides:
undo in class Graph2DUndoManager

© Copyright 2000-2003,
yWorks GmbH.
All rights reserved.

2003