org.graffiti.undo
Class GraphElementsDeletionEdit

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

public class GraphElementsDeletionEdit
extends GraphElementsEdit

GraphElementsDeletionEdit makes deletion of graph elements undoable.

Version:
$Revision: 5779 $
Author:
$Author $
See Also:
Serialized Form

Nested Class Summary
static class GraphElementsDeletionEdit.Builder
          A builder for the GraphElementsDeletionEdit class.
 
Field Summary
protected  boolean executed
          this flag assures that execute method will be invoked before calling undo or redo methods
 
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
GraphElementsDeletionEdit(Collection<GraphElement> graphElements, Graph graph, Map<GraphElement,GraphElement> geMap)
           
 
Method Summary
 void execute()
          Executes the deletion of selected graph elements
 String getPresentationName()
          Used to display the name for this edit.
 void redo()
          Deletes the GraphElements stored in this edit.
 void undo()
          Adds the deleted GraphElements 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
 

Field Detail

executed

protected boolean executed
this flag assures that execute method will be invoked before calling undo or redo methods

Constructor Detail

GraphElementsDeletionEdit

public GraphElementsDeletionEdit(Collection<GraphElement> graphElements,
                                 Graph graph,
                                 Map<GraphElement,GraphElement> geMap)
See Also:
GraffitiAbstractUndoableEdit.GraffitiAbstractUndoableEdit(Map)
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()
Executes the deletion of selected graph elements

Specified by:
execute in class GraffitiAbstractUndoableEdit

redo

public void redo()
Deletes the GraphElements stored in this edit.

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

undo

public void undo()
Adds the deleted GraphElements 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