GLAutoDrawable and Window interface,
using a delegated Window instance, which may be an aggregation (lifecycle: created and destroyed).
This implementation supports GL state preservation,
hence isGLStatePreservationSupported() returns true.
This implementation does not make the OpenGL context current
before calling the various input EventListener callbacks, ie MouseListener etc.
This design decision is made in favor of a more performant and simplified
implementation. Also the event dispatcher shall be implemented OpenGL agnostic.
To be able to use OpenGL commands from within such input NEWTEventListener,
you can inject GLRunnable objects
via invoke(boolean, GLRunnable) to the OpenGL command stream.
OpenGL Context Sharing
To share a GLContext see the following note in the documentation overview:
context sharing
as well as GLSharedContextSetter.
| Modifier and Type | Class and Description |
|---|---|
| protected class |
| Modifier and Type | Field and Description |
|---|---|
| private GLDrawableFactory | |
| private final WindowImpl |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public final boolean | |
| public final void | addGestureHandler(final GestureHandler gh)
Implements com. GestureHandler to the end of the list.
|
| public final void | addGestureHandler(final int
Position where the listener will be inserted.
Should be within (0 <= index && index <= size()).
An index value of -1 is interpreted as the end of the list, size(). index, final GestureHandler The listener object to be inserted gh)Implements com. GestureHandler at the
specified position in the list.
|
| public final void | addGestureListener(final GestureHandler.
Implements com. GestureHandler. to the end of the list.
|
| public final void | addGestureListener(final int
Position where the listener will be inserted.
Should be within (0 <= index && index <= size()).
An index value of -1 is interpreted as the end of the list, size(). index, final GestureHandler.The listener object to be inserted glImplements com. GestureHandler. at the
specified position in the list.
|
| public final void | addKeyListener(final KeyListener l)
Implements com. com. to the end of
the list.
|
| public final void | addKeyListener(final int
Position where the listener will be inserted.
Should be within (0 <= index && index <= size()).
An index value of -1 is interpreted as the end of the list, size(). index, final KeyListener The listener object to be inserted l)Implements com. com. at the
specified position in the list.
|
| public final void | addMouseListener(final MouseListener l)
Implements com. MouseListener to the end of the list.
|
| public final void | addMouseListener(final int
Position where the listener will be inserted.
Should be within (0 <= index && index <= size()).
An index value of -1 is interpreted as the end of the list, size(). index, final MouseListener The listener object to be inserted l)Implements com. MouseListener at the
specified position in the list.
|
| public final void | addSurfaceUpdatedListener(final SurfaceUpdatedListener l)
Implements com. SurfaceUpdatedListener to the end of the list.
|
| public final void | addSurfaceUpdatedListener(final int
Position where the listener will be inserted.
Should be within (0 <= index && index <= size()).
An index value of -1 is interpreted as the end of the list, size(). index, final SurfaceUpdatedListener The listener object to be inserted l)Implements com. SurfaceUpdatedListener at the
specified position in the list.
|
| public final void | addWindowListener(final WindowListener l)
Implements com. com. to the end of
the list.
|
| public final void | addWindowListener(final int
Position where the listener will be inserted.
Should be within (0 <= index && index <= size()).
An index value of -1 is interpreted as the end of the list, size(). index, final WindowListener The listener object to be inserted l)Implements com. com. at the
specified position in the list.
|
| public boolean | areDefaultGesturesEnabled()
Implements com. GestureHandler are enabled.
|
| public final void | confinePointer(final boolean
defaults to grab)false.Implements com. |
| public boolean | consumeEvent(final NEWTEvent event)
Implements com. |
| public final int[] | convertToPixelUnits(final int[]
int[2] storage holding the window units for the x- and y-coord to convert
and the resulting values. windowUnitsAndResult)Implements com. |
| public final int[] | convertToWindowUnits(final int[]
int[2] storage holding the pixel units for the x- and y-coord to convert
and the resulting values. pixelUnitsAndResult)Implements com. |
| public static GLWindow | create(final GLCapabilitiesImmutable caps)
Creates a new GLWindow attaching a new Window referencing a new default Screen and default Display with the given GLCapabilities. |
| public static GLWindow | create(final Screen screen, final GLCapabilitiesImmutable caps)
Creates a new GLWindow attaching a new Window referencing the given Screen with the given GLCapabilities. |
| public static GLWindow | |
| public static GLWindow | create(final NativeWindow parentNativeWindow, final GLCapabilitiesImmutable caps)
Creates a new GLWindow attaching a new child Window
of the given |
| public final void | destroy()
Implements com. |
| public void | display()
Implements com. Causes OpenGL rendering to be performed for this GLAutoDrawable in the following order:
|
| public final void | enqueueEvent(final boolean
Passing wait, final NEWTEvent true will block until the event has been processed, otherwise method returns immediately.The event)event to enqueue.Implements com. NEWT event.
|
| public final Rectangle | getBounds()
Implements com. Rectangle containing window origin, getX() & getY(),
and size, getWidth() & getHeight(), in window units.
|
| public final CapabilitiesImmutable | getChosenCapabilities()
Implements com. |
| public final float[] | getCurrentSurfaceScale(final float[]
float[2] storage for the result result)Implements com. NativeSurface.
|
| public WindowClosingProtocol. | |
| public final Window | getDelegatedWindow()
Implements com. Window instance,
otherwise return this instance.
|
| public final long | getDisplayHandle()
Implements com. |
| public final GLDrawableFactory | getFactory()
Implements com. GLDrawableFactory being used to create this instance.
|
| public final AbstractGraphicsConfiguration | getGraphicsConfiguration()
Implements com. |
| public final int | getHeight()
Implements com. |
| public final InsetsImmutable | getInsets()
Implements com. |
| public final KeyListener | |
| public final KeyListener[] | |
| public Point | getLocationOnScreen(final Point
Optional storage)Point storage.
If not null, null, it is translated about the resulting screen position
and returned.Implements com. |
| public final MonitorDevice | getMainMonitor()
Implements com. MonitorDevice with the highest viewport
coverage of this window.
|
| public final float[] | getMaximumSurfaceScale(final float[]
float[2] storage for the result result)Implements com. NativeSurface.
|
| public final float[] | getMinimumSurfaceScale(final float[]
float[2] storage for the result result)Implements com. NativeSurface.
|
| public final MouseListener | getMouseListener(final int index)
Implements com. MouseListener from the list at the given index.
|
| public final MouseListener[] | |
| public final NativeWindow | |
| public final float[] | getPixelsPerMM(final float[]
float[2] storage for the ppmm result ppmmStore)Implements com. NativeSurface
according to the main monitor's current mode's
surface resolution.
|
| public final Display. | getPointerIcon()
Implements com. PointerIcon, which maybe null for the default.
|
| public final CapabilitiesImmutable | getRequestedCapabilities()
Implements com. |
| public final float[] | getRequestedSurfaceScale(final float[]
float[2] storage for the result result)Implements com. requested pixel scale of the associated NativeSurface.
|
| public final Screen | |
| public final int | getScreenIndex()
Implements com. |
| public final int | getStateMask()
Implements com. |
| public final String | getStateMaskString()
Implements com. current state mask.
|
| public final int | getStatePublicBitCount()
Implements com. |
| public final int | getStatePublicBitmask()
Implements com. |
| public final int | getSupportedStateMask()
Implements com. state mask of the implementation.
|
| public final String | getSupportedStateMaskString()
Implements com. supported state mask.
|
| public final long | getSurfaceHandle()
Implements com. |
| public final int | getSurfaceHeight()
Overrides jogamp. Implements com. GLDrawable's surface client area in pixel units.
|
| public final Thread | getSurfaceLockOwner()
Implements com. |
| public final int | getSurfaceWidth()
Overrides jogamp. Implements com. GLDrawable's surface client area in pixel units.
|
| public final String | |
| public final RecursiveLock | getUpstreamLock()
Implements com. upstream widget
to synchronize multithreaded access on top of NativeSurface#lockSurface().
|
| public final Object | getUpstreamWidget()
Implements com. GLAutoDrawable instance, if exist.</td<></td<></td<></td<></td<>
|
| public final int | getWidth()
Implements com. |
| public final long | getWindowHandle()
Implements com. |
| public final WindowListener | |
| public final WindowListener[] | |
| public final int | getX()
Implements com. |
| public final int | getY()
Implements com. |
| public boolean | hasFocus()
Implements com. |
| public final boolean | |
| public final boolean | |
| public final boolean | isChildWindow()
Implements com. true if this window is a child window,
i.e. has been reparented.
|
| public final boolean | |
| public final boolean | isGLStatePreservationSupported()
Overrides jogamp. Implements com.
GLWindow supports GL state preservation, hence returns |
| public final boolean | isKeyboardVisible()
Implements com. true if the virtual on-screen keyboard is visible, otherwise false.
|
| public final boolean | |
| public final boolean | |
| public final boolean | |
| public final boolean | |
| public final boolean | |
| public final boolean | |
| public final boolean | |
| public final boolean | isSurfaceLockedByOtherThread()
Implements com. |
| public final boolean | |
| public final boolean | |
| public final int | lockSurface()
Implements com. |
| public static void | |
| public final boolean | |
| public final void | removeGestureHandler(final GestureHandler gh)
Implements com. GestureHandler from the list.
|
| public final void | removeGestureListener(final GestureHandler.
Implements com. GestureHandler. from the list.
|
| public final void | |
| public final void | removeMouseListener(final MouseListener l)
Implements com. MouseListener from the list.
|
| public final void | removeSurfaceUpdatedListener(final SurfaceUpdatedListener l)
Implements com. SurfaceUpdatedListener from the list.
|
| public final void | |
| public final Window. | reparentWindow(final NativeWindow
The new parent NativeWindow. If null, this Window becomes a top level window. newParent, final int new top-level position in window units, use -1 for default position. x, final int new top-level position in window units, use -1 for default position. y, final int May contain hints (bitfield values) like hints)REPARENT_HINT_FORCE_RECREATION or REPARENT_HINT_BECOMES_VISIBLE.Implements com. |
| public final void | requestFocus()
Implements com. The request is handled on this Window EDT and blocked until finished. |
| public final void | requestFocus(final boolean
true if waiting until the request is executed, otherwise false wait)Implements com. The request is handled on this Window EDT. |
| public final void | runOnEDTIfAvail(final boolean wait, final Runnable task)
Implements com. |
| public void | sendWindowEvent(final int
a eventType)WindowEvent type, e.g. WindowEvent#EVENT_WINDOW_REPAINT.Implements com. WindowEvent to all WindowListener.
|
| public final void | setAlwaysOnBottom(final boolean value)
Implements com. Operation is ignored if this instance |
| public final void | setAlwaysOnTop(final boolean value)
Implements com. Operation is ignored if this instance |
| public CapabilitiesChooser | setCapabilitiesChooser(final CapabilitiesChooser
the new CapabilitiesChooser chooser)Implements com. |
| public WindowClosingProtocol. | setDefaultCloseOperation(final WindowClosingProtocol.
the new close operation value opImplements com. |
| public void | setDefaultGesturesEnabled(final boolean enable)
Implements com. GestureHandler.
|
| public final void | setFocusAction(final Window.
Implements com. FocusRunnable,
which FocusRunnable#run() method is executed before the native focus is requested.
|
| public final boolean | setFullscreen(final boolean
enable or disable fullscreen mode fullscreen)Implements com. |
| public boolean | setFullscreen(final List<MonitorDevice>
if monitors)null fullscreen will be spanned across all MonitorDevices,
otherwise across the given list of MonitorDevice.Implements com. MonitorDevices
or across all MonitorDevices.
|
| public void | setKeyboardFocusHandler(final KeyListener l)
Implements com. KeyListener allowing focus traversal with a covered window toolkit like AWT.
|
| public final void | setKeyboardVisible(final boolean visible)
Implements com. visible is true
or false.
|
| public final void | setMaximized(final boolean horz, final boolean vert)
Implements com. Operation is ignored if this instance |
| public final void | setPointerIcon(final Display.
Valid piPointerIcon reference or null to reset the pointer icon to default.Implements com. |
| public final void | setPointerVisible(final boolean
defaults to mouseVisible)true for platforms w/ visible pointer,
otherwise defaults to true, eg. Android.Implements com. |
| public final void | setPosition(final int
coord of the client-area's top left corner in window units x, final int coord of the client-area's top left corner in window units y)Implements com. |
| public final void | setResizable(final boolean value)
Implements com. Operation is ignored if this instance |
| public final void | setSize(final int
of the window's client area in window units width, final int of the window's client area in window units height)Implements com. |
| public final void | setSticky(final boolean value)
Implements com. Operation is ignored if this instance |
| public final boolean | setSurfaceScale(final float[]
requested surface pixel scale float[2] values for x- and y-direction. pixelScale)Implements com. NativeSurface,
where size_in_pixel_units = pixel_scale * size_in_window_units.
|
| public final void | setSurfaceSize(final int
of the window's client area in pixel units pixelWidth, final int of the window's client area in pixel units pixelHeight)Implements com. |
| public final void | |
| public void | setTopLevelPosition(final int
coord of the top-level left corner in window units x, final int coord of the top-level left corner in window units y)Implements com. |
| public void | setTopLevelSize(final int
of the top-level window area in window units width, final int of the top-level window area in window units height)Implements com. |
| public final void | |
| public final void | setVisible(final boolean visible)
Implements com. setVisible(true, visible),
i.e. blocks until the window becomes visible.
|
| public void | setVisible(final boolean wait, final boolean visible)
Implements com. setVisible(..) makes the window and children visible if visible is true,
otherwise the window and children becomes invisible.
|
| public void | setWindowDestroyNotifyAction(final Runnable r)
Implements com. toolkit triggered window destroy
replacing the default destroy() action.
|
| public final boolean | surfaceSwap()
Implements com. |
| public final void | surfaceUpdated(final Object
is the caller object who updated the surface,
e.g. a JOGL GLDrawable. updater, final NativeSurface the updated NativeSurface ns, final long the time in ms, when the surface was updated when)Implements com. |
| public final void | swapBuffers()
Implements com. |
| public final String | toString()
Overrides jogamp. Implements com. |
| public final void | unlockSurface()
Implements com. lockSurface()
The implementation shall also invoke |
| public final void | warpPointer(final int
relative pointer x position within this window in pixel units x, final int relative pointer y position within this window in pixel units y)Implements com. |
| public final void | windowRepaint(final int
dirty-region y-pos in pixel units x, final int dirty-region x-pos in pixel units y, final int dirty-region width in pixel units width, final int dirty-region height in pixel units height)Implements com. |