org.argouml.uml.ui
Class ActionPaste

java.lang.Object
  |
  +--javax.swing.AbstractAction
        |
        +--org.argouml.uml.ui.ActionPaste
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, javax.swing.event.CaretListener, java.lang.Cloneable, java.util.EventListener, java.awt.event.FocusListener, java.io.Serializable

public class ActionPaste
extends javax.swing.AbstractAction
implements javax.swing.event.CaretListener, java.awt.event.FocusListener

Action to paste the content of either the GEF clipboard or the system clipboard. The action is enabled if there is content on either clipboard AND either the mouse hovers over the JGraph (the diagram) or the caret in a UMLTextField2 or UMLTextArea2 is enabled.

See Also:
Serialized Form

Field Summary
private  boolean _inJGraph
          Flag to indicate that the mouse is hovering over the JGraph
private static ActionPaste _Instance
           
private  javax.swing.text.JTextComponent _textSource
          The source textcomponent where the caret is positioned
private static java.lang.String LOCALIZE_KEY
           
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
private ActionPaste()
          Default constructor for action.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
          Copies some text or a fig
 void caretUpdate(javax.swing.event.CaretEvent e)
           
 void focusGained(java.awt.event.FocusEvent e)
           
 void focusLost(java.awt.event.FocusEvent e)
           
static ActionPaste getInstance()
          Singleton implementation.
private  boolean isSystemClipBoardEmpty()
           
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_Instance

private static ActionPaste _Instance

LOCALIZE_KEY

private static final java.lang.String LOCALIZE_KEY
See Also:
Constant Field Values

_textSource

private javax.swing.text.JTextComponent _textSource
The source textcomponent where the caret is positioned


_inJGraph

private boolean _inJGraph
Flag to indicate that the mouse is hovering over the JGraph

Constructor Detail

ActionPaste

private ActionPaste()
Default constructor for action. We cannot use UMLChangeAction as a parent for this class since it works with shouldBeEnabled etc. which doesn't give enough control about enabling/disabling this action.

Method Detail

getInstance

public static ActionPaste getInstance()
Singleton implementation.

Returns:
The singleton

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
Copies some text or a fig

Specified by:
actionPerformed in interface java.awt.event.ActionListener

isSystemClipBoardEmpty

private boolean isSystemClipBoardEmpty()

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Specified by:
focusLost in interface java.awt.event.FocusListener
See Also:
FocusListener.focusLost(java.awt.event.FocusEvent)

caretUpdate

public void caretUpdate(javax.swing.event.CaretEvent e)
Specified by:
caretUpdate in interface javax.swing.event.CaretListener
See Also:
CaretListener.caretUpdate(javax.swing.event.CaretEvent)

focusGained

public void focusGained(java.awt.event.FocusEvent e)
Specified by:
focusGained in interface java.awt.event.FocusListener
See Also:
FocusListener.focusGained(java.awt.event.FocusEvent)


ArgoUML © 1996-2004 (20040306)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook