org.graffiti.editor.actions.undo
Class PasteActionEdit

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

public class PasteActionEdit
extends GraphElementsEdit
implements ClipboardOwner

Class performes the paste-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
PasteActionEdit(Selection selection, Graph graph, Map<GraphElement,GraphElement> geMap, MainFrame mainFrame)
          Creates a new PasteActionEdit
 
Method Summary
 void execute()
          Performes the paste-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 wether the paste button should still be enabled
 void redo()
          Performes the redo action
 void undo()
          Performes the undo action
 
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

PasteActionEdit

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

Parameters:
selection - items that will be pasted
graph - the graph in which paste, undo and redo operation should be performed
geMap - saves relationships between elements and their inserted copies
mainFrame - the mainframe in which the pastedItems will be marked
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

execute

public void execute()
Performes the paste-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 wether the paste button should still be enabled

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

redo

public void redo()
Performes the redo action

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

undo

public void undo()
Performes the undo action

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


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