Top Inners Fields Constructors Methods
jogamp.newt

public abstract Class WindowImpl

extends Object
implements Window, NEWTEventConsumer
Class Inheritance
All Implemented Interfaces
com.jogamp.newt.event.NEWTEventConsumer, com.jogamp.newt.Window, com.jogamp.nativewindow.ScalableSurface, com.jogamp.nativewindow.WindowClosingProtocol, com.jogamp.nativewindow.NativeWindow, com.jogamp.nativewindow.NativeSurfaceHolder, com.jogamp.nativewindow.NativeSurface, com.jogamp.nativewindow.SurfaceUpdatedListener
Known Direct Subclasses
jogamp.newt.driver.awt.WindowDriver, jogamp.newt.driver.bcm.egl.WindowDriver, jogamp.newt.driver.bcm.vc.iv.WindowDriver, jogamp.newt.driver.intel.gdl.WindowDriver, jogamp.newt.driver.kd.WindowDriver, jogamp.newt.driver.macosx.WindowDriver, jogamp.newt.driver.windows.WindowDriver, jogamp.newt.driver.x11.WindowDriver, jogamp.newt.OffscreenWindow
Imports
java.lang.ref.WeakReference, java.lang.reflect.Method, java.util.ArrayList, .List, com.jogamp.nativewindow.AbstractGraphicsConfiguration, .AbstractGraphicsDevice, .CapabilitiesChooser, .CapabilitiesImmutable, .NativeSurface, .NativeWindow, .NativeWindowException, .NativeWindowFactory, .OffscreenLayerSurface, .ScalableSurface, .SurfaceUpdatedListener, .WindowClosingProtocol, com.jogamp.nativewindow.util.DimensionImmutable, .Insets, .InsetsImmutable, .PixelRectangle, .Point, .PointImmutable, .Rectangle, .RectangleImmutable, jogamp.nativewindow.SurfaceScaleUtils, .SurfaceUpdatedHelper, com.jogamp.common.ExceptionUtils, com.jogamp.common.util.ArrayHashSet, .Bitfield, .PropertyAccess, .ReflectionUtil, com.jogamp.common.util.locks.LockFactory, .RecursiveLock, com.jogamp.newt.Display, .Display.PointerIcon, .MonitorDevice, .MonitorMode, .NewtFactory, .Screen, .Window, com.jogamp.newt.event.DoubleTapScrollGesture, .GestureHandler, .InputEvent, .KeyEvent, .KeyListener, .MonitorEvent, .MonitorModeListener, .MouseEvent, .MouseEvent.PointerType, .MouseListener, .NEWTEvent, .NEWTEventConsumer, .WindowEvent, .WindowListener, .WindowUpdateEvent

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class
private class
private class
public static interface
private class
private class
private static class
private static class
private class
private class
private class
private class
private class
private class

Field Summary

Modifier and TypeField and Description
private boolean
protected CapabilitiesChooser
protected CapabilitiesImmutable
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
private final ArrayList<NativeWindow>
private final Object
private final Object
private AbstractGraphicsConfiguration
private static final MouseEvent.PointerType[]
private static final boolean
public static final boolean
private WindowClosingProtocol.WindowClosingMode
private boolean
private final Runnable
private Window.FocusRunnable
private final WindowImpl.FullScreenAction
private List<MonitorDevice>
private DoubleTapScrollGesture
private ArrayList<GestureHandler.GestureListener>
protected final float[]
private volatile Insets
private KeyListener
protected boolean
private ArrayList<KeyListener>
private final Bitfield
private static final int
private WindowImpl.LifecycleHook
protected final float[]
protected static final int
protected final float[]
private final WindowImpl.MonitorModeListenerImpl
private ArrayList<MouseListener>
private int
private NativeWindow
private int
private int
private int
private final int[]
private final boolean[]
private NativeWindow
private long
private volatile int
private volatile int
private final ArrayHashSet<Integer>
pName2pID

Pointer names -> pointer ID (consecutive index, starting w/ 0)

private ArrayList<GestureHandler>
private PointerIconImpl
private final WindowImpl.PointerState0
private final WindowImpl.PointerState1
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final long
QUEUED_EVENT_TO

Timeout of queued events (repaint and resize)

protected static final int
QUIRK_BIT_VISIBILITY

Bug 1249 and Bug 1250: Visibility issues on X11

  • setVisible(false) IconicState not listening to _NET_WM_STATE_HIDDEN
  • setVisible(true) not restoring from _NET_WM_STATE_HIDDEN
protected static final Bitfield
quirks

Quirk mask

private boolean
private final Runnable
protected final float[]
private final Runnable
private final Runnable
private ScreenImpl
private boolean
protected static final int
STATE_BIT_COUNT_ALL_PUBLIC

Number of all public state bits, .

protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
private static final int
STATE_MASK_FULLSCREEN_NFS

Mask covering all preserved non-fullscreen (NFS) states while in fullscreen mode.

pack-priv static final int
pack-priv final Bitfield
stateMask

Regular state mask

private final Bitfield
stateMaskNFS

Non fullscreen state mask

protected int
private int
private final SurfaceUpdatedHelper
private String
private Runnable
private volatile long
protected static final ArrayList<WeakReference<WindowImpl>>
private ArrayList<WindowListener>
private final RecursiveLock
private volatile int
private volatile int
private volatile int
x

private volatile int
y

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final boolean
public final void
addGestureHandler(final GestureHandler gh)

Implements com.jogamp.newt.Window.addGestureHandler.

Appends the given GestureHandler to the end of the list.
public final void
addGestureHandler(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.jogamp.newt.Window.addGestureHandler.

Inserts the given GestureHandler at the specified position in the list.
public final void
public final void
addGestureListener(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.GestureListener
The listener object to be inserted
gl
)

Implements com.jogamp.newt.Window.addGestureListener.

Inserts the given GestureHandler.GestureListener at the specified position in the list.
public final void
addKeyListener(final KeyListener l)

Implements com.jogamp.newt.Window.addKeyListener.

Appends the given com.jogamp.newt.event.KeyListener to the end of the list.
public final void
addKeyListener(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.jogamp.newt.Window.addKeyListener.

Inserts the given com.jogamp.newt.event.KeyListener at the specified position in the list.
public final void
addMouseListener(final MouseListener l)

Implements com.jogamp.newt.Window.addMouseListener.

Appends the given MouseListener to the end of the list.
public final void
addMouseListener(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.jogamp.newt.Window.addMouseListener.

Inserts the given MouseListener at the specified position in the list.
public final void
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.jogamp.nativewindow.NativeSurface.addSurfaceUpdatedListener.

Inserts the given SurfaceUpdatedListener at the specified position in the list.
private static void
addWindow2List(final WindowImpl window)

public final void
public final void
addWindowListener(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.jogamp.newt.Window.addWindowListener.

Inserts the given com.jogamp.newt.event.WindowListener at the specified position in the list.
protected static StringBuilder
appendStateBits(final StringBuilder sb, final int mask, final boolean showChangeFlags)

public final boolean
protected final boolean
protected boolean
protected abstract void
public final void
confinePointer(final boolean
defaults to false.
confine
)

Implements com.jogamp.newt.Window.confinePointer.

Confine the pointer to this window, ie.
protected boolean
confinePointerImpl(final boolean confine)

public final boolean
protected void
protected void
protected void
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.jogamp.nativewindow.NativeSurface.convertToPixelUnits.

Converts the given window units into pixel units in place.
protected final Point
convertToPixelUnits(final Point windowUnitsAndResult)

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.jogamp.nativewindow.NativeSurface.convertToWindowUnits.

Converts the given pixel units into window units in place.
protected final Point
convertToWindowUnits(final Point pixelUnitsAndResult)

public static WindowImpl
create(final NativeWindow parentWindow, final long parentWindowHandle, final Screen screen, final CapabilitiesImmutable caps)

public static WindowImpl
create(final Object[] cstrArguments, final Screen screen, final CapabilitiesImmutable caps)

private boolean
protected abstract void
createNativeImpl()

The native implementation must set the native windowHandle.

protected final void
definePosition(final int x, final int y)

Sets the position fields x and y in window units to the given values and autoPosition to false.

protected final void
defineSize(final int winWidth, final int winHeight)

Sets the size fields winWidth and winHeight in window units to the given values and pixWidth and pixHeight in pixel units according to convertToPixelUnits(int[]).

public void
destroy()

Implements com.jogamp.newt.Window.destroy.

Destroys this window incl.
protected void
destroy(final boolean preserveResources)

private final void
private void
doEvent(final boolean enqueue, boolean wait, final NEWTEvent event)

protected final void
doMouseEvent(final boolean enqueue, final boolean wait, final short eventType, final int modifiers, final int x, final int y, final short button, final float rotation)

protected void
doMouseEvent(final boolean
if true, event will be enqueued, otherwise consumed directly.
enqueue
,
final boolean
if true wait until consumed.
wait
,
final short eventType, final int modifiers, final int x, final int y, final short button, final float[] rotationXYZ, final float rotationScale)

Send mouse event (one-pointer) either to be directly consumed or to be enqueued

public final void
doPointerEvent(final boolean
if true, event will be enqueued, otherwise consumed directly.
enqueue
,
final boolean
if true wait until consumed.
wait
,
final MouseEvent.PointerType[]
MouseEvent.PointerType for each pointer (multiple pointer)
pTypes
,
final short eventType, final int modifiers, final int
index of multiple-pointer arrays representing the pointer which triggered the event
actionIdx
,
final boolean
see pName below.
normalPNames
,
final int[]
Pointer name for each pointer (multiple pointer). We assume consecutive pointer names starting w/ 0 if normalPIDs is true. Otherwise we hash-map the values during state pressed to retrieve the normal ID.
pNames
,
final int[]
X-axis for each pointer (multiple pointer)
pX
,
final int[]
Y-axis for each pointer (multiple pointer)
pY
,
final float[]
Pressure for each pointer (multiple pointer)
pPressure
,
final float
Maximum pointer pressure for all pointer
maxPressure
,
final float[] rotationXYZ, final float rotationScale)

Send multiple-pointer event either to be directly consumed or to be enqueued

The index for the element of multiple-pointer arrays represents the pointer which triggered the event is passed via actionIdx.

public final void
doPointerEvent(final boolean
if true, event will be enqueued, otherwise consumed directly.
enqueue
,
final boolean
if true wait until consumed.
wait
,
final MouseEvent.PointerType[]
MouseEvent.PointerType for each pointer (multiple pointer)
pTypes
,
final short eventType, int modifiers, final int
index of multiple-pointer arrays representing the pointer which triggered the event
pActionIdx
,
final short[]
Pointer ID for each pointer (multiple pointer). We assume consecutive pointerIDs starting w/ 0.
pID
,
final short
Corresponding mouse-button, a button of 0 denotes no activity, i.e. PointerType#Mouse move.
buttonIn
,
final int[]
X-axis for each pointer (multiple pointer)
pX
,
final int[]
Y-axis for each pointer (multiple pointer)
pY
,
final float[]
Pressure for each pointer (multiple pointer)
pPressure
,
final float
Maximum pointer pressure for all pointer
maxPressure
,
final float[] rotationXYZ, final float rotationScale)

Send multiple-pointer event either to be directly consumed or to be enqueued.

public final void
enqueueEvent(final boolean
Passing true will block until the event has been processed, otherwise method returns immediately.
wait
,
final NEWTEvent
The event to enqueue.
event
)

Implements com.jogamp.newt.Window.enqueueEvent.

Enqueues a NEWT event.
public void
enqueueKeyEvent(final boolean wait, final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar)

public final void
enqueueMouseEvent(final boolean wait, final short eventType, final int modifiers, final int x, final int y, final short button, final float rotation)

public final void
enqueueWindowEvent(final boolean wait, final int eventType)

private boolean
protected void
focusChanged(final boolean defer, final boolean focusGained)

Triggered by implementation's WM events to update the focus state.

protected final void
focusVisibleChanged(final boolean defer, final int
-1 ignored, 0 unfocused, > 0 focused
focusChange
,
final int
-1 ignored, 0 invisible, > 0 visible
visibleChange
)

Triggered by implementation's WM events to update the focus and visibility state

private static String
getArgsStrList(final Object[] args)

public final Rectangle
getBounds()

Implements com.jogamp.newt.Window.getBounds.

Returns a newly created Rectangle containing window origin, getX() & getY(), and size, getWidth() & getHeight(), in window units.
public final CapabilitiesImmutable
getChosenCapabilities()

Implements com.jogamp.newt.Window.getChosenCapabilities.

Gets an immutable set of chosen capabilities.
public final float[]
getCurrentSurfaceScale(final float[]
float[2] storage for the result
result
)

Implements com.jogamp.nativewindow.ScalableSurface.getCurrentSurfaceScale.

Returns the current pixel scale of the associated NativeSurface.
private static Class<?>[]
public final WindowClosingProtocol.WindowClosingMode
public final Window
getDelegatedWindow()

Implements com.jogamp.newt.Window.getDelegatedWindow.

If the implementation uses delegation, return the delegated Window instance, otherwise return this instance.
public final long
getDisplayHandle()

Implements com.jogamp.nativewindow.NativeSurface.getDisplayHandle.

Convenience: Get display handle from AbstractGraphicsConfiguration .
public final AbstractGraphicsConfiguration
getGraphicsConfiguration()

Implements com.jogamp.nativewindow.NativeSurface.getGraphicsConfiguration.

Returns the graphics configuration corresponding to this window.
public final int
getHeight()

Implements com.jogamp.nativewindow.NativeWindow.getHeight.

Returns the height of the client area excluding insets (window decorations) in window units.
public final InsetsImmutable
getInsets()

Implements com.jogamp.nativewindow.NativeWindow.getInsets.

Returns the insets defined as the width and height of the window decoration on the left, right, top and bottom in window units.
public final KeyListener
public final KeyListener[]
public final WindowImpl.LifecycleHook
public Point
getLocationOnScreen(Point
Optional Point storage. If not null, null, it is translated about the resulting screen position and returned.
storage
)

Implements com.jogamp.nativewindow.NativeWindow.getLocationOnScreen.

Returns the window's top-left client-area position in the screen.
protected abstract Point

Returns:

if not null, the screen location of the given coordinates
getLocationOnScreenImpl
(int x, int y)

Translates the given window client-area coordinates with top-left origin to screen coordinates in window units.

public final RecursiveLock
public final MonitorDevice
getMainMonitor()

Implements com.jogamp.newt.Window.getMainMonitor.

Returns the MonitorDevice with the highest viewport coverage of this window.
public final float[]
getMaximumSurfaceScale(final float[]
float[2] storage for the result
result
)

Implements com.jogamp.nativewindow.ScalableSurface.getMaximumSurfaceScale.

Returns the maximum pixel scale of the associated NativeSurface.
public final float[]
getMinimumSurfaceScale(final float[]
float[2] storage for the result
result
)

Implements com.jogamp.nativewindow.ScalableSurface.getMinimumSurfaceScale.

Returns the minimum pixel scale of the associated NativeSurface.
public final MouseListener
getMouseListener(int index)

Implements com.jogamp.newt.Window.getMouseListener.

Returns the MouseListener from the list at the given index.
public final MouseListener[]
public final NativeSurface
private static long
getNativeWindowHandle(final NativeWindow nativeWindow)

public final NativeWindow
protected final long
protected final float
getPixelScaleX()

HiDPI: We currently base scaling of window units to pixel units on an integer scale factor per component.

protected final float
getPixelScaleY()

HiDPI: We currently base scaling of window units to pixel units on an integer scale factor per component.

public final float[]
getPixelsPerMM(final float[]
float[2] storage for the ppmm result
ppmmStore
)

Implements com.jogamp.newt.Window.getPixelsPerMM.

Returns the pixels per millimeter of this window's NativeSurface according to the main monitor's current mode's surface resolution.
public final Display.PointerIcon
getPointerIcon()

Implements com.jogamp.newt.Window.getPointerIcon.

Returns the current PointerIcon, which maybe null for the default.
protected static String
getReconfigStateMaskString(final int flags)

protected int
getReconfigureMask(final int changeFlags, final boolean visible)

public final CapabilitiesImmutable
getRequestedCapabilities()

Implements com.jogamp.newt.Window.getRequestedCapabilities.

Gets an immutable set of requested capabilities.
public final float[]
getRequestedSurfaceScale(final float[]
float[2] storage for the result
result
)

Implements com.jogamp.nativewindow.ScalableSurface.getRequestedSurfaceScale.

Returns the requested pixel scale of the associated NativeSurface.
public final Screen
public final int
getScreenIndex()

Implements com.jogamp.nativewindow.NativeSurface.getScreenIndex.

Convenience: Get display handle from AbstractGraphicsConfiguration .
public final int
getStateMask()

Implements com.jogamp.newt.Window.getStateMask.

Returns the current status mask of this instance.
public final String
getStateMaskString()

Implements com.jogamp.newt.Window.getStateMaskString.

Returns a string representation of the current state mask.
public final int
getStatePublicBitCount()

Implements com.jogamp.newt.Window.getStatePublicBitCount.

Number of all public state bits.
public final int
getStatePublicBitmask()

Implements com.jogamp.newt.Window.getStatePublicBitmask.

Bitmask covering all public state bits.
protected abstract int
getSupportedReconfigMaskImpl()

Returns the reconfigure state-mask supported by the implementation.

public final int
getSupportedStateMask()

Implements com.jogamp.newt.Window.getSupportedStateMask.

Returns the supported state mask of the implementation.
public final String
public long
getSurfaceHandle()

Implements com.jogamp.nativewindow.NativeSurface.getSurfaceHandle.

Returns the handle to the surface for this NativeSurface.
public final int
getSurfaceHeight()

Implements com.jogamp.nativewindow.NativeSurface.getSurfaceHeight.

Returns the height of the client area excluding insets (window decorations) in pixel units.
public final Thread
getSurfaceLockOwner()

Implements com.jogamp.nativewindow.NativeSurface.getSurfaceLockOwner.

Return the locking owner's Thread, or null if not locked.
public final int
getSurfaceWidth()

Implements com.jogamp.nativewindow.NativeSurface.getSurfaceWidth.

Returns the width of the client area excluding insets (window decorations) in pixel units.
public static String
public final String
private static String
getTypeStrList(final Class<?>[] types)

public final int
getWidth()

Implements com.jogamp.nativewindow.NativeWindow.getWidth.

Returns the width of the client area excluding insets (window decorations) in window units.
private static Class<?>
getWindowClass(final String type)

public final long
getWindowHandle()

Implements com.jogamp.nativewindow.NativeWindow.getWindowHandle.

Returns the window handle for this NativeWindow.
public final WindowListener
public final WindowListener[]
public NativeSurface
getWrappedSurface()

If this Window actually wraps a NativeSurface from another instance or toolkit, it will return such reference.

public final int
getX()

Implements com.jogamp.nativewindow.NativeWindow.getX.

Returns the x position of the top-left corner of the client area relative to it's parent in window units.
public final int
getY()

Implements com.jogamp.nativewindow.NativeWindow.getY.

Returns the current y position of the top-left corner of the client area relative to it's parent in window units.
public boolean
hasDeviceChanged()

If the implementation is capable of detecting a device change return true and clear the status/reason of the change.

public final boolean
hasFocus()

Implements com.jogamp.nativewindow.NativeWindow.hasFocus.

Returns true if this native window owns the focus, otherwise false.
protected void
insetsChanged(final boolean defer, final int
insets, -1 ignored
left
,
final int
insets, -1 ignored
right
,
final int
insets, -1 ignored
top
,
final int
insets, -1 ignored
bottom
)

Triggered by implementation's WM events to update the insets.

protected final void
insetsVisibleChanged(final boolean defer, final int
insets, -1 ignored
left
,
final int
insets, -1 ignored
right
,
final int
insets, -1 ignored
top
,
final int
insets, -1 ignored
bottom
,
final int
-1 ignored, 0 invisible, > 0 visible
visibleChange
)

Triggered by implementation's WM events to update the client-area position, size, insets and maximized flags.

private final void
instantiationFinished()

Notifies the driver impl.

protected void
public final boolean
public final boolean
public final boolean
isChildWindow()

Implements com.jogamp.newt.Window.isChildWindow.

Returns true if this window is a child window, i.e. has been reparented.
public final boolean
public final boolean
isKeyboardVisible()

Implements com.jogamp.newt.Window.isKeyboardVisible.

Return true if the virtual on-screen keyboard is visible, otherwise false.
protected final boolean
isKeyCodeTracked(final short keyCode)

protected final boolean

Returns:

true if pressed, otherwise false
isKeyPressed
(final short
the keyCode to test pressed state
keyCode
)

public final boolean
public final boolean
public final boolean
protected static boolean

Returns:

true if at least one of both window's configurations is offscreen
isOffscreenInstance
(final NativeWindow
child window, must not be null
cWin
,
final NativeWindow
parent window, may be null
pWin
)

public final boolean
public final boolean
protected final boolean
isReconfigureMaskSupported(final int reconfigMask)

Tests whether the given reconfigure state-mask is supported by implementation.

public final boolean
public final boolean
public final boolean
isSurfaceLockedByOtherThread()

Implements com.jogamp.nativewindow.NativeSurface.isSurfaceLockedByOtherThread.

Query if surface is locked by another thread, i.e. not the current one.
public final boolean
private static final boolean
isUndecorated(final int smask)

public final boolean
protected void
keyboardVisibilityChanged(final boolean visible)

Triggered by implementation's WM events to update the virtual on-screen keyboard's visibility state.

public final int
lockSurface()

Implements com.jogamp.nativewindow.NativeSurface.lockSurface.

Lock the surface of this native window.
protected int
protected final void
maximizedChanged(final boolean newMaxHorz, final boolean newMaxVert)

Triggered by implementation's WM events to update maximized window state.

protected void
monitorModeChanged(final MonitorEvent me, final boolean success)

Notify WindowDriver about the finished monitor mode change.

public final void
pixelScaleChangeNotify(final float[] minPixelScale, final float[] maxPixelScale, final boolean
if true reset pixel-scale w/ requested values value to reflect the new minimum and maximum values.
reset
)

Notify to update the pixel-scale values.

protected final void
positionChanged(final boolean defer, final int newX, final int newY)

Triggered by implementation's WM events to update the position.

private final boolean
protected void
reconfigMaximizedManual(final int flags, final int[] posSize, final InsetsImmutable insets)

Manually calculate maximized and de-maximized position and size not regarding a fixed taskbar etc.

Use only if: 0 != ( ( CHANGE_MASK_MAXIMIZED_HORZ | CHANGE_MASK_MAXIMIZED_VERT ) & flags )

protected abstract boolean
reconfigureWindowImpl(int
client-area position in window units, or <0 if unchanged
x
,
int
client-area position in window units, or <0 if unchanged
y
,
int
client-area size in window units, or <=0 if unchanged
width
,
int
client-area size in window units, or <=0 if unchanged
height
,
int
bitfield of change and status flags
flags
)

The native implementation should invoke the referenced java state callbacks to notify this Java object of state changes.

public final boolean
public final void
public final void
public final void
public final void
private void
public final void
public final void
public final Window.ReparentOperation
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 REPARENT_HINT_FORCE_RECREATION or REPARENT_HINT_BECOMES_VISIBLE.
hints
)

Implements com.jogamp.newt.Window.reparentWindow.

Change this window's parent window.
public final void
requestFocus()

Implements com.jogamp.newt.Window.requestFocus.

Request focus for this native window

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.jogamp.newt.Window.requestFocus.

Request focus for this native window

The request is handled on this Window EDT.

private void
requestFocus(final boolean wait, final boolean skipFocusAction, final boolean force)

protected abstract void
requestFocusImpl(boolean
if true, bypass focusChanged(boolean, boolean) and force focus request
force
)

Async request which shall be performed within TIMEOUT_NATIVEWINDOW.

private void
requestFocusInt(final boolean skipFocusAction)

Internally forcing request focus on current thread

protected void
resetMaximizedManual(final int[] posSize)

pack-priv final void
public final void
runOnEDTIfAvail(final boolean wait, final Runnable task)

Implements com.jogamp.newt.Window.runOnEDTIfAvail.

public void
sendKeyEvent(final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar)

public final void
sendMouseEvent(final short eventType, final int modifiers, final int x, final int y, final short button, final float rotation)

protected final void
sendMouseEventRequestFocus(final short eventType, final int modifiers, final int x, final int y, final short button, final float rotation)

Triggered by implementation.

public final void
public final void
setAlwaysOnBottom(final boolean value)

Implements com.jogamp.newt.Window.setAlwaysOnBottom.

Operation is ignored if this instance is a child window.

public final void
setAlwaysOnTop(final boolean value)

Implements com.jogamp.newt.Window.setAlwaysOnTop.

Operation is ignored if this instance is a child window.

protected final void
setBrokenFocusChange(final boolean v)

public final CapabilitiesChooser
setCapabilitiesChooser(final CapabilitiesChooser
the new CapabilitiesChooser
chooser
)

Implements com.jogamp.newt.Window.setCapabilitiesChooser.

Set the CapabilitiesChooser to help determine the native visual type.
public final WindowClosingProtocol.WindowClosingMode
public final void
setDefaultGesturesEnabled(final boolean enable)

Implements com.jogamp.newt.Window.setDefaultGesturesEnabled.

Enable or disable default GestureHandler.
public final void
setFocusAction(final Window.FocusRunnable focusAction)

Implements com.jogamp.newt.Window.setFocusAction.

Sets a FocusRunnable, which FocusRunnable#run() method is executed before the native focus is requested.
public boolean
setFullscreen(final boolean
enable or disable fullscreen mode
fullscreen
)

Implements com.jogamp.newt.Window.setFullscreen.

Enable or disable fullscreen mode for this window.
public boolean
setFullscreen(final List<MonitorDevice>
if null fullscreen will be spanned across all MonitorDevices, otherwise across the given list of MonitorDevice.
monitors
)

Implements com.jogamp.newt.Window.setFullscreen.

Enable fullscreen mode for this window spanning across the given MonitorDevices or across all MonitorDevices.
private boolean
setFullscreenImpl(final boolean fullscreen, final boolean useMainMonitor, final List<MonitorDevice> monitors)

protected final void
public final void
setKeyboardFocusHandler(final KeyListener l)

Implements com.jogamp.newt.Window.setKeyboardFocusHandler.

Sets a KeyListener allowing focus traversal with a covered window toolkit like AWT.
public final void
setKeyboardVisible(final boolean visible)

Implements com.jogamp.newt.Window.setKeyboardVisible.

In case the platform supports or even requires a virtual on-screen keyboard, this method shows or hide it depending on whether visible is true or false.
protected boolean
setKeyboardVisibleImpl(final boolean visible)

Returns true if operation was successful, otherwise false.

protected final boolean

Returns:

the previous pressed value
setKeyPressed
(final short
the keyCode to set pressed state
keyCode
,
final boolean
true if pressed, otherwise false
pressed
)

public final WindowImpl.LifecycleHook
public final void
setMaximized(boolean horz, boolean vert)

Implements com.jogamp.newt.Window.setMaximized.

Operation is ignored if this instance is a child window.

private boolean
setOffscreenPointerIcon(final PointerIconImpl
the PointerIconImpl instance, if null PointerIcon gets reset.
pi
)

Helper method to delegate setPointerIconIntern(PointerIconImpl) to OffscreenLayerSurface#setCursor(PixelRectangle, PointImmutable)

Note

JAWTWindow is an OffscreenLayerSurface.

private boolean
setOffscreenPointerVisible(final boolean
true for visible, otherwise invisible.
pointerVisible
,
final PointerIconImpl
default PointerIcon for visibility
defaultPointerIcon
)

Helper method to delegate setPointerVisibleImpl(boolean) to OffscreenLayerSurface#hideCursor() or OffscreenLayerSurface#setCursor(PixelRectangle, PointImmutable).

public final void
setPointerIcon(final Display.PointerIcon
Valid PointerIcon reference or null to reset the pointer icon to default.
pi
)

Implements com.jogamp.newt.Window.setPointerIcon.

protected void
private void
public final void
setPointerVisible(final boolean
defaults to true for platforms w/ visible pointer, otherwise defaults to true, eg. Android.
pointerVisible
)

Implements com.jogamp.newt.Window.setPointerVisible.

Makes the pointer visible or invisible.
protected boolean
setPointerVisibleImpl(final boolean pointerVisible)

private boolean
setPointerVisibleIntern(final boolean pointerVisible)

public 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.jogamp.newt.Window.setPosition.

Sets the location of the window's client area excluding insets (window decorations) in window units.
public final void
setResizable(final boolean value)

Implements com.jogamp.newt.Window.setResizable.

Operation is ignored if this instance is a child window.

protected void
setScreen(final ScreenImpl newScreen)

private void
setSize(final int width, final int height, final boolean force)

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.jogamp.newt.Window.setSize.

Sets the size of the window's client area in window units, excluding decorations.
public final void
setSticky(final boolean value)

Implements com.jogamp.newt.Window.setSticky.

Operation is ignored if this instance is a child window.

public boolean
setSurfaceScale(final float[]
requested surface pixel scale float[2] values for x- and y-direction.
pixelScale
)

Implements com.jogamp.nativewindow.ScalableSurface.setSurfaceScale.

Request a pixel scale in x- and y-direction for the associated 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.jogamp.newt.Window.setSurfaceSize.

Sets the size of the window's surface in pixel units which claims the window's client area excluding decorations.
public final void
protected void
setTitleImpl(final String title)

public final 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.jogamp.newt.Window.setTopLevelPosition.

Sets the location of the top-level window inclusive insets (window decorations) in window units.
public final 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.jogamp.newt.Window.setTopLevelSize.

Sets the size of the top-level window including insets (window decorations) in window units.
public final void
setUndecorated(final boolean value)

Implements com.jogamp.newt.Window.setUndecorated.

public final void
setVisible(final boolean wait, final boolean visible)

Implements com.jogamp.newt.Window.setVisible.

setVisible(..) makes the window and children visible if visible is true, otherwise the window and children becomes invisible.
public final void
setVisible(final boolean visible)

Implements com.jogamp.newt.Window.setVisible.

Calls setVisible(true, visible), i.e. blocks until the window becomes visible.
pack-priv final void
setVisibleActionImpl(final boolean visible)

protected final void
setVisibleImpl(final boolean visible, final boolean
true hints that the WM shall be skiped (no animation)
fast
,
final int
client-area position in window units, or <0 if unchanged
x
,
final int
client-area position in window units, or <0 if unchanged
y
,
final int
client-area size in window units, or <=0 if unchanged
width
,
final int
client-area size in window units, or <=0 if unchanged
height
)

public final void
setWindowDestroyNotifyAction(final Runnable r)

Implements com.jogamp.newt.Window.setWindowDestroyNotifyAction.

Set a custom action handling destruction issued by a toolkit triggered window destroy replacing the default destroy() action.
protected final void
setWindowHandle(final long handle)

private final void
shutdown()

Fast invalidation of instance w/o any blocking function call.

public static final void
shutdownAll()

Maybe utilized at a shutdown hook, impl.

protected void
sizeChanged(final boolean defer, final int newWidth, final int newHeight, final boolean force)

Triggered by implementation's WM events to update the client-area size in window units w/o insets/decorations.

protected final void
sizePosInsetsFocusVisibleChanged(final boolean defer, final int newX, final int newY, final int newWidth, final int newHeight, final int
insets, -1 ignored
left
,
final int
insets, -1 ignored
right
,
final int
insets, -1 ignored
top
,
final int
insets, -1 ignored
bottom
,
final int
-1 ignored, 0 unfocused, > 0 focused
focusChange
,
final int
-1 ignored, 0 invisible, > 0 visible
visibleChange
,
final boolean force)

Triggered by implementation's WM events to update the client-area position, size, insets and maximized flags.

protected final void
sizePosMaxInsetsVisibleChanged(final boolean defer, final int newX, final int newY, final int newWidth, final int newHeight, final int
-1 ignored, 0 !maximized, > 0 maximized
maxHorzChange
,
final int
-1 ignored, 0 !maximized, > 0 maximized
maxVertChange
,
final int
insets, -1 ignored
left
,
final int
insets, -1 ignored
right
,
final int
insets, -1 ignored
top
,
final int
insets, -1 ignored
bottom
,
final int
-1 ignored, 0 invisible, > 0 visible
visibleChange
,
final boolean force)

Triggered by implementation's WM events to update the client-area position, size, insets and maximized flags.

private static int
step(final int lower, final int edge, final int value)

public boolean
surfaceSwap()

Implements com.jogamp.nativewindow.NativeSurface.surfaceSwap.

Provide a mechanism to utilize custom (pre-) swap surface code.
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.jogamp.nativewindow.SurfaceUpdatedListener.surfaceUpdated.

Notification of a surface update event, eg.
public static String
toHexString(final int hex)

public static String
toHexString(final long hex)

public final String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public final void
unlockSurface()

Implements com.jogamp.nativewindow.NativeSurface.unlockSurface.

Unlock the surface of this native window Shall not modify the surface handle, see lockSurface()

The implementation shall also invoke AbstractGraphicsDevice#unlock() for the final unlock (recursive count zero).

protected void
private boolean
private static int
verifyConstructorArgumentTypes(final Class<?>[] types, final Object[] args)

protected final void
visibleChanged(final boolean defer, final boolean visible)

Triggered by implementation's WM events to update the visibility state.

protected final void
visibleChangedSendMouseEvent(final boolean defer, final int
-1 ignored, 0 invisible, > 0 visible
visibleChange
,
final short
0 ignored, > 0 [send|enqueue]MouseEvent
eventType
,
final int modifiers, final int x, final int y, final short button, final float rotation)

Triggered by implementation's WM events to update the visibility state and send- or enqueue one mouse event

protected final void
visibleChangedWindowRepaint(final boolean
if true sent event later, otherwise wait until processed.
defer
,
final int
-1 ignored, 0 invisible, > 0 visible
visibleChange
,
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
)

Triggered by implementation's WM events to update the content

private boolean
waitForPosition(final boolean useCustomPosition, final int x, final int y, final long timeOut)

Wait until position is reached within tolerances, either auto-position or custom position.

private boolean
waitForSize(final int w, final int h, final boolean failFast, final long timeOut)

private long
waitForVisible(final boolean visible, final boolean failFast)

Returns -1 if failed, otherwise remaining time until TIMEOUT_NATIVEWINDOW, maybe zero.

private long
waitForVisible(final boolean visible, final boolean failFast, final long timeOut)

Returns -1 if failed, otherwise remaining time until timeOut, maybe zero.

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.jogamp.newt.Window.warpPointer.

Moves the pointer to x/y relative to this window's origin in pixel units.
protected void
warpPointerImpl(final int x, final int y)

public final boolean

Returns:

true if this window is no more valid and hence has been destroyed, otherwise false.
windowDestroyNotify
(final boolean
if true, overrides setDefaultCloseOperation(WindowClosingMode) with WindowClosingProtocol#DISPOSE_ON_CLOSE and hence force destruction. Otherwise is follows the user settings.
force
)

Triggered by implementation's WM events or programmatic while respecting getDefaultCloseOperation().

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.jogamp.newt.Window.windowRepaint.

Trigger window repaint while passing the dirty region in pixel units.
protected final void
windowRepaint(final boolean
if true sent event later, otherwise wait until processed.
defer
,
final int
dirty-region y-pos in pixel units
x
,
final int
dirty-region x-pos in pixel units
y
,
int
dirty-region width in pixel units
width
,
int
dirty-region height in pixel units
height
)

Triggered by implementation's WM events to update the content

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait