This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


java.awt.dnd
class DragGestureEvent

java.lang.Object extended by java.util.EventObject extended by java.awt.dnd.DragGestureEvent
All Implemented Interfaces:
Serializable

public class DragGestureEvent
extends 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.


Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
DragGestureEvent(DragGestureRecognizer dgr, int act, Point ori, List 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

          Returns the Component associated with this DragGestureEvent.
 int

          Returns an int representing the action selected by the user.
 Point

          Returns a Point in the coordinates of the Component over which the drag originated.
 DragSource

          Returns the DragSource.
 DragGestureRecognizer

          Returns the source as a DragGestureRecognizer.
 InputEvent

          Returns the initial event that triggered the gesture.
 Iterator

          Returns an Iterator for the events comprising the gesture.
 void
startDrag(Cursor dragCursor, Image dragImage, Point imageOffset, Transferable transferable, 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(Cursor dragCursor, 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(Cursor dragCursor, Transferable transferable, DragSourceListener dsl)

          Starts the drag given the initial Cursor to display, the Transferable object, and the DragSourceListener to use.
 Object[]

          Returns an Object array of the events comprising the drag gesture.
 Object[]
toArray(Object[] array)

          Returns an array of the events comprising the drag gesture.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DragGestureEvent

public DragGestureEvent(DragGestureRecognizer dgr,
                        int act,
                        Point ori,
                        List 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

Method Detail

getComponent

public Component getComponent()
Returns the Component associated with this DragGestureEvent.

Returns:
the Component

getDragAction

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

Returns:
the action selected by the user

getDragOrigin

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

getDragSource

public DragSource getDragSource()
Returns the DragSource.

Returns:
the DragSource

getSourceAsDragGestureRecognizer

public DragGestureRecognizer getSourceAsDragGestureRecognizer()
Returns the source as a DragGestureRecognizer.

Returns:
the source as a DragGestureRecognizer

getTriggerEvent

public InputEvent getTriggerEvent()
Returns the initial event that triggered the gesture.

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

iterator

public Iterator iterator()
Returns an Iterator for the events comprising the gesture.

Returns:
an Iterator for the events comprising the gesture

startDrag

public void startDrag(Cursor dragCursor,
                      Image dragImage,
                      Point imageOffset,
                      Transferable transferable,
                      DragSourceListener dsl)
               throws 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

startDrag

public void startDrag(Cursor dragCursor,
                      Transferable transferable)
               throws 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

startDrag

public void startDrag(Cursor dragCursor,
                      Transferable transferable,
                      DragSourceListener dsl)
               throws 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

toArray

public Object[] toArray()
Returns an Object array of the events comprising the drag gesture.

Returns:
an array of the events comprising the gesture

toArray

public Object[] toArray(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


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.