DropTargetDropEvent is delivered
via the DropTargetListener drop() method.
The DropTargetDropEvent reports the source drop actions
and the user drop action that reflect the current state of the
drag-and-drop operation.
Source drop actions is a bitwise mask of DnDConstants
that represents the set of drop actions supported by the drag source for
this drag-and-drop operation.
User drop action depends on the drop actions supported by the drag source and the drop action selected by the user. The user can select a drop action by pressing modifier keys during the drag operation:
Ctrl + Shift -> ACTION_LINK Ctrl -> ACTION_COPY Shift -> ACTION_MOVEIf the user selects a drop action, the user drop action is one of
DnDConstants that represents the selected drop action if this
drop action is supported by the drag source or
DnDConstants.ACTION_NONE if this drop action is not supported
by the drag source.
If the user doesn't select a drop action, the set of
DnDConstants that represents the set of drop actions supported
by the drag source is searched for DnDConstants.ACTION_MOVE,
then for DnDConstants.ACTION_COPY, then for
DnDConstants.ACTION_LINK and the user drop action is the
first constant found. If no constant is found the user drop action
is DnDConstants.ACTION_NONE.
| Modifier and Type | Field and Description |
|---|---|
| private int | actions
The source drop actions. |
| private int | dropAction
The user drop action. |
| private boolean | isLocalTx
|
| private Point | location
The location of the drag cursor's hotspot in Component coordinates. |
| private static final long | serialVersionUID
Use serialVersionUID from JDK 1.4 for interoperability.
|
| private static final Point |
| Access | Constructor and Description |
|---|---|
| public | DropTargetDropEvent(DropTargetContext
The dtc, Point DropTargetContext for this operationThe location of the "Drag" Cursor's
hotspot in cursorLocn, int Component coordinatesthe user drop action. dropAction, int the source drop actions. srcActions)Construct a |
| public | DropTargetDropEvent(DropTargetContext
The DropTargetContext for this operation dtc, Point The location of the "Drag" Cursor's
hotspot in Component's coordinates cursorLocn, int the user drop action. dropAction, int the source drop actions. srcActions, boolean True if the source is in the same JVM as the target isLocal)Construct a |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | dropComplete(boolean
a success)boolean indicating that the drop transfer(s) are completed.This method notifies the |
| public DataFlavor[] | |
| public List | Returns: the currently available DataFlavors as a java.util.ListThis method returns the currently available
|
| public int | |
| public Point | Returns: the currentCursor location in Component's coords.This method returns a |
| public int | |
| public Transferable | Returns: theTransferable associated with the dropThis method returns the |
| public boolean | Returns: true if the DataFlavor specified is available
from the source, otherwise falsethe df)DataFlavor to testThis method returns a |
| public boolean | Returns: true if the Source is in the same JVM, otherwise
falseThis method returns a |
| public void |
| actions | back to summary |
|---|---|
| private int actions The source drop actions. | |
| dropAction | back to summary |
|---|---|
| private int dropAction The user drop action. | |
| isLocalTx | back to summary |
|---|---|
| private boolean isLocalTx
| |
| location | back to summary |
|---|---|
| private Point location The location of the drag cursor's hotspot in Component coordinates. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. Use serialVersionUID from JDK 1.4 for interoperability. | |
| zero | back to summary |
|---|---|
| private static final Point zero | |
| DropTargetDropEvent | back to summary |
|---|---|
| public DropTargetDropEvent(DropTargetContext dtc, Point cursorLocn, int dropAction, int srcActions) Construct a
| |
| DropTargetDropEvent | back to summary |
|---|---|
| public DropTargetDropEvent(DropTargetContext dtc, Point cursorLocn, int dropAction, int srcActions, boolean isLocal) Construct a
| |
| acceptDrop | back to summary |
|---|---|
| public void acceptDrop(int dropAction) accept the drop, using the specified action.
| |
| dropComplete | back to summary |
|---|---|
| public void dropComplete(boolean success) This method notifies the
| |
| getCurrentDataFlavors | back to summary |
|---|---|
| public DataFlavor[] getCurrentDataFlavors() This method returns the current DataFlavors.
| |
| getCurrentDataFlavorsAsList | back to summary |
|---|---|
| public List This method returns the currently available
| |
| getDropAction | back to summary |
|---|---|
| public int getDropAction() This method returns the user drop action.
| |
| getLocation | back to summary |
|---|---|
| public Point getLocation() This method returns a
| |
| getSourceActions | back to summary |
|---|---|
| public int getSourceActions() This method returns the source drop actions.
| |
| getTransferable | back to summary |
|---|---|
| public Transferable getTransferable() This method returns the
| |
| isDataFlavorSupported | back to summary |
|---|---|
| public boolean isDataFlavorSupported(DataFlavor df) This method returns a
| |
| isLocalTransfer | back to summary |
|---|---|
| public boolean isLocalTransfer() This method returns a
| |
| rejectDrop | back to summary |
|---|---|
| public void rejectDrop() reject the Drop. | |