Package com.jogamp.newt.opengl.util
Class NEWTDemoListener
- java.lang.Object
-
- com.jogamp.newt.event.WindowAdapter
-
- com.jogamp.newt.opengl.util.NEWTDemoListener
-
- All Implemented Interfaces:
KeyListener,MouseListener,NEWTEventListener,WindowListener,EventListener
public class NEWTDemoListener extends WindowAdapter implements KeyListener, MouseListener
NEWTGLWindowDemo functionality- SPACE: Toggle animator
pause/resume - A: Toggle window
always on top - B: Toggle window
always on bottom - C: Toggle different
pointer icons - D: Toggle window
decoration on/off - F: Toggle window
fullscreen on/off - Three-Finger Double-Tap: Toggle window
fullscreen on/off - G: Increase
gammaby 0.1, +SHIFT decrease gamma by 0.1 - I: Toggle
pointer visbility - J: Toggle
pointer jail (confine to window) - M: Toggle
window maximized: Y, +CTRL off, +SHIFT toggle X+Y, +ALT X - P: Set window
position to 100/100 - Q: Quit
- R: Toggle window
resizable - S: Toggle window
sticky - V: Toggle window
visibilityfor 5s - V: +CTRL: Rotate
swap interval-1, 0, 1 - W:
Warp pointerto center of window - X: Toggle
[{@link ScalableSurface#IDENTITY_PIXELSCALE}, {@link ScalableSurface#AUTOMAX_PIXELSCALE}]
-
-
Constructor Summary
Constructors Constructor Description NEWTDemoListener(GLWindow glWin)Creates a new instance withcreatePointerIcons(Display)default pointer icons.NEWTDemoListener(GLWindow glWin, Display.PointerIcon[] pointerIcons)Creates a new instance with given pointer icons, which are not used ifnull.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearQuitAdapter()static Display.PointerIcon[]createPointerIcons(Display disp)voiddoQuit()voidkeyPressed(KeyEvent e)voidkeyReleased(KeyEvent e)voidmouseClicked(MouseEvent e)voidmouseDragged(MouseEvent e)voidmouseEntered(MouseEvent e)Only generated forMouseEvent.PointerType.MousevoidmouseExited(MouseEvent e)Only generated forMouseEvent.PointerType.MousevoidmouseMoved(MouseEvent e)voidmousePressed(MouseEvent e)voidmouseReleased(MouseEvent e)voidmouseWheelMoved(MouseEvent e)Traditional event name originally produced by amousepointer type.voidquitAdapterEnable(boolean v)voidsetConfinedFixedCenter(boolean v)voidsetTitle()static voidsetTitle(GLWindow win)booleanshouldQuit()voidwindowDestroyNotify(WindowEvent e)Window destruction has been requested.-
Methods inherited from class com.jogamp.newt.event.WindowAdapter
windowDestroyed, windowGainedFocus, windowLostFocus, windowMoved, windowRepaint, windowResized
-
-
-
-
Constructor Detail
-
NEWTDemoListener
public NEWTDemoListener(GLWindow glWin, Display.PointerIcon[] pointerIcons)
Creates a new instance with given pointer icons, which are not used ifnull.- Parameters:
glWin- the GLWindow instance to usepointerIcons- ifnulldon't use multiple pointer icons
-
NEWTDemoListener
public NEWTDemoListener(GLWindow glWin)
Creates a new instance withcreatePointerIcons(Display)default pointer icons.- Parameters:
glWin- the GLWindow instance to use
-
-
Method Detail
-
keyPressed
public void keyPressed(KeyEvent e)
Description copied from interface:KeyListener- Specified by:
keyPressedin interfaceKeyListener
-
keyReleased
public void keyReleased(KeyEvent e)
Description copied from interface:KeyListenerA key has beenreleased, excludingauto-repeatmodifierkeys. SeeKeyEvent.To simulated the removed
keyTyped(KeyEvent e)semantics, simply apply the following constraints upfront and bail out if not matched, i.e.:if( !e.isPrintableKey() || e.isAutoRepeat() ) { return; }- Specified by:
keyReleasedin interfaceKeyListener
-
setConfinedFixedCenter
public void setConfinedFixedCenter(boolean v)
-
mouseMoved
public void mouseMoved(MouseEvent e)
- Specified by:
mouseMovedin interfaceMouseListener
-
mouseDragged
public void mouseDragged(MouseEvent e)
- Specified by:
mouseDraggedin interfaceMouseListener
-
mouseClicked
public void mouseClicked(MouseEvent e)
- Specified by:
mouseClickedin interfaceMouseListener
-
mouseEntered
public void mouseEntered(MouseEvent e)
Description copied from interface:MouseListenerOnly generated forMouseEvent.PointerType.Mouse- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
public void mouseExited(MouseEvent e)
Description copied from interface:MouseListenerOnly generated forMouseEvent.PointerType.Mouse- Specified by:
mouseExitedin interfaceMouseListener
-
mousePressed
public void mousePressed(MouseEvent e)
- Specified by:
mousePressedin interfaceMouseListener
-
mouseReleased
public void mouseReleased(MouseEvent e)
- Specified by:
mouseReleasedin interfaceMouseListener
-
mouseWheelMoved
public void mouseWheelMoved(MouseEvent e)
Description copied from interface:MouseListenerTraditional event name originally produced by amousepointer type.Triggered for any rotational pointer events, see
MouseEvent.getRotation()andMouseEvent.getRotationScale().- Specified by:
mouseWheelMovedin interfaceMouseListener
-
quitAdapterEnable
public void quitAdapterEnable(boolean v)
-
clearQuitAdapter
public void clearQuitAdapter()
-
shouldQuit
public boolean shouldQuit()
-
doQuit
public void doQuit()
-
windowDestroyNotify
public void windowDestroyNotify(WindowEvent e)
Description copied from interface:WindowListenerWindow destruction has been requested.Depending on the
In case the window will be destroyed (see above), release of resources is recommended.default close operation, the window maybe destroyed or not.- Specified by:
windowDestroyNotifyin interfaceWindowListener- Overrides:
windowDestroyNotifyin classWindowAdapter
-
setTitle
public void setTitle()
-
setTitle
public static void setTitle(GLWindow win)
-
createPointerIcons
public static Display.PointerIcon[] createPointerIcons(Display disp)
-
-