java.awt.dnd
Class DragGestureEvent

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.util.EventObject sample code for java.util.EventObject definition code for java.util.EventObject 
      extended by java.awt.dnd.DragGestureEvent
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable

public class DragGestureEvent
extends EventObject sample code for java.util.EventObject definition code for java.util.EventObject

A 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.

See Also:
DragGestureRecognizer sample code for java.awt.dnd.DragGestureRecognizer definition code for java.awt.dnd.DragGestureRecognizer , DragGestureListener sample code for java.awt.dnd.DragGestureListener definition code for java.awt.dnd.DragGestureListener , DragSource sample code for java.awt.dnd.DragSource definition code for java.awt.dnd.DragSource , Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject sample code for java.util.EventObject definition code for java.util.EventObject
source sample code for java.util.EventObject.source definition code for java.util.EventObject.source
 
Constructor Summary
DragGestureEvent sample code for java.awt.dnd.DragGestureEvent.DragGestureEvent(java.awt.dnd.DragGestureRecognizer, int, java.awt.Point, java.util.List) definition code for java.awt.dnd.DragGestureEvent.DragGestureEvent(java.awt.dnd.DragGestureRecognizer, int, java.awt.Point, java.util.List) (DragGestureRecognizer sample code for java.awt.dnd.DragGestureRecognizer definition code for java.awt.dnd.DragGestureRecognizer  dgr, int act, Point sample code for java.awt.Point definition code for java.awt.Point  ori, List sample code for java.util.List definition code for java.util.List <? extends InputEvent sample code for java.awt.event.InputEvent definition code for java.awt.event.InputEvent > evs)
          Construct a DragGestureEvent given the DragGestureRecognizer firing this event, an int representing the user's preferred action, a Point indicating the origin of the drag, and a List of events that comprise the gesture.
 
Method Summary
 Component sample code for java.awt.Component definition code for java.awt.Component getComponent sample code for java.awt.dnd.DragGestureEvent.getComponent() definition code for java.awt.dnd.DragGestureEvent.getComponent() ()
          Returns the Component associated with this DragGestureEvent.
 int getDragAction sample code for java.awt.dnd.DragGestureEvent.getDragAction() definition code for java.awt.dnd.DragGestureEvent.getDragAction() ()
          Returns an int representing the action selected by the user.
 Point sample code for java.awt.Point definition code for java.awt.Point getDragOrigin sample code for java.awt.dnd.DragGestureEvent.getDragOrigin() definition code for java.awt.dnd.DragGestureEvent.getDragOrigin() ()
          Returns a Point in the coordinates of the Component over which the drag originated.
 DragSource sample code for java.awt.dnd.DragSource definition code for java.awt.dnd.DragSource getDragSource sample code for java.awt.dnd.DragGestureEvent.getDragSource() definition code for java.awt.dnd.DragGestureEvent.getDragSource() ()
          Returns the DragSource.
 DragGestureRecognizer sample code for java.awt.dnd.DragGestureRecognizer definition code for java.awt.dnd.DragGestureRecognizer getSourceAsDragGestureRecognizer sample code for java.awt.dnd.DragGestureEvent.getSourceAsDragGestureRecognizer() definition code for java.awt.dnd.DragGestureEvent.getSourceAsDragGestureRecognizer() ()
          Returns the source as a DragGestureRecognizer.
 InputEvent sample code for java.awt.event.InputEvent definition code for java.awt.event.InputEvent getTriggerEvent sample code for java.awt.dnd.DragGestureEvent.getTriggerEvent() definition code for java.awt.dnd.DragGestureEvent.getTriggerEvent() ()
          Returns the initial event that triggered the gesture.
 Iterator sample code for java.util.Iterator definition code for java.util.Iterator <InputEvent sample code for java.awt.event.InputEvent definition code for java.awt.event.InputEvent > iterator sample code for java.awt.dnd.DragGestureEvent.iterator() definition code for java.awt.dnd.DragGestureEvent.iterator() ()
          Returns an Iterator for the events comprising the gesture.
 void startDrag sample code for java.awt.dnd.DragGestureEvent.startDrag(java.awt.Cursor, java.awt.Image, java.awt.Point, java.awt.datatransfer.Transferable, java.awt.dnd.DragSourceListener) definition code for java.awt.dnd.DragGestureEvent.startDrag(java.awt.Cursor, java.awt.Image, java.awt.Point, java.awt.datatransfer.Transferable, java.awt.dnd.DragSourceListener) (Cursor sample code for java.awt.Cursor definition code for java.awt.Cursor  dragCursor, Image sample code for java.awt.Image definition code for java.awt.Image  dragImage, Point sample code for java.awt.Point definition code for java.awt.Point  imageOffset, Transferable sample code for java.awt.datatransfer.Transferable definition code for java.awt.datatransfer.Transferable  transferable, DragSourceListener sample code for java.awt.dnd.DragSourceListener definition code for java.awt.dnd.DragSourceListener  dsl)
          Start the drag given the initial Cursor to display, a drag Image, the offset of the Image, the Transferable object, and the DragSourceListener to use.
 void startDrag sample code for java.awt.dnd.DragGestureEvent.startDrag(java.awt.Cursor, java.awt.datatransfer.Transferable) definition code for java.awt.dnd.DragGestureEvent.startDrag(java.awt.Cursor, java.awt.datatransfer.Transferable) (Cursor sample code for java.awt.Cursor definition code for java.awt.Cursor  dragCursor, Transferable sample code for java.awt.datatransfer.Transferable definition code for java.awt.datatransfer.Transferable  transferable)
          Starts the drag operation given the Cursor for this drag operation and the Transferable representing the source data for this drag operation.
 void startDrag sample code for java.awt.dnd.DragGestureEvent.startDrag(java.awt.Cursor, java.awt.datatransfer.Transferable, java.awt.dnd.DragSourceListener) definition code for java.awt.dnd.DragGestureEvent.startDrag(java.awt.Cursor, java.awt.datatransfer.Transferable, java.awt.dnd.DragSourceListener) (Cursor sample code for java.awt.Cursor definition code for java.awt.Cursor  dragCursor, Transferable sample code for java.awt.datatransfer.Transferable definition code for java.awt.datatransfer.Transferable  transferable, DragSourceListener sample code for java.awt.dnd.DragSourceListener definition code for java.awt.dnd.DragSourceListener  dsl)
          Starts the drag given the initial Cursor to display, the Transferable object, and the DragSourceListener to use.
 Object sample code for java.lang.Object definition code for java.lang.Object [] toArray sample code for java.awt.dnd.DragGestureEvent.toArray() definition code for java.awt.dnd.DragGestureEvent.toArray() ()
          Returns an Object array of the events comprising the drag gesture.
 Object sample code for java.lang.Object definition code for java.lang.Object [] toArray sample code for java.awt.dnd.DragGestureEvent.toArray(java.lang.Object[]) definition code for java.awt.dnd.DragGestureEvent.toArray(java.lang.Object[]) (Object sample code for java.lang.Object definition code for java.lang.Object [] array)
          Returns an array of the events comprising the drag gesture.
 
Methods inherited from class java.util.EventObject sample code for java.util.EventObject definition code for java.util.EventObject
getSource sample code for java.util.EventObject.getSource() definition code for java.util.EventObject.getSource() , toString sample code for java.util.EventObject.toString() definition code for java.util.EventObject.toString()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

DragGestureEvent sample code for java.awt.dnd.DragGestureEvent(java.awt.dnd.DragGestureRecognizer, int, java.awt.Point, java.util.List<? extends java.awt.event.InputEvent>) definition code for java.awt.dnd.DragGestureEvent(java.awt.dnd.DragGestureRecognizer, int, java.awt.Point, java.util.List<? extends java.awt.event.InputEvent>)

public DragGestureEvent(DragGestureRecognizer sample code for java.awt.dnd.DragGestureRecognizer definition code for java.awt.dnd.DragGestureRecognizer  dgr,
                        int act,
                        Point sample code for java.awt.Point definition code for java.awt.Point  ori,
                        List sample code for java.util.List definition code for java.util.List <? extends InputEvent sample code for java.awt.event.InputEvent definition code for java.awt.event.InputEvent > evs)
Construct a DragGestureEvent given the DragGestureRecognizer firing this event, an int representing the user's preferred action, a Point indicating the origin of the drag, and a List of events that comprise the gesture.

Parameters:
dgr - The DragGestureRecognizer firing this event
act - The the user's preferred action
ori - The origin of the drag
evs - The List of events that comprise the gesture

Throws:
IllegalArgumentException - if input parameters are null
Method Detail

getSourceAsDragGestureRecognizer sample code for java.awt.dnd.DragGestureEvent.getSourceAsDragGestureRecognizer() definition code for java.awt.dnd.DragGestureEvent.getSourceAsDragGestureRecognizer()

public DragGestureRecognizer sample code for java.awt.dnd.DragGestureRecognizer definition code for java.awt.dnd.DragGestureRecognizer  getSourceAsDragGestureRecognizer()
Returns the source as a DragGestureRecognizer.

Returns:
the source as a DragGestureRecognizer

getComponent sample code for java.awt.dnd.DragGestureEvent.getComponent() definition code for java.awt.dnd.DragGestureEvent.getComponent()

public Component sample code for java.awt.Component definition code for java.awt.Component  getComponent()
Returns the Component associated with this DragGestureEvent.

Returns:
the Component

getDragSource sample code for java.awt.dnd.DragGestureEvent.getDragSource() definition code for java.awt.dnd.DragGestureEvent.getDragSource()

public DragSource sample code for java.awt.dnd.DragSource definition code for java.awt.dnd.DragSource  getDragSource()
Returns the DragSource.

Returns:
the DragSource

getDragOrigin sample code for java.awt.dnd.DragGestureEvent.getDragOrigin() definition code for java.awt.dnd.DragGestureEvent.getDragOrigin()

public Point sample code for java.awt.Point definition code for java.awt.Point  getDragOrigin()
Returns a Point in the coordinates of the Component over which the drag originated.

Returns:
the Point where the drag originated in Component coords.

iterator sample code for java.awt.dnd.DragGestureEvent.iterator() definition code for java.awt.dnd.DragGestureEvent.iterator()

public Iterator sample code for java.util.Iterator definition code for java.util.Iterator <InputEvent sample code for java.awt.event.InputEvent definition code for java.awt.event.InputEvent > iterator()
Returns an Iterator for the events comprising the gesture.

Returns:
an Iterator for the events comprising the gesture

toArray sample code for java.awt.dnd.DragGestureEvent.toArray() definition code for java.awt.dnd.DragGestureEvent.toArray()

public Object sample code for java.lang.Object definition code for java.lang.Object [] toArray()
Returns an Object array of the events comprising the drag gesture.

Returns:
an array of the events comprising the gesture

toArray sample code for java.awt.dnd.DragGestureEvent.toArray(java.lang.Object[]) definition code for java.awt.dnd.DragGestureEvent.toArray(java.lang.Object[])

public Object sample code for java.lang.Object definition code for java.lang.Object [] toArray(Object sample code for java.lang.Object definition code for java.lang.Object [] array)
Returns an array of the events comprising the drag gesture.

Parameters:
array - the array of EventObject sub(types)

Returns:
an array of the events comprising the gesture

getDragAction sample code for java.awt.dnd.DragGestureEvent.getDragAction() definition code for java.awt.dnd.DragGestureEvent.getDragAction()

public int getDragAction()
Returns an int representing the action selected by the user.

Returns:
the action selected by the user

getTriggerEvent sample code for java.awt.dnd.DragGestureEvent.getTriggerEvent() definition code for java.awt.dnd.DragGestureEvent.getTriggerEvent()

public InputEvent sample code for java.awt.event.InputEvent definition code for java.awt.event.InputEvent  getTriggerEvent()
Returns the initial event that triggered the gesture.

Returns:
the first "triggering" event in the sequence of the gesture

startDrag sample code for java.awt.dnd.DragGestureEvent.startDrag(java.awt.Cursor, java.awt.datatransfer.Transferable) definition code for java.awt.dnd.DragGestureEvent.startDrag(java.awt.Cursor, java.awt.datatransfer.Transferable)

public void startDrag(Cursor sample code for java.awt.Cursor definition code for java.awt.Cursor  dragCursor,
                      Transferable sample code for java.awt.datatransfer.Transferable definition code for java.awt.datatransfer.Transferable  transferable)
               throws InvalidDnDOperationException sample code for java.awt.dnd.InvalidDnDOperationException definition code for java.awt.dnd.InvalidDnDOperationException 
Starts the drag operation given the Cursor for this drag operation and the Transferable representing the source data for this drag operation.
If a null Cursor is specified no exception will be thrown and default drag cursors will be used instead.
If a null Transferable is specified NullPointerException will be thrown.

Parameters:
dragCursor - The Cursor for this drag operation
transferable - The Transferable representing the source data for this drag operation.
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.
NullPointerException - if the Transferable is null.
InvalidDnDOperationException sample code for java.awt.dnd.InvalidDnDOperationException definition code for java.awt.dnd.InvalidDnDOperationException
Since:
1.4

startDrag sample code for java.awt.dnd.DragGestureEvent.startDrag(java.awt.Cursor, java.awt.datatransfer.Transferable, java.awt.dnd.DragSourceListener) definition code for java.awt.dnd.DragGestureEvent.startDrag(java.awt.Cursor, java.awt.datatransfer.Transferable, java.awt.dnd.DragSourceListener)

public void startDrag(Cursor sample code for java.awt.Cursor definition code for java.awt.Cursor  dragCursor,
                      Transferable sample code for java.awt.datatransfer.Transferable definition code for java.awt.datatransfer.Transferable  transferable,
                      DragSourceListener sample code for java.awt.dnd.DragSourceListener definition code for java.awt.dnd.DragSourceListener  dsl)
               throws InvalidDnDOperationException sample code for java.awt.dnd.InvalidDnDOperationException definition code for java.awt.dnd.InvalidDnDOperationException 
Starts the drag given the initial Cursor to display, the Transferable object, and the DragSourceListener to use.

Parameters:
dragCursor - The initial drag Cursor
transferable - The source's Transferable
dsl - The source's DragSourceListener

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.
InvalidDnDOperationException sample code for java.awt.dnd.InvalidDnDOperationException definition code for java.awt.dnd.InvalidDnDOperationException

startDrag sample code for java.awt.dnd.DragGestureEvent.startDrag(java.awt.Cursor, java.awt.Image, java.awt.Point, java.awt.datatransfer.Transferable, java.awt.dnd.DragSourceListener) definition code for java.awt.dnd.DragGestureEvent.startDrag(java.awt.Cursor, java.awt.Image, java.awt.Point, java.awt.datatransfer.Transferable, java.awt.dnd.DragSourceListener)

public void startDrag(Cursor sample code for java.awt.Cursor definition code for java.awt.Cursor  dragCursor,
                      Image sample code for java.awt.Image definition code for java.awt.Image  dragImage,
                      Point sample code for java.awt.Point definition code for java.awt.Point  imageOffset,
                      Transferable sample code for java.awt.datatransfer.Transferable definition code for java.awt.datatransfer.Transferable  transferable,
                      DragSourceListener sample code for java.awt.dnd.DragSourceListener definition code for java.awt.dnd.DragSourceListener  dsl)
               throws InvalidDnDOperationException sample code for java.awt.dnd.InvalidDnDOperationException definition code for java.awt.dnd.InvalidDnDOperationException 
Start the drag given the initial Cursor to display, a drag Image, the offset of the Image, the Transferable object, and the DragSourceListener to use.

Parameters:
dragCursor - The initial drag Cursor
dragImage - The source's dragImage
imageOffset - The dragImage's offset
transferable - The source's Transferable
dsl - The source's DragSourceListener

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.
InvalidDnDOperationException sample code for java.awt.dnd.InvalidDnDOperationException definition code for java.awt.dnd.InvalidDnDOperationException