Package jgl.wt.awt.listener
Class GLUTReflectiveCallbackListener
- java.lang.Object
 - 
- jgl.wt.awt.listener.GLUTReflectiveCallbackListener
 
 
- 
- All Implemented Interfaces:
 GLUTListener
public class GLUTReflectiveCallbackListener extends Object implements GLUTListener
Old reflection based 'Method' callback based on method name. 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected MethoddisplayMethodprotected MethodidleMethodprotected MethodkeyMethodprotected MethodkeyUpMethodprotected MethodmotionMethodprotected MethodmouseMethodprotected MethodreshapeMethodprotected MethodspecialKeyMethodprotected MethodspecialKeyUpMethod 
- 
Constructor Summary
Constructors Constructor Description GLUTReflectiveCallbackListener() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasKeyboardCallback()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)}booleanhasMouseCallback()Indicates whether the listener has usable {@link this#onMouse(Component, int, int, int, int)}voidonDisplay(Component target)Sets the display callback for the current window (occurs when window needs to be redisplayed).voidonIdle(Component target)Sets the global idle callback so that program can perform background processing tasks.voidonKeyboard(Component target, char key, int x, int y)Sets the keyboard callback for the current window.voidonKeyboardUp(Component target, char key, int x, int y)Sets the keyboard key up callback for the current window.voidonMotion(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))voidonMouse(Component target, int button, int state, int x, int y)Sets mouse callback for the current window.voidonReshape(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))voidonSpecialKey(Component target, char key, int x, int y)Sets the special keyboard key callback for the current window.voidonSpecialKeyUp(Component target, char key, int x, int y)Sets the special keyboard key up callback for the current window.voidsetDisplayMethod(Method displayMethod)voidsetIdleMethod(Method idleMethod)voidsetKeyMethod(Method keyMethod)voidsetKeyUpMethod(Method keyUpMethod)voidsetMotionMethod(Method motionMethod)voidsetMouseMethod(Method mouseMethod)voidsetReshapeMethod(Method reshapeMethod)voidsetSpecialKeyMethod(Method specialKeyMethod)voidsetSpecialKeyUpMethod(Method specialKeyUpMethod) 
 - 
 
- 
- 
Field Detail
- 
reshapeMethod
protected Method reshapeMethod
 
- 
mouseMethod
protected Method mouseMethod
 
- 
motionMethod
protected Method motionMethod
 
- 
keyMethod
protected Method keyMethod
 
- 
keyUpMethod
protected Method keyUpMethod
 
- 
specialKeyMethod
protected Method specialKeyMethod
 
- 
specialKeyUpMethod
protected Method specialKeyUpMethod
 
- 
displayMethod
protected Method displayMethod
 
- 
idleMethod
protected Method idleMethod
 
 - 
 
- 
Method Detail
- 
onMouse
public void onMouse(Component target, int button, int state, int x, int y)
Description copied from interface:GLUTListenerSets mouse callback for the current window. void glutMouseFunc (void (*func)(int button, int state, int x, int y))- Specified by:
 onMousein interfaceGLUTListener- 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
public void onMotion(Component target, int x, int y)
Description copied from interface:GLUTListenerSet 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:
 onMotionin interfaceGLUTListener- 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
public void onKeyboard(Component target, char key, int x, int y)
Description copied from interface:GLUTListenerSets the keyboard callback for the current window. void glutKeyboardFunc (void (*func)(unsigned char key, int x, int y))- Specified by:
 onKeyboardin interfaceGLUTListener- 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
public void onKeyboardUp(Component target, char key, int x, int y)
Description copied from interface:GLUTListenerSets the keyboard key up callback for the current window. void glutKeyboardUpFunc (void (*func)(unsigned char key, int x, int y))- Specified by:
 onKeyboardUpin interfaceGLUTListener- 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
public void onSpecialKey(Component target, char key, int x, int y)
Description copied from interface:GLUTListenerSets the special keyboard key callback for the current window. void glutSpecialFunc(void (*func)(int key, int x, int y))- Specified by:
 onSpecialKeyin interfaceGLUTListener- 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
public void onSpecialKeyUp(Component target, char key, int x, int y)
Description copied from interface:GLUTListenerSets the special keyboard key up callback for the current window. void glutSpecialUpFunc (void (*func)(unsigned char key, int x, int y))- Specified by:
 onSpecialKeyUpin interfaceGLUTListener- 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
public void onDisplay(Component target)
Description copied from interface:GLUTListenerSets the display callback for the current window (occurs when window needs to be redisplayed). void glutDisplayFunc (void (*func)(void))- Specified by:
 onDisplayin interfaceGLUTListener- Parameters:
 target- Rendering target component
 
- 
onReshape
public void onReshape(Component target, int width, int height)
Description copied from interface:GLUTListenerSets the reshape callback for the current window (triggered when window dimensions are changed) void glutReshapeFunc (void (*func)(int width, int height))- Specified by:
 onReshapein interfaceGLUTListener- Parameters:
 target- Rendering target componentwidth- New width of window, pxheight- New height of window, px
 
- 
onIdle
public void onIdle(Component target)
Description copied from interface:GLUTListenerSets the global idle callback so that program can perform background processing tasks. void glutIdleFunc (void (*func)(void))- Specified by:
 onIdlein interfaceGLUTListener- Parameters:
 target- Rendering target component
 
- 
hasMouseCallback
public boolean hasMouseCallback()
Description copied from interface:GLUTListenerIndicates whether the listener has usable {@link this#onMouse(Component, int, int, int, int)}- Specified by:
 hasMouseCallbackin interfaceGLUTListener
 
- 
hasKeyboardCallback
public boolean hasKeyboardCallback()
Description copied from interface:GLUTListenerIndicates 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)}- Specified by:
 hasKeyboardCallbackin interfaceGLUTListener
 
- 
setReshapeMethod
public void setReshapeMethod(Method reshapeMethod)
 
- 
setMouseMethod
public void setMouseMethod(Method mouseMethod)
 
- 
setMotionMethod
public void setMotionMethod(Method motionMethod)
 
- 
setKeyMethod
public void setKeyMethod(Method keyMethod)
 
- 
setKeyUpMethod
public void setKeyUpMethod(Method keyUpMethod)
 
- 
setSpecialKeyMethod
public void setSpecialKeyMethod(Method specialKeyMethod)
 
- 
setSpecialKeyUpMethod
public void setSpecialKeyUpMethod(Method specialKeyUpMethod)
 
- 
setDisplayMethod
public void setDisplayMethod(Method displayMethod)
 
- 
setIdleMethod
public void setIdleMethod(Method idleMethod)
 
 - 
 
 -