java.lang.Objectjava.awt.dnd.DragSource
All Implemented Interfaces:
Serializable
DragSource is the entity responsible
for the initiation of the Drag
and Drop operation, and may be used in a number of scenarios:
Component, or application specific
object associated with a Component
instance in the GUI. [implementation dependent]
DragSource is
obtained, a DragGestureRecognizer should
also be obtained to associate the DragSource
with a particular
Component.
The initial interpretation of the user's gesture,
and the subsequent starting of the drag operation
are the responsibility of the implementing
Component, which is usually
implemented by a DragGestureRecognizer.
When a drag gesture occurs, the
DragSource's
startDrag() method shall be
invoked in order to cause processing
of the user's navigational
gestures and delivery of Drag and Drop
protocol notifications. A
DragSource shall only
permit a single Drag and Drop operation to be
current at any one time, and shall
reject any further startDrag() requests
by throwing an IllegalDnDOperationException
until such time as the extant operation is complete.
The startDrag() method invokes the
createDragSourceContext() method to
instantiate an appropriate
DragSourceContext
and associate the DragSourceContextPeer
with that.
If the Drag and Drop System is
unable to initiate a drag operation for
some reason, the startDrag() method throws
a java.awt.dnd.InvalidDnDOperationException
to signal such a condition. Typically this
exception is thrown when the underlying platform
system is either not in a state to
initiate a drag, or the parameters specified are invalid.
Note that during the drag, the
set of operations exposed by the source
at the start of the drag operation may not change
until the operation is complete.
The operation(s) are constant for the
duration of the operation with respect to the
DragSource.
1.2 - | Field Summary | ||
|---|---|---|
| public static final Cursor | DefaultCopyDrop | The default Cursor to use with a copy operation indicating
that a drop is currently allowed. null if
GraphicsEnvironment.isHeadless() returns true.
|
| public static final Cursor | DefaultMoveDrop | The default Cursor to use with a move operation indicating
that a drop is currently allowed. null if
GraphicsEnvironment.isHeadless() returns true.
|
| public static final Cursor | DefaultLinkDrop | The default Cursor to use with a link operation indicating
that a drop is currently allowed. null if
GraphicsEnvironment.isHeadless() returns true.
|
| public static final Cursor | DefaultCopyNoDrop | The default Cursor to use with a copy operation indicating
that a drop is currently not allowed. null if
GraphicsEnvironment.isHeadless() returns true.
|
| public static final Cursor | DefaultMoveNoDrop | The default Cursor to use with a move operation indicating
that a drop is currently not allowed. null if
GraphicsEnvironment.isHeadless() returns true.
|
| public static final Cursor | DefaultLinkNoDrop | The default Cursor to use with a link operation indicating
that a drop is currently not allowed. null if
GraphicsEnvironment.isHeadless() returns true.
|
| static final String | dragSourceListenerK | Internal constants for serialization. |
| static final String | dragSourceMotionListenerK | |
| Constructor: |
|---|
DragSource.
|
| Methods from java.lang.Object: |
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from java.awt.dnd.DragSource Detail: |
|---|
DragSourceListener to this
DragSource to receive drag source events during drag
operations intiated with this DragSource.
If a null listener is specified, no action is taken and no
exception is thrown. |
DragSourceMotionListener to this
DragSource to receive drag motion events during drag
operations intiated with this DragSource.
If a null listener is specified, no action is taken and no
exception is thrown. |
DragGestureRecognizer
that implements the default
abstract subclass of DragGestureRecognizer
for this DragSource,
and sets the specified Component
and DragGestureListener on the
newly created object.
For this DragSource
the default is MouseDragGestureRecognizer.
|
DragGestureRecognizer
that implements the specified
abstract subclass of
DragGestureRecognizer, and
sets the specified Component
and DragGestureListener on
the newly created object.
|
To incorporate a new
If
If |
DragSource object associated with
the underlying platform. |
DragSourceListeners
registered with this DragSource. |
DragSourceMotionListeners
registered with this DragSource. |
If the system property |
FlavorMap for this DragSource.
|
FooListeners upon this DragSource.
FooListeners are registered using the
addFooListener method. |
Image support
is available on the underlying platform.
|
dragDropEnd on the
DragSourceListeners registered with this
DragSource, and passes them the specified
DragSourceDropEvent. |
dragEnter on the
DragSourceListeners registered with this
DragSource, and passes them the specified
DragSourceDragEvent. |
dragExit on the
DragSourceListeners registered with this
DragSource, and passes them the specified
DragSourceEvent. |
dragMouseMoved on the
DragSourceMotionListeners registered with this
DragSource, and passes them the specified
DragSourceDragEvent. |
dragOver on the
DragSourceListeners registered with this
DragSource, and passes them the specified
DragSourceDragEvent. |
dropActionChanged on the
DragSourceListeners registered with this
DragSource, and passes them the specified
DragSourceDragEvent. |
DragSourceListener from this
DragSource.
If a null listener is specified, no action is taken and no
exception is thrown.
If the listener specified by the argument was not previously added to
this DragSource, no action is taken and no exception
is thrown. |
DragSourceMotionListener from this
DragSource.
If a null listener is specified, no action is taken and no
exception is thrown.
If the listener specified by the argument was not previously added to
this DragSource, no action is taken and no exception
is thrown. |
DragGestureEvent
that initiated the drag, the initial
Cursor to
use,
the Transferable subject data
of the drag, and the DragSourceListener.
|
DragGestureEvent
that initiated the drag, the initial
Cursor to use,
the Transferable subject data
of the drag, the DragSourceListener,
and the FlavorMap.
|
DragGestureEvent
that initiated the drag, the initial Cursor
to use,
the Image to drag,
the offset of the Image origin
from the hotspot of the Cursor
at the instant of the trigger,
the subject data of the drag, and
the DragSourceListener.
|
DragGestureEvent
that initiated the drag, the initial
Cursor to use,
the Image to drag,
the offset of the Image origin
from the hotspot of the Cursor at
the instant of the trigger,
the Transferable subject data
of the drag, the DragSourceListener,
and the FlavorMap.
|