public class DropTargetContext extends Object implements Serializable
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
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.
|Modifier and Type||Class and Description|
public DropTarget getDropTarget()
This method returns the
DropTarget associated with this
DropTargetassociated with this
public Component getComponent()
This method returns the
Component associated with this
public void addNotify(java.awt.dnd.peer.DropTargetContextPeer dtcp)
Called when associated with the
public void removeNotify()
Called when disassociated with the
protected void setTargetActions(int actions)
This method sets the current actions acceptable to this
intrepresenting the supported action(s)
protected int getTargetActions()
This method returns an
int representing the current actions this
DropTarget will accept.
public void dropComplete(boolean success) throws InvalidDnDOperationException
This method signals that the drop is completed and if it was successful or not.
success- true for success, false if not
InvalidDnDOperationException- if a drop is not outstanding/extant
protected void acceptDrag(int dragOperation)
accept the Drag.
dragOperation- the supported action(s)
protected void rejectDrag()
reject the Drag.
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.
dropOperation- the supported action(s)
protected void rejectDrop()
called to signal that the drop is unacceptable. must be called during DropTargetListener.drop method invocation.
protected DataFlavor getCurrentDataFlavors()
get the available DataFlavors of the
Transferable operand of this operation.
DataFlavorcontaining the supported
DataFlavors of the
protected List<DataFlavor> getCurrentDataFlavorsAsList()
This method returns a the currently available DataFlavors of the
Transferable operand as a
protected boolean isDataFlavorSupported(DataFlavor df)
This method returns a
boolean indicating if the given
DataFlavor is supported by this
DataFlavorspecified is supported
protected Transferable getTransferable() throws InvalidDnDOperationException
get the Transferable (proxy) operand of this operation
InvalidDnDOperationException- if a drag is not outstanding/extant
protected Transferable createTransferableProxy(Transferable t, boolean local)
Creates a TransferableProxy to proxy for the specified Transferable.
Transferableto be proxied
trepresents the result of a local drag-n-drop operation.
© 1993–2017, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.