public class WidgetTransferHandler
extends javax.swing.TransferHandler
implements java.awt.dnd.DragSourceMotionListener
Constructor and Description |
---|
WidgetTransferHandler()
Creates a new WidgetTransferHandler object.
|
Modifier and Type | Method and Description |
---|---|
java.awt.datatransfer.Transferable |
createTransferable(javax.swing.JComponent cmp)
This creates the Transferable object.
|
void |
dragMouseMoved(java.awt.dnd.DragSourceDragEvent dsde) |
int |
getSourceActions(javax.swing.JComponent cmp)
This is queried to see whether the component can be copied,
moved, both or neither.
|
public WidgetTransferHandler()
public java.awt.datatransfer.Transferable createTransferable(javax.swing.JComponent cmp)
This creates the Transferable object. In our case, RandomDragAndDropPanel implements Transferable, so this requires only a type cast.
createTransferable
in class javax.swing.TransferHandler
cmp
- The component to make transferable.public void dragMouseMoved(java.awt.dnd.DragSourceDragEvent dsde)
dragMouseMoved
in interface java.awt.dnd.DragSourceMotionListener
public int getSourceActions(javax.swing.JComponent cmp)
This is queried to see whether the component can be copied, moved, both or neither. We are only concerned with copying.
getSourceActions
in class javax.swing.TransferHandler
cmp
- The component to get source actions for.Copyright © 2008-2022 University of Manitoba.