com.jgaap.gui.dnd
Class LabelTransferHandler

java.lang.Object
  extended by javax.swing.TransferHandler
      extended by com.jgaap.gui.dnd.LabelTransferHandler
All Implemented Interfaces:
java.io.Serializable

public class LabelTransferHandler
extends javax.swing.TransferHandler

This class is responsible for handling the drag and drop functionality of CanonicizerLabel components.

Author:
Chuck Liddell
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.TransferHandler
COPY, COPY_OR_MOVE, MOVE, NONE
 
Constructor Summary
LabelTransferHandler()
           
 
Method Summary
 boolean canImport(javax.swing.JComponent c, java.awt.datatransfer.DataFlavor[] df)
          Called to see if this CanonicizerLabel can accept data from component type c of dataflavor df.
 void exportAsDrag(javax.swing.JComponent c, java.awt.event.InputEvent event, int type)
          This method is called by our own code to kick off the Drag and Drop functionality.
 void exportToClipboard(javax.swing.JComponent arg0, java.awt.datatransfer.Clipboard arg1, int arg2)
           
 int getSourceActions(javax.swing.JComponent c)
          Asks this TransferHandler what kinds of actions are supported by the component being passed as an argument.
 javax.swing.Icon getVisualRepresentation(java.awt.datatransfer.Transferable arg0)
           
 boolean importData(javax.swing.JComponent arg0, java.awt.datatransfer.Transferable arg1)
           
 
Methods inherited from class javax.swing.TransferHandler
getCopyAction, getCutAction, getPasteAction
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelTransferHandler

public LabelTransferHandler()
Method Detail

canImport

public boolean canImport(javax.swing.JComponent c,
                         java.awt.datatransfer.DataFlavor[] df)
Called to see if this CanonicizerLabel can accept data from component type c of dataflavor df.

Overrides:
canImport in class javax.swing.TransferHandler
Parameters:
c - JComponent that is the source of the drag and drop
df - The type of data being dragged
See Also:
TransferHandler.canImport(javax.swing.JComponent, java.awt.datatransfer.DataFlavor[])

exportAsDrag

public void exportAsDrag(javax.swing.JComponent c,
                         java.awt.event.InputEvent event,
                         int type)
This method is called by our own code to kick off the Drag and Drop functionality.

Overrides:
exportAsDrag in class javax.swing.TransferHandler
Parameters:
c - The JComponent that is the source of the Drag
event - The event representing the start of the drag
type - the ActionType of the drag (Move, Copy, Copy or Move, None)
See Also:
TransferHandler.exportAsDrag(javax.swing.JComponent, java.awt.event.InputEvent, int)

exportToClipboard

public void exportToClipboard(javax.swing.JComponent arg0,
                              java.awt.datatransfer.Clipboard arg1,
                              int arg2)
                       throws java.lang.IllegalStateException
Overrides:
exportToClipboard in class javax.swing.TransferHandler
Throws:
java.lang.IllegalStateException
See Also:
TransferHandler.exportToClipboard(javax.swing.JComponent, java.awt.datatransfer.Clipboard, int)

getSourceActions

public int getSourceActions(javax.swing.JComponent c)
Asks this TransferHandler what kinds of actions are supported by the component being passed as an argument.

Overrides:
getSourceActions in class javax.swing.TransferHandler
Parameters:
c - The JComponent linked to this TransferHandler
See Also:
TransferHandler.getSourceActions(javax.swing.JComponent)

getVisualRepresentation

public javax.swing.Icon getVisualRepresentation(java.awt.datatransfer.Transferable arg0)
Overrides:
getVisualRepresentation in class javax.swing.TransferHandler
See Also:
TransferHandler.getVisualRepresentation(java.awt.datatransfer.Transferable)

importData

public boolean importData(javax.swing.JComponent arg0,
                          java.awt.datatransfer.Transferable arg1)
Overrides:
importData in class javax.swing.TransferHandler
See Also:
TransferHandler.importData(javax.swing.JComponent, java.awt.datatransfer.Transferable)