Java Platform 1.2

java.awt.dnd
Class DropTargetDragEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--java.awt.dnd.DropTargetEvent
              |
              +--java.awt.dnd.DropTargetDragEvent

public class DropTargetDragEvent
extends DropTargetEvent

The DropTargetDragEvent is delivered to a DropTargetListener via its dragEnter() and dragOver().

Since:
JDK1.2
See Also:
Serialized Form

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)
          construct an Event
 
Method Summary
 void acceptDrag(int dragOperation)
          Accept the drag This method should be called from a DropTargetListeners dragEnter(), dragOver() and dragActionChanged() 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.
 DataFlavor[] getCurrentDataFlavors()
           
 List getCurrentDataFlavorsAsList()
           
 int getDropAction()
           
 Point getLocation()
           
 int getSourceActions()
           
 boolean isDataFlavorSupported(DataFlavor df)
           
 void rejectDrag()
          Reject 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
 

Constructor Detail

DropTargetDragEvent

public DropTargetDragEvent(DropTargetContext dtc,
                           Point cursorLocn,
                           int dropAction,
                           int srcActions)
construct an Event
Parameters:
dtc - The DropTargetContext for this operation
cursorLocn - The location of the "Drag" Cursors hotspot in Component coordinates
dropAction - The currently selected user drop action
srcActions - The current set of actions supported by the source
Method Detail

getLocation

public Point getLocation()
Returns:
the current cursor location in Component's coords.

getCurrentDataFlavors

public DataFlavor[] getCurrentDataFlavors()
Returns:
current DataFlavors from the DropTargetContext

getCurrentDataFlavorsAsList

public List getCurrentDataFlavorsAsList()
Returns:
a java.util.List of the Current DataFlavors

isDataFlavorSupported

public boolean isDataFlavorSupported(DataFlavor df)
Returns:
if a particular DataFlavor is supported

getSourceActions

public int getSourceActions()
Returns:
source actions

getDropAction

public int getDropAction()
Returns:
currently selected drop action

acceptDrag

public void acceptDrag(int dragOperation)
Accept the drag This method should be called from a DropTargetListeners dragEnter(), dragOver() and dragActionChanged() 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()
Reject the drag as a result of examining either the dropAction or the available DataFlavor types.

Java Platform 1.2

Submit a bug or feature Version 1.2 of Java Platform API Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.