Top Description Fields Methods
com.jogamp.nativewindow

public Interface NativeWindow

extends NativeSurface, NativeSurfaceHolder
Known Direct Subinterfaces
com.jogamp.newt.Window
Known Direct Implementers
com.jogamp.nativewindow.awt.JAWTWindow, com.jogamp.newt.swt.NewtCanvasSWT.SWTNativeWindow, jogamp.nativewindow.WrappedWindow
Imports
com.jogamp.nativewindow.util.InsetsImmutable, .Point

Extend the NativeSurface interface with windowing information such as window-handle, window-size and window-position.

All values of this interface are represented in window units, if not stated otherwise. See NativeSurface.

Coordinate System

A window toolkit such as the AWT may either implement this interface directly with one of its components, or provide and register an implementation of NativeWindowFactory which can create NativeWindow objects for its components.

Field Summary

Inherited from com.jogamp.nativewindow.NativeSurface:
LOCK_SUCCESSLOCK_SURFACE_CHANGEDLOCK_SURFACE_NOT_READYLOCK_SURFACE_UNLOCKED

Method Summary

Modifier and TypeMethod and Description
public void
destroy()

Destroys this window incl.

public int

Returns:

height of the client area in window units
getHeight
()

Returns the height of the client area excluding insets (window decorations) in window units.

public InsetsImmutable

Returns:

insets
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 Point
getLocationOnScreen(Point
Optional Point storage. If not null, null, it is translated about the resulting screen position and returned.
point
)

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

public NativeSurface
public NativeWindow

Returns:

The parent NativeWindow, or null if this NativeWindow is top level.
getParent
()

public int

Returns:

width of the client area in window units
getWidth
()

Returns the width of the client area excluding insets (window decorations) in window units.

public long
getWindowHandle()

Returns the window handle for this NativeWindow.

public int
getX()

Returns the x position of the top-left corner of the client area relative to it's parent in window units.

public int
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
hasFocus()

Returns true if this native window owns the focus, otherwise false.

Inherited from com.jogamp.nativewindow.NativeSurface:
addSurfaceUpdatedListeneraddSurfaceUpdatedListenerconvertToPixelUnitsconvertToWindowUnitsgetDisplayHandlegetGraphicsConfigurationgetScreenIndexgetSurfaceHandlegetSurfaceHeightgetSurfaceLockOwnergetSurfaceWidthisSurfaceLockedByOtherThreadlockSurfaceremoveSurfaceUpdatedListenersurfaceSwapunlockSurface

Method Detail

destroyback to summary
public void destroy()

Destroys this window incl. releasing all related resources.

getHeightback to summary
public int getHeight()

Returns the height of the client area excluding insets (window decorations) in window units.

Returns:int

height of the client area in window units

See Also
NativeSurface#getSurfaceHeight()
getInsetsback to summary
public InsetsImmutable getInsets()

Returns the insets defined as the width and height of the window decoration on the left, right, top and bottom in window units.

Insets are zero if the window is undecorated, including child windows.

Insets are available only after the native window has been created, ie. the native window has been made visible.
The top-level window area's top-left corner is located at

  getX() - getInsets().getLeftWidth()
  getY() - getInsets().getTopHeight()
The top-level window size is
  getWidth()  + getInsets().getTotalWidth()
  getHeight() + getInsets().getTotalHeight()
Returns:InsetsImmutable

insets

getLocationOnScreenback to summary
public Point getLocationOnScreen(Point point)

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

If Point is not null, it is translated about the resulting screen position and returned.

See Coordinate System.

Since the position reflects the client area, it does not include the insets.

Parameters
point:Point

Optional Point storage. If not null, null, it is translated about the resulting screen position and returned.

See Also
getX(), getY(), getInsets()
getNativeSurfaceback to summary
public NativeSurface getNativeSurface()

Redeclares com.jogamp.nativewindow.NativeSurfaceHolder.getNativeSurface.

Doc from com.jogamp.nativewindow.NativeSurfaceHolder.getNativeSurface.

Returns the associated NativeSurface of this NativeSurfaceHolder.

Returns this instance, which is-a NativeSurface.

Annotations
@Override
getParentback to summary
public NativeWindow getParent()
Returns:NativeWindow

The parent NativeWindow, or null if this NativeWindow is top level.

getWidthback to summary
public int getWidth()

Returns the width of the client area excluding insets (window decorations) in window units.

Returns:int

width of the client area in window units

See Also
NativeSurface#getSurfaceWidth()
getWindowHandleback to summary
public long getWindowHandle()

Returns the window handle for this NativeWindow.

The window handle shall reflect the platform one for all window related operations, e.g. open, close, resize.

On X11 this returns an entity of type Window.
On Microsoft Windows this returns an entity of type HWND.

getXback to summary
public int getX()

Returns the x position of the top-left corner of the client area relative to it's parent in window units.

If no parent exist (top-level window), this coordinate equals the screen coordinate.

Since the position reflects the client area, it does not include the insets.

See Coordinate System.

See Also
getInsets(), getLocationOnScreen(Point)
getYback to summary
public int getY()

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

If no parent exist (top-level window), this coordinate equals the screen coordinate.

Since the position reflects the client area, it does not include the insets.

See Coordinate System.

See Also
getInsets(), getLocationOnScreen(Point)
hasFocusback to summary
public boolean hasFocus()

Returns true if this native window owns the focus, otherwise false.