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 voidexecute()Executes action for corresponding tools.StringgetPresentationName()Used to display the name for this edit.voidredo()Adds the same node that was added through the method that created this edit.voidundo()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:
getPresentationNamein interfaceUndoableEdit- Overrides:
getPresentationNamein classAbstractUndoableEdit- Returns:
- the name of this edit.
- See Also:
UndoableEdit
-
execute
public void execute()Description copied from class:GraffitiAbstractUndoableEditExecutes action for corresponding tools.- Specified by:
executein classGraffitiAbstractUndoableEdit
-
redo
public void redo()Adds the same node that was added through the method that created this edit.- Specified by:
redoin interfaceUndoableEdit- Overrides:
redoin classAbstractUndoableEdit
-
undo
public void undo()Deletes the node that is stored in this edit.- Specified by:
undoin interfaceUndoableEdit- Overrides:
undoin classAbstractUndoableEdit
-