Class DragProxy
public class DragProxy implements DragHandler
{
// Constructors
public DragProxy();
public DragProxy(DragHandler handler);
public DragProxy(DragHandler handler, int xOffset, int yOffset);
// 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);
public DragHandler getHandler();
public Point getOffset();
public void setHandler(DragHandler handler);
public void setHandler(DragHandler handler, int xOffset,
int yOffset);
public void setOffset(Point offset);
public void setOffset(int xOffset, int yOffset);
}
This class provides a DragHandler implementation that forwards calls to another specified DragHandler. Optionally, x and y offsets can be set and retrieved for a DragProxy object.
public DragProxy();
Creates a new DragProxy object.
public DragProxy(DragHandler handler);
Creates a new DragProxy object that has the specified drag handler.
Parameter | Description |
handler
| The drag handler to assign to the DragProxy instance.
|
public DragProxy(DragHandler handler, int xOffset, int yOffset);
Creates a new DragProxy object that has the specified drag handler, x offset, and y offset.
Parameter | Description |
handler
| The drag handler for the DragProxy object.
|
xOffset
| The x offset for the DragProxy object.
|
yOffset
| The y offset for the DragProxy object.
|
public void dragEnter(DragSession session);
Notifies the recipient when a source object enters the space 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 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 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.
|
public DragHandler getHandler();
Retrieves the drag handler for the DragProxy object.
Return Value:
Returns the drag handler for the DragProxy object.
public Point getOffset();
Retrieves the offset for the DragProxy object.
Return Value:
Returns the Point object that represents the x offset and y offset of the DragProxy object.
public void setHandler(DragHandler handler);
Sets the drag handler for the DragProxy object.
Return Value:
No return value.
Parameter | Description |
handler
| The new handler for the DragProxy object.
|
public void setHandler(DragHandler handler, int xOffset, int yOffset);
Sets the drag handler and the x and y offsets for the DragProxy object.
Return Value:
No return value.
Parameter | Description |
handler
| The new handler for the DragProxy object.
|
xOffset
| The new x offset for the DragProxy object.
|
yoffset
| The new y offset for the DragProxy object.
|
public void setOffset(Point offset);
Sets the x offset and y offset of the DragProxy object based on a specified Point object.
Return Value:
No return value.
Parameter | Description |
offset
| The Point object that represents an x offset and y offset.
|
public void setOffset(int xOffset, int yOffset);
Sets the x offset and y offset of the DragProxy object.
Return Value:
No return value.
Parameter | Description |
xOffset
| The new value for the x offset.
|
yOffset
| The new value for the y offset.
|