Interface MouseManager

All Known Implementing Classes:
AwtMouseManager, JoglNewtMouseManager, SwtMouseManager

public interface MouseManager
Defines the contract for managing the native mouse.
  • Method Details

    • setCursor

      void setCursor(MouseCursor cursor)
      Change the mouse cursor presently used. This is a mandatory operation that all implementing classes must support.
      Parameters:
      cursor - the cursor to use
    • setPosition

      void setPosition(int x, int y)
      Optional method for changing the mouse cursor position to the specified coordinates. A client can confirm whether or not this method is support by calling isSetPositionSupported().
      Parameters:
      x - x position within the current canvas, 0 = left
      y - y position within the current canvas, 0 = bottom
    • setGrabbed

      void setGrabbed(GrabbedState grabbedState)
      Optional method for changing the mouse to behave as if it is grabbed or not. A client can confirm whether or not this method is support by calling isSetGrabbedSupported().
      Parameters:
      grabbedState - the value determines which grabbed state is selected
    • getGrabbed

      GrabbedState getGrabbed()
      Returns:
      current grabbed state of the mouse.
    • isSetPositionSupported

      boolean isSetPositionSupported()
      Indicates to clients whether or not it is safe to call the setPosition(int, int) method. Note that if this method returns false, a runtime exception may be thrown by the setPosition(int, int) method.
      Returns:
      true if the mouse's position can be changed by this implementation, false otherwise.
    • isSetGrabbedSupported

      boolean isSetGrabbedSupported()
      Indicates to clients whether or not it is safe to call the setGrabbed(GrabbedState) method. Note that if this method returns false, a runtime exception may be thrown by the setGrabbed(GrabbedState) method.
      Returns:
      true if the mouse's grabbed state can be changed by this implementation, false otherwise.