lacam.gui.components.taskdesktop.transfer
Class TaskTransferHandler

java.lang.Object
  extended byjavax.swing.TransferHandler
      extended bylacam.gui.components.taskdesktop.transfer.TaskTransferHandler
All Implemented Interfaces:
java.io.Serializable

public class TaskTransferHandler
extends javax.swing.TransferHandler

Handles the DnD actions between the task explorer and the main windows desktop.

Author:
Dimitrij Zub
See Also:
TransferHandler, Serialized Form

Field Summary
 
Fields inherited from class javax.swing.TransferHandler
COPY, COPY_OR_MOVE, MOVE, NONE
 
Constructor Summary
TaskTransferHandler()
           
 
Method Summary
 boolean canImport(javax.swing.JComponent comp, java.awt.datatransfer.DataFlavor[] transferFlavors)
           
 boolean importData(javax.swing.JComponent comp, java.awt.datatransfer.Transferable t, int x, int y)
          Imports the task in t to the desktop.
 
Methods inherited from class javax.swing.TransferHandler
exportAsDrag, exportToClipboard, getCopyAction, getCutAction, getPasteAction, getSourceActions, getVisualRepresentation, importData
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskTransferHandler

public TaskTransferHandler()
Method Detail

canImport

public boolean canImport(javax.swing.JComponent comp,
                         java.awt.datatransfer.DataFlavor[] transferFlavors)
Returns:
True if the DnD'd object is a tree path coming from the task explorer, so the desktop can import them.
See Also:
TransferHandler.canImport(javax.swing.JComponent, java.awt.datatransfer.DataFlavor[])

importData

public boolean importData(javax.swing.JComponent comp,
                          java.awt.datatransfer.Transferable t,
                          int x,
                          int y)
Imports the task in t to the desktop.

Parameters:
comp - Should be always the GraphicsPanel of the main window.
t - The Task capsulated by a Transferable
x - Where to add
y - Where to add
Returns:
Truee if success