JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.newt.swt.NewtCanvasSWT Class Reference

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

Inheritance diagram for com.jogamp.newt.swt.NewtCanvasSWT:
Collaboration diagram for com.jogamp.newt.swt.NewtCanvasSWT:

Public Member Functions

 NewtCanvasSWT (final Composite parent, final int style, final Window child)
 Instantiates a NewtCanvas with a NEWT child. More...
 
void setBounds (final int x, final int y, final int width, final int height)
 
void update ()
 
void dispose () throws SWTException
 Destroys this resource: 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 (final WindowClosingMode op)
 
Window setNEWTChild (final Window newChild) throws SWTException
 Sets a new NEWT child, provoking reparenting. More...
 
Window getNEWTChild ()
 
boolean setParent (final Composite parent)
 
boolean forceFocus ()
 
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)
 

Static Public Member Functions

static NewtCanvasSWT create (final Composite parent, final int style, final Window child)
 Creates an instance using NewtCanvasSWT(Composite, int, Window) on the SWT thread. More...
 

Protected Member Functions

final boolean isNativeValid ()
 
final boolean validateNative ()
 
final void updatePosSizeCheck ()
 

Detailed Description

SWT Canvas containing a NEWT Window using native parenting.

Implementation allows use of custom GLCapabilities.

Definition at line 74 of file NewtCanvasSWT.java.

Constructor & Destructor Documentation

◆ NewtCanvasSWT()

com.jogamp.newt.swt.NewtCanvasSWT.NewtCanvasSWT ( final Composite  parent,
final int  style,
final Window  child 
)

Instantiates a NewtCanvas with a NEWT child.

Note: The NEWT child Display's EDTUtil is being set to an SWT conform implementation via Display#setEDTUtil(EDTUtil).

Parameters
parentthe SWT composite
styleadditional styles to SWT::NO_BACKGROUND
childoptional preassigned Window, maybe null

Definition at line 131 of file NewtCanvasSWT.java.

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

Member Function Documentation

◆ create()

static NewtCanvasSWT com.jogamp.newt.swt.NewtCanvasSWT.create ( final Composite  parent,
final int  style,
final Window  child 
)
static

Creates an instance using NewtCanvasSWT(Composite, int, Window) on the SWT thread.

Note: The NEWT child Display's EDTUtil is being set to an SWT conform implementation via Display#setEDTUtil(EDTUtil).

Parameters
parentthe SWT composite
styleadditional styles to SWT::NO_BACKGROUND
childoptional preassigned Window, maybe null
Returns
a new instance

Definition at line 106 of file NewtCanvasSWT.java.

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

◆ dispose()

void com.jogamp.newt.swt.NewtCanvasSWT.dispose ( ) throws SWTException

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()
Exceptions
SWTExceptionIf this method is not called from the SWT thread, an SWTException is thrown for compliance across platforms. User may utilize SWTAccessor#invokeOnSWTThread(org.eclipse.swt.widgets.Display, boolean, Runnable).

Definition at line 448 of file NewtCanvasSWT.java.

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

◆ forceFocus()

boolean com.jogamp.newt.swt.NewtCanvasSWT.forceFocus ( )

Definition at line 628 of file NewtCanvasSWT.java.

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

◆ getDefaultCloseOperation()

WindowClosingMode com.jogamp.newt.swt.NewtCanvasSWT.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 494 of file NewtCanvasSWT.java.

◆ getNativeSurface()

NativeSurface com.jogamp.newt.swt.NewtCanvasSWT.getNativeSurface ( )

Returns the associated NativeSurface of this NativeSurfaceHolder.

Returns
this SWT Canvas NativeSurface representation, may be null in case it has not been realized

Implements com.jogamp.nativewindow.NativeSurfaceHolder.

Definition at line 491 of file NewtCanvasSWT.java.

◆ getNativeWindow()

NativeWindow com.jogamp.newt.swt.NewtCanvasSWT.getNativeWindow ( )

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

Returns
this SWT Canvas NativeWindow representation, may be null in case it has not been realized

Implements com.jogamp.nativewindow.NativeWindowHolder.

Definition at line 484 of file NewtCanvasSWT.java.

Here is the caller graph for this function:

◆ getNEWTChild()

Window com.jogamp.newt.swt.NewtCanvasSWT.getNEWTChild ( )
Returns
the current NEWT child

Definition at line 557 of file NewtCanvasSWT.java.

◆ isNativeValid()

final boolean com.jogamp.newt.swt.NewtCanvasSWT.isNativeValid ( )
protected

Definition at line 339 of file NewtCanvasSWT.java.

◆ setBounds()

void com.jogamp.newt.swt.NewtCanvasSWT.setBounds ( final int  x,
final int  y,
final int  width,
final int  height 
)

Definition at line 331 of file NewtCanvasSWT.java.

Here is the call graph for this function:

◆ setDefaultCloseOperation()

WindowClosingMode com.jogamp.newt.swt.NewtCanvasSWT.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 499 of file NewtCanvasSWT.java.

◆ setNEWTChild()

Window com.jogamp.newt.swt.NewtCanvasSWT.setNEWTChild ( final Window  newChild) throws SWTException

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.

Note: The NEWT child Display's EDTUtil is being set to an SWT conform implementation via Display#setEDTUtil(EDTUtil).

Returns
the previous attached newt child.
Exceptions
SWTExceptionIf this method is not called from the SWT thread, an SWTException is thrown for compliance across platforms. User may utilize SWTAccessor#invokeOnSWTThread(org.eclipse.swt.widgets.Display, boolean, Runnable).

Definition at line 533 of file NewtCanvasSWT.java.

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

◆ setParent()

boolean com.jogamp.newt.swt.NewtCanvasSWT.setParent ( final Composite  parent)

Definition at line 562 of file NewtCanvasSWT.java.

◆ update()

void com.jogamp.newt.swt.NewtCanvasSWT.update ( )

Definition at line 429 of file NewtCanvasSWT.java.

◆ updatePosSizeCheck()

final void com.jogamp.newt.swt.NewtCanvasSWT.updatePosSizeCheck ( )
protected

Definition at line 379 of file NewtCanvasSWT.java.

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

◆ validateNative()

final boolean com.jogamp.newt.swt.NewtCanvasSWT.validateNative ( )
protected

Definition at line 341 of file NewtCanvasSWT.java.

Here is the call graph for this function:

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