org.graffiti.undo
Class AddEdgeEdit

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.AddEdgeEdit
All Implemented Interfaces:
Serializable, UndoableEdit

public class AddEdgeEdit
extends GraphElementsEdit

Class AddNodeEdit makes the add edge 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
AddEdgeEdit(Edge edge, Graph graph, Map<GraphElement,GraphElement> geMap)
          Constructor for AddEdgeEdit.
 
Method Summary
 void execute()
          Executes action for corresponding tools.
 String getPresentationName()
          Used to display the name for this edit.
 void redo()
          Adds the same edge that was added through the method that created this edit.
 void undo()
          Deletes the edge whose addition 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

AddEdgeEdit

public AddEdgeEdit(Edge edge,
                   Graph graph,
                   Map<GraphElement,GraphElement> geMap)
Constructor for AddEdgeEdit.

Parameters:
edge -
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 edge 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 edge whose addition 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