com.mindfusion.diagramming
Class UndoManager

java.lang.Object
  extended by com.mindfusion.diagramming.UndoManager

public class UndoManager
extends java.lang.Object

Implements undo/redo functionality in JDiagram. A flowchart's undo manager can be accessed via the Diagram.getUndoManager() method of the Diagram class.


Method Summary
 CommandHistory getHistory()
          Gets a reference to the list of commands stored for later undo/redo.
 boolean getUndoEnabled()
          Gets a value indicating whether actions performed on the diagram can be undone or redone.
 void redo()
          Redoes the next action in the undo/redo queue.
 void setUndoEnabled(boolean value)
          Enables or disabled undo/redo.
 CompositeCmd startComposite(java.lang.String title)
          Starts recording a composite undo/redo command.
 CompositeCmd startComposite(java.lang.String title, boolean saveZOrder)
          Starts recording a composite undo/redo command.
 void undo()
          Undoes the previous action in the undo/redo queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getUndoEnabled

public boolean getUndoEnabled()
Gets a value indicating whether actions performed on the diagram can be undone or redone.

Returns:
true if undo/redo is enabled, otherwise false.

setUndoEnabled

public void setUndoEnabled(boolean value)
Enables or disabled undo/redo.

Parameters:
value - true if JDiagram should track modifications done on the diagram so that they can be undone or redone later, otherwise false.

undo

public void undo()
Undoes the previous action in the undo/redo queue.


redo

public void redo()
Redoes the next action in the undo/redo queue.


getHistory

public CommandHistory getHistory()
Gets a reference to the list of commands stored for later undo/redo.

Returns:
A CommandHistory object representing the undo/redo queue.

startComposite

public CompositeCmd startComposite(java.lang.String title)
Starts recording a composite undo/redo command.

Parameters:
title - A String containing the title of the composite command.
Returns:
A CompositeCmd object representing the composite command.

startComposite

public CompositeCmd startComposite(java.lang.String title,
                                   boolean saveZOrder)
Starts recording a composite undo/redo command.

Parameters:
title - A String containing the title of the composite command.
Returns:
A CompositeCmd object representing the composite command.