java.awt.dnd
Class DropTargetDragEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--java.awt.dnd.DropTargetEvent
              |
              +--java.awt.dnd.DropTargetDragEvent
All Implemented Interfaces:
Serializable

public class DropTargetDragEvent
extends DropTargetEvent

Safe:

See Also:
Serialized Form

Field Summary
private  int actions
          The source drop actions.
private  int dropAction
          The user drop action.
private  Point location
          The location of the drag cursor's hotspot in Component coordinates.
private static long serialVersionUID
           
 
Fields inherited from class java.awt.dnd.DropTargetEvent
context
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
DropTargetDragEvent(DropTargetContext dtc, Point cursorLocn, int dropAction, int srcActions)
          Suppressed: Construct a DropTargetDragEvent given the DropTargetContext for this operation, the location of the "Drag" Cursor's hotspot in the Component's coordinates, the user drop action, and the source drop actions.
 
Method Summary
 void acceptDrag(int dragOperation)
          Enabled: Accepts the drag.
 DataFlavor[] getCurrentDataFlavors()
          Enabled: This method returns the current DataFlavors from the DropTargetContext.
 List getCurrentDataFlavorsAsList()
          Enabled: This method returns the current DataFlavors as a java.util.List
 int getDropAction()
          Enabled: This method returns the user drop action.
 Point getLocation()
          Enabled: This method returns a Point indicating the Cursor's current location within the Component's coordinates.
 int getSourceActions()
          Enabled: This method returns the source drop actions.
 boolean isDataFlavorSupported(DataFlavor df)
          Enabled: This method returns a boolean indicating if the specified DataFlavor is supported.
 void rejectDrag()
          Enabled: Rejects the drag as a result of examining either the dropAction or the available DataFlavor types.
 
Methods inherited from class java.awt.dnd.DropTargetEvent
getDropTargetContext
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID

location

private Point location
The location of the drag cursor's hotspot in Component coordinates.


actions

private int actions
The source drop actions.


dropAction

private int dropAction
The user drop action.

Constructor Detail

DropTargetDragEvent

public DropTargetDragEvent(DropTargetContext dtc,
                           Point cursorLocn,
                           int dropAction,
                           int srcActions)
Suppressed: Construct a DropTargetDragEvent given the DropTargetContext for this operation, the location of the "Drag" Cursor's hotspot in the Component's coordinates, the user drop action, and the source drop actions.

Parameters:
dtc - The DropTargetContext for this operation
cursorLocn - The location of the "Drag" Cursor's hotspot in Component coordinates
dropAction - The user drop action
srcActions - The source drop actions
Throws:
NullPointerException - if cursorLocn is null
IllegalArgumentException - if dropAction is not one of DnDConstants.
IllegalArgumentException - if srcActions is not a bitwise mask of DnDConstants.
IllegalArgumentException - if dtc is null.
Method Detail

getLocation

public Point getLocation()
Enabled: This method returns a Point indicating the Cursor's current location within the Component's coordinates.

Returns:
the current cursor location in Component's coords.

getCurrentDataFlavors

public DataFlavor[] getCurrentDataFlavors()
Enabled: This method returns the current DataFlavors from the DropTargetContext.

Returns:
current DataFlavors from the DropTargetContext

getCurrentDataFlavorsAsList

public List getCurrentDataFlavorsAsList()
Enabled: This method returns the current DataFlavors as a java.util.List

Returns:
a java.util.List of the Current DataFlavors

isDataFlavorSupported

public boolean isDataFlavorSupported(DataFlavor df)
Enabled: This method returns a boolean indicating if the specified DataFlavor is supported.

Parameters:
df - the DataFlavor to test

Returns:
if a particular DataFlavor is supported

getSourceActions

public int getSourceActions()
Enabled: This method returns the source drop actions.

Returns:
the source drop actions

getDropAction

public int getDropAction()
Enabled: This method returns the user drop action.

Returns:
the user drop action

acceptDrag

public void acceptDrag(int dragOperation)
Enabled: Accepts the drag. This method should be called from a DropTargetListeners dragEnter, dragOver, and dropActionChanged methods if the implementation wishes to accept an operation from the srcActions other than the one selected by the user as represented by the dropAction.

Parameters:
dragOperation - the operation accepted by the target

rejectDrag

public void rejectDrag()
Enabled: Rejects the drag as a result of examining either the dropAction or the available DataFlavor types.



comments?