Java Platform 1.2

java.awt.dnd
Class DropTargetContext

java.lang.Object
  |
  +--java.awt.dnd.DropTargetContext

public class DropTargetContext
extends Object

A DropTargetContext is created whenever the logical cursor associated with a Drag and Drop operation coincides with the visibel geometry of a Component, with an associated DropTarget. The DropTargetContext provides the mechanism for a potential receiver of a Drop operation to both provide the end userr with the appropriate drag under feedback, but also to effect the subsequent data transfer if appropriate.

Since:
JDK1.2

Inner Class Summary
protected  class DropTargetContext.TransferableProxy
           
 
Method Summary
protected  void acceptDrag(int dragOperation)
          accept the Drag
protected  void acceptDrop(int dropOperation)
          called to signal that the drop is acceptable using the specified operation.
 void addNotify(java.awt.dnd.peer.DropTargetContextPeer dtcp)
          called when associated with the DropTargetContextPeer
protected  Transferable createTransferableProxy(Transferable t, boolean local)
          subclasses may override this to supply their own Proxy Transferable
 void dropComplete(boolean success)
          signal that the drop is completed and if it was successful or not
 Component getComponent()
           
protected  DataFlavor[] getCurrentDataFlavors()
          get the available DataFlavors of the Transferable operand of this operation
protected  List getCurrentDataFlavorsAsList()
           
 DropTarget getDropTarget()
           
protected  int getTargetActions()
           
protected  Transferable getTransferable()
          get the Transferable (proxy) operand of this operation
protected  boolean isDataFlavorSupported(DataFlavor df)
           
protected  void rejectDrag()
          reject the Drag
protected  void rejectDrop()
          called to signal that the drop is unacceptable.
 void removeNotify()
          called when disassociated with the DropTargetContextPeer
protected  void setTargetActions(int actions)
          set the current actions acceptable to this DropTarget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDropTarget

public DropTarget getDropTarget()
Returns:
the DropTarget associated with this Context

getComponent

public Component getComponent()
Returns:
the Component associated with this Context

addNotify

public void addNotify(java.awt.dnd.peer.DropTargetContextPeer dtcp)
called when associated with the DropTargetContextPeer

removeNotify

public void removeNotify()
called when disassociated with the DropTargetContextPeer

setTargetActions

protected void setTargetActions(int actions)
set the current actions acceptable to this DropTarget

getTargetActions

protected int getTargetActions()
Returns:
the current actions acceptable to this DropTarget

dropComplete

public void dropComplete(boolean success)
                  throws InvalidDnDOperationException
signal that the drop is completed and if it was successful or not

acceptDrag

protected void acceptDrag(int dragOperation)
accept the Drag

rejectDrag

protected void rejectDrag()
reject the Drag

acceptDrop

protected void acceptDrop(int dropOperation)
called to signal that the drop is acceptable using the specified operation. must be called during DropTargetListener.drop method invocation.

rejectDrop

protected void rejectDrop()
called to signal that the drop is unacceptable. must be called during DropTargetListener.drop method invocation.

getCurrentDataFlavors

protected DataFlavor[] getCurrentDataFlavors()
get the available DataFlavors of the Transferable operand of this operation

getCurrentDataFlavorsAsList

protected List getCurrentDataFlavorsAsList()
Returns:
the currently available DataFlavors as a java.util.List

isDataFlavorSupported

protected boolean isDataFlavorSupported(DataFlavor df)
Returns:
if the DataFlavor specified is supported by the source

getTransferable

protected Transferable getTransferable()
                                throws InvalidDnDOperationException
get the Transferable (proxy) operand of this operation

createTransferableProxy

protected Transferable createTransferableProxy(Transferable t,
                                               boolean local)
subclasses may override this to supply their own Proxy Transferable

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.