java.awt.dnd
public class DragSource extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static Cursor |
DefaultCopyDrop |
static Cursor |
DefaultCopyNoDrop |
static Cursor |
DefaultLinkDrop |
static Cursor |
DefaultLinkNoDrop |
static Cursor |
DefaultMoveDrop |
static Cursor |
DefaultMoveNoDrop |
Constructor and Description |
---|
DragSource()
Initializes the drag source.
|
public static final Cursor DefaultCopyDrop
public static final Cursor DefaultMoveDrop
public static final Cursor DefaultLinkDrop
public static final Cursor DefaultCopyNoDrop
public static final Cursor DefaultMoveNoDrop
public static final Cursor DefaultLinkNoDrop
public DragSource()
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.public static DragSource getDefaultDragSource()
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.public static boolean isDragImageSupported()
public void startDrag(DragGestureEvent trigger, Cursor dragCursor, Image dragImage, Point imageOffset, Transferable trans, DragSourceListener dsl, 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, Cursor dragCursor, Transferable trans, DragSourceListener dsl, 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, Cursor dragCursor, Image dragImage, Point imageOffset, 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, Cursor dragCursor, 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(DragSourceContextPeer peer, DragGestureEvent dge, Cursor cursor, Image image, Point offset, Transferable t, DragSourceListener dsl)
IllegalArgumentException
NullPointerException
- If dscp, dgl, dragImage or t is null.public FlavorMap getFlavorMap()
public <T extends DragGestureRecognizer> T createDragGestureRecognizer(Class<T> recognizer, Component c, int actions, DragGestureListener dgl)
public DragGestureRecognizer createDefaultDragGestureRecognizer(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 EventListener> T[] getListeners(Class<T> listenerType)
public static int getDragThreshold() throws NotImplementedException
NotImplementedException