java.awt.dnd

Class DragSource

public class DragSource extends Object implements Serializable

Since: 1.2

Field Summary
static CursorDefaultCopyDrop
static CursorDefaultCopyNoDrop
static CursorDefaultLinkDrop
static CursorDefaultLinkNoDrop
static CursorDefaultMoveDrop
static CursorDefaultMoveNoDrop
Constructor Summary
DragSource()
Initializes the drag source.
Method Summary
voidaddDragSourceListener(DragSourceListener l)
voidaddDragSourceMotionListener(DragSourceMotionListener l)
DragGestureRecognizercreateDefaultDragGestureRecognizer(Component c, int actions, DragGestureListener dgl)
<T extends DragGestureRecognizer> TcreateDragGestureRecognizer(Class<T> recognizer, Component c, int actions, DragGestureListener dgl)
protected DragSourceContextcreateDragSourceContext(DragSourceContextPeer peer, DragGestureEvent dge, Cursor cursor, Image image, Point offset, Transferable t, DragSourceListener dsl)
Creates the DragSourceContext to handle this drag.
static DragSourcegetDefaultDragSource()
Gets the default drag source.
DragSourceListener[]getDragSourceListeners()
DragSourceMotionListener[]getDragSourceMotionListeners()
static intgetDragThreshold()
TODO
FlavorMapgetFlavorMap()
<T extends EventListener> T[]getListeners(Class<T> listenerType)
static booleanisDragImageSupported()
voidremoveDragSourceListener(DragSourceListener l)
voidremoveDragSourceMotionListener(DragSourceMotionListener l)
voidstartDrag(DragGestureEvent trigger, Cursor dragCursor, Image dragImage, Point imageOffset, Transferable trans, DragSourceListener dsl, FlavorMap map)
Start a drag, given the DragGestureEvent that initiated the drag.
voidstartDrag(DragGestureEvent trigger, Cursor dragCursor, Transferable trans, DragSourceListener dsl, FlavorMap map)
Start a drag, given the DragGestureEvent that initiated the drag.
voidstartDrag(DragGestureEvent trigger, Cursor dragCursor, Image dragImage, Point imageOffset, Transferable trans, DragSourceListener dsl)
Start a drag, given the DragGestureEvent that initiated the drag.
voidstartDrag(DragGestureEvent trigger, Cursor dragCursor, Transferable trans, DragSourceListener dsl)
Start a drag, given the DragGestureEvent that initiated the drag.

Field Detail

DefaultCopyDrop

public static final Cursor DefaultCopyDrop

DefaultCopyNoDrop

public static final Cursor DefaultCopyNoDrop

DefaultLinkDrop

public static final Cursor DefaultLinkDrop

DefaultLinkNoDrop

public static final Cursor DefaultLinkNoDrop

DefaultMoveDrop

public static final Cursor DefaultMoveDrop

DefaultMoveNoDrop

public static final Cursor DefaultMoveNoDrop

Constructor Detail

DragSource

public DragSource()
Initializes the drag source.

Throws: HeadlessException If GraphicsEnvironment.isHeadless() is true.

Method Detail

addDragSourceListener

public void addDragSourceListener(DragSourceListener l)

Since: 1.4

addDragSourceMotionListener

public void addDragSourceMotionListener(DragSourceMotionListener l)

Since: 1.4

createDefaultDragGestureRecognizer

public DragGestureRecognizer createDefaultDragGestureRecognizer(Component c, int actions, DragGestureListener dgl)

createDragGestureRecognizer

public <T extends DragGestureRecognizer> T createDragGestureRecognizer(Class<T> recognizer, Component c, int actions, DragGestureListener dgl)

createDragSourceContext

protected DragSourceContext createDragSourceContext(DragSourceContextPeer peer, DragGestureEvent dge, Cursor cursor, Image image, Point offset, Transferable t, DragSourceListener dsl)
Creates the DragSourceContext to handle this drag.

Throws: IllegalArgumentException NullPointerException If dscp, dgl, dragImage or t is null.

getDefaultDragSource

public static DragSource getDefaultDragSource()
Gets the default drag source.

Throws: HeadlessException If GraphicsEnvironment.isHeadless() is true.

getDragSourceListeners

public DragSourceListener[] getDragSourceListeners()

Since: 1.4

getDragSourceMotionListeners

public DragSourceMotionListener[] getDragSourceMotionListeners()

Since: 1.4

getDragThreshold

public static int getDragThreshold()
TODO

Returns: TODO

Since: 1.5

getFlavorMap

public FlavorMap getFlavorMap()

getListeners

public <T extends EventListener> T[] getListeners(Class<T> listenerType)

Since: 1.4

isDragImageSupported

public static boolean isDragImageSupported()

removeDragSourceListener

public void removeDragSourceListener(DragSourceListener l)

Since: 1.4

removeDragSourceMotionListener

public void removeDragSourceMotionListener(DragSourceMotionListener l)

Since: 1.4

startDrag

public void startDrag(DragGestureEvent trigger, Cursor dragCursor, Image dragImage, Point imageOffset, Transferable trans, DragSourceListener dsl, FlavorMap map)
Start a drag, given the DragGestureEvent that initiated the drag.

Throws: 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.

startDrag

public void startDrag(DragGestureEvent trigger, Cursor dragCursor, Transferable trans, DragSourceListener dsl, FlavorMap map)
Start a drag, given the DragGestureEvent that initiated the drag.

Throws: 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.

startDrag

public void startDrag(DragGestureEvent trigger, Cursor dragCursor, Image dragImage, Point imageOffset, Transferable trans, DragSourceListener dsl)
Start a drag, given the DragGestureEvent that initiated the drag.

Throws: 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.

startDrag

public void startDrag(DragGestureEvent trigger, Cursor dragCursor, Transferable trans, DragSourceListener dsl)
Start a drag, given the DragGestureEvent that initiated the drag.

Throws: 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.