DragSourceDragEvent and
DragSourceDropEvent.
DragSourceEvents are generated whenever the drag enters, moves
over, or exits a drop site, when the drop action changes, and when the drag
ends. The location for the generated DragSourceEvent specifies
the mouse cursor location in screen coordinates at the moment this event
occurred.
In a multi-screen environment without a virtual device, the cursor location is
specified in the coordinate system of the initiator
GraphicsConfiguration. The initiator
GraphicsConfiguration is the GraphicsConfiguration
of the Component on which the drag gesture for the current drag
operation was recognized. If the cursor location is outside the bounds of
the initiator GraphicsConfiguration, the reported coordinates are
clipped to fit within the bounds of that GraphicsConfiguration.
In a multi-screen environment with a virtual device, the location is specified in the corresponding virtual coordinate system. If the cursor location is outside the bounds of the virtual device the reported coordinates are clipped to fit within the bounds of the virtual device.
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | locationSpecified
The |
| private static final long | serialVersionUID
Use serialVersionUID from JDK 1.4 for interoperability.
|
| private final int | x
The horizontal coordinate for the cursor location at the moment this event occurred if the cursor location is specified for this event; otherwise zero. |
| private final int | y
The vertical coordinate for the cursor location at the moment this event occurred if the cursor location is specified for this event; otherwise zero. |
| Access | Constructor and Description |
|---|---|
| public | DragSourceEvent(DragSourceContext
the dsc)DragSourceContextConstruct a |
| public | DragSourceEvent(DragSourceContext
the dsc, int DragSourceContextthe horizontal coordinate for the cursor location x, int the vertical coordinate for the cursor location y)Construct a |
| Modifier and Type | Method and Description |
|---|---|
| public DragSourceContext | Returns: theDragSourceContext that originated the eventThis method returns the |
| public Point | Returns: thePoint indicating the cursor location
or null if the cursor location is not specifiedThis method returns a |
| public int | Returns: an integer indicating the horizontal coordinate of the cursor location or zero if the cursor location is not specifiedThis method returns the horizontal coordinate of the cursor location in screen coordinates at the moment this event occurred, or zero if the cursor location is not specified for this event. |
| public int | Returns: an integer indicating the vertical coordinate of the cursor location or zero if the cursor location is not specifiedThis method returns the vertical coordinate of the cursor location in screen coordinates at the moment this event occurred, or zero if the cursor location is not specified for this event. |
| locationSpecified | back to summary |
|---|---|
| private final boolean locationSpecified The | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. Use serialVersionUID from JDK 1.4 for interoperability. | |
| x | back to summary |
|---|---|
| private final int x The horizontal coordinate for the cursor location at the moment this event occurred if the cursor location is specified for this event; otherwise zero. | |
| y | back to summary |
|---|---|
| private final int y The vertical coordinate for the cursor location at the moment this event occurred if the cursor location is specified for this event; otherwise zero. | |
| DragSourceEvent | back to summary |
|---|---|
| public DragSourceEvent(DragSourceContext dsc) Construct a
| |
| DragSourceEvent | back to summary |
|---|---|
| public DragSourceEvent(DragSourceContext dsc, int x, int y) Construct a
| |
| getDragSourceContext | back to summary |
|---|---|
| public DragSourceContext getDragSourceContext() This method returns the
| |
| getLocation | back to summary |
|---|---|
| public Point getLocation() This method returns a
| |
| getX | back to summary |
|---|---|
| public int getX() This method returns the horizontal coordinate of the cursor location in screen coordinates at the moment this event occurred, or zero if the cursor location is not specified for this event.
| |
| getY | back to summary |
|---|---|
| public int getY() This method returns the vertical coordinate of the cursor location in screen coordinates at the moment this event occurred, or zero if the cursor location is not specified for this event.
| |