One use case is com., which delegates
window operation to an instance of this interface while providing OpenGL
functionality.
All values of this interface are represented in window units, if not stated otherwise.
getX() and getY(). insets, i.e. window decoration.NativeWindow and Screen.
Custom window icons can be defined via system property newt.window.icons,
which shall contain a list of PNG icon locations from low- to high-resolution,
separated by one whitespace or one comma character.
The location must be resolvable via classpath, i.e. shall reference a location within the jar file.
Example (our default):
-Dnewt.window.icons="newt/data/jogamp-16x16.png,newt/data/jogamp-32x32.png" -Djnlp.newt.window.icons="newt/data/jogamp-16x16.png,newt/data/jogamp-32x32.png"The property can also be set programmatically, which must happen before any NEWT classes are touched:
System.setProperty("newt.window.icons", "newt/data/jogamp-16x16.png, newt/data/jogamp-32x32.png");
To disable even Jogamp's own window icons in favor of system icons,
simply set a non-existing location, e.g.:
-Dnewt.window.icons="null,null"
Some of the methods specified here are lifecycle-heavy. That is, they are able
to destroy and/or reattach resources to/from the window. Because of this, the methods
are not safe to be called from EDT related threads. For example, it is not
safe for a method in an attached KeyListener to call setFullscreen(boolean)
on a Window directly. It is safe, however, for that method to spawn a background
worker thread which calls the method directly. The documentation for individual methods
indicates whether or not they are lifecycle-heavy.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | |
| public static enum | Window.
Reparenting operation types |
| Modifier and Type | Field and Description |
|---|---|
| public static final boolean | |
| public static final boolean | |
| public static final boolean | |
| public static final int | REPARENT_HINT_BECOMES_VISIBLE
Reparenting hint (bitfield value): Claim window becomes visible after reparenting, which is important for e.g. preserving the GL-states in case window is invisible while reparenting. |
| public static final int | REPARENT_HINT_FORCE_RECREATION
Reparenting hint (bitfield value): Force destroy and hence |
| public static final int | STATE_BIT_ALWAYSONBOTTOM
Set if window is always on bottom, otherwise cleared. |
| public static final int | STATE_BIT_ALWAYSONTOP
Set if window is always on top, otherwise cleared. |
| public static final int | STATE_BIT_AUTOPOSITION
Hinting that no custom position has been set before first |
| public static final int | STATE_BIT_CHILDWIN
Set if window is a child window, i.e. has been |
| public static final int | STATE_BIT_FOCUSED
Set if window has the input focus, otherwise cleared. |
| public static final int | STATE_BIT_FULLSCREEN
Set if window is in fullscreen mode, otherwise cleared. |
| public static final int | STATE_BIT_MAXIMIZED_HORZ
Set if window is maximized horizontally, otherwise cleared. |
| public static final int | STATE_BIT_MAXIMIZED_VERT
Set if window is maximized vertically, otherwise cleared. |
| public static final int | STATE_BIT_POINTERCONFINED
Set if the pointer is confined to the window, otherwise cleared. |
| public static final int | STATE_BIT_POINTERVISIBLE
Set if the pointer is visible when inside the window, otherwise cleared. |
| public static final int | STATE_BIT_RESIZABLE
Set if window is resizable, otherwise cleared. |
| public static final int | STATE_BIT_STICKY
Set if window is sticky, i.e. visible on all virtual desktop, otherwise cleared. |
| public static final int | STATE_BIT_UNDECORATED
Set if window has window decorations, otherwise cleared. |
| public static final int | STATE_BIT_VISIBLE
Visibility of this instance. |
| public static final int | STATE_MASK_ALWAYSONBOTTOM
Bitmask for |
| public static final int | STATE_MASK_ALWAYSONTOP
Bitmask for |
| public static final int | STATE_MASK_AUTOPOSITION
Bitmask for |
| public static final int | STATE_MASK_CHILDWIN
Bitmask for |
| public static final int | STATE_MASK_FOCUSED
Bitmask for |
| public static final int | STATE_MASK_FULLSCREEN
Bitmask for |
| public static final int | STATE_MASK_MAXIMIZED_HORZ
Bitmask for |
| public static final int | STATE_MASK_MAXIMIZED_VERT
Bitmask for |
| public static final int | STATE_MASK_POINTERCONFINED
Bitmask for |
| public static final int | STATE_MASK_POINTERVISIBLE
Bitmask for |
| public static final int | STATE_MASK_RESIZABLE
Bitmask for |
| public static final int | STATE_MASK_STICKY
Bitmask for |
| public static final int | STATE_MASK_UNDECORATED
Bitmask for |
| public static final int | STATE_MASK_VISIBLE
Bitmask for |
| public static final long | TIMEOUT_NATIVEWINDOW
A 1s timeout while waiting for a native action response, ie |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public void | |
| public 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, GestureHandler The listener object to be inserted gh)Inserts the given |
| public void | addGestureListener(GestureHandler.
Appends the given |
| public 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, GestureHandler.The listener object to be inserted glInserts the given |
| public void | addKeyListener(KeyListener l)
Appends the given |
| public 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, KeyListener The listener object to be inserted l)Inserts the given |
| public void | |
| public 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, MouseListener The listener object to be inserted l)Inserts the given |
| public void | addWindowListener(WindowListener l)
Appends the given |
| public 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, WindowListener The listener object to be inserted l)Inserts the given |
| public boolean | |
| public void | |
| public void | |
| public void | enqueueEvent(boolean
Passing wait, NEWTEvent true will block until the event has been processed, otherwise method returns immediately.The event)event to enqueue.Enqueues a |
| public Rectangle | getBounds()
Returns a newly created |
| public CapabilitiesImmutable | Returns: the chosen capabilitiesGets an immutable set of chosen capabilities. |
| public Window | getDelegatedWindow()
If the implementation uses delegation, return the delegated |
| public KeyListener | |
| public KeyListener[] | |
| public MonitorDevice | |
| public MouseListener | |
| public MouseListener[] | |
| public float[] | Returns: the passed storage containing the ppmm for chainingfloat[2] storage for the ppmm result ppmmStore)Returns the pixels per millimeter of this window's |
| public Display. | |
| public CapabilitiesImmutable | Returns: the requested capabilitiesGets an immutable set of requested capabilities. |
| public Screen | |
| public int | |
| public String | |
| public int | |
| public int | |
| public int | |
| public String | |
| public String | |
| public WindowListener | |
| public WindowListener[] | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | Returns: true if the native window handle is valid and ready to operate, ie if the native window has been created viasetVisible(true), otherwise false.
|
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public void | |
| public void | removeGestureListener(GestureHandler.
Removes the given |
| public void | |
| public void | |
| public void | |
| public Window. | Returns: The issued reparent action type (strategy) as defined in Window.ReparentActionThe new parent NativeWindow. If null, this Window becomes a top level window. newParent, int new top-level position in window units, use -1 for default position. x, int new top-level position in window units, use -1 for default position. y, int May contain hints (bitfield values) like hints)REPARENT_HINT_FORCE_RECREATION or REPARENT_HINT_BECOMES_VISIBLE.Change this window's parent window. |
| public void | requestFocus()
Request focus for this native window The request is handled on this Window EDT and blocked until finished. |
| public void | requestFocus(boolean
true if waiting until the request is executed, otherwise false wait)Request focus for this native window The request is handled on this Window EDT. |
| public void | |
| public void | sendWindowEvent(int
a eventType)WindowEvent type, e.g. WindowEvent#EVENT_WINDOW_REPAINT.Send a |
| public void | |
| public void | |
| public CapabilitiesChooser | Returns: the previous CapabilitiesChooserthe new CapabilitiesChooser chooser)Set the CapabilitiesChooser to help determine the native visual type. |
| public void | |
| public void | setFocusAction(Window.
Sets a |
| public boolean | Returns: successenable or disable fullscreen mode fullscreen)Enable or disable fullscreen mode for this window. |
| public boolean | Returns: successif monitors)null fullscreen will be spanned across all MonitorDevices,
otherwise across the given list of MonitorDevice.Enable fullscreen mode for this window spanning across the given |
| public void | setKeyboardFocusHandler(KeyListener l)
Sets a |
| public void | setKeyboardVisible(boolean visible)
In case the platform supports or even requires a virtual on-screen keyboard,
this method shows or hide it depending on whether |
| public void | setMaximized(final boolean horz, final boolean vert)
Operation is ignored if this instance |
| public void | setPointerIcon(final Display.
Valid piPointerIcon reference or null to reset the pointer icon to default.
|
| public void | setPointerVisible(boolean
defaults to pointerVisible)true for platforms w/ visible pointer,
otherwise defaults to true, eg. Android.Makes the pointer visible or invisible. |
| public void | setPosition(int
coord of the client-area's top left corner in window units x, int coord of the client-area's top left corner in window units y)Sets the location of the window's client area excluding insets (window decorations) in window units. |
| public void | |
| public void | setSize(int
of the window's client area in window units width, int of the window's client area in window units height)Sets the size of the window's client area in window units, excluding decorations. |
| public void | |
| public void | setSurfaceSize(int
of the window's client area in pixel units pixelWidth, int of the window's client area in pixel units pixelHeight)Sets the size of the window's surface in pixel units which claims the window's client area excluding decorations. |
| public void | |
| public void | setTopLevelPosition(int
coord of the top-level left corner in window units x, int coord of the top-level left corner in window units y)Sets the location of the top-level window inclusive insets (window decorations) in window units. |
| public void | setTopLevelSize(int
of the top-level window area in window units width, int of the top-level window area in window units height)Sets the size of the top-level window including insets (window decorations) in window units. |
| public void | |
| public void | setVisible(boolean visible)
Calls |
| public void | setVisible(boolean wait, boolean visible)
|
| public void | setWindowDestroyNotifyAction(Runnable r)
Set a custom action handling destruction issued by a |
| public void | warpPointer(int
relative pointer x position within this window in pixel units x, int relative pointer y position within this window in pixel units y)Moves the pointer to x/y relative to this window's origin in pixel units. |
| public void | windowRepaint(int
dirty-region y-pos in pixel units x, 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)Trigger window repaint while passing the dirty region in pixel units. |