Package jgl.wt.awt.listener
Interface GLUTListener
- All Known Implementing Classes:
GLUTLambdaCallbackListener
,GLUTNoopListener
,GLUTReflectiveCallbackListener
public interface GLUTListener
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
Indicates whether the listener has any of usableinvalid @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)
default boolean
Indicates whether the listener has usableinvalid @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
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
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
Sets mouse callback for the current window.default void
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
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
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
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
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
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
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
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
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
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 usableinvalid @link
{@link this#onMouse(Component, int, int, int, int)
-
hasKeyboardCallback
default boolean hasKeyboardCallback()Indicates whether the listener has any of usableinvalid @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)
-