org.graffiti.undo
Class AddNodeEdit

java.lang.Object
  extended by javax.swing.undo.AbstractUndoableEdit
      extended by org.graffiti.undo.GraffitiAbstractUndoableEdit
          extended by org.graffiti.undo.GraphElementsEdit
              extended by org.graffiti.undo.AddNodeEdit
All Implemented Interfaces:
Serializable, UndoableEdit

public class AddNodeEdit
extends GraphElementsEdit

Class AddNodeEdit makes the add node action undoable.

Version:
$Revision: 5767 $
Author:
Walter Wirch
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.graffiti.undo.GraphElementsEdit
graph
 
Fields inherited from class org.graffiti.undo.GraffitiAbstractUndoableEdit
coreBundle, geMap
 
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
 
Constructor Summary
AddNodeEdit(Node node, Graph graph, Map<GraphElement,GraphElement> geMap)
          Constructor for AddNodeEdit.
 
Method Summary
 void execute()
          Executes action for corresponding tools.
 String getPresentationName()
          Used to display the name for this edit.
 void redo()
          Adds the same node that was added through the method that created this edit.
 void undo()
          Deletes the node that is stored in this edit.
 
Methods inherited from class org.graffiti.undo.GraffitiAbstractUndoableEdit
getCurrentGraphElement
 
Methods inherited from class javax.swing.undo.AbstractUndoableEdit
addEdit, canRedo, canUndo, die, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AddNodeEdit

public AddNodeEdit(Node node,
                   Graph graph,
                   Map<GraphElement,GraphElement> geMap)
Constructor for AddNodeEdit.

Parameters:
node -
graph -
geMap -
Method Detail

getPresentationName

public String getPresentationName()
Used to display the name for this edit.

Specified by:
getPresentationName in interface UndoableEdit
Overrides:
getPresentationName in class AbstractUndoableEdit
Returns:
the name of this edit.
See Also:
UndoableEdit

execute

public void execute()
Description copied from class: GraffitiAbstractUndoableEdit
Executes action for corresponding tools.

Specified by:
execute in class GraffitiAbstractUndoableEdit

redo

public void redo()
Adds the same node that was added through the method that created this edit.

Specified by:
redo in interface UndoableEdit
Overrides:
redo in class AbstractUndoableEdit

undo

public void undo()
Deletes the node that is stored in this edit.

Specified by:
undo in interface UndoableEdit
Overrides:
undo in class AbstractUndoableEdit


Generated at 2012-05-30 11:00:36 PM CEST