Package com.ardor3d.extension.ui.event
Interface DragListener
- All Known Implementing Classes:
FrameDragListener
,FrameResizeListener
public interface DragListener
Classes interested in processing drag events should implement this interface.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
drag
(int mouseX, int mouseY) Method called when the button is still held after startDrag and the mouse has moved again.void
endDrag
(UIComponent component, int mouseX, int mouseY) End our drag.boolean
isDragHandle
(UIComponent component, int mouseX, int mouseY) Ask if the given component and coordinates indicate a drag handle for the implementor.void
startDrag
(int mouseX, int mouseY) Let the implementor know that we've accepted this as our current drag target.
-
Method Details
-
isDragHandle
Ask if the given component and coordinates indicate a drag handle for the implementor. For example, a scroll bar setting up a listener might only allow dragging if the component acted on is its button.- Parameters:
component
- the UIComponent being acted upon in a suspected drag operationmouseX
- the x mouse coordinatemouseY
- the y mouse coordinate- Returns:
- true if the given parameters describe a drag handle
-
startDrag
void startDrag(int mouseX, int mouseY) Let the implementor know that we've accepted this as our current drag target. This is called by the hud if a drag action is detected and isDragHandle has returned true.- Parameters:
mouseX
- the x mouse coordinatemouseY
- the y mouse coordinate
-
drag
void drag(int mouseX, int mouseY) Method called when the button is still held after startDrag and the mouse has moved again.- Parameters:
mouseX
- the new x mouse coordinatemouseY
- the new y mouse coordinate
-
endDrag
End our drag. This is called when the button is released after initDrag.- Parameters:
component
- the UIComponent our drag ended over.mouseX
- the x mouse coordinatemouseY
- the y mouse coordinate
-