Class FrameDragListener

java.lang.Object
com.ardor3d.extension.ui.event.FrameDragListener
All Implemented Interfaces:
DragListener

public class FrameDragListener extends Object implements DragListener
The drag listener responsible for allowing a frame to be moved around the screen with the mouse.
  • Field Details

    • uiFrame

      protected final UIFrame uiFrame
  • Constructor Details

    • FrameDragListener

      public FrameDragListener(UIFrame uiFrame)
  • Method Details

    • startDrag

      public void startDrag(int mouseX, int mouseY)
      Description copied from interface: DragListener
      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.
      Specified by:
      startDrag in interface DragListener
      Parameters:
      mouseX - the x mouse coordinate
      mouseY - the y mouse coordinate
    • drag

      public void drag(int mouseX, int mouseY)
      Description copied from interface: DragListener
      Method called when the button is still held after startDrag and the mouse has moved again.
      Specified by:
      drag in interface DragListener
      Parameters:
      mouseX - the new x mouse coordinate
      mouseY - the new y mouse coordinate
    • smallerThanWindow

      public boolean smallerThanWindow()
      Returns:
      true if this frame can be fully contained by the hud.
    • endDrag

      public void endDrag(UIComponent component, int mouseX, int mouseY)
      Do nothing.
      Specified by:
      endDrag in interface DragListener
      Parameters:
      component - the UIComponent our drag ended over.
      mouseX - the x mouse coordinate
      mouseY - the y mouse coordinate
    • isDragHandle

      public boolean isDragHandle(UIComponent component, int mouseX, int mouseY)
      Check if we are dragging's the frames title bar label.
      Specified by:
      isDragHandle in interface DragListener
      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