DragGestureEvent
is passed
to DragGestureListener
's
dragGestureRecognized() method
when a particular DragGestureRecognizer
detects that a
platform dependent drag initiating gesture has occurred
on the Component
that it is tracking.
The action
field of any DragGestureEvent
instance should take one of the following
values:
DnDConstants.ACTION_COPY
DnDConstants.ACTION_MOVE
DnDConstants.ACTION_LINK
java.awt.dnd.DragGestureRecognizer
, java.awt.dnd.DragGestureListener
, java.awt.dnd.DragSource
, java.awt.dnd.DnDConstants
Modifier and Type | Field and Description |
---|---|
private int | action
The user's preferred action. |
private Component | component
The Component associated with this DragGestureEvent. |
private DragSource | dragSource
The DragSource associated with this DragGestureEvent. |
private transient List | |
private Point | origin
The origin of the drag. |
private static final long | serialVersionUID
Use serialVersionUID from JDK 1.4 for interoperability.
|
Access | Constructor and Description |
---|---|
public | DragGestureEvent(DragGestureRecognizer
The dgr, int DragGestureRecognizer firing this eventThe user's preferred action.
For information on allowable values, see
the class description for act, Point DragGestureEvent The origin of the drag ori, List<? extends InputEvent> The evs)List of events that comprise the gestureConstructs a |
Modifier and Type | Method and Description |
---|---|
public Component | |
public int | Returns: the action selected by the userReturns an |
public Point | Returns: the Point where the drag originated in Component coords.Returns a |
public DragSource | |
public DragGestureRecognizer | Returns: the source as aDragGestureRecognizer Returns the source as a |
public InputEvent | Returns: the first "triggering" event in the sequence of the gestureReturns the initial event that triggered the gesture. |
public Iterator | Returns: an Iterator for the events comprising the gestureReturns an |
private void | |
public void | startDrag(Cursor
The initial dragCursor, Transferable Cursor for this drag operation
or null for the default cursor handling;
see
DragSourceContext
for more details on the cursor handling mechanism
during drag and dropThe transferable)Transferable representing the source
data for this drag operation.Starts the drag operation given the |
public void | startDrag(Cursor
The initial dragCursor, Transferable Cursor for this drag operation
or null for the default cursor handling;
see
DragSourceContext
for more details on the cursor handling mechanism
during drag and dropThe source's Transferable transferable, DragSourceListener The source's DragSourceListener dsl)Starts the drag given the initial |
public void | startDrag(Cursor
The initial dragCursor, Image Cursor for this drag operation
or null for the default cursor handling;
see
DragSourceContext
for more details on the cursor handling mechanism
during drag and dropThe source's dragImage dragImage, Point The dragImage's offset imageOffset, Transferable The source's Transferable transferable, DragSourceListener The source's DragSourceListener dsl)Start the drag given the initial |
public Object[] | Returns: an array of the events comprising the gestureReturns an |
public Object[] | |
private void |
action | back to summary |
---|---|
private int action The user's preferred action. |
component | back to summary |
---|---|
private Component component The Component associated with this DragGestureEvent. |
dragSource | back to summary |
---|---|
private DragSource dragSource The DragSource associated with this DragGestureEvent. |
events | back to summary |
---|---|
private transient List<E> events
|
origin | back to summary |
---|---|
private Point origin The origin of the drag. |
serialVersionUID | back to summary |
---|---|
private static final long serialVersionUID Hides java. Use serialVersionUID from JDK 1.4 for interoperability. |
DragGestureEvent | back to summary |
---|---|
public DragGestureEvent(DragGestureRecognizer dgr, int act, Point ori, List<? extends InputEvent> evs) Constructs a
|
getComponent | back to summary |
---|---|
public Component getComponent() Returns the
|
getDragAction | back to summary |
---|---|
public int getDragAction() Returns an
|
getDragOrigin | back to summary |
---|---|
public Point getDragOrigin() Returns a
|
getDragSource | back to summary |
---|---|
public DragSource getDragSource() Returns the
|
getSourceAsDragGestureRecognizer | back to summary |
---|---|
public DragGestureRecognizer getSourceAsDragGestureRecognizer() Returns the source as a
|
getTriggerEvent | back to summary |
---|---|
public InputEvent getTriggerEvent() Returns the initial event that triggered the gesture.
|
iterator | back to summary |
---|---|
public Iterator Returns an
|
readObject | back to summary |
---|---|
private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException Deserializes this
|
startDrag | back to summary |
---|---|
public void startDrag(Cursor dragCursor, Transferable transferable) throws InvalidDnDOperationException Starts the drag operation given the
|
startDrag | back to summary |
---|---|
public void startDrag(Cursor dragCursor, Transferable transferable, DragSourceListener dsl) throws InvalidDnDOperationException Starts the drag given the initial
|
startDrag | back to summary |
---|---|
public void startDrag(Cursor dragCursor, Image dragImage, Point imageOffset, Transferable transferable, DragSourceListener dsl) throws InvalidDnDOperationException Start the drag given the initial
|
toArray | back to summary |
---|---|
public Object[] toArray() Returns an
|
toArray | back to summary |
---|---|
public Object[] toArray(Object[] array) Returns an array of the events comprising the drag gesture.
|
writeObject | back to summary |
---|---|
private void writeObject(ObjectOutputStream s) throws IOException Serializes this
|