java.awt.dnd
Class DragSource

java.lang.Object
  extended by java.awt.dnd.DragSource
All Implemented Interfaces:
Serializable

public class DragSource
extends Object
implements Serializable

Since:
1.2
See Also:
Serialized Form

Field Summary
static Cursor DefaultCopyDrop
           
static Cursor DefaultCopyNoDrop
           
static Cursor DefaultLinkDrop
           
static Cursor DefaultLinkNoDrop
           
static Cursor DefaultMoveDrop
           
static Cursor DefaultMoveNoDrop
           
 
Constructor Summary
DragSource()
          Initializes the drag source.
 
Method Summary
 void addDragSourceListener(DragSourceListener l)
           
 void addDragSourceMotionListener(DragSourceMotionListener l)
           
 DragGestureRecognizer createDefaultDragGestureRecognizer(Component c, int actions, DragGestureListener dgl)
           
<T extends DragGestureRecognizer>
T
createDragGestureRecognizer(Class<T> recognizer, Component c, int actions, DragGestureListener dgl)
           
protected  DragSourceContext createDragSourceContext(DragSourceContextPeer peer, DragGestureEvent dge, Cursor cursor, Image image, Point offset, 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
 FlavorMap getFlavorMap()
           
<T extends EventListener>
T[]
getListeners(Class<T> listenerType)
           
static boolean isDragImageSupported()
           
 void removeDragSourceListener(DragSourceListener l)
           
 void removeDragSourceMotionListener(DragSourceMotionListener l)
           
 void startDrag(DragGestureEvent trigger, Cursor dragCursor, Image dragImage, Point imageOffset, Transferable trans, DragSourceListener dsl)
          Start a drag, given the DragGestureEvent that initiated the drag.
 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.
 void startDrag(DragGestureEvent trigger, Cursor dragCursor, Transferable trans, DragSourceListener dsl)
          Start a drag, given the DragGestureEvent that initiated the drag.
 void startDrag(DragGestureEvent trigger, Cursor dragCursor, Transferable trans, DragSourceListener dsl, FlavorMap map)
          Start a drag, given the DragGestureEvent that initiated the drag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DefaultCopyDrop

public static final Cursor DefaultCopyDrop

DefaultMoveDrop

public static final Cursor DefaultMoveDrop

DefaultLinkDrop

public static final Cursor DefaultLinkDrop

DefaultCopyNoDrop

public static final Cursor DefaultCopyNoDrop

DefaultMoveNoDrop

public static final Cursor DefaultMoveNoDrop

DefaultLinkNoDrop

public static final Cursor DefaultLinkNoDrop
Constructor Detail

DragSource

public DragSource()
Initializes the drag source.

Throws:
HeadlessException - If GraphicsEnvironment.isHeadless() is true.
Method Detail

getDefaultDragSource

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

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

isDragImageSupported

public static boolean isDragImageSupported()

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.

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.

getFlavorMap

public FlavorMap getFlavorMap()

createDragGestureRecognizer

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

createDefaultDragGestureRecognizer

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

addDragSourceListener

public void addDragSourceListener(DragSourceListener l)
Since:
1.4

removeDragSourceListener

public void removeDragSourceListener(DragSourceListener l)
Since:
1.4

getDragSourceListeners

public DragSourceListener[] getDragSourceListeners()
Since:
1.4

addDragSourceMotionListener

public void addDragSourceMotionListener(DragSourceMotionListener l)
Since:
1.4

removeDragSourceMotionListener

public void removeDragSourceMotionListener(DragSourceMotionListener l)
Since:
1.4

getDragSourceMotionListeners

public DragSourceMotionListener[] getDragSourceMotionListeners()
Since:
1.4

getListeners

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

getDragThreshold

public static int getDragThreshold()
                            throws NotImplementedException
TODO

Returns:
TODO
Throws:
NotImplementedException
Since:
1.5