com.jogamp.nativewindow.awt

## Class JAWTWindow

- java.lang.Object
- - com.jogamp.nativewindow.awt.JAWTWindow

- All Implemented Interfaces:
    NativeSurface, NativeSurfaceHolder, NativeWindow, OffscreenLayerOption, OffscreenLayerSurface, ScalableSurface, SurfaceUpdatedListener

      public abstract class JAWTWindow
      extends Object
      implements NativeWindow, OffscreenLayerSurface, OffscreenLayerOption, ScalableSurface

- - ### Field Summary

    - ### Fields inherited from interface javax.media.nativewindow.NativeSurface

      `LOCK_SUCCESS, LOCK_SURFACE_CHANGED, LOCK_SURFACE_NOT_READY, LOCK_SURFACE_UNLOCKED`

    - ### Fields inherited from interface javax.media.nativewindow.ScalableSurface

      `AUTOMAX_PIXELSCALE, IDENTITY_PIXELSCALE`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l)` Inserts the given `SurfaceUpdatedListener` at the specified position in the list.
    `void` | `addSurfaceUpdatedListener(SurfaceUpdatedListener l)` Appends the given `SurfaceUpdatedListener` to the end of the list.
    `void` | `attachSurfaceLayer(long layerHandle)` Attach the offscreen layer to this offscreen layer surface.
    `int[]` | `convertToPixelUnits(int[] windowUnitsAndResult)` Converts the given window units into pixel units in place.
    `int[]` | `convertToWindowUnits(int[] pixelUnitsAndResult)` Converts the given pixel units into window units in place.
    `void` | `destroy()` Destroys this window incl.
    `void` | `detachSurfaceLayer()` Detaches a previously attached offscreen layer from this offscreen layer surface.
    `long` | `getAttachedSurfaceLayer()` Returns the attached surface layer or null if none is attached.
    `Component` | `getAWTComponent()`
    `RectangleImmutable` | `getBounds()`
    `int[]` | `getCurrentSurfaceScale(int[] result)` Returns the current pixel scale of the associated `NativeSurface`.
    `long` | `getDisplayHandle()` Convenience: Get display handle from AbstractGraphicsConfiguration .
    `AbstractGraphicsConfiguration` | `getGraphicsConfiguration()` Returns the graphics configuration corresponding to this window.
    `int` | `getHeight()` Returns the height of the client area excluding insets (window decorations) in window units.
    `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.
    `jogamp.nativewindow.jawt.JAWT` | `getJAWT()` Returns the underlying JAWT instance created @ `lockSurface()`.
    `Point` | `getLocationOnScreen(Point storage)` Returns the window's top-left client-area position in the screen.
    `RecursiveLock` | `getLock()` Returns the recursive lock object of this surface, which synchronizes multithreaded access.
    `NativeSurface` | `getNativeSurface()` Returns the associated `NativeSurface` of this `NativeSurfaceHolder`.
    `int[]` | `getNativeSurfaceScale(int[] result)` Returns the native pixel scale of the associated `NativeSurface` reflecting it's currently bound monitor surface resolution in pixels.
    `NativeWindow` | `getParent()`
    `int[]` | `getRequestedSurfaceScale(int[] result)` Returns the requested pixel scale of the associated `NativeSurface`.
    `int` | `getScreenIndex()` Convenience: Get display handle from AbstractGraphicsConfiguration .
    `boolean` | `getShallUseOffscreenLayer()` Returns the property set by `OffscreenLayerOption.setShallUseOffscreenLayer(boolean)`.
    `long` | `getSurfaceHandle()` Returns the handle to the surface for this NativeSurface.
    `int` | `getSurfaceHeight()` Returns the height of the client area excluding insets (window decorations) in pixel units.
    `Thread` | `getSurfaceLockOwner()` Return the locking owner's Thread, or null if not locked.
    `int` | `getSurfaceWidth()` Returns the width of the client area excluding insets (window decorations) in pixel units.
    `int` | `getWidth()` Returns the width of the client area excluding insets (window decorations) in window units.
    `long` | `getWindowHandle()` Returns the window handle for this NativeWindow.
    `int` | `getX()` Returns the x position of the top-left corner of the client area relative to it's parent in window units.
    `int` | `getY()` Returns the current y position of the top-left corner of the client area relative to it's parent in window units.
    `boolean` | `hasFocus()` Returns true if this native window owns the focus, otherwise false.
    `boolean` | `hideCursor()` Optional method hiding the cursor in the corresponding on-screen surface/window, if exists.
    `boolean` | `isApplet()` Returns true if the AWT component is parented to an `Applet`, otherwise false.
    `boolean` | `isOffscreenLayerSurfaceEnabled()` Returns true if this instance uses an offscreen layer, otherwise false.
    `boolean` | `isSurfaceLayerAttached()` Returns true if a surface layer is attached, otherwise false.
    `boolean` | `isSurfaceLockedByOtherThread()` Query if surface is locked by another thread, i.e.
    `int` | `lockSurface()` Lock the surface of this native window.
    `void` | `removeSurfaceUpdatedListener(SurfaceUpdatedListener l)` Remove the specified `SurfaceUpdatedListener` from the list.
    `void` | `setChosenCapabilities(CapabilitiesImmutable caps)` Sets the capabilities of this instance, allowing upstream API's to refine it, i.e.
    `boolean` | `setCursor(PixelRectangle pixelrect, PointImmutable hotSpot)` Optional method setting cursor in the corresponding on-screen surface/window, if exists.
    `void` | `setShallUseOffscreenLayer(boolean v)` Request an offscreen layer, if supported.
    `void` | `setSurfaceScale(int[] pixelScale)` Request a pixel scale in x- and y-direction for the associated `NativeSurface`.
    `boolean` | `surfaceSwap()` Provide a mechanism to utilize custom (pre-) swap surface code.
    `void` | `surfaceUpdated(Object updater, NativeSurface ns, long when)` Notification of a surface update event, eg.
    `String` | `toString()`
    `void` | `unlockSurface()` Unlock the surface of this native window Shall not modify the surface handle, see `NativeSurface.lockSurface()`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### setSurfaceScale

          public void setSurfaceScale(int[] pixelScale)

      Request a pixel scale in x- and y-direction for the associated `NativeSurface`.

      Default pixel scale request for both directions is `ScalableSurface.AUTOMAX_PIXELSCALE`.

      In case platform only supports uniform pixel scale, i.e. one scale for both directions, either `ScalableSurface.AUTOMAX_PIXELSCALE` or the maximum requested pixel scale component is used.

      The requested pixel scale will be validated against platform limits before native scale-setup, i.e. clipped to `ScalableSurface.IDENTITY_PIXELSCALE` if not supported or clipped to the platform maximum. It can be queried via `ScalableSurface.getRequestedSurfaceScale(int[])`.

      The actual realized pixel scale values of the `NativeSurface` can be queried via `ScalableSurface.getCurrentSurfaceScale(int[])` or computed via `surface.`convertToPixelUnits`(new int[] { 1, 1 })`

      Per default impl. only works for not yet `realized` instances, current exception OSX.

      Specified by:
        `setSurfaceScale` in interface `ScalableSurface`
      Parameters:
        `pixelScale` - requested surface pixel scale int[2] values for x- and y-direction.

    - #### getRequestedSurfaceScale

          public final int[] getRequestedSurfaceScale(int[] result)

      Description copied from interface: `ScalableSurface`
      Returns the requested pixel scale of the associated `NativeSurface`.
      Specified by:
        `getRequestedSurfaceScale` in interface `ScalableSurface`
      Parameters:
        `result` - int[2] storage for the result
      Returns:
        the passed storage containing the requested pixelScale for chaining

    - #### getCurrentSurfaceScale

          public final int[] getCurrentSurfaceScale(int[] result)

      Description copied from interface: `ScalableSurface`
      Returns the current pixel scale of the associated `NativeSurface`.
      Specified by:
        `getCurrentSurfaceScale` in interface `ScalableSurface`
      Parameters:
        `result` - int[2] storage for the result
      Returns:
        the passed storage containing the current pixelScale for chaining

    - #### getNativeSurfaceScale

          public final int[] getNativeSurfaceScale(int[] result)

      Description copied from interface: `ScalableSurface`
      Returns the native pixel scale of the associated `NativeSurface` reflecting it's currently bound monitor surface resolution in pixels.

      The native pixel scale maybe used to determine the proper dpi value of this `NativeSurface`:

              surfacePpMM = monitorPpMM * currentSurfaceScale / nativeSurfaceScale,
              with PpMM == pixel per millimeter

      Specified by:
        `getNativeSurfaceScale` in interface `ScalableSurface`
      Parameters:
        `result` - int[2] storage for the result
      Returns:
        the passed storage containing the native pixelScale for chaining

    - #### getBounds

          public final RectangleImmutable getBounds()

      Returns:
        the JAWT_DrawingSurfaceInfo's (JAWT_Rectangle) bounds, updated with lock

    - #### getInsets

          public final InsetsImmutable getInsets()

      Description copied from interface: `NativeWindow`
      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

             NativeWindow.getX() - getInsets().getLeftWidth()
             NativeWindow.getY() - getInsets().getTopHeight()

      The top-level window size is

             NativeWindow.getWidth()  + getInsets().getTotalWidth()
             NativeWindow.getHeight() + getInsets().getTotalHeight()

      Specified by:
        `getInsets` in interface `NativeWindow`
      Returns:
        insets

    - #### getAWTComponent

          public final Component getAWTComponent()

    - #### isApplet

          public final boolean isApplet()

      Returns true if the AWT component is parented to an `Applet`, otherwise false. This information is valid only after `lockSurface()`.

    - #### getJAWT

          public final jogamp.nativewindow.jawt.JAWT getJAWT()

      Returns the underlying JAWT instance created @ `lockSurface()`.

    - #### setShallUseOffscreenLayer

          public void setShallUseOffscreenLayer(boolean v)

      Description copied from interface: `OffscreenLayerOption`
      Request an offscreen layer, if supported.

      Shall be called before the first `NativeSurface.lockSurface()`, and hence before realization.

      Specified by:
        `setShallUseOffscreenLayer` in interface `OffscreenLayerOption`
      See Also:
        `OffscreenLayerOption.getShallUseOffscreenLayer()`, `OffscreenLayerOption.isOffscreenLayerSurfaceEnabled()`

    - #### getShallUseOffscreenLayer

          public final boolean getShallUseOffscreenLayer()

      Description copied from interface: `OffscreenLayerOption`
      Returns the property set by `OffscreenLayerOption.setShallUseOffscreenLayer(boolean)`.
      Specified by:
        `getShallUseOffscreenLayer` in interface `OffscreenLayerOption`

    - #### isOffscreenLayerSurfaceEnabled

          public final boolean isOffscreenLayerSurfaceEnabled()

      Description copied from interface: `OffscreenLayerOption`
      Returns true if this instance uses an offscreen layer, otherwise false.

      This instance is an offscreen layer, if `setShallUseOffscreenLayer(true)` has been called before it's realization and first lock and the underlying implementation supports it.

      The return value is undefined before issuing the first `NativeSurface.lockSurface()`.
      Specified by:
        `isOffscreenLayerSurfaceEnabled` in interface `OffscreenLayerOption`
      See Also:
        `OffscreenLayerOption.setShallUseOffscreenLayer(boolean)`

    - #### attachSurfaceLayer

          public final void attachSurfaceLayer(long layerHandle)
                                        throws NativeWindowException

      Description copied from interface: `OffscreenLayerSurface`
      Attach the offscreen layer to this offscreen layer surface.

      Implementation may realize all required resources at this point.

      Specified by:
        `attachSurfaceLayer` in interface `OffscreenLayerSurface`
      Throws:
        `NativeWindowException` - if `#isOffscreenLayerSurfaceEnabled()` == false
      See Also:
        `#isOffscreenLayerSurfaceEnabled()`

    - #### detachSurfaceLayer

          public final void detachSurfaceLayer()
                                        throws NativeWindowException

      Description copied from interface: `OffscreenLayerSurface`
      Detaches a previously attached offscreen layer from this offscreen layer surface.
      Specified by:
        `detachSurfaceLayer` in interface `OffscreenLayerSurface`
      Throws:
        `NativeWindowException` - if `#isOffscreenLayerSurfaceEnabled()` == false or no surface layer is attached.
      See Also:
        `OffscreenLayerSurface.attachSurfaceLayer(long)`, `#isOffscreenLayerSurfaceEnabled()`

    - #### getAttachedSurfaceLayer

          public final long getAttachedSurfaceLayer()

      Description copied from interface: `OffscreenLayerSurface`
      Returns the attached surface layer or null if none is attached.
      Specified by:
        `getAttachedSurfaceLayer` in interface `OffscreenLayerSurface`

    - #### isSurfaceLayerAttached

          public final boolean isSurfaceLayerAttached()

      Description copied from interface: `OffscreenLayerSurface`
      Returns true if a surface layer is attached, otherwise false.
      Specified by:
        `isSurfaceLayerAttached` in interface `OffscreenLayerSurface`

    - #### setChosenCapabilities

          public final void setChosenCapabilities(CapabilitiesImmutable caps)

      Description copied from interface: `OffscreenLayerSurface`
      Sets the capabilities of this instance, allowing upstream API's to refine it, i.e. OpenGL related settings.
      Specified by:
        `setChosenCapabilities` in interface `OffscreenLayerSurface`

    - #### getLock

          public final RecursiveLock getLock()

      Description copied from interface: `OffscreenLayerSurface`
      Returns the recursive lock object of this surface, which synchronizes multithreaded access.
      Specified by:
        `getLock` in interface `OffscreenLayerSurface`

    - #### setCursor

          public final boolean setCursor(PixelRectangle pixelrect,
                          PointImmutable hotSpot)

      Description copied from interface: `OffscreenLayerSurface`
      Optional method setting cursor in the corresponding on-screen surface/window, if exists.
      Specified by:
        `setCursor` in interface `OffscreenLayerSurface`
      Parameters:
        `pixelrect` - cursor pixels, maybe null for default cursor
        `hotSpot` - maybe null for default cursor
      Returns:
        true if successful, i.e. on-screen surface/window w/ cursor capabilities exists. Otherwise false.

    - #### hideCursor

          public final boolean hideCursor()

      Description copied from interface: `OffscreenLayerSurface`
      Optional method hiding the cursor in the corresponding on-screen surface/window, if exists.
      Specified by:
        `hideCursor` in interface `OffscreenLayerSurface`
      Returns:
        true if successful, i.e. on-screen surface/window w/ cursor capabilities exists. Otherwise false.

    - #### lockSurface

          public final int lockSurface()
                                throws NativeWindowException,
                                       RuntimeException

      Description copied from interface: `NativeSurface`
      Lock the surface of this native window.

      The surface handle shall be valid after a successfull call, ie return a value other than `NativeSurface.LOCK_SURFACE_UNLOCKED` and `NativeSurface.LOCK_SURFACE_NOT_READY`, which is

              boolean ok = LOCK_SURFACE_NOT_READY < lockSurface();

      The caller may need to take care of the result `NativeSurface.LOCK_SURFACE_CHANGED`, where the surface handle is valid but has changed.

      This call is blocking until the surface has been locked or a timeout is reached. The latter will throw a runtime exception.

      This call allows recursion from the same thread.

      The implementation may want to aquire the application level `RecursiveLock` first before proceeding with a native surface lock.

      The implementation shall also invoke `AbstractGraphicsDevice.lock()` for the initial lock (recursive count zero).

      Specified by:
        `lockSurface` in interface `NativeSurface`
      Returns:
        `NativeSurface.LOCK_SUCCESS`, `NativeSurface.LOCK_SURFACE_CHANGED` or `NativeSurface.LOCK_SURFACE_NOT_READY`.
      Throws:
        `NativeWindowException` - if native locking failed, maybe platform related
        `RuntimeException` - after timeout when waiting for the surface lock
      See Also:
        `RecursiveLock`

    - #### unlockSurface

          public final void unlockSurface()

      Description copied from interface: `NativeSurface`
      Unlock the surface of this native window Shall not modify the surface handle, see `NativeSurface.lockSurface()`

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

      The implementation shall be fail safe, i.e. tolerant in case the native resources are already released / unlocked. In this case the implementation shall simply ignore the call.

      Specified by:
        `unlockSurface` in interface `NativeSurface`
      See Also:
        `NativeSurface.lockSurface()`, `RecursiveLock`

    - #### isSurfaceLockedByOtherThread

          public final boolean isSurfaceLockedByOtherThread()

      Description copied from interface: `NativeSurface`
      Query if surface is locked by another thread, i.e. not the current one.
      Convenient shortcut for:

             final Thread o = getSurfaceLockOwner();
             if( null != o && Thread.currentThread() != o ) { .. }

      Specified by:
        `isSurfaceLockedByOtherThread` in interface `NativeSurface`

    - #### getSurfaceLockOwner

          public final Thread getSurfaceLockOwner()

      Description copied from interface: `NativeSurface`
      Return the locking owner's Thread, or null if not locked.
      Specified by:
        `getSurfaceLockOwner` in interface `NativeSurface`

    - #### surfaceSwap

          public boolean surfaceSwap()

      Description copied from interface: `NativeSurface`
      Provide a mechanism to utilize custom (pre-) swap surface code. This method is called before the render toolkit (e.g. JOGL) swaps the buffer/surface if double buffering is enabled.

      The implementation may itself apply the swapping, in which case true shall be returned.

      Specified by:
        `surfaceSwap` in interface `NativeSurface`
      Returns:
        true if this method completed swapping the surface, otherwise false, in which case eg the GLDrawable implementation has to swap the code.

    - #### addSurfaceUpdatedListener

          public void addSurfaceUpdatedListener(SurfaceUpdatedListener l)

      Description copied from interface: `NativeSurface`
      Appends the given `SurfaceUpdatedListener` to the end of the list.
      Specified by:
        `addSurfaceUpdatedListener` in interface `NativeSurface`

    - #### addSurfaceUpdatedListener

          public void addSurfaceUpdatedListener(int index,
                                       SurfaceUpdatedListener l)
                                         throws IndexOutOfBoundsException

      Description copied from interface: `NativeSurface`
      Inserts the given `SurfaceUpdatedListener` at the specified position in the list.
      Specified by:
        `addSurfaceUpdatedListener` in interface `NativeSurface`
      Parameters:
        `index` - 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().
        `l` - The listener object to be inserted
      Throws:
        `IndexOutOfBoundsException` - If the index is not within (0 <= index && index <= size()), or -1

    - #### removeSurfaceUpdatedListener

          public void removeSurfaceUpdatedListener(SurfaceUpdatedListener l)

      Description copied from interface: `NativeSurface`
      Remove the specified `SurfaceUpdatedListener` from the list.
      Specified by:
        `removeSurfaceUpdatedListener` in interface `NativeSurface`

    - #### surfaceUpdated

          public void surfaceUpdated(Object updater,
                            NativeSurface ns,
                            long when)

      Description copied from interface: `SurfaceUpdatedListener`
      Notification of a surface update event, eg. after a swap buffer operation.
      Specified by:
        `surfaceUpdated` in interface `SurfaceUpdatedListener`
      Parameters:
        `updater` - is the caller object who updated the surface, e.g. a JOGL GLDrawable.
        `ns` - the updated NativeSurface
        `when` - the time in ms, when the surface was updated

    - #### getSurfaceHandle

          public long getSurfaceHandle()

      Description copied from interface: `NativeSurface`
      Returns the handle to the surface for this NativeSurface.

      The surface handle should be set/update by `NativeSurface.lockSurface()`, where `NativeSurface.unlockSurface()` is not allowed to modify it. After `NativeSurface.unlockSurface()` it is no more guaranteed that the surface handle is still valid. The surface handle shall reflect the platform one for all drawable surface operations, e.g. opengl, swap-buffer.

      On X11 this returns an entity of type Window, since there is no differentiation of surface and window there.
      On Microsoft Windows this returns an entity of type HDC.

      Specified by:
        `getSurfaceHandle` in interface `NativeSurface`

    - #### getGraphicsConfiguration

          public final AbstractGraphicsConfiguration getGraphicsConfiguration()

      Description copied from interface: `NativeSurface`
      Returns the graphics configuration corresponding to this window.

      In case the implementation utilizes a delegation pattern to wrap abstract toolkits, this method shall return the native `AbstractGraphicsConfiguration` via `AbstractGraphicsConfiguration.getNativeGraphicsConfiguration()`.

      Specified by:
        `getGraphicsConfiguration` in interface `NativeSurface`
      See Also:
        `AbstractGraphicsConfiguration.getNativeGraphicsConfiguration()`, `javax.media.nativewindow.GraphicsConfigurationFactory#chooseGraphicsConfiguration(Capabilities, CapabilitiesChooser, AbstractGraphicsScreen)`

    - #### getDisplayHandle

          public final long getDisplayHandle()

      Description copied from interface: `NativeSurface`
      Convenience: Get display handle from AbstractGraphicsConfiguration . AbstractGraphicsScreen . AbstractGraphicsDevice
      Specified by:
        `getDisplayHandle` in interface `NativeSurface`

    - #### getScreenIndex

          public final int getScreenIndex()

      Description copied from interface: `NativeSurface`
      Convenience: Get display handle from AbstractGraphicsConfiguration . AbstractGraphicsScreen
      Specified by:
        `getScreenIndex` in interface `NativeSurface`

    - #### getSurfaceWidth

          public final int getSurfaceWidth()

      Description copied from interface: `NativeSurface`
      Returns the width of the client area excluding insets (window decorations) in pixel units.
      Specified by:
        `getSurfaceWidth` in interface `NativeSurface`
      Returns:
        width of the client area in pixel units
      See Also:
        `NativeWindow.getWidth()`, `NativeSurface.convertToWindowUnits(int[])`

    - #### getSurfaceHeight

          public final int getSurfaceHeight()

      Description copied from interface: `NativeSurface`
      Returns the height of the client area excluding insets (window decorations) in pixel units.
      Specified by:
        `getSurfaceHeight` in interface `NativeSurface`
      Returns:
        height of the client area in pixel units
      See Also:
        `NativeWindow.getHeight()`, `NativeSurface.convertToWindowUnits(int[])`

    - #### convertToWindowUnits

          public final int[] convertToWindowUnits(int[] pixelUnitsAndResult)

      Description copied from interface: `NativeSurface`
      Converts the given pixel units into window units in place.
      Specified by:
        `convertToWindowUnits` in interface `NativeSurface`
      Parameters:
        `pixelUnitsAndResult` - int[2] storage holding the pixel units for the x- and y-coord to convert and the resulting values.
      Returns:
        result int[2] storage pixelUnitsAndResult for chaining holding the converted values

    - #### convertToPixelUnits

          public final int[] convertToPixelUnits(int[] windowUnitsAndResult)

      Description copied from interface: `NativeSurface`
      Converts the given window units into pixel units in place.
      Specified by:
        `convertToPixelUnits` in interface `NativeSurface`
      Parameters:
        `windowUnitsAndResult` - int[2] storage holding the window units for the x- and y-coord to convert and the resulting values.
      Returns:
        result int[2] storage windowUnitsAndResult for chaining holding the converted values

    - #### getNativeSurface

          public final NativeSurface getNativeSurface()

      Description copied from interface: `NativeWindow`
      Returns the associated `NativeSurface` of this `NativeSurfaceHolder`.

      Returns this instance, which is-a `NativeSurface`.

      Specified by:
        `getNativeSurface` in interface `NativeSurfaceHolder`
      Specified by:
        `getNativeSurface` in interface `NativeWindow`

    - #### getWidth

          public final int getWidth()

      Description copied from interface: `NativeWindow`
      Returns the width of the client area excluding insets (window decorations) in window units.
      Specified by:
        `getWidth` in interface `NativeWindow`
      Returns:
        width of the client area in window units
      See Also:
        `NativeSurface.getSurfaceWidth()`

    - #### getHeight

          public final int getHeight()

      Description copied from interface: `NativeWindow`
      Returns the height of the client area excluding insets (window decorations) in window units.
      Specified by:
        `getHeight` in interface `NativeWindow`
      Returns:
        height of the client area in window units
      See Also:
        `NativeSurface.getSurfaceHeight()`

    - #### destroy

          public void destroy()

      Description copied from interface: `NativeWindow`
      Destroys this window incl. releasing all related resources.
      Specified by:
        `destroy` in interface `NativeWindow`

    - #### getParent

          public final NativeWindow getParent()

      Specified by:
        `getParent` in interface `NativeWindow`
      Returns:
        The parent NativeWindow, or null if this NativeWindow is top level.

    - #### getWindowHandle

          public long getWindowHandle()

      Description copied from interface: `NativeWindow`
      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.

      Specified by:
        `getWindowHandle` in interface `NativeWindow`

    - #### getX

          public final int getX()

      Description copied from interface: `NativeWindow`
      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.

      Specified by:
        `getX` in interface `NativeWindow`
      See Also:
        `NativeWindow.getInsets()`, `NativeWindow.getLocationOnScreen(Point)`

    - #### getY

          public final int getY()

      Description copied from interface: `NativeWindow`
      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.

      Specified by:
        `getY` in interface `NativeWindow`
      See Also:
        `NativeWindow.getInsets()`, `NativeWindow.getLocationOnScreen(Point)`

    - #### getLocationOnScreen

          public Point getLocationOnScreen(Point storage)

      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.

      This JAWT default implementation is currently still using a blocking implementation. It first attempts to retrieve the location via a native implementation. If this fails, it tries the blocking AWT implementation. If the latter fails due to an external AWT tree-lock, the non block implementation `getLocationOnScreenNonBlocking(Point, Component)` is being used. The latter simply traverse up to the AWT component tree and sums the rel. position. We have to determine whether the latter is good enough for all cases, currently only OS X utilizes the non blocking method per default.

      Specified by:
        `getLocationOnScreen` in interface `NativeWindow`
      Parameters:
        `storage` - Optional `Point` storage. If not null, `null`, it is translated about the resulting screen position and returned.
      See Also:
        `NativeWindow.getX()`, `NativeWindow.getY()`, `NativeWindow.getInsets()`

    - #### hasFocus

          public boolean hasFocus()

      Description copied from interface: `NativeWindow`
      Returns true if this native window owns the focus, otherwise false.
      Specified by:
        `hasFocus` in interface `NativeWindow`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright 2010 JogAmp Community.