JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.newt.awt.NewtCanvasAWT Class Reference

AWT Canvas containing a NEWT Window using native parenting. More...

Inheritance diagram for com.jogamp.newt.awt.NewtCanvasAWT:
Collaboration diagram for com.jogamp.newt.awt.NewtCanvasAWT:

Classes

class  FocusAction
 
class  FocusPropertyChangeListener
 
class  FocusTraversalKeyListener
 

Public Member Functions

 NewtCanvasAWT ()
 Instantiates a NewtCanvas without a NEWT child. More...
 
 NewtCanvasAWT (final GraphicsConfiguration gc)
 Instantiates a NewtCanvas without a NEWT child. More...
 
 NewtCanvasAWT (final Window child)
 Instantiates a NewtCanvas with a NEWT child. More...
 
 NewtCanvasAWT (final GraphicsConfiguration gc, final Window child)
 Instantiates a NewtCanvas with a NEWT child. 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 boolean isApplet ()
 Returns true if the AWT component is parented to an java.applet.Applet, otherwise false. More...
 
Window setNEWTChild (final Window newChild)
 Sets a new NEWT child, provoking reparenting. More...
 
Window getNEWTChild ()
 
NativeWindow getNativeWindow ()
 Returns the associated NativeWindow of this NativeWindowHolder, which is identical to getNativeSurface(). More...
 
NativeSurface getNativeSurface ()
 Returns the associated NativeSurface of this NativeSurfaceHolder. More...
 
WindowClosingMode getDefaultCloseOperation ()
 
WindowClosingMode setDefaultCloseOperation (final WindowClosingMode op)
 
final void setSkipJAWTDestroy (final boolean v)
 Mitigates Bug 910 (IcedTea-Web), i.e. More...
 
final boolean getSkipJAWTDestroy ()
 See setSkipJAWTDestroy(boolean). More...
 
GraphicsConfiguration getGraphicsConfiguration ()
 
void addNotify ()
 
void removeNotify ()
 
final void destroy ()
 Destroys this resource: More...
 
void paint (final Graphics g)
 
void update (final Graphics g)
 
void reshape (final int x, final int y, final int width, final int height)
 
void setupPrint (final double scaleMatX, final double scaleMatY, final int numSamples, final int tileWidth, final int tileHeight)
 Shall be called before PrinterJob#print(). More...
 
void releasePrint ()
 Shall be called after PrinterJob#print(). More...
 
void print (final Graphics graphics)
 
final boolean isAWTEventPassThrough ()
 Returns true if Key and Mouse input events will be passed through AWT, otherwise only the NEWT child will receive them. More...
 
NativeWindow getNativeWindow ()
 Returns the associated NativeWindow of this NativeWindowHolder, which is identical to getNativeSurface(). More...
 
NativeSurface getNativeSurface ()
 Returns the associated NativeSurface of this NativeSurfaceHolder. More...
 
WindowClosingMode getDefaultCloseOperation ()
 
WindowClosingMode setDefaultCloseOperation (WindowClosingMode op)
 
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...
 
void setupPrint (double scaleMatX, double scaleMatY, int numSamples, int tileWidth, int tileHeight)
 Shall be called before PrinterJob#print(). More...
 
void releasePrint ()
 Shall be called after PrinterJob#print(). More...
 

Static Public Attributes

static final boolean DEBUG = Debug.debug("Window")
 
- Static Public Attributes inherited from com.jogamp.nativewindow.awt.AWTPrintLifecycle
static final int DEFAULT_PRINT_TILE_SIZE = 1024
 

Static Protected Member Functions

static String currentThreadName ()
 

Detailed Description

AWT Canvas containing a NEWT Window using native parenting.

Offscreen Layer Remarks

setShallUseOffscreenLayer(true) maybe called to use an offscreen drawable (FBO or PBuffer) allowing the underlying JAWT mechanism to composite the image, if supported.

Definition at line 102 of file NewtCanvasAWT.java.

Constructor & Destructor Documentation

◆ NewtCanvasAWT() [1/4]

com.jogamp.newt.awt.NewtCanvasAWT.NewtCanvasAWT ( )

Instantiates a NewtCanvas without a NEWT child.


Definition at line 149 of file NewtCanvasAWT.java.

Here is the call graph for this function:

◆ NewtCanvasAWT() [2/4]

com.jogamp.newt.awt.NewtCanvasAWT.NewtCanvasAWT ( final GraphicsConfiguration  gc)

Instantiates a NewtCanvas without a NEWT child.


Definition at line 160 of file NewtCanvasAWT.java.

Here is the call graph for this function:

◆ NewtCanvasAWT() [3/4]

com.jogamp.newt.awt.NewtCanvasAWT.NewtCanvasAWT ( final Window  child)

Instantiates a NewtCanvas with a NEWT child.

Definition at line 171 of file NewtCanvasAWT.java.

Here is the call graph for this function:

◆ NewtCanvasAWT() [4/4]

com.jogamp.newt.awt.NewtCanvasAWT.NewtCanvasAWT ( final GraphicsConfiguration  gc,
final Window  child 
)

Instantiates a NewtCanvas with a NEWT child.

Definition at line 183 of file NewtCanvasAWT.java.

Here is the call graph for this function:

Member Function Documentation

◆ addNotify()

void com.jogamp.newt.awt.NewtCanvasAWT.addNotify ( )

Definition at line 583 of file NewtCanvasAWT.java.

Here is the call graph for this function:

◆ currentThreadName()

static String com.jogamp.newt.awt.NewtCanvasAWT.currentThreadName ( )
staticprotected

Definition at line 1121 of file NewtCanvasAWT.java.

◆ destroy()

final void com.jogamp.newt.awt.NewtCanvasAWT.destroy ( )

Destroys this resource:

  • Make the NEWT Child invisible
  • Disconnects the NEWT Child from this Canvas NativeWindow, reparent to NULL
  • Issues destroy() on the NEWT Child
  • Remove reference to the NEWT Child
See also
Window::destroy()

Definition at line 692 of file NewtCanvasAWT.java.

Here is the caller graph for this function:

◆ getDefaultCloseOperation()

WindowClosingMode com.jogamp.newt.awt.NewtCanvasAWT.getDefaultCloseOperation ( )
Returns
the current close operation value
See also
WindowClosingMode::DISPOSE_ON_CLOSE
WindowClosingMode::DO_NOTHING_ON_CLOSE

Implements com.jogamp.nativewindow.WindowClosingProtocol.

Definition at line 441 of file NewtCanvasAWT.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getGraphicsConfiguration()

GraphicsConfiguration com.jogamp.newt.awt.NewtCanvasAWT.getGraphicsConfiguration ( )

Overridden to choose a GraphicsConfiguration from a parent container's GraphicsDevice.

Method also intercepts GraphicsConfiguration changes regarding to its capabilities and its GraphicsDevice. This may happen in case the display changes its configuration or the component is moved to another screen.

Definition at line 496 of file NewtCanvasAWT.java.

Here is the call graph for this function:

◆ getNativeSurface()

NativeSurface com.jogamp.newt.awt.NewtCanvasAWT.getNativeSurface ( )

Returns the associated NativeSurface of this NativeSurfaceHolder.

Returns
this AWT Canvas NativeSurface representation, may be null in case removeNotify() has been called, or addNotify() hasn't been called yet.

Implements com.jogamp.nativewindow.NativeSurfaceHolder.

Definition at line 438 of file NewtCanvasAWT.java.

◆ getNativeWindow()

NativeWindow com.jogamp.newt.awt.NewtCanvasAWT.getNativeWindow ( )

Returns the associated NativeWindow of this NativeWindowHolder, which is identical to getNativeSurface().

Returns
this AWT Canvas NativeWindow representation, may be null in case removeNotify() has been called, or addNotify() hasn't been called yet.

Implements com.jogamp.nativewindow.NativeWindowHolder.

Definition at line 430 of file NewtCanvasAWT.java.

Here is the caller graph for this function:

◆ getNEWTChild()

Window com.jogamp.newt.awt.NewtCanvasAWT.getNEWTChild ( )
Returns
the current NEWT child

Definition at line 420 of file NewtCanvasAWT.java.

Here is the caller graph for this function:

◆ getShallUseOffscreenLayer()

final boolean com.jogamp.newt.awt.NewtCanvasAWT.getShallUseOffscreenLayer ( )

Returns the property set by setShallUseOffscreenLayer(boolean).

Implements com.jogamp.nativewindow.OffscreenLayerOption.

Definition at line 198 of file NewtCanvasAWT.java.

◆ getSkipJAWTDestroy()

final boolean com.jogamp.newt.awt.NewtCanvasAWT.getSkipJAWTDestroy ( )

See setSkipJAWTDestroy(boolean).

Definition at line 462 of file NewtCanvasAWT.java.

◆ isApplet()

final boolean com.jogamp.newt.awt.NewtCanvasAWT.isApplet ( )

Returns true if the AWT component is parented to an java.applet.Applet, otherwise false.

This information is valid only after addNotify() is issued.

Definition at line 212 of file NewtCanvasAWT.java.

◆ isAWTEventPassThrough()

final boolean com.jogamp.newt.awt.NewtCanvasAWT.isAWTEventPassThrough ( )

Returns true if Key and Mouse input events will be passed through AWT, otherwise only the NEWT child will receive them.

Normally only the NEWT child will receive Key and Mouse input events. In offscreen mode, e.g. OSX/CALayer, the AWT events will be received and translated into NEWT events and delivered to the NEWT child window.
Note: AWT key events will consumed in pass-through mode.

Definition at line 1033 of file NewtCanvasAWT.java.

◆ isOffscreenLayerSurfaceEnabled()

final boolean com.jogamp.newt.awt.NewtCanvasAWT.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().

See also
setShallUseOffscreenLayer(boolean)

Implements com.jogamp.nativewindow.OffscreenLayerOption.

Definition at line 203 of file NewtCanvasAWT.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ paint()

void com.jogamp.newt.awt.NewtCanvasAWT.paint ( final Graphics  g)

Definition at line 743 of file NewtCanvasAWT.java.

Here is the call graph for this function:

◆ print()

void com.jogamp.newt.awt.NewtCanvasAWT.print ( final Graphics  graphics)

Definition at line 918 of file NewtCanvasAWT.java.

Here is the call graph for this function:

◆ releasePrint()

void com.jogamp.newt.awt.NewtCanvasAWT.releasePrint ( )

Shall be called after PrinterJob#print().

See Usage.

Implements com.jogamp.nativewindow.awt.AWTPrintLifecycle.

Definition at line 885 of file NewtCanvasAWT.java.

Here is the call graph for this function:

◆ removeNotify()

void com.jogamp.newt.awt.NewtCanvasAWT.removeNotify ( )

Definition at line 664 of file NewtCanvasAWT.java.

Here is the call graph for this function:

◆ reshape()

void com.jogamp.newt.awt.NewtCanvasAWT.reshape ( final int  x,
final int  y,
final int  width,
final int  height 
)

Definition at line 757 of file NewtCanvasAWT.java.

◆ setDefaultCloseOperation()

WindowClosingMode com.jogamp.newt.awt.NewtCanvasAWT.setDefaultCloseOperation ( final WindowClosingMode  op)
Parameters
opthe new close operation value
Returns
the previous close operation value
See also
WindowClosingMode::DISPOSE_ON_CLOSE
WindowClosingMode::DO_NOTHING_ON_CLOSE

Implements com.jogamp.nativewindow.WindowClosingProtocol.

Definition at line 446 of file NewtCanvasAWT.java.

Here is the call graph for this function:

◆ setNEWTChild()

Window com.jogamp.newt.awt.NewtCanvasAWT.setNEWTChild ( final Window  newChild)

Sets a new NEWT child, provoking reparenting.

A previously detached newChild will be released to top-level status and made invisible.

Note: When switching NEWT child's, detaching the previous first via setNEWTChild(null) produced much cleaner visual results.

Returns
the previous attached newt child.

Definition at line 387 of file NewtCanvasAWT.java.

Here is the caller graph for this function:

◆ setShallUseOffscreenLayer()

void com.jogamp.newt.awt.NewtCanvasAWT.setShallUseOffscreenLayer ( final boolean  v)

Request an offscreen layer, if supported.

Shall be called before the first NativeWindow#lockSurface(), and hence before realization.

See also
getShallUseOffscreenLayer()
isOffscreenLayerSurfaceEnabled()

Implements com.jogamp.nativewindow.OffscreenLayerOption.

Definition at line 193 of file NewtCanvasAWT.java.

Here is the caller graph for this function:

◆ setSkipJAWTDestroy()

final void com.jogamp.newt.awt.NewtCanvasAWT.setSkipJAWTDestroy ( final boolean  v)

Mitigates Bug 910 (IcedTea-Web), i.e.

crash via removeNotify() invoked before Applet.destroy().

skipJAWTDestroy defaults to false. Due to above IcedTea-Web issue the Applet code needs to avoid JAWT destruction before Applet.destroy() is reached by setting skipJAWTDestroy to true. Afterwards the value should be reset to false and destroy() needs to be called, which finally will perform the pending JAWT destruction.

Definition at line 460 of file NewtCanvasAWT.java.

Here is the caller graph for this function:

◆ setupPrint()

void com.jogamp.newt.awt.NewtCanvasAWT.setupPrint ( final double  scaleMatX,
final double  scaleMatY,
final int  numSamples,
final int  tileWidth,
final int  tileHeight 
)

Shall be called before PrinterJob#print().

See Usage.

Parameters
scaleMatXGraphics2D scaling factor, i.e. rendering 1/scaleMatX * width pixels
scaleMatYGraphics2D scaling factor, i.e. rendering 1/scaleMatY * height pixels
numSamplesmultisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples
tileWidthcustom tile width for tile renderer, pass -1 for default.
tileHeightcustom tile height for tile renderer, pass -1 for default. FIXME: Add border size !

Implements com.jogamp.nativewindow.awt.AWTPrintLifecycle.

Definition at line 788 of file NewtCanvasAWT.java.

◆ update()

void com.jogamp.newt.awt.NewtCanvasAWT.update ( final Graphics  g)

Definition at line 751 of file NewtCanvasAWT.java.

Member Data Documentation

◆ DEBUG

final boolean com.jogamp.newt.awt.NewtCanvasAWT.DEBUG = Debug.debug("Window")
static

Definition at line 103 of file NewtCanvasAWT.java.


The documentation for this class was generated from the following file: