Top Description Inners Fields Constructors Methods
jogamp.newt.driver.awt

public Class WindowDriver

extends WindowImpl
Class Inheritance
Imports
java.awt.BorderLayout, .Container, .Dimension, .Frame, .Insets, com.jogamp.nativewindow.NativeSurface, .NativeWindow, .NativeWindowException, com.jogamp.nativewindow.util.Point, jogamp.nativewindow.awt.AWTMisc, jogamp.newt.WindowImpl, com.jogamp.common.os.Platform, com.jogamp.nativewindow.awt.AWTGraphicsConfiguration, .AWTGraphicsDevice, .AWTGraphicsScreen, com.jogamp.newt.event.WindowEvent, .WindowUpdateEvent, com.jogamp.newt.event.awt.AWTKeyAdapter, .AWTMouseAdapter, .AWTWindowAdapter

An implementation of the Newt Window class built using the AWT. This is provided for convenience of porting to platforms supporting Java SE.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
pack-priv class

Field Summary

Modifier and TypeField and Description
private AWTCanvas
private Container
private Frame
awtFrame

same instance as container, just for impl.

private boolean
private final AWTCanvas.UpstreamScalable
private volatile boolean
Inherited from jogamp.newt.WindowImpl:
capabilitiesChoosercapsRequestedCHANGE_MASK_ALWAYSONBOTTOMCHANGE_MASK_ALWAYSONTOPCHANGE_MASK_DECORATIONCHANGE_MASK_FULLSCREENCHANGE_MASK_MAXIMIZED_HORZCHANGE_MASK_MAXIMIZED_VERTCHANGE_MASK_PARENTINGCHANGE_MASK_RESIZABLECHANGE_MASK_STICKYCHANGE_MASK_VISIBILITYCHANGE_MASK_VISIBILITY_FASTDEBUG_TEST_REPARENT_INCOMPATIBLEhasPixelScalekeyboardVisiblemaxPixelScaleminimumReconfigStateMaskminPixelScaleQUIRK_BIT_VISIBILITYquirksreqPixelScaleSTATE_BIT_COUNT_ALL_PUBLICSTATE_BIT_COUNT_ALL_RECONFIGSTATE_BIT_FULLSCREEN_SPANSTATE_MASK_ALL_PUBLICSTATE_MASK_ALL_PUBLIC_SUPPORTEDSTATE_MASK_ALL_RECONFIGSTATE_MASK_CREATENATIVEsupportedReconfigStateMaskwindowList

Constructor Summary

AccessConstructor and Description
public
public
WindowDriver(final Container container)

Method Summary

Modifier and TypeMethod and Description
protected void
protected void
createNativeImpl()

Implements abstract jogamp.newt.WindowImpl.createNativeImpl.

The native implementation must set the native windowHandle.
public static Class<?>[]
protected Point
getLocationOnScreenImpl(final int x, final int y)

Implements abstract jogamp.newt.WindowImpl.getLocationOnScreenImpl.

Translates the given window client-area coordinates with top-left origin to screen coordinates in window units.
protected final int
getSupportedReconfigMaskImpl()

Implements abstract jogamp.newt.WindowImpl.getSupportedReconfigMaskImpl.

Returns the reconfigure state-mask supported by the implementation.
public NativeSurface
getWrappedSurface()

Overrides jogamp.newt.WindowImpl.getWrappedSurface.

If this Window actually wraps a NativeSurface from another instance or toolkit, it will return such reference.
public boolean
hasDeviceChanged()

Overrides jogamp.newt.WindowImpl.hasDeviceChanged.

If the implementation is capable of detecting a device change return true and clear the status/reason of the change.
pack-priv void
pack-priv void
protected boolean
reconfigureWindowImpl(final int
client-area position in window units, or <0 if unchanged
x
,
final int
client-area position in window units, or <0 if unchanged
y
,
final int
client-area size in window units, or <=0 if unchanged
width
,
final int
client-area size in window units, or <=0 if unchanged
height
,
final int
bitfield of change and status flags
flags
)

Implements abstract jogamp.newt.WindowImpl.reconfigureWindowImpl.

The native implementation should invoke the referenced java state callbacks to notify this Java object of state changes.
protected void
requestFocusImpl(final boolean
if true, bypass focusChanged(boolean, boolean) and force focus request
reparented
)

Implements abstract jogamp.newt.WindowImpl.requestFocusImpl.

Async request which shall be performed within TIMEOUT_NATIVEWINDOW.
private void
setCanvasSizeImpl(final int width, final int height)

private void
setFrameSizeImpl(final int width, final int height)

protected void
private void
Inherited from jogamp.newt.WindowImpl:
addChildaddGestureHandleraddGestureHandleraddGestureListeneraddGestureListeneraddKeyListeneraddKeyListeneraddMouseListeneraddMouseListeneraddSurfaceUpdatedListeneraddSurfaceUpdatedListeneraddWindowListeneraddWindowListenerappendStateBitsareDefaultGesturesEnabledautoPositioncanCreateNativeImplconfinePointerconfinePointerImplconsumeEventconsumeKeyEventconsumePointerEventconsumeWindowEventconvertToPixelUnitsconvertToPixelUnitsconvertToWindowUnitsconvertToWindowUnitscreatecreatedefinePositiondefineSizedestroydestroydoMouseEventdoMouseEventdoPointerEventdoPointerEventenqueueEventenqueueKeyEventenqueueMouseEventenqueueWindowEventfocusChangedfocusVisibleChangedgetBoundsgetChosenCapabilitiesgetCurrentSurfaceScalegetDefaultCloseOperationgetDelegatedWindowgetDisplayHandlegetGraphicsConfigurationgetHeightgetInsetsgetKeyListenergetKeyListenersgetLifecycleHookgetLocationOnScreengetLockgetMainMonitorgetMaximumSurfaceScalegetMinimumSurfaceScalegetMouseListenergetMouseListenersgetNativeSurfacegetParentgetParentWindowHandlegetPixelScaleXgetPixelScaleYgetPixelsPerMMgetPointerIcongetReconfigStateMaskStringgetReconfigureMaskgetRequestedCapabilitiesgetRequestedSurfaceScalegetScreengetScreenIndexgetStateMaskgetStateMaskStringgetStatePublicBitCountgetStatePublicBitmaskgetSupportedStateMaskgetSupportedStateMaskStringgetSurfaceHandlegetSurfaceHeightgetSurfaceLockOwnergetSurfaceWidthgetThreadNamegetTitlegetWidthgetWindowHandlegetWindowListenergetWindowListenersgetXgetYhasFocusinsetsChangedinsetsVisibleChangedinstantiationFinishedImplisAlwaysOnBottomisAlwaysOnTopisChildWindowisFullscreenisKeyboardVisibleisKeyCodeTrackedisKeyPressedisMaximizedHorzisMaximizedVertisNativeValidisOffscreenInstanceisPointerConfinedisPointerVisibleisReconfigureMaskSupportedisResizableisStickyisSurfaceLockedByOtherThreadisUndecoratedisVisiblekeyboardVisibilityChangedlockSurfacelockSurfaceImplmaximizedChangedmonitorModeChangedpixelScaleChangeNotifypositionChangedreconfigMaximizedManualremoveChildremoveGestureHandlerremoveGestureListenerremoveKeyListenerremoveMouseListenerremoveSurfaceUpdatedListenerremoveWindowListenerreparentWindowrequestFocusrequestFocusresetMaximizedManualrunOnEDTIfAvailsendKeyEventsendMouseEventsendMouseEventRequestFocussendWindowEventsetAlwaysOnBottomsetAlwaysOnTopsetBrokenFocusChangesetCapabilitiesChoosersetDefaultCloseOperationsetDefaultGesturesEnabledsetFocusActionsetFullscreensetFullscreensetGraphicsConfigurationsetKeyboardFocusHandlersetKeyboardVisiblesetKeyboardVisibleImplsetKeyPressedsetLifecycleHooksetMaximizedsetPointerIconsetPointerIconImplsetPointerVisiblesetPointerVisibleImplsetPositionsetResizablesetScreensetSizesetStickysetSurfaceScalesetSurfaceSizesetTitlesetTopLevelPositionsetTopLevelSizesetUndecoratedsetVisiblesetVisiblesetVisibleImplsetWindowDestroyNotifyActionsetWindowHandleshutdownAllsizeChangedsizePosInsetsFocusVisibleChangedsizePosMaxInsetsVisibleChangedsurfaceSwapsurfaceUpdatedtoHexStringtoHexStringtoStringunlockSurfaceunlockSurfaceImplvisibleChangedvisibleChangedSendMouseEventvisibleChangedWindowRepaintwarpPointerwarpPointerImplwindowDestroyNotifywindowRepaintwindowRepaint

Field Detail

awtCanvasback to summary
private AWTCanvas awtCanvas
awtContainerback to summary
private Container awtContainer
awtFrameback to summary
private Frame awtFrame

same instance as container, just for impl. convenience

owningFrameback to summary
private boolean owningFrame
upstreamScalableback to summary
private final AWTCanvas.UpstreamScalable upstreamScalable
withinLocalDisposeback to summary
private volatile boolean withinLocalDispose

Constructor Detail

WindowDriverback to summary
public WindowDriver()
WindowDriverback to summary
public WindowDriver(final Container container)

Method Detail

closeNativeImplback to summary
protected void closeNativeImpl()

Implements abstract jogamp.newt.WindowImpl.closeNativeImpl.

Annotations
@Override
createNativeImplback to summary
protected void createNativeImpl()

Implements abstract jogamp.newt.WindowImpl.createNativeImpl.

Doc from jogamp.newt.WindowImpl.createNativeImpl.

The native implementation must set the native windowHandle.

The implementation shall respect the states isAlwaysOnTop()/FLAG_IS_ALWAYSONTOP and isUndecorated()/FLAG_IS_UNDECORATED, ie. the created window shall reflect those settings.

The implementation should invoke the referenced java state callbacks to notify this Java object of state changes.

Annotations
@Override
getCustomConstructorArgumentTypesback to summary
public static Class<?>[] getCustomConstructorArgumentTypes()
getLocationOnScreenImplback to summary
protected Point getLocationOnScreenImpl(final int x, final int y)

Implements abstract jogamp.newt.WindowImpl.getLocationOnScreenImpl.

Doc from jogamp.newt.WindowImpl.getLocationOnScreenImpl.

Translates the given window client-area coordinates with top-left origin to screen coordinates in window units.

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

May return null, in which case the caller shall traverse through the NativeWindow tree as demonstrated in getLocationOnScreen(com.jogamp.nativewindow.util.Point).

Returns:Point

if not null, the screen location of the given coordinates

Annotations
@Override
getSupportedReconfigMaskImplback to summary
protected final int getSupportedReconfigMaskImpl()

Implements abstract jogamp.newt.WindowImpl.getSupportedReconfigMaskImpl.

Doc from jogamp.newt.WindowImpl.getSupportedReconfigMaskImpl.

Returns the reconfigure state-mask supported by the implementation.

Default value is STATE_MASK_VISIBLE | STATE_MASK_FOCUSED, i.e. the minimum requirement for all implementations.

Annotations
@Override
getWrappedSurfaceback to summary
public NativeSurface getWrappedSurface()

Overrides jogamp.newt.WindowImpl.getWrappedSurface.

Doc from jogamp.newt.WindowImpl.getWrappedSurface.

If this Window actually wraps a NativeSurface from another instance or toolkit, it will return such reference. Otherwise returns null.

Annotations
@Override
hasDeviceChangedback to summary
public boolean hasDeviceChanged()

Overrides jogamp.newt.WindowImpl.hasDeviceChanged.

Doc from jogamp.newt.WindowImpl.hasDeviceChanged.

If the implementation is capable of detecting a device change return true and clear the status/reason of the change.

Annotations
@Override
localCreateback to summary
pack-priv void localCreate()
localDestroyback to summary
pack-priv void localDestroy()
reconfigureWindowImplback to summary
protected boolean reconfigureWindowImpl(final int x, final int y, final int width, final int height, final int flags)

Implements abstract jogamp.newt.WindowImpl.reconfigureWindowImpl.

Doc from jogamp.newt.WindowImpl.reconfigureWindowImpl.

The native implementation should invoke the referenced java state callbacks to notify this Java object of state changes.

Implementations shall set x/y to 0, in case it's negative. This could happen due to insets and positioning a decorated window to 0/0, which would place the frame outside of the screen.

Parameters
x:int

client-area position in window units, or <0 if unchanged

y:int

client-area position in window units, or <0 if unchanged

width:int

client-area size in window units, or <=0 if unchanged

height:int

client-area size in window units, or <=0 if unchanged

flags:int

bitfield of change and status flags

Annotations
@Override
requestFocusImplback to summary
protected void requestFocusImpl(final boolean reparented)

Implements abstract jogamp.newt.WindowImpl.requestFocusImpl.

Doc from jogamp.newt.WindowImpl.requestFocusImpl.

Async request which shall be performed within TIMEOUT_NATIVEWINDOW.

If if force == false the native implementation may only request focus if not yet owner.

focusChanged(boolean, boolean) should be called to notify about the focus traversal.

Parameters
reparented:boolean

if true, bypass focusChanged(boolean, boolean) and force focus request

Annotations
@Override
setCanvasSizeImplback to summary
private void setCanvasSizeImpl(final int width, final int height)
setFrameSizeImplback to summary
private void setFrameSizeImpl(final int width, final int height)
setTitleImplback to summary
protected void setTitleImpl(final String title)

Overrides jogamp.newt.WindowImpl.setTitleImpl.

Annotations
@Override
setupHandleAndGCback to summary
private void setupHandleAndGC()
jogamp.newt.driver.awt back to summary

pack-priv Class WindowDriver.AWTWindowListener

extends Object
implements WindowListener
Class Inheritance
All Implemented Interfaces
com.jogamp.newt.event.WindowListener, com.jogamp.newt.event.NEWTEventListener, java.util.EventListener

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
public void
windowDestroyNotify(final WindowEvent e)

Implements com.jogamp.newt.event.WindowListener.windowDestroyNotify.

Window destruction has been requested.
public void
public void
public void
public void
windowRepaint(final WindowUpdateEvent e)

Implements com.jogamp.newt.event.WindowListener.windowRepaint.

Window area shall be repainted.
public void
windowResized(final WindowEvent e)

Implements com.jogamp.newt.event.WindowListener.windowResized.

Window is resized, your application shall respect the new window dimension.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

AWTWindowListenerback to summary
pack-priv AWTWindowListener()

Method Detail

windowDestroyedback to summary
public void windowDestroyed(final WindowEvent e)

Implements com.jogamp.newt.event.WindowListener.windowDestroyed.

Doc from com.jogamp.newt.event.WindowListener.windowDestroyed.

Window has been destroyed.

Annotations
@Override
windowDestroyNotifyback to summary
public void windowDestroyNotify(final WindowEvent e)

Implements com.jogamp.newt.event.WindowListener.windowDestroyNotify.

Doc from com.jogamp.newt.event.WindowListener.windowDestroyNotify.

Window destruction has been requested.

Depending on the default close operation, the window maybe destroyed or not.

In case the window will be destroyed (see above), release of resources is recommended.
Annotations
@Override
windowGainedFocusback to summary
public void windowGainedFocus(final WindowEvent e)

Implements com.jogamp.newt.event.WindowListener.windowGainedFocus.

Doc from com.jogamp.newt.event.WindowListener.windowGainedFocus.

Window gained focus.

Annotations
@Override
windowLostFocusback to summary
public void windowLostFocus(final WindowEvent e)

Implements com.jogamp.newt.event.WindowListener.windowLostFocus.

Doc from com.jogamp.newt.event.WindowListener.windowLostFocus.

Window lost focus.

Annotations
@Override
windowMovedback to summary
public void windowMoved(final WindowEvent e)

Implements com.jogamp.newt.event.WindowListener.windowMoved.

Doc from com.jogamp.newt.event.WindowListener.windowMoved.

Window has been moved.

Annotations
@Override
windowRepaintback to summary
public void windowRepaint(final WindowUpdateEvent e)

Implements com.jogamp.newt.event.WindowListener.windowRepaint.

Doc from com.jogamp.newt.event.WindowListener.windowRepaint.

Window area shall be repainted.

Annotations
@Override
windowResizedback to summary
public void windowResized(final WindowEvent e)

Implements com.jogamp.newt.event.WindowListener.windowResized.

Doc from com.jogamp.newt.event.WindowListener.windowResized.

Window is resized, your application shall respect the new window dimension. A repaint is recommended.

Annotations
@Override
jogamp.newt.driver.awt back to summary

pack-priv Class WindowDriver.NEWTWindowListener

extends Object
implements WindowListener
Class Inheritance
All Implemented Interfaces
com.jogamp.newt.event.WindowListener, com.jogamp.newt.event.NEWTEventListener, java.util.EventListener

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
public void
windowDestroyNotify(final WindowEvent e)

Implements com.jogamp.newt.event.WindowListener.windowDestroyNotify.

Window destruction has been requested.
public void
public void
public void
public void
windowRepaint(final WindowUpdateEvent e)

Implements com.jogamp.newt.event.WindowListener.windowRepaint.

Window area shall be repainted.
public void
windowResized(final WindowEvent e)

Implements com.jogamp.newt.event.WindowListener.windowResized.

Window is resized, your application shall respect the new window dimension.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

NEWTWindowListenerback to summary
pack-priv NEWTWindowListener()

Method Detail

windowDestroyedback to summary
public void windowDestroyed(final WindowEvent e)

Implements com.jogamp.newt.event.WindowListener.windowDestroyed.

Doc from com.jogamp.newt.event.WindowListener.windowDestroyed.

Window has been destroyed.

Annotations
@Override
windowDestroyNotifyback to summary
public void windowDestroyNotify(final WindowEvent e)

Implements com.jogamp.newt.event.WindowListener.windowDestroyNotify.

Doc from com.jogamp.newt.event.WindowListener.windowDestroyNotify.

Window destruction has been requested.

Depending on the default close operation, the window maybe destroyed or not.

In case the window will be destroyed (see above), release of resources is recommended.
Annotations
@Override
windowGainedFocusback to summary
public void windowGainedFocus(final WindowEvent e)

Implements com.jogamp.newt.event.WindowListener.windowGainedFocus.

Doc from com.jogamp.newt.event.WindowListener.windowGainedFocus.

Window gained focus.

Annotations
@Override
windowLostFocusback to summary
public void windowLostFocus(final WindowEvent e)

Implements com.jogamp.newt.event.WindowListener.windowLostFocus.

Doc from com.jogamp.newt.event.WindowListener.windowLostFocus.

Window lost focus.

Annotations
@Override
windowMovedback to summary
public void windowMoved(final WindowEvent e)

Implements com.jogamp.newt.event.WindowListener.windowMoved.

Doc from com.jogamp.newt.event.WindowListener.windowMoved.

Window has been moved.

Annotations
@Override
windowRepaintback to summary
public void windowRepaint(final WindowUpdateEvent e)

Implements com.jogamp.newt.event.WindowListener.windowRepaint.

Doc from com.jogamp.newt.event.WindowListener.windowRepaint.

Window area shall be repainted.

Annotations
@Override
windowResizedback to summary
public void windowResized(final WindowEvent e)

Implements com.jogamp.newt.event.WindowListener.windowResized.

Doc from com.jogamp.newt.event.WindowListener.windowResized.

Window is resized, your application shall respect the new window dimension. A repaint is recommended.

Annotations
@Override