Package jgl.wt.awt.listener
Interface GLUTListener
-
- All Known Implementing Classes:
GLUTLambdaCallbackListener
,GLUTNoopListener
,GLUTReflectiveCallbackListener
public interface GLUTListener
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default boolean
hasKeyboardCallback()
Indicates whether the listener has any of usable {@link this#onKeyboard(Component, char, int, int)} {@link this#onSpecialKey(Component, char, int, int)} {@link this#onSpecialKeyUp(Component, char, int, int)} (Component, char, int, int)}default boolean
hasMouseCallback()
Indicates whether the listener has usable {@link this#onMouse(Component, int, int, int, int)}default void
onDisplay(Component target)
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 Detail
-
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 componentbutton
- Mouse button identifier (GLUT_LEFT_BUTTON, etc.)state
- GLUT_UP or GLUT_DOWN indicating mouse button state causex
- Window relative coordinate x of mouse when event has occurredy
- 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 componentx
- Window relative coordinate x of mouse when event has occurredy
- 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 componentkey
- Generated ASCII character (i.e. 'a' or 'A' depending on SHIFT key)x
- Window relative coordinate x of mouse when event has occurredy
- 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 componentkey
- Generated ASCII character (i.e. 'a' or 'A' depending on SHIFT key)x
- Window relative coordinate x of mouse when event has occurredy
- 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 componentkey
- Special key code as char - i.e. GLUT_KEY_PAGE_UPx
- Window relative coordinate x of mouse when event has occurredy
- 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 componentkey
- Special key code as char - i.e. GLUT_KEY_PAGE_UPx
- Window relative coordinate x of mouse when event has occurredy
- 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 componentwidth
- New width of window, pxheight
- 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 {@link this#onMouse(Component, int, int, int, int)}
-
hasKeyboardCallback
default boolean hasKeyboardCallback()
Indicates whether the listener has any of usable {@link this#onKeyboard(Component, char, int, int)} {@link this#onSpecialKey(Component, char, int, int)} {@link this#onSpecialKeyUp(Component, char, int, int)} (Component, char, int, int)}
-
-