| java.awt.dnd.DragSourceEvent java.awt.dnd.DragSourceDragEvent
DragSourceDragEvent | public class DragSourceDragEvent extends DragSourceEvent (Code) | | The 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_MOVE
If 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 .
version: 1.37, 05/05/07 since: 1.2 |
Constructor Summary | |
public | DragSourceDragEvent(DragSourceContext dsc, int dropAction, int action, int modifiers) Constructs a DragSourceDragEvent . | public | DragSourceDragEvent(DragSourceContext dsc, int dropAction, int action, int modifiers, int x, int y) Constructs a DragSourceDragEvent given the specified
DragSourceContext , user drop action, target drop action,
modifiers and coordinates.
The arguments dropAction and action should
be one of DnDConstants that represents a single action.
The argument modifiers should be either a bitwise mask
of old java.awt.event.InputEvent.*_MASK constants or a
bitwise mask of extended java.awt.event.InputEvent.*_DOWN_MASK
constants.
This constructor does not throw any exception for invalid dropAction ,
action and modifiers .
Parameters: dsc - the DragSourceContext associated with thisevent. |
Method 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. | public int | getGestureModifiers() This method returns an int representing
the current state of the input device modifiers
associated with the user's gesture. | public int | getGestureModifiersEx() This method returns an int representing
the current state of the input device extended modifiers
associated with the user's gesture. | public int | getTargetActions() This method returns the target drop action. | public int | getUserAction() This method returns the user drop action. |
DragSourceDragEvent | public DragSourceDragEvent(DragSourceContext dsc, int dropAction, int action, int modifiers)(Code) | | Constructs a DragSourceDragEvent .
This class is typically
instantiated by the DragSourceContextPeer
rather than directly
by client code.
The coordinates for this DragSourceDragEvent
are not specified, so getLocation will return
null for this event.
The arguments dropAction and action should
be one of DnDConstants that represents a single action.
The argument modifiers should be either a bitwise mask
of old java.awt.event.InputEvent.*_MASK constants or a
bitwise mask of extended java.awt.event.InputEvent.*_DOWN_MASK
constants.
This constructor does not throw any exception for invalid dropAction ,
action and modifiers .
Parameters: dsc - the DragSourceContext that is to manage notifications for this event. Parameters: dropAction - the user drop action. Parameters: action - the target drop action. Parameters: modifiers - the modifier keys down during event (shift, ctrl,alt, meta)Either extended _DOWN_MASK or old _MASK modifiersshould be used, but both models should not be mixedin one event. Use of the extended modifiers ispreferred. IllegalArgumentException if dsc is null . See Also: java.awt.event.InputEvent See Also: DragSourceEvent.getLocation |
DragSourceDragEvent | public DragSourceDragEvent(DragSourceContext dsc, int dropAction, int action, int modifiers, int x, int y)(Code) | | Constructs a DragSourceDragEvent given the specified
DragSourceContext , user drop action, target drop action,
modifiers and coordinates.
The arguments dropAction and action should
be one of DnDConstants that represents a single action.
The argument modifiers should be either a bitwise mask
of old java.awt.event.InputEvent.*_MASK constants or a
bitwise mask of extended java.awt.event.InputEvent.*_DOWN_MASK
constants.
This constructor does not throw any exception for invalid dropAction ,
action and modifiers .
Parameters: dsc - the DragSourceContext associated with thisevent. Parameters: dropAction - the user drop action. Parameters: action - the target drop action. Parameters: modifiers - the modifier keys down during event (shift, ctrl,alt, meta)Either extended _DOWN_MASK or old _MASK modifiersshould be used, but both models should not be mixedin one event. Use of the extended modifiers ispreferred. Parameters: x - the horizontal coordinate for the cursor location Parameters: y - the vertical coordinate for the cursor location IllegalArgumentException if dsc is null . See Also: java.awt.event.InputEvent since: 1.4 |
getDropAction | public int getDropAction()(Code) | | This method returns the logical intersection of
the target drop action and the set of drop actions supported by
the drag source.
the logical intersection of the target drop action andthe set of drop actions supported by the drag source. |
getGestureModifiers | public int getGestureModifiers()(Code) | | This method returns an int representing
the current state of the input device modifiers
associated with the user's gesture. Typically these
would be mouse buttons or keyboard modifiers.
If the modifiers passed to the constructor
are invalid, this method returns them unchanged.
the current state of the input device modifiers |
getGestureModifiersEx | public int getGestureModifiersEx()(Code) | | This method returns an int representing
the current state of the input device extended modifiers
associated with the user's gesture.
See
InputEvent.getModifiersEx
If the modifiers passed to the constructor
are invalid, this method returns them unchanged.
the current state of the input device extended modifiers since: 1.4 |
getTargetActions | public int getTargetActions()(Code) | | This method returns the target drop action.
the target drop action. |
getUserAction | public int getUserAction()(Code) | | This method returns the user drop action.
the user drop action. |
|
|