Package org.graffiti.undo
Class AddEdgeEdit
java.lang.Object
javax.swing.undo.AbstractUndoableEdit
org.graffiti.undo.GraffitiAbstractUndoableEdit
org.graffiti.undo.GraphElementsEdit
org.graffiti.undo.AddEdgeEdit
- All Implemented Interfaces:
Serializable
,UndoableEdit
public class AddEdgeEdit extends GraphElementsEdit
Class
AddNodeEdit
makes the add edge action undoable.- Version:
- $Revision: 1.5 $
- Author:
- Walter Wirch
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description AddEdgeEdit(Edge edge, Graph graph, Map<GraphElement,GraphElement> geMap)
Constructor for AddEdgeEdit. -
Method Summary
Modifier and Type Method Description 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 javax.swing.undo.AbstractUndoableEdit
addEdit, canRedo, canUndo, die, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, toString
-
Constructor Details
-
AddEdgeEdit
Constructor for AddEdgeEdit.- Parameters:
edge
-graph
-geMap
-
-
-
Method Details
-
getPresentationName
Used to display the name for this edit.- Specified by:
getPresentationName
in interfaceUndoableEdit
- Overrides:
getPresentationName
in classAbstractUndoableEdit
- 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 classGraffitiAbstractUndoableEdit
-
redo
public void redo()Adds the same edge that was added through the method that created this edit.- Specified by:
redo
in interfaceUndoableEdit
- Overrides:
redo
in classAbstractUndoableEdit
-
undo
public void undo()Deletes the edge whose addition is stored in this edit.- Specified by:
undo
in interfaceUndoableEdit
- Overrides:
undo
in classAbstractUndoableEdit
-