org.graffiti.editor.actions.undo
Class CutActionEdit

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.editor.actions.undo.CutActionEdit
All Implemented Interfaces:
ClipboardOwner, Serializable, UndoableEdit

public class CutActionEdit
extends GraphElementsEdit
implements ClipboardOwner

Class performs the cut-action and is responsible for correct undo and redo operations

Author:
MH
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
CutActionEdit(Selection selection, Graph graph, Map<GraphElement,GraphElement> geMap, MainFrame mainFrame)
          Creates a new CutActionEdit
 
Method Summary
 void execute()
          Performs the cut-action
 String getPresentationName()
          Returns a name for the performed operations.
 void lostOwnership(Clipboard arg0, Transferable arg1)
          Calls all selection listeners as soon as any application writes to the system clipboard to check whether the paste button should still be enabled
 void redo()
          Performs the redo action
 void undo()
          Performs the undo operation
 
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

CutActionEdit

public CutActionEdit(Selection selection,
                     Graph graph,
                     Map<GraphElement,GraphElement> geMap,
                     MainFrame mainFrame)
Creates a new CutActionEdit

Parameters:
selection - the currently selected items which should be cut
graph - the graph in which cut, undo and redo operation should be performed
geMap - saves relationships between cut elements and their inserted copies.
mainFrame - a MainFrame object from which the elements are cut.
Method Detail

getPresentationName

public String getPresentationName()
Returns a name for the performed operations.

Specified by:
getPresentationName in interface UndoableEdit
Overrides:
getPresentationName in class AbstractUndoableEdit
Returns:
name a String naming the performed operations.

execute

public void execute()
Performs the cut-action

Specified by:
execute in class GraffitiAbstractUndoableEdit

lostOwnership

public void lostOwnership(Clipboard arg0,
                          Transferable arg1)
Calls all selection listeners as soon as any application writes to the system clipboard to check whether the paste button should still be enabled

Specified by:
lostOwnership in interface ClipboardOwner
Parameters:
arg0 - not used
arg1 - not used

redo

public void redo()
Performs the redo action

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

undo

public void undo()
Performs the undo operation

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


Generated at 2012-05-30 11:00:36 PM CEST