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 Type
    Method
    Description
    void
    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

      boolean isDragHandle(UIComponent component, int mouseX, int mouseY)
      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 operation
      mouseX - the x mouse coordinate
      mouseY - 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 coordinate
      mouseY - 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 coordinate
      mouseY - the new y mouse coordinate
    • endDrag

      void endDrag(UIComponent component, int mouseX, int mouseY)
      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 coordinate
      mouseY - the y mouse coordinate