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
NEWTGLWindow
Demo 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
gamma
by 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
visibility
for 5s - V: +CTRL: Rotate
swap interval
-1, 0, 1 - W:
Warp pointer
to 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 void
clearQuitAdapter()
static Display.PointerIcon[]
createPointerIcons(Display disp)
void
doQuit()
void
keyPressed(KeyEvent e)
void
keyReleased(KeyEvent e)
void
mouseClicked(MouseEvent e)
void
mouseDragged(MouseEvent e)
void
mouseEntered(MouseEvent e)
Only generated forMouseEvent.PointerType.Mouse
void
mouseExited(MouseEvent e)
Only generated forMouseEvent.PointerType.Mouse
void
mouseMoved(MouseEvent e)
void
mousePressed(MouseEvent e)
void
mouseReleased(MouseEvent e)
void
mouseWheelMoved(MouseEvent e)
Traditional event name originally produced by amouse
pointer type.void
quitAdapterEnable(boolean v)
void
setConfinedFixedCenter(boolean v)
void
setTitle()
static void
setTitle(GLWindow win)
boolean
shouldQuit()
void
windowDestroyNotify(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
- ifnull
don'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:
keyPressed
in interfaceKeyListener
-
keyReleased
public void keyReleased(KeyEvent e)
Description copied from interface:KeyListener
A key has beenreleased
, excludingauto-repeat
modifier
keys. 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:
keyReleased
in interfaceKeyListener
-
setConfinedFixedCenter
public void setConfinedFixedCenter(boolean v)
-
mouseMoved
public void mouseMoved(MouseEvent e)
- Specified by:
mouseMoved
in interfaceMouseListener
-
mouseDragged
public void mouseDragged(MouseEvent e)
- Specified by:
mouseDragged
in interfaceMouseListener
-
mouseClicked
public void mouseClicked(MouseEvent e)
- Specified by:
mouseClicked
in interfaceMouseListener
-
mouseEntered
public void mouseEntered(MouseEvent e)
Description copied from interface:MouseListener
Only generated forMouseEvent.PointerType.Mouse
- Specified by:
mouseEntered
in interfaceMouseListener
-
mouseExited
public void mouseExited(MouseEvent e)
Description copied from interface:MouseListener
Only generated forMouseEvent.PointerType.Mouse
- Specified by:
mouseExited
in interfaceMouseListener
-
mousePressed
public void mousePressed(MouseEvent e)
- Specified by:
mousePressed
in interfaceMouseListener
-
mouseReleased
public void mouseReleased(MouseEvent e)
- Specified by:
mouseReleased
in interfaceMouseListener
-
mouseWheelMoved
public void mouseWheelMoved(MouseEvent e)
Description copied from interface:MouseListener
Traditional event name originally produced by amouse
pointer type.Triggered for any rotational pointer events, see
MouseEvent.getRotation()
andMouseEvent.getRotationScale()
.- Specified by:
mouseWheelMoved
in 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:WindowListener
Window 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:
windowDestroyNotify
in interfaceWindowListener
- Overrides:
windowDestroyNotify
in classWindowAdapter
-
setTitle
public void setTitle()
-
setTitle
public static void setTitle(GLWindow win)
-
createPointerIcons
public static Display.PointerIcon[] createPointerIcons(Display disp)
-
-