Package org.apache.pivot.wtk
Interface DragSource
-
public interface DragSourceInterface representing a drag source.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanbeginDrag(Component component, int x, int y)Called by the framework to initiate a drag operation.voidendDrag(Component component, DropAction dropAction)Called by the framework to terminate a drag operation.LocalManifestgetContent()PointgetOffset()Returns the offset of the mouse pointer within the drag visual.VisualgetRepresentation()Returns a visual representing the drag content.intgetSupportedDropActions()Returns the drop actions supported by this drag source.booleanisNative()Returns the drag source's native flag.
-
-
-
Method Detail
-
beginDrag
boolean beginDrag(Component component, int x, int y)
Called by the framework to initiate a drag operation.- Parameters:
component- The component to drag from.x- The X-position of the mouse at the beginning of the drag.y- The Y-position of the mouse.- Returns:
trueto accept the drag;falseto reject it.
-
endDrag
void endDrag(Component component, DropAction dropAction)
Called by the framework to terminate a drag operation.- Parameters:
component- The drag component.dropAction- Which operation to perform at the end of the drag.
-
isNative
boolean isNative()
Returns the drag source's native flag.- Returns:
- If
true, the drag will be executed via the native OS. Otherwise, it will be executed locally.
-
getContent
LocalManifest getContent()
- Returns:
- The drag content.
-
getRepresentation
Visual getRepresentation()
Returns a visual representing the drag content.- Returns:
- The drag visual, or
nullfor no visual.
-
getOffset
Point getOffset()
Returns the offset of the mouse pointer within the drag visual. Not required unless a representation is specified.- Returns:
- The mouse offset within the drag visual, or
nullif no visual is specified.
-
getSupportedDropActions
int getSupportedDropActions()
Returns the drop actions supported by this drag source.- Returns:
- A bitfield of the supported drop actions.
-
-