public class DragSource extends java.lang.Object implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static java.awt.Cursor |
DefaultCopyDrop |
static java.awt.Cursor |
DefaultCopyNoDrop |
static java.awt.Cursor |
DefaultLinkDrop |
static java.awt.Cursor |
DefaultLinkNoDrop |
static java.awt.Cursor |
DefaultMoveDrop |
static java.awt.Cursor |
DefaultMoveNoDrop |
| Constructor and Description |
|---|
DragSource()
Initializes the drag source.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDragSourceListener(DragSourceListener l) |
void |
addDragSourceMotionListener(DragSourceMotionListener l) |
DragGestureRecognizer |
createDefaultDragGestureRecognizer(java.awt.Component c,
int actions,
DragGestureListener dgl) |
<T extends DragGestureRecognizer> |
createDragGestureRecognizer(java.lang.Class<T> recognizer,
java.awt.Component c,
int actions,
DragGestureListener dgl) |
protected DragSourceContext |
createDragSourceContext(java.awt.dnd.peer.DragSourceContextPeer peer,
DragGestureEvent dge,
java.awt.Cursor cursor,
java.awt.Image image,
java.awt.Point offset,
java.awt.datatransfer.Transferable t,
DragSourceListener dsl)
Creates the DragSourceContext to handle this drag.
|
static DragSource |
getDefaultDragSource()
Gets the default drag source.
|
DragSourceListener[] |
getDragSourceListeners() |
DragSourceMotionListener[] |
getDragSourceMotionListeners() |
static int |
getDragThreshold()
TODO
|
java.awt.datatransfer.FlavorMap |
getFlavorMap() |
<T extends java.util.EventListener> |
getListeners(java.lang.Class<T> listenerType) |
static boolean |
isDragImageSupported() |
void |
removeDragSourceListener(DragSourceListener l) |
void |
removeDragSourceMotionListener(DragSourceMotionListener l) |
void |
startDrag(DragGestureEvent trigger,
java.awt.Cursor dragCursor,
java.awt.Image dragImage,
java.awt.Point imageOffset,
java.awt.datatransfer.Transferable trans,
DragSourceListener dsl)
Start a drag, given the DragGestureEvent that initiated the drag.
|
void |
startDrag(DragGestureEvent trigger,
java.awt.Cursor dragCursor,
java.awt.Image dragImage,
java.awt.Point imageOffset,
java.awt.datatransfer.Transferable trans,
DragSourceListener dsl,
java.awt.datatransfer.FlavorMap map)
Start a drag, given the DragGestureEvent that initiated the drag.
|
void |
startDrag(DragGestureEvent trigger,
java.awt.Cursor dragCursor,
java.awt.datatransfer.Transferable trans,
DragSourceListener dsl)
Start a drag, given the DragGestureEvent that initiated the drag.
|
void |
startDrag(DragGestureEvent trigger,
java.awt.Cursor dragCursor,
java.awt.datatransfer.Transferable trans,
DragSourceListener dsl,
java.awt.datatransfer.FlavorMap map)
Start a drag, given the DragGestureEvent that initiated the drag.
|
public static final java.awt.Cursor DefaultCopyDrop
public static final java.awt.Cursor DefaultMoveDrop
public static final java.awt.Cursor DefaultLinkDrop
public static final java.awt.Cursor DefaultCopyNoDrop
public static final java.awt.Cursor DefaultMoveNoDrop
public static final java.awt.Cursor DefaultLinkNoDrop
public DragSource()
java.awt.HeadlessException - If GraphicsEnvironment.isHeadless() is true.public static DragSource getDefaultDragSource()
java.awt.HeadlessException - If GraphicsEnvironment.isHeadless() is true.public static boolean isDragImageSupported()
public void startDrag(DragGestureEvent trigger, java.awt.Cursor dragCursor, java.awt.Image dragImage, java.awt.Point imageOffset, java.awt.datatransfer.Transferable trans, DragSourceListener dsl, java.awt.datatransfer.FlavorMap map)
InvalidDnDOperationException - If the Drag and Drop system is
unable to initiate a drag operation, or if the user attempts to start
a drag while an existing drag operation is still executing.public void startDrag(DragGestureEvent trigger, java.awt.Cursor dragCursor, java.awt.datatransfer.Transferable trans, DragSourceListener dsl, java.awt.datatransfer.FlavorMap map)
InvalidDnDOperationException - If the Drag and Drop system is
unable to initiate a drag operation, or if the user attempts to start
a drag while an existing drag operation is still executing.public void startDrag(DragGestureEvent trigger, java.awt.Cursor dragCursor, java.awt.Image dragImage, java.awt.Point imageOffset, java.awt.datatransfer.Transferable trans, DragSourceListener dsl)
InvalidDnDOperationException - If the Drag and Drop system is
unable to initiate a drag operation, or if the user attempts to start
a drag while an existing drag operation is still executing.public void startDrag(DragGestureEvent trigger, java.awt.Cursor dragCursor, java.awt.datatransfer.Transferable trans, DragSourceListener dsl)
InvalidDnDOperationException - If the Drag and Drop system is
unable to initiate a drag operation, or if the user attempts to start
a drag while an existing drag operation is still executing.protected DragSourceContext createDragSourceContext(java.awt.dnd.peer.DragSourceContextPeer peer, DragGestureEvent dge, java.awt.Cursor cursor, java.awt.Image image, java.awt.Point offset, java.awt.datatransfer.Transferable t, DragSourceListener dsl)
java.lang.IllegalArgumentExceptionjava.lang.NullPointerException - If dscp, dgl, dragImage or t is null.public java.awt.datatransfer.FlavorMap getFlavorMap()
public <T extends DragGestureRecognizer> T createDragGestureRecognizer(java.lang.Class<T> recognizer, java.awt.Component c, int actions, DragGestureListener dgl)
public DragGestureRecognizer createDefaultDragGestureRecognizer(java.awt.Component c, int actions, DragGestureListener dgl)
public void addDragSourceListener(DragSourceListener l)
public void removeDragSourceListener(DragSourceListener l)
public DragSourceListener[] getDragSourceListeners()
public void addDragSourceMotionListener(DragSourceMotionListener l)
public void removeDragSourceMotionListener(DragSourceMotionListener l)
public DragSourceMotionListener[] getDragSourceMotionListeners()
public <T extends java.util.EventListener> T[] getListeners(java.lang.Class<T> listenerType)
public static int getDragThreshold() throws NotImplementedException
NotImplementedException