Package org.graffiti.undo
Class AddNodeEdit
java.lang.Object
javax.swing.undo.AbstractUndoableEdit
org.graffiti.undo.GraffitiAbstractUndoableEdit
org.graffiti.undo.GraphElementsEdit
org.graffiti.undo.AddNodeEdit
- All Implemented Interfaces:
Serializable
,UndoableEdit
public class AddNodeEdit extends GraphElementsEdit
Class
AddNodeEdit
makes the add node action undoable.- Version:
- $Revision: 1.6 $
- Author:
- Walter Wirch
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description AddNodeEdit(Node node, Graph graph, Map<GraphElement,GraphElement> geMap)
Constructor for AddNodeEdit. -
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 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 javax.swing.undo.AbstractUndoableEdit
addEdit, canRedo, canUndo, die, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, toString
-
Constructor Details
-
AddNodeEdit
Constructor for AddNodeEdit.- Parameters:
node
-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 node 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 node that is stored in this edit.- Specified by:
undo
in interfaceUndoableEdit
- Overrides:
undo
in classAbstractUndoableEdit
-