Interface GLUTListener

All Known Implementing Classes:
GLUTLambdaCallbackListener, GLUTNoopListener, GLUTReflectiveCallbackListener

public interface GLUTListener
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Indicates whether the listener has any of usable
    invalid @link
    {@link this#onKeyboard(Component, char, int, int)
    }
    invalid @link
    {@link this#onSpecialKey(Component, char, int, int)
    }
    invalid @link
    {@link this#onSpecialKeyUp(Component, char, int, int)
    } (Component, char, int, int)}
    default boolean
    Indicates whether the listener has usable
    invalid @link
    {@link this#onMouse(Component, int, int, int, int)
    }
    default void
    Sets the display callback for the current window (occurs when window needs to be redisplayed).
    default void
    onIdle(Component target)
    Sets the global idle callback so that program can perform background processing tasks.
    default void
    onKeyboard(Component target, char key, int x, int y)
    Sets the keyboard callback for the current window.
    default void
    onKeyboardUp(Component target, char key, int x, int y)
    Sets the keyboard key up callback for the current window.
    default void
    onMotion(Component target, int x, int y)
    Set the motion callback for the current window (mouse movement within window while one or more mouse buttons are pressed) void glutMotionFunc (void (*func)(int x, int y))
    default void
    onMouse(Component target, int button, int state, int x, int y)
    Sets mouse callback for the current window.
    default void
    onReshape(Component target, int width, int height)
    Sets the reshape callback for the current window (triggered when window dimensions are changed) void glutReshapeFunc (void (*func)(int width, int height))
    default void
    onSpecialKey(Component target, char key, int x, int y)
    Sets the special keyboard key callback for the current window.
    default void
    onSpecialKeyUp(Component target, char key, int x, int y)
    Sets the special keyboard key up callback for the current window.
  • Method Details

    • onMouse

      default void onMouse(Component target, int button, int state, int x, int y)
      Sets mouse callback for the current window. void glutMouseFunc (void (*func)(int button, int state, int x, int y))
      Parameters:
      target - Rendering target component
      button - Mouse button identifier (GLUT_LEFT_BUTTON, etc.)
      state - GLUT_UP or GLUT_DOWN indicating mouse button state cause
      x - Window relative coordinate x of mouse when event has occurred
      y - Window relative coordinate y of mouse when event has occurred
    • onMotion

      default void onMotion(Component target, int x, int y)
      Set the motion callback for the current window (mouse movement within window while one or more mouse buttons are pressed) void glutMotionFunc (void (*func)(int x, int y))
      Parameters:
      target - Rendering target component
      x - Window relative coordinate x of mouse when event has occurred
      y - Window relative coordinate y of mouse when event has occurred
    • onKeyboard

      default void onKeyboard(Component target, char key, int x, int y)
      Sets the keyboard callback for the current window. void glutKeyboardFunc (void (*func)(unsigned char key, int x, int y))
      Parameters:
      target - Rendering target component
      key - Generated ASCII character (i.e. 'a' or 'A' depending on SHIFT key)
      x - Window relative coordinate x of mouse when event has occurred
      y - Window relative coordinate y of mouse when event has occurred
    • onKeyboardUp

      default void onKeyboardUp(Component target, char key, int x, int y)
      Sets the keyboard key up callback for the current window. void glutKeyboardUpFunc (void (*func)(unsigned char key, int x, int y))
      Parameters:
      target - Rendering target component
      key - Generated ASCII character (i.e. 'a' or 'A' depending on SHIFT key)
      x - Window relative coordinate x of mouse when event has occurred
      y - Window relative coordinate y of mouse when event has occurred
    • onSpecialKey

      default void onSpecialKey(Component target, char key, int x, int y)
      Sets the special keyboard key callback for the current window. void glutSpecialFunc(void (*func)(int key, int x, int y))
      Parameters:
      target - Rendering target component
      key - Special key code as char - i.e. GLUT_KEY_PAGE_UP
      x - Window relative coordinate x of mouse when event has occurred
      y - Window relative coordinate y of mouse when event has occurred
    • onSpecialKeyUp

      default void onSpecialKeyUp(Component target, char key, int x, int y)
      Sets the special keyboard key up callback for the current window. void glutSpecialUpFunc (void (*func)(unsigned char key, int x, int y))
      Parameters:
      target - Rendering target component
      key - Special key code as char - i.e. GLUT_KEY_PAGE_UP
      x - Window relative coordinate x of mouse when event has occurred
      y - Window relative coordinate y of mouse when event has occurred
    • onDisplay

      default void onDisplay(Component target)
      Sets the display callback for the current window (occurs when window needs to be redisplayed). void glutDisplayFunc (void (*func)(void))
      Parameters:
      target - Rendering target component
    • onReshape

      default void onReshape(Component target, int width, int height)
      Sets the reshape callback for the current window (triggered when window dimensions are changed) void glutReshapeFunc (void (*func)(int width, int height))
      Parameters:
      target - Rendering target component
      width - New width of window, px
      height - New height of window, px
    • onIdle

      default void onIdle(Component target)
      Sets the global idle callback so that program can perform background processing tasks. void glutIdleFunc (void (*func)(void))
      Parameters:
      target - Rendering target component
    • hasMouseCallback

      default boolean hasMouseCallback()
      Indicates whether the listener has usable
      invalid @link
      {@link this#onMouse(Component, int, int, int, int)
      }
    • hasKeyboardCallback

      default boolean hasKeyboardCallback()
      Indicates whether the listener has any of usable
      invalid @link
      {@link this#onKeyboard(Component, char, int, int)
      }
      invalid @link
      {@link this#onSpecialKey(Component, char, int, int)
      }
      invalid @link
      {@link this#onSpecialKeyUp(Component, char, int, int)
      } (Component, char, int, int)}