|
JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java (public API).
|
Public Member Functions | |||
| final void | setAWTGraphicsConfiguration (final AWTGraphicsConfiguration config) | ||
Set a new AWTGraphicsConfiguration instance, as required if upstream component's GraphicsConfiguration has been changed due to reconfiguration, e.g. More... | |||
| final AWTGraphicsConfiguration | getAWTGraphicsConfiguration () | ||
Return the current AWTGraphicsConfiguration instance, which also holds its upstream component's GraphicsConfiguration. More... | |||
| final boolean | canSetSurfaceScale () | ||
Returns true if setSurfaceScale(float[]) is supported, otherwise false.For pure downstream scalable surfaces like AWT widgets, setting the picel scale is not supported since the pixel scale is set by the underlying toolkit. More... | |||
| boolean | setSurfaceScale (final float[] pixelScale) | ||
Request a pixel scale in x- and y-direction for the associated NativeSurface, where size_in_pixel_units = pixel_scale * size_in_window_units.Default pixel scale request for both directions is AUTOMAX_PIXELSCALE. If canSetSurfaceScale() returns false, requested pixel scale is AUTOMAX_PIXELSCALE, immutable and method returns false. In case platform only supports uniform pixel scale, i.e. one scale for both directions, either 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 IDENTITY_PIXELSCALE if not supported or clipped to the platform maximum. It can be queried via getRequestedSurfaceScale(float[]). The actual realized pixel scale values of the NativeSurface can be queried via getCurrentSurfaceScale(float[]) or computed via surface.
| |||
| final float[] | getRequestedSurfaceScale (final float[] result) | ||
Returns the requested pixel scale of the associated NativeSurface.If canSetSurfaceScale() returns false, requested pixel scale is AUTOMAX_PIXELSCALE and immutable.
| |||
| final float[] | getCurrentSurfaceScale (final float[] result) | ||
Returns the current pixel scale of the associated NativeSurface. More... | |||
| float[] | getMinimumSurfaceScale (final float[] result) | ||
Returns the minimum pixel scale of the associated NativeSurface.
| |||
| final float[] | getMaximumSurfaceScale (final float[] result) | ||
Returns the maximum pixel scale of the associated NativeSurface.The maximum pixel scale maybe used to determine the proper dpi value of the monitor displaying this NativeSurface. surfacePpMM = monitorPpMM * currentSurfaceScale / nativeSurfaceScale, with PpMM == pixel per millimeter
| |||
| final boolean | updatePixelScale (final GraphicsConfiguration gc, final boolean clearFlag) | ||
Updates the minimum and maximum pixel-scale values and returns true if they were updated. More... | |||
| final boolean | hasPixelScaleChanged () | ||
Returns and clears the hasPixelScaleChanged flag, as set via lockSurface(). More... | |||
| final RectangleImmutable | getJAWTSurfaceBounds () | ||
| final 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. More... | |||
| final Component | getAWTComponent () | ||
| final boolean | isApplet () | ||
Return false since there is no more java.applet.Applet support. More... | |||
| final JAWT | getJAWT () | ||
Returns the underlying JAWT instance created @ lockSurface(). More... | |||
| void | setShallUseOffscreenLayer (final boolean v) | ||
| Request an offscreen layer, if supported. More... | |||
| final boolean | getShallUseOffscreenLayer () | ||
Returns the property set by setShallUseOffscreenLayer(boolean). More... | |||
| final boolean | isOffscreenLayerSurfaceEnabled () | ||
| Returns true if this instance uses an offscreen layer, otherwise false. More... | |||
| final void | attachSurfaceLayer (final long layerHandle) throws NativeWindowException | ||
| Attach the offscreen layer to this offscreen layer surface. More... | |||
| final void | detachSurfaceLayer () throws NativeWindowException | ||
| Detaches a previously attached offscreen layer from this offscreen layer surface. More... | |||
| final long | getAttachedSurfaceLayer () | ||
| Returns the attached surface layer or null if none is attached. More... | |||
| final boolean | isSurfaceLayerAttached () | ||
| Returns true if a surface layer is attached, otherwise false. More... | |||
| final void | setChosenCapabilities (final CapabilitiesImmutable caps) | ||
| Sets the capabilities of this instance, allowing upstream API's to refine it, i.e. More... | |||
| final RecursiveLock | getLock () | ||
| Returns the recursive lock object of this surface, which synchronizes multithreaded access. More... | |||
| final boolean | setCursor (final PixelRectangle pixelrect, final PointImmutable hotSpot) | ||
| Optional method setting cursor in the corresponding on-screen surface/window, if exists. More... | |||
| final boolean | hideCursor () | ||
| Optional method hiding the cursor in the corresponding on-screen surface/window, if exists. More... | |||
| final int | lockSurface () throws NativeWindowException, RuntimeException | ||
| Lock the surface of this native window. More... | |||
| final void | unlockSurface () | ||
| Unlock the surface of this native window. More... | |||
| final boolean | isSurfaceLockedByOtherThread () | ||
| Query if surface is locked by another thread, i.e. More... | |||
| final Thread | getSurfaceLockOwner () | ||
| Return the locking owner's Thread, or null if not locked. More... | |||
| boolean | surfaceSwap () | ||
| Provide a mechanism to utilize custom (pre-) swap surface code. More... | |||
| void | addSurfaceUpdatedListener (final SurfaceUpdatedListener l) | ||
Appends the given SurfaceUpdatedListener to the end of the list. More... | |||
| void | addSurfaceUpdatedListener (final int index, final SurfaceUpdatedListener l) throws IndexOutOfBoundsException | ||
Inserts the given SurfaceUpdatedListener at the specified position in the list. More... | |||
| void | removeSurfaceUpdatedListener (final SurfaceUpdatedListener l) | ||
Remove the specified SurfaceUpdatedListener from the list. More... | |||
| void | surfaceUpdated (final Object updater, final NativeSurface ns, final long when) | ||
| Notification of a surface update event, eg. More... | |||
| long | getSurfaceHandle () | ||
| Returns the handle to the surface for this NativeSurface. More... | |||
| final AbstractGraphicsConfiguration | getGraphicsConfiguration () | ||
| Returns the graphics configuration corresponding to this window. More... | |||
| final long | getDisplayHandle () | ||
| Convenience: Get display handle from AbstractGraphicsConfiguration . More... | |||
| final int | getScreenIndex () | ||
| Convenience: Get display handle from AbstractGraphicsConfiguration . More... | |||
| final int | getSurfaceWidth () | ||
| Returns the width of the client area excluding insets (window decorations) in pixel units. More... | |||
| final int | getSurfaceHeight () | ||
| Returns the height of the client area excluding insets (window decorations) in pixel units. More... | |||
| final int[] | convertToWindowUnits (final int[] pixelUnitsAndResult) | ||
| Converts the given pixel units into window units in place. More... | |||
| final int[] | convertToPixelUnits (final int[] windowUnitsAndResult) | ||
| Converts the given window units into pixel units in place. More... | |||
| final NativeSurface | getNativeSurface () | ||
Returns the associated NativeSurface of this NativeSurfaceHolder.Returns this instance, which is-a NativeSurface. More... | |||
| final int | getX () | ||
| Returns the current x position of this window, relative to it's parent. More... | |||
| final int | getY () | ||
| Returns the current y position of the top-left corner of the client area relative to it's parent in window units. More... | |||
| final int | getWidth () | ||
| Returns the width of the client area excluding insets (window decorations) in window units. More... | |||
| final int | getHeight () | ||
| Returns the height of the client area excluding insets (window decorations) in window units. More... | |||
| final Rectangle | getBounds () | ||
Returns a newly created Rectangle containing window origin, getX() & getY(), and size, getWidth() & getHeight(), in window units. More... | |||
| final Rectangle | getSurfaceBounds () | ||
Returns a newly created Rectangle containing window's surface origin and size in pixel units. More... | |||
| void | destroy () | ||
| Destroys this window incl. More... | |||
| final NativeWindow | getParent () | ||
| long | getWindowHandle () | ||
| Returns the window handle for this NativeWindow. More... | |||
| Point | getLocationOnScreen (final 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.
| |||
| boolean | hasFocus () | ||
| Returns true if this native window owns the focus, otherwise false. More... | |||
| String | toString () | ||
| NativeSurface | getNativeSurface () | ||
Returns the associated NativeSurface of this NativeSurfaceHolder. More... | |||
| void | destroy () | ||
| Destroys this window incl. More... | |||
| NativeWindow | getParent () | ||
| long | getWindowHandle () | ||
| Returns the window handle for this NativeWindow. More... | |||
| 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. More... | |||
| int | getX () | ||
| Returns the current x position of this window, relative to it's parent. More... | |||
| int | getY () | ||
| Returns the current y position of the top-left corner of the client area relative to it's parent in window units. More... | |||
| int | getWidth () | ||
| Returns the width of the client area excluding insets (window decorations) in window units. More... | |||
| int | getHeight () | ||
| Returns the height of the client area excluding insets (window decorations) in window units. More... | |||
| Rectangle | getBounds () | ||
Returns a newly created Rectangle containing window origin, getX() & getY(), and size, getWidth() & getHeight(), in window units. More... | |||
| Rectangle | getSurfaceBounds () | ||
Returns a newly created Rectangle containing window's surface origin and size in pixel units. More... | |||
| Point | getLocationOnScreen (Point point) | ||
| Returns the window's top-left client-area position in the screen. More... | |||
| boolean | hasFocus () | ||
| Returns true if this native window owns the focus, otherwise false. More... | |||
| RecursiveLock | getLock () | ||
Returns the implementation's RecursiveLock synchronizing multithreaded access if used. More... | |||
| int | lockSurface () throws NativeWindowException, RuntimeException | ||
| Lock the surface of this native window. More... | |||
| void | unlockSurface () | ||
| Unlock the surface of this native window. More... | |||
| boolean | isSurfaceLockedByOtherThread () | ||
| Query if surface is locked by another thread, i.e. More... | |||
| Thread | getSurfaceLockOwner () | ||
| Return the locking owner's Thread, or null if not locked. More... | |||
| boolean | surfaceSwap () | ||
| Provide a mechanism to utilize custom (pre-) swap surface code. More... | |||
| void | addSurfaceUpdatedListener (SurfaceUpdatedListener l) | ||
Appends the given SurfaceUpdatedListener to the end of the list. More... | |||
| void | addSurfaceUpdatedListener (int index, SurfaceUpdatedListener l) throws IndexOutOfBoundsException | ||
Inserts the given SurfaceUpdatedListener at the specified position in the list. More... | |||
| void | removeSurfaceUpdatedListener (SurfaceUpdatedListener l) | ||
Remove the specified SurfaceUpdatedListener from the list. More... | |||
| long | getSurfaceHandle () | ||
| Returns the handle to the surface for this NativeSurface. More... | |||
| int | getSurfaceWidth () | ||
| Returns the width of the client area excluding insets (window decorations) in pixel units. More... | |||
| int | getSurfaceHeight () | ||
| Returns the height of the client area excluding insets (window decorations) in pixel units. More... | |||
| int[] | convertToWindowUnits (final int[] pixelUnitsAndResult) | ||
| Converts the given pixel units into window units in place. More... | |||
| int[] | convertToPixelUnits (final int[] windowUnitsAndResult) | ||
| Converts the given window units into pixel units in place. More... | |||
| AbstractGraphicsConfiguration | getGraphicsConfiguration () | ||
| Returns the graphics configuration corresponding to this window. More... | |||
| long | getDisplayHandle () | ||
| Convenience: Get display handle from AbstractGraphicsConfiguration . More... | |||
| int | getScreenIndex () | ||
| Convenience: Get display handle from AbstractGraphicsConfiguration . More... | |||
| void | surfaceUpdated (Object updater, NativeSurface ns, long when) | ||
| Notification of a surface update event, eg. More... | |||
| NativeSurface | getNativeSurface () | ||
Returns the associated NativeSurface of this NativeSurfaceHolder. More... | |||
| void | attachSurfaceLayer (final long layerHandle) throws NativeWindowException | ||
| Attach the offscreen layer to this offscreen layer surface. More... | |||
| void | detachSurfaceLayer () throws NativeWindowException | ||
| Detaches a previously attached offscreen layer from this offscreen layer surface. More... | |||
| long | getAttachedSurfaceLayer () | ||
| Returns the attached surface layer or null if none is attached. More... | |||
| boolean | isSurfaceLayerAttached () | ||
| Returns true if a surface layer is attached, otherwise false. More... | |||
| void | setChosenCapabilities (CapabilitiesImmutable caps) | ||
| Sets the capabilities of this instance, allowing upstream API's to refine it, i.e. More... | |||
| RecursiveLock | getLock () | ||
| Returns the recursive lock object of this surface, which synchronizes multithreaded access. More... | |||
| boolean | setCursor (PixelRectangle pixelrect, PointImmutable hotSpot) | ||
| Optional method setting cursor in the corresponding on-screen surface/window, if exists. More... | |||
| boolean | hideCursor () | ||
| Optional method hiding the cursor in the corresponding on-screen surface/window, if exists. More... | |||
| void | setShallUseOffscreenLayer (boolean v) | ||
| Request an offscreen layer, if supported. More... | |||
| boolean | getShallUseOffscreenLayer () | ||
Returns the property set by setShallUseOffscreenLayer(boolean). More... | |||
| boolean | isOffscreenLayerSurfaceEnabled () | ||
| Returns true if this instance uses an offscreen layer, otherwise false. More... | |||
| boolean | canSetSurfaceScale () | ||
Returns true if setSurfaceScale(float[]) is supported, otherwise false. More... | |||
| boolean | setSurfaceScale (final float[] pixelScale) | ||
Request a pixel scale in x- and y-direction for the associated NativeSurface, where size_in_pixel_units = pixel_scale * size_in_window_units. More... | |||
| float[] | getRequestedSurfaceScale (final float[] result) | ||
Returns the requested pixel scale of the associated NativeSurface. More... | |||
| float[] | getCurrentSurfaceScale (final float[] result) | ||
Returns the current pixel scale of the associated NativeSurface. More... | |||
| float[] | getMinimumSurfaceScale (final float[] result) | ||
Returns the minimum pixel scale of the associated NativeSurface. More... | |||
| float[] | getMaximumSurfaceScale (final float[] result) | ||
Returns the maximum pixel scale of the associated NativeSurface. More... | |||
Protected Member Functions | |
| JAWTWindow (final Object comp, final AbstractGraphicsConfiguration config) | |
Constructed by jogamp.nativewindow.NativeWindowFactoryImpl#getNativeWindow(Object, AbstractGraphicsConfiguration) via this platform's specialization (X11, OSX, Windows, ..). More... | |
| synchronized void | invalidate () |
| abstract void | invalidateNative (final long _offscreenSurfaceLayer) |
| final boolean | updateLockedData (final JAWT_Rectangle jawtBounds, final GraphicsConfiguration gc) |
| Updates bounds and pixelScale. More... | |
| final float | getPixelScaleX () |
| final float | getPixelScaleY () |
| void | attachSurfaceLayerImpl (final long _offscreenSurfaceLayer) |
| void | layoutSurfaceLayerImpl (final boolean visible) |
| Layout the offscreen layer according to the implementing class's constraints. More... | |
| void | detachSurfaceLayerImpl (final long _offscreenSurfaceLayer) |
| abstract JAWT | fetchJAWTImpl () throws NativeWindowException |
| private void determineIfApplet() { boolean isApplet = false; // dummy Component c = component; while(!isApplet && null != c) { isApplet = c instanceof java.applet.Applet; c = c.getParent(); } } More... | |
| abstract int | lockSurfaceImpl (GraphicsConfiguration gc) throws NativeWindowException |
| void | dumpJAWTInfo () |
| abstract void | unlockSurfaceImpl () throws NativeWindowException |
| Point | getLocationOnScreenNative (final Point storage) |
| abstract Point | getLocationOnScreenNativeImpl (int x, int y) |
| StringBuilder | jawt2String (StringBuilder sb) |
Static Protected Member Functions | |
| static final String | toHexString (final long l) |
| static final String | toHexString (final int i) |
Protected Attributes | |
| boolean | shallUseOffscreenLayer = false |
| final Component | component |
| long | drawable |
| Rectangle | jawt_surface_bounds |
| Insets | insets |
Static Protected Attributes | |
| static final boolean | DEBUG = JAWTUtil.DEBUG |
Additional Inherited Members | |
Static Public Attributes inherited from com.jogamp.nativewindow.NativeSurface | |
| static final int | LOCK_SURFACE_UNLOCKED = 0 |
| Unlocked state, {@value}. More... | |
| static final int | LOCK_SURFACE_NOT_READY = 1 |
Returned by lockSurface() if the surface is not ready to be locked, {@value}. More... | |
| static final int | LOCK_SURFACE_CHANGED = 2 |
Returned by lockSurface() if the surface is locked, but has changed, {@value}. More... | |
| static final int | LOCK_SUCCESS = 3 |
Returned by lockSurface() if the surface is locked, and is unchanged, {@value}. More... | |
Static Public Attributes inherited from com.jogamp.nativewindow.ScalableSurface | |
| static final float | IDENTITY_PIXELSCALE = 1f |
| Setting surface-pixel-scale of {@value}, results in same pixel- and window-units. More... | |
| static final float | AUTOMAX_PIXELSCALE = 0f |
| Setting surface-pixel-scale of {@value}, results in maximum platform dependent pixel-scale, i.e. More... | |
Definition at line 83 of file JAWTWindow.java.
|
protected |
Constructed by jogamp.nativewindow.NativeWindowFactoryImpl#getNativeWindow(Object, AbstractGraphicsConfiguration) via this platform's specialization (X11, OSX, Windows, ..).
| comp | |
| config |
Definition at line 116 of file JAWTWindow.java.
| void com.jogamp.nativewindow.awt.JAWTWindow.addSurfaceUpdatedListener | ( | final int | index, |
| final SurfaceUpdatedListener | l | ||
| ) | throws IndexOutOfBoundsException |
Inserts the given SurfaceUpdatedListener at the specified position in the list.
| 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 |
| IndexOutOfBoundsException | If the index is not within (0 <= index && index <= size()), or -1 |
Implements com.jogamp.nativewindow.NativeSurface.
Definition at line 772 of file JAWTWindow.java.
| void com.jogamp.nativewindow.awt.JAWTWindow.addSurfaceUpdatedListener | ( | final SurfaceUpdatedListener | l | ) |
Appends the given SurfaceUpdatedListener to the end of the list.
Implements com.jogamp.nativewindow.NativeSurface.
Definition at line 767 of file JAWTWindow.java.
| final void com.jogamp.nativewindow.awt.JAWTWindow.attachSurfaceLayer | ( | final long | layerHandle | ) | throws NativeWindowException |
Attach the offscreen layer to this offscreen layer surface.
Implementation may realize all required resources at this point.
| NativeWindowException | if isOffscreenLayerSurfaceEnabled() == false |
Implements com.jogamp.nativewindow.OffscreenLayerSurface.
Definition at line 512 of file JAWTWindow.java.
|
protected |
| final boolean com.jogamp.nativewindow.awt.JAWTWindow.canSetSurfaceScale | ( | ) |
Returns true if setSurfaceScale(float[]) is supported, otherwise false.For pure downstream scalable surfaces like AWT widgets, setting the picel scale is not supported since the pixel scale is set by the underlying toolkit.
This implementation returns false, i.e. not supporting manual change of pixel-scale.
Implements com.jogamp.nativewindow.ScalableSurface.
Definition at line 325 of file JAWTWindow.java.
| final int[] com.jogamp.nativewindow.awt.JAWTWindow.convertToPixelUnits | ( | final int[] | windowUnitsAndResult | ) |
Converts the given window units into pixel units in place.
| windowUnitsAndResult | int[2] storage holding the window units for the x- and y-coord to convert and the resulting values. |
Implements com.jogamp.nativewindow.NativeSurface.
Definition at line 825 of file JAWTWindow.java.
| final int[] com.jogamp.nativewindow.awt.JAWTWindow.convertToWindowUnits | ( | final int[] | pixelUnitsAndResult | ) |
Converts the given pixel units into window units in place.
| pixelUnitsAndResult | int[2] storage holding the pixel units for the x- and y-coord to convert and the resulting values. |
Implements com.jogamp.nativewindow.NativeSurface.
Definition at line 820 of file JAWTWindow.java.
| void com.jogamp.nativewindow.awt.JAWTWindow.destroy | ( | ) |
Destroys this window incl.
releasing all related resources.
Implements com.jogamp.nativewindow.NativeWindow.
Definition at line 869 of file JAWTWindow.java.
| final void com.jogamp.nativewindow.awt.JAWTWindow.detachSurfaceLayer | ( | ) | throws NativeWindowException |
Detaches a previously attached offscreen layer from this offscreen layer surface.
| NativeWindowException | if isOffscreenLayerSurfaceEnabled() == false or no surface layer is attached. |
Implements com.jogamp.nativewindow.OffscreenLayerSurface.
Definition at line 562 of file JAWTWindow.java.
|
protected |
| detachNotify | Runnable to be called before native detachment |
Definition at line 579 of file JAWTWindow.java.
|
protected |
|
abstractprotected |
private void determineIfApplet() { boolean isApplet = false; // dummy Component c = component; while(!isApplet && null != c) { isApplet = c instanceof java.applet.Applet; c = c.getParent(); } }
If JAWT offscreen layer is supported, implementation shall respect getShallUseOffscreenLayer() and may respect isApplet().
| NativeWindowException |
| final long com.jogamp.nativewindow.awt.JAWTWindow.getAttachedSurfaceLayer | ( | ) |
Returns the attached surface layer or null if none is attached.
Implements com.jogamp.nativewindow.OffscreenLayerSurface.
Definition at line 585 of file JAWTWindow.java.
| final Component com.jogamp.nativewindow.awt.JAWTWindow.getAWTComponent | ( | ) |
| final AWTGraphicsConfiguration com.jogamp.nativewindow.awt.JAWTWindow.getAWTGraphicsConfiguration | ( | ) |
Return the current AWTGraphicsConfiguration instance, which also holds its upstream component's GraphicsConfiguration.
Definition at line 314 of file JAWTWindow.java.
| final Rectangle com.jogamp.nativewindow.awt.JAWTWindow.getBounds | ( | ) |
Returns a newly created Rectangle containing window origin, getX() & getY(), and size, getWidth() & getHeight(), in window units.
Implements com.jogamp.nativewindow.NativeWindow.
Definition at line 857 of file JAWTWindow.java.
| final float[] com.jogamp.nativewindow.awt.JAWTWindow.getCurrentSurfaceScale | ( | final float[] | result | ) |
Returns the current pixel scale of the associated NativeSurface.
| result | float[2] storage for the result |
Implements com.jogamp.nativewindow.ScalableSurface.
Definition at line 352 of file JAWTWindow.java.
| final long com.jogamp.nativewindow.awt.JAWTWindow.getDisplayHandle | ( | ) |
Convenience: Get display handle from AbstractGraphicsConfiguration .
AbstractGraphicsScreen . AbstractGraphicsDevice
Implements com.jogamp.nativewindow.NativeSurface.
Definition at line 800 of file JAWTWindow.java.
| final AbstractGraphicsConfiguration com.jogamp.nativewindow.awt.JAWTWindow.getGraphicsConfiguration | ( | ) |
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().
Implements com.jogamp.nativewindow.NativeSurface.
Definition at line 792 of file JAWTWindow.java.
| final int com.jogamp.nativewindow.awt.JAWTWindow.getHeight | ( | ) |
Returns the height of the client area excluding insets (window decorations) in window units.
Implements com.jogamp.nativewindow.NativeWindow.
Definition at line 852 of file JAWTWindow.java.
| final InsetsImmutable com.jogamp.nativewindow.awt.JAWTWindow.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()
Implements com.jogamp.nativewindow.NativeWindow.
Definition at line 466 of file JAWTWindow.java.
| final JAWT com.jogamp.nativewindow.awt.JAWTWindow.getJAWT | ( | ) |
Returns the underlying JAWT instance created @ lockSurface().
Definition at line 484 of file JAWTWindow.java.
| final RectangleImmutable com.jogamp.nativewindow.awt.JAWTWindow.getJAWTSurfaceBounds | ( | ) |
Definition at line 457 of file JAWTWindow.java.
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.
| point | Optional Point storage. If not null, null, it is translated about the resulting screen position and returned. |
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.
Implements com.jogamp.nativewindow.NativeWindow.
Definition at line 907 of file JAWTWindow.java.
|
protected |
Definition at line 915 of file JAWTWindow.java.
|
abstractprotected |
| final RecursiveLock com.jogamp.nativewindow.awt.JAWTWindow.getLock | ( | ) |
Returns the recursive lock object of this surface, which synchronizes multithreaded access.
Implements com.jogamp.nativewindow.OffscreenLayerSurface.
Definition at line 601 of file JAWTWindow.java.
| final float[] com.jogamp.nativewindow.awt.JAWTWindow.getMaximumSurfaceScale | ( | final float[] | result | ) |
Returns the maximum pixel scale of the associated NativeSurface.The maximum pixel scale maybe used to determine the proper dpi value of the monitor displaying this NativeSurface.
surfacePpMM = monitorPpMM * currentSurfaceScale / nativeSurfaceScale, with PpMM == pixel per millimeter
| result | float[2] storage for the result |
Returns getCurrentSurfaceScale(float[]).
Implements com.jogamp.nativewindow.ScalableSurface.
Definition at line 377 of file JAWTWindow.java.
| float[] com.jogamp.nativewindow.awt.JAWTWindow.getMinimumSurfaceScale | ( | final float[] | result | ) |
Returns the minimum pixel scale of the associated NativeSurface.
| result | float[2] storage for the result |
Returns 1.0, always.
Implements com.jogamp.nativewindow.ScalableSurface.
Definition at line 364 of file JAWTWindow.java.
| final NativeSurface com.jogamp.nativewindow.awt.JAWTWindow.getNativeSurface | ( | ) |
Returns the associated NativeSurface of this NativeSurfaceHolder.Returns this instance, which is-a NativeSurface.
Returns this instance, which is-a NativeSurface.
Implements com.jogamp.nativewindow.NativeWindow.
Definition at line 830 of file JAWTWindow.java.
| final NativeWindow com.jogamp.nativewindow.awt.JAWTWindow.getParent | ( | ) |
Implements com.jogamp.nativewindow.NativeWindow.
Definition at line 883 of file JAWTWindow.java.
|
protected |
Definition at line 460 of file JAWTWindow.java.
|
protected |
Definition at line 463 of file JAWTWindow.java.
| final float[] com.jogamp.nativewindow.awt.JAWTWindow.getRequestedSurfaceScale | ( | final float[] | result | ) |
Returns the requested pixel scale of the associated NativeSurface.If canSetSurfaceScale() returns false, requested pixel scale is AUTOMAX_PIXELSCALE and immutable.
| result | float[2] storage for the result |
Returns ScalableSurface#AUTOMAX_PIXELSCALE, always.
Implements com.jogamp.nativewindow.ScalableSurface.
Definition at line 345 of file JAWTWindow.java.
| final int com.jogamp.nativewindow.awt.JAWTWindow.getScreenIndex | ( | ) |
Convenience: Get display handle from AbstractGraphicsConfiguration .
Implements com.jogamp.nativewindow.NativeSurface.
Definition at line 805 of file JAWTWindow.java.
| final boolean com.jogamp.nativewindow.awt.JAWTWindow.getShallUseOffscreenLayer | ( | ) |
Returns the property set by setShallUseOffscreenLayer(boolean).
Implements com.jogamp.nativewindow.OffscreenLayerOption.
Definition at line 498 of file JAWTWindow.java.
| final Rectangle com.jogamp.nativewindow.awt.JAWTWindow.getSurfaceBounds | ( | ) |
Returns a newly created Rectangle containing window's surface origin and size in pixel units.
Implements com.jogamp.nativewindow.NativeWindow.
Definition at line 862 of file JAWTWindow.java.
| long com.jogamp.nativewindow.awt.JAWTWindow.getSurfaceHandle | ( | ) |
Returns the handle to the surface for this NativeSurface.
The surface handle should be set/update by lockSurface(), where unlockSurface() is not allowed to modify it. After 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.
Implements com.jogamp.nativewindow.NativeSurface.
Definition at line 787 of file JAWTWindow.java.
| final int com.jogamp.nativewindow.awt.JAWTWindow.getSurfaceHeight | ( | ) |
Returns the height of the client area excluding insets (window decorations) in pixel units.
Implements com.jogamp.nativewindow.NativeSurface.
Definition at line 815 of file JAWTWindow.java.
| final Thread com.jogamp.nativewindow.awt.JAWTWindow.getSurfaceLockOwner | ( | ) |
Return the locking owner's Thread, or null if not locked.
Implements com.jogamp.nativewindow.NativeSurface.
Definition at line 757 of file JAWTWindow.java.
| final int com.jogamp.nativewindow.awt.JAWTWindow.getSurfaceWidth | ( | ) |
Returns the width of the client area excluding insets (window decorations) in pixel units.
Implements com.jogamp.nativewindow.NativeSurface.
Definition at line 810 of file JAWTWindow.java.
| final int com.jogamp.nativewindow.awt.JAWTWindow.getWidth | ( | ) |
Returns the width of the client area excluding insets (window decorations) in window units.
Implements com.jogamp.nativewindow.NativeWindow.
Definition at line 847 of file JAWTWindow.java.
| long com.jogamp.nativewindow.awt.JAWTWindow.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.
Implements com.jogamp.nativewindow.NativeWindow.
Definition at line 888 of file JAWTWindow.java.
| final int com.jogamp.nativewindow.awt.JAWTWindow.getX | ( | ) |
Returns the current x position of this window, relative to it's parent.
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.
Implements com.jogamp.nativewindow.NativeWindow.
Definition at line 837 of file JAWTWindow.java.
| final int com.jogamp.nativewindow.awt.JAWTWindow.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.
Implements com.jogamp.nativewindow.NativeWindow.
Definition at line 842 of file JAWTWindow.java.
| boolean com.jogamp.nativewindow.awt.JAWTWindow.hasFocus | ( | ) |
Returns true if this native window owns the focus, otherwise false.
Implements com.jogamp.nativewindow.NativeWindow.
Definition at line 940 of file JAWTWindow.java.
| final boolean com.jogamp.nativewindow.awt.JAWTWindow.hasPixelScaleChanged | ( | ) |
Returns and clears the hasPixelScaleChanged flag, as set via lockSurface().
hasPixelScaleChanged is true, if the minimum or maximum pixel scale has changed. User needs to set the current pixel scale in this case using the requested pixel scale to update the surface pixel scale.
Definition at line 450 of file JAWTWindow.java.
| final boolean com.jogamp.nativewindow.awt.JAWTWindow.hideCursor | ( | ) |
Optional method hiding the cursor in the corresponding on-screen surface/window, if exists.
Implements com.jogamp.nativewindow.OffscreenLayerSurface.
Definition at line 629 of file JAWTWindow.java.
|
protected |
Definition at line 260 of file JAWTWindow.java.
|
abstractprotected |
| final boolean com.jogamp.nativewindow.awt.JAWTWindow.isApplet | ( | ) |
Return false since there is no more java.applet.Applet support.
Historical: Returns true if the AWT component is parented to an java.applet.Applet, otherwise false. This information is valid only after lockSurface().
Definition at line 479 of file JAWTWindow.java.
| final boolean com.jogamp.nativewindow.awt.JAWTWindow.isOffscreenLayerSurfaceEnabled | ( | ) |
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 NativeWindow#lockSurface().
Implements com.jogamp.nativewindow.OffscreenLayerOption.
Definition at line 503 of file JAWTWindow.java.
| final boolean com.jogamp.nativewindow.awt.JAWTWindow.isSurfaceLayerAttached | ( | ) |
Returns true if a surface layer is attached, otherwise false.
Implements com.jogamp.nativewindow.OffscreenLayerSurface.
Definition at line 590 of file JAWTWindow.java.
| final boolean com.jogamp.nativewindow.awt.JAWTWindow.isSurfaceLockedByOtherThread | ( | ) |
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 ) { .. }
Implements com.jogamp.nativewindow.NativeSurface.
Definition at line 752 of file JAWTWindow.java.
|
protected |
Definition at line 944 of file JAWTWindow.java.
|
protected |
Layout the offscreen layer according to the implementing class's constraints.
This method allows triggering a re-layout of the offscreen surface in case the implementation requires it.
Call this method if any parent or ancestor's layout has been changed, which could affects the layout of this surface.
| NativeWindowException | if isOffscreenLayerSurfaceEnabled() == false |
Definition at line 552 of file JAWTWindow.java.
| final int com.jogamp.nativewindow.awt.JAWTWindow.lockSurface | ( | ) | throws NativeWindowException, RuntimeException |
Lock the surface of this native window.
The surface handle shall be valid after a successfull call, ie return a value other than LOCK_SURFACE_UNLOCKED and LOCK_SURFACE_NOT_READY, which is
boolean ok = LOCK_SURFACE_NOT_READY < lockSurface();
The caller may need to take care of the result 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 com.jogamp.common.util.locks.RecursiveLock first before proceeding with a native surface lock.
The implementation shall also invoke AbstractGraphicsDevice#lock() for the initial lock (recursive count zero).
LOCK_SUCCESS, LOCK_SURFACE_CHANGED or LOCK_SURFACE_NOT_READY.| RuntimeException | after timeout when waiting for the surface lock |
| NativeWindowException | if native locking failed, maybe platform related |
Implements com.jogamp.nativewindow.NativeSurface.
Definition at line 673 of file JAWTWindow.java.
|
abstractprotected |
| void com.jogamp.nativewindow.awt.JAWTWindow.removeSurfaceUpdatedListener | ( | final SurfaceUpdatedListener | l | ) |
Remove the specified SurfaceUpdatedListener from the list.
Implements com.jogamp.nativewindow.NativeSurface.
Definition at line 777 of file JAWTWindow.java.
| final void com.jogamp.nativewindow.awt.JAWTWindow.setAWTGraphicsConfiguration | ( | final AWTGraphicsConfiguration | config | ) |
Set a new AWTGraphicsConfiguration instance, as required if upstream component's GraphicsConfiguration has been changed due to reconfiguration, e.g.
moving to a different monitor or changed capabilities.
Upstream component shall override Component#getGraphicsConfiguration(), which shall call this method if detecting a reconfiguration. See JOGL's GLCanvas and NewtCanvasAWT.
| config | the new AWTGraphicsConfiguration |
Definition at line 299 of file JAWTWindow.java.
| final void com.jogamp.nativewindow.awt.JAWTWindow.setChosenCapabilities | ( | final CapabilitiesImmutable | caps | ) |
Sets the capabilities of this instance, allowing upstream API's to refine it, i.e.
OpenGL related settings.
Implements com.jogamp.nativewindow.OffscreenLayerSurface.
Definition at line 595 of file JAWTWindow.java.
| final boolean com.jogamp.nativewindow.awt.JAWTWindow.setCursor | ( | final PixelRectangle | pixelrect, |
| final PointImmutable | hotSpot | ||
| ) |
Optional method setting cursor in the corresponding on-screen surface/window, if exists.
| pixelrect | cursor pixels, maybe null for default cursor |
| hotSpot | maybe null for default cursor |
Implements com.jogamp.nativewindow.OffscreenLayerSurface.
Definition at line 606 of file JAWTWindow.java.
| void com.jogamp.nativewindow.awt.JAWTWindow.setShallUseOffscreenLayer | ( | final boolean | v | ) |
Request an offscreen layer, if supported.
Shall be called before the first NativeWindow#lockSurface(), and hence before realization.
Implements com.jogamp.nativewindow.OffscreenLayerOption.
Definition at line 493 of file JAWTWindow.java.
| boolean com.jogamp.nativewindow.awt.JAWTWindow.setSurfaceScale | ( | final float[] | pixelScale | ) |
Request a pixel scale in x- and y-direction for the associated NativeSurface, where size_in_pixel_units = pixel_scale * size_in_window_units.Default pixel scale request for both directions is AUTOMAX_PIXELSCALE. If canSetSurfaceScale() returns false, requested pixel scale is AUTOMAX_PIXELSCALE, immutable and method returns false. In case platform only supports uniform pixel scale, i.e. one scale for both directions, either 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 IDENTITY_PIXELSCALE if not supported or clipped to the platform maximum. It can be queried via getRequestedSurfaceScale(float[]). The actual realized pixel scale values of the NativeSurface can be queried via getCurrentSurfaceScale(float[]) or computed via surface. convertToPixelUnits(new int[] { 1, 1 })
| pixelScale | requested surface pixel scale float[2] values for x- and y-direction. |
true if the current pixel scale has changed, otherwise false. Ignored for an AWT widget since pixelScale is dictated by AWT mechanisms.
Implements com.jogamp.nativewindow.ScalableSurface.
Definition at line 334 of file JAWTWindow.java.
| boolean com.jogamp.nativewindow.awt.JAWTWindow.surfaceSwap | ( | ) |
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.
Implements com.jogamp.nativewindow.NativeSurface.
Definition at line 762 of file JAWTWindow.java.
| void com.jogamp.nativewindow.awt.JAWTWindow.surfaceUpdated | ( | final Object | updater, |
| final NativeSurface | ns, | ||
| final long | when | ||
| ) |
Notification of a surface update event, eg.
after a swap buffer operation.
| 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 |
Implements com.jogamp.nativewindow.SurfaceUpdatedListener.
Definition at line 782 of file JAWTWindow.java.
|
staticprotected |
Definition at line 989 of file JAWTWindow.java.
|
staticprotected |
| String com.jogamp.nativewindow.awt.JAWTWindow.toString | ( | ) |
Definition at line 964 of file JAWTWindow.java.
| final void com.jogamp.nativewindow.awt.JAWTWindow.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).
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.
Implements com.jogamp.nativewindow.NativeSurface.
Definition at line 734 of file JAWTWindow.java.
|
abstractprotected |
|
protected |
Updates bounds and pixelScale.
| gc | GraphicsConfiguration for updatePixelScale(GraphicsConfiguration, boolean) |
Definition at line 387 of file JAWTWindow.java.
| final boolean com.jogamp.nativewindow.awt.JAWTWindow.updatePixelScale | ( | final GraphicsConfiguration | gc, |
| final boolean | clearFlag | ||
| ) |
Updates the minimum and maximum pixel-scale values and returns true if they were updated.
| gc | pre-fetched GraphicsConfiguration instance of upstream component, caller may use cached getAWTGraphicsConfiguration()'s GC or a Component#getGraphicsConfiguration(). |
| clearFlag | if true, the hasPixelScaleChanged flag will be cleared |
true if values were updated, otherwise false. Definition at line 419 of file JAWTWindow.java.
|
protected |
Definition at line 90 of file JAWTWindow.java.
|
staticprotected |
Definition at line 84 of file JAWTWindow.java.
|
protected |
Definition at line 100 of file JAWTWindow.java.
|
protected |
Definition at line 102 of file JAWTWindow.java.
|
protected |
Definition at line 101 of file JAWTWindow.java.
|
protected |
Definition at line 87 of file JAWTWindow.java.