Class GLUTLambdaCallbackListener

java.lang.Object
jgl.wt.awt.listener.GLUTLambdaCallbackListener
All Implemented Interfaces:
GLUTListener

public class GLUTLambdaCallbackListener extends Object implements GLUTListener
Newer, lambda based callback listener.
  • Field Details

  • Constructor Details

    • GLUTLambdaCallbackListener

      public GLUTLambdaCallbackListener()
  • Method Details

    • onMouse

      public void onMouse(Component target, int button, int state, int x, int y)
      Description copied from interface: GLUTListener
      Sets mouse callback for the current window. void glutMouseFunc (void (*func)(int button, int state, int x, int y))
      Specified by:
      onMouse in interface GLUTListener
      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

      public void onMotion(Component target, int x, int y)
      Description copied from interface: GLUTListener
      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))
      Specified by:
      onMotion in interface GLUTListener
      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

      public void onKeyboard(Component target, char key, int x, int y)
      Description copied from interface: GLUTListener
      Sets the keyboard callback for the current window. void glutKeyboardFunc (void (*func)(unsigned char key, int x, int y))
      Specified by:
      onKeyboard in interface GLUTListener
      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

      public void onKeyboardUp(Component target, char key, int x, int y)
      Description copied from interface: GLUTListener
      Sets the keyboard key up callback for the current window. void glutKeyboardUpFunc (void (*func)(unsigned char key, int x, int y))
      Specified by:
      onKeyboardUp in interface GLUTListener
      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

      public void onSpecialKey(Component target, char key, int x, int y)
      Description copied from interface: GLUTListener
      Sets the special keyboard key callback for the current window. void glutSpecialFunc(void (*func)(int key, int x, int y))
      Specified by:
      onSpecialKey in interface GLUTListener
      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

      public void onSpecialKeyUp(Component target, char key, int x, int y)
      Description copied from interface: GLUTListener
      Sets the special keyboard key up callback for the current window. void glutSpecialUpFunc (void (*func)(unsigned char key, int x, int y))
      Specified by:
      onSpecialKeyUp in interface GLUTListener
      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

      public void onDisplay(Component target)
      Description copied from interface: GLUTListener
      Sets the display callback for the current window (occurs when window needs to be redisplayed). void glutDisplayFunc (void (*func)(void))
      Specified by:
      onDisplay in interface GLUTListener
      Parameters:
      target - Rendering target component
    • onReshape

      public void onReshape(Component target, int width, int height)
      Description copied from interface: GLUTListener
      Sets the reshape callback for the current window (triggered when window dimensions are changed) void glutReshapeFunc (void (*func)(int width, int height))
      Specified by:
      onReshape in interface GLUTListener
      Parameters:
      target - Rendering target component
      width - New width of window, px
      height - New height of window, px
    • onIdle

      public void onIdle(Component target)
      Description copied from interface: GLUTListener
      Sets the global idle callback so that program can perform background processing tasks. void glutIdleFunc (void (*func)(void))
      Specified by:
      onIdle in interface GLUTListener
      Parameters:
      target - Rendering target component
    • hasMouseCallback

      public boolean hasMouseCallback()
      Description copied from interface: GLUTListener
      Indicates whether the listener has usable
      invalid @link
      {@link this#onMouse(Component, int, int, int, int)
      }
      Specified by:
      hasMouseCallback in interface GLUTListener
    • hasKeyboardCallback

      public boolean hasKeyboardCallback()
      Description copied from interface: GLUTListener
      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)}
      Specified by:
      hasKeyboardCallback in interface GLUTListener
    • setReshapeMethod

      public void setReshapeMethod(ReshapeCallback reshapeMethod)
    • setMouseMethod

      public void setMouseMethod(MouseCallback mouseMethod)
    • setMotionMethod

      public void setMotionMethod(MotionCallback motionMethod)
    • setKeyMethod

      public void setKeyMethod(KeyboardCallback keyMethod)
    • setKeyUpMethod

      public void setKeyUpMethod(KeyboardCallback keyUpMethod)
    • setSpecialKeyMethod

      public void setSpecialKeyMethod(KeyboardCallback specialKeyMethod)
    • setSpecialKeyUpMethod

      public void setSpecialKeyUpMethod(KeyboardCallback specialKeyUpMethod)
    • setDisplayMethod

      public void setDisplayMethod(Consumer<Component> displayMethod)
    • setIdleMethod

      public void setIdleMethod(Consumer<Component> idleMethod)