DragSourceDragEvent is
delivered from the DragSourceContextPeer,
via the DragSourceContext, to the DragSourceListener
registered with that DragSourceContext and with its associated
DragSource.
The DragSourceDragEvent reports the target drop action
and the user drop action that reflect the current state of
the drag operation.
Target drop action is one of DnDConstants that represents
the drop action selected by the current drop target 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.
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 | dropAction
The user drop action. |
| private int | gestureModifiers
The state of the input device modifiers associated with the user gesture. |
| private boolean | invalidModifiers
Indicates whether the |
| private static final int | |
| private static final int | |
| private static final long | serialVersionUID
Use serialVersionUID from JDK 1.4 for interoperability.
|
| private int | targetActions
The target drop action. |
| Access | Constructor and Description |
|---|---|
| public | DragSourceDragEvent(DragSourceContext
the dsc, int DragSourceContext that is to manage
notifications for this event.the user drop action. dropAction, int the target drop action. action, int the modifier keys down during event (shift, ctrl,
alt, meta)
Either extended _DOWN_MASK or old _MASK modifiers
should be used, but both models should not be mixed
in one event. Use of the extended modifiers is
preferred. modifiers)Constructs a |
| public | DragSourceDragEvent(DragSourceContext
the dsc, int DragSourceContext associated with this
event.the user drop action. dropAction, int the target drop action. action, int the modifier keys down during event (shift, ctrl,
alt, meta)
Either extended _DOWN_MASK or old _MASK modifiers
should be used, but both models should not be mixed
in one event. Use of the extended modifiers is
preferred. modifiers, int the horizontal coordinate for the cursor location x, int the vertical coordinate for the cursor location y)Constructs a |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: the logical intersection of the target drop action and the set of drop actions supported by the drag source.This method returns the logical intersection of the target drop action and the set of drop actions supported by the drag source. |
| public int | Returns: the current state of the input device modifiersThis method returns an |
| public int | Returns: the current state of the input device extended modifiersThis method returns an |
| public int | |
| public int | |
| private void | |
| private void |
| dropAction | back to summary |
|---|---|
| private int dropAction The user drop action. | |
| gestureModifiers | back to summary |
|---|---|
| private int gestureModifiers The state of the input device modifiers associated with the user gesture. | |
| invalidModifiers | back to summary |
|---|---|
| private boolean invalidModifiers Indicates whether the | |
| JDK_1_3_MODIFIERS | back to summary |
|---|---|
| private static final int JDK_1_3_MODIFIERS | |
| JDK_1_4_MODIFIERS | back to summary |
|---|---|
| private static final int JDK_1_4_MODIFIERS | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. Use serialVersionUID from JDK 1.4 for interoperability. | |
| targetActions | back to summary |
|---|---|
| private int targetActions The target drop action. | |
| DragSourceDragEvent | back to summary |
|---|---|
| public DragSourceDragEvent(DragSourceContext dsc, int dropAction, int action, int modifiers) Constructs a
The arguments
| |
| DragSourceDragEvent | back to summary |
|---|---|
| public DragSourceDragEvent(DragSourceContext dsc, int dropAction, int action, int modifiers, int x, int y) Constructs a
The arguments
| |
| getDropAction | back to summary |
|---|---|
| public int getDropAction() This method returns the logical intersection of the target drop action and the set of drop actions supported by the drag source.
| |
| getGestureModifiers | back to summary |
|---|---|
| public int getGestureModifiers() This method returns an
If the
| |
| getGestureModifiersEx | back to summary |
|---|---|
| public int getGestureModifiersEx() This method returns an
If the
| |
| getTargetActions | back to summary |
|---|---|
| public int getTargetActions() This method returns the target drop action.
| |
| getUserAction | back to summary |
|---|---|
| public int getUserAction() This method returns the user drop action.
| |
| setNewModifiers | back to summary |
|---|---|
| private void setNewModifiers() Sets new modifiers by the old ones. The mouse modifiers have higher priority than overlaying key modifiers.
| |
| setOldModifiers | back to summary |
|---|---|
| private void setOldModifiers() Sets old modifiers by the new ones.
| |