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 DropTargetContext

java.lang.Object extended by java.awt.dnd.DropTargetContext
All Implemented Interfaces:
Serializable

Most common way to construct:

DropTargetDropEvent dtde = …;

DropTargetContext dtc = dtde.getDropTargetContext();

Based on 6 examples


public class DropTargetContext
extends Object
implements Serializable

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


Nested Class Summary
protected class

           TransferableProxy is a helper inner class that implements Transferable interface and serves as a proxy for another Transferable object which represents data transfer for a particular drag-n-drop operation.
 
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

          Called when associated with the DropTargetContextPeer.
protected Transferable

          Creates a TransferableProxy to proxy for the specified Transferable.
 void
dropComplete(boolean success)

          This method signals that the drop is completed and if it was successful or not.
 Component

          This method returns the Component associated with this DropTargetContext.
protected DataFlavor[]

          get the available DataFlavors of the Transferable operand of this operation.
protected List

          This method returns a the currently available DataFlavors of the Transferable operand as a java.util.List.
 DropTarget

          This method returns the DropTarget associated with this DropTargetContext.
protected int

          This method returns an int representing the current actions this DropTarget will accept.
protected Transferable

          get the Transferable (proxy) operand of this operation
protected boolean

          This method returns a boolean indicating if the given DataFlavor is supported by this DropTargetContext.
protected void

          reject the Drag.
protected void

          called to signal that the drop is unacceptable.
 void

          Called when disassociated with the DropTargetContextPeer.
protected void
setTargetActions(int actions)

          This method sets 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

acceptDrag

protected void acceptDrag(int dragOperation)
accept the Drag.

Parameters:
dragOperation - the supported action(s)

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.

Parameters:
dropOperation - the supported action(s)

addNotify

public void addNotify(DropTargetContextPeer dtcp)
Called when associated with the DropTargetContextPeer.

Parameters:
dtcp - the DropTargetContextPeer

createTransferableProxy

protected Transferable createTransferableProxy(Transferable t,
                                               boolean local)
Creates a TransferableProxy to proxy for the specified Transferable.

Parameters:
t - the Transferable to be proxied
local - true if t represents the result of a local drag-n-drop operation.
Returns:
the new TransferableProxy instance.

dropComplete

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

Parameters:
success - true for success, false if not

Throws:
InvalidDnDOperationException - if a drop is not outstanding/extant

getComponent

public Component getComponent()
This method returns the Component associated with this DropTargetContext.

Returns:
the Component associated with this Context

getCurrentDataFlavors

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

Returns:
a DataFlavor[] containing the supported DataFlavors of the Transferable operand.

getCurrentDataFlavorsAsList

protected List getCurrentDataFlavorsAsList()
This method returns a the currently available DataFlavors of the Transferable operand as a java.util.List.

Returns:
the currently available DataFlavors as a java.util.List

getDropTarget

public DropTarget getDropTarget()
This method returns the DropTarget associated with this DropTargetContext.

Returns:
the DropTarget associated with this DropTargetContext

getTargetActions

protected int getTargetActions()
This method returns an int representing the current actions this DropTarget will accept.

Returns:
the current actions acceptable to this DropTarget

getTransferable

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

Returns:
the Transferable
Throws:
InvalidDnDOperationException - if a drag is not outstanding/extant


isDataFlavorSupported

protected boolean isDataFlavorSupported(DataFlavor df)
This method returns a boolean indicating if the given DataFlavor is supported by this DropTargetContext.

Parameters:
df - the DataFlavor

Returns:
if the DataFlavor specified is supported

rejectDrag

protected void rejectDrag()
reject the Drag.


rejectDrop

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


removeNotify

public void removeNotify()
Called when disassociated with the DropTargetContextPeer.


setTargetActions

protected void setTargetActions(int actions)
This method sets the current actions acceptable to this DropTarget.

Parameters:
actions - an int representing the supported action(s)


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