public interface NativeWindow extends NativeSurface, NativeSurfaceHolder
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.
getX() and getY(). insets, i.e. window decoration.
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.
LOCK_SUCCESS, LOCK_SURFACE_CHANGED, LOCK_SURFACE_NOT_READY, LOCK_SURFACE_UNLOCKED| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroys this window incl.
|
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.
|
Point |
getLocationOnScreen(Point point)
Returns the window's top-left client-area position in the screen.
|
NativeSurface |
getNativeSurface()
Returns the associated
NativeSurface of this NativeSurfaceHolder. |
NativeWindow |
getParent() |
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.
|
addSurfaceUpdatedListener, addSurfaceUpdatedListener, convertToPixelUnits, convertToWindowUnits, getDisplayHandle, getGraphicsConfiguration, getScreenIndex, getSurfaceHandle, getSurfaceHeight, getSurfaceLockOwner, getSurfaceWidth, isSurfaceLockedByOtherThread, lockSurface, removeSurfaceUpdatedListener, surfaceSwap, unlockSurfacesurfaceUpdatedNativeSurface getNativeSurface()
NativeSurface of this NativeSurfaceHolder.
Returns this instance, which is-a NativeSurface.
getNativeSurface in interface NativeSurfaceHoldervoid destroy()
NativeWindow getParent()
long getWindowHandle()
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.
InsetsImmutable getInsets()
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
The top-level window size isgetX()- getInsets().getLeftWidth()getY()- getInsets().getTopHeight()
getWidth()+ getInsets().getTotalWidth()getHeight()+ getInsets().getTotalHeight()
int getX()
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.
getInsets(),
getLocationOnScreen(Point)int getY()
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.
getInsets(),
getLocationOnScreen(Point)int getWidth()
NativeSurface.getSurfaceWidth()int getHeight()
NativeSurface.getSurfaceHeight()Point getLocationOnScreen(Point point)
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.
point - Optional Point storage.
If not null, null, it is translated about the resulting screen position
and returned.getX(),
getY(),
getInsets()boolean hasFocus()
Copyright 2010 JogAmp Community.