Interface DragHandler
public interface DragHandler
{
// Methods
public void dragEnter(DragSession session);
public void dragLeave();
public int dragOver(DragSession session, int x, int y);
public void drop(DragSession session, int x, int y);
}
This interface defines methods that handle drag operations relative to other objects. A recipient would implement this interface to receive drops from a drag source. There are methods in this interface that notify the recipient when the object has entered, left, moved, or might have been dropped by the user.
To view an example that implements a DragHandler, see the com.ms.object.dragdrop overview.
public void dragEnter(DragSession session);
Notifies the recipient when a source object enters the space that is defined by a container, window, or object.
Return Value:
No return value.
Parameter | Description |
session
| The DragSession object that represents the current drag operation.
|
public void dragLeave();
Notifies the recipient when a source object exits the space that is defined by a container, window, or object.
Return Value:
No return value.
public int dragOver(DragSession session, int x, int y);
Notifies the recipient when a source object continues through the space that is defined by a container, window, or object.
Return Value:
Returns one or more of the following values:
Parameter | Description |
session
| The DragSession object that represents the current drag operation.
|
x
| The x coordinate of the current cursor position.
|
y
| The y coordinate of the current cursor position.
|
public void drop(DragSession session, int x, int y);
Notifies the recipient when a source object is dropped at a new location.
Return Value:
No return value.
Parameter | Description |
session
| The DragSession object that represents the current drag operation.
|
x
| The x coordinate of the current cursor position.
|
y
| The y coordinate of the current cursor position.
|