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

A NEWT based JFX Canvas specialization allowing a NEWT child Window to be attached using native parenting. More...

Inheritance diagram for com.jogamp.newt.javafx.NewtCanvasJFX:
Collaboration diagram for com.jogamp.newt.javafx.NewtCanvasJFX:

Public Member Functions

 NewtCanvasJFX (final Window child)
 Instantiates a NewtCanvas with a NEWT child. More...
 
void destroy ()
 Destroys this resource: 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)
 
void requestFocus ()
 
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)
 

Detailed Description

A NEWT based JFX Canvas specialization allowing a NEWT child Window to be attached using native parenting.

NewtCanvasJFX allows utilizing custom GLCapabilities settings independent from the JavaFX's window as well as independent rendering from JavaFX's thread.

NewtCanvasJFX allows native parenting operations before and after it's belonging Group's Scene has been attached to the JavaFX Window's actual native window, i.e. becoming fully realized and visible.

Note that JFXAccessor#runOnJFXThread(boolean, Runnable) is still used to for certain mandatory JavaFX lifecycle operation on the JavaFX thread.

Definition at line 83 of file NewtCanvasJFX.java.

Constructor & Destructor Documentation

◆ NewtCanvasJFX()

com.jogamp.newt.javafx.NewtCanvasJFX.NewtCanvasJFX ( final Window  child)

Instantiates a NewtCanvas with a NEWT child.

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

Parameters
childoptional preassigned Window, maybe null

Definition at line 130 of file NewtCanvasJFX.java.

Here is the call graph for this function:

Member Function Documentation

◆ destroy()

void com.jogamp.newt.javafx.NewtCanvasJFX.destroy ( )

Destroys this resource:

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

JavaFX will issue this call when sending out the javafx.stage.WindowEvent#WINDOW_CLOSE_REQUEST automatically, if the user has not overridden the default WindowClosingMode#DISPOSE_ON_CLOSE to WindowClosingMode#DO_NOTHING_ON_CLOSE via setDefaultCloseOperation(com.jogamp.nativewindow.WindowClosingProtocol.WindowClosingMode).

See also
Window::destroy()
setDefaultCloseOperation(com.jogamp.nativewindow.WindowClosingProtocol.WindowClosingMode)

Definition at line 293 of file NewtCanvasJFX.java.

◆ getDefaultCloseOperation()

WindowClosingMode com.jogamp.newt.javafx.NewtCanvasJFX.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 491 of file NewtCanvasJFX.java.

◆ getNativeSurface()

NativeSurface com.jogamp.newt.javafx.NewtCanvasJFX.getNativeSurface ( )

Returns the associated NativeSurface of this NativeSurfaceHolder.

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

Implements com.jogamp.nativewindow.NativeSurfaceHolder.

Definition at line 488 of file NewtCanvasJFX.java.

◆ getNativeWindow()

NativeWindow com.jogamp.newt.javafx.NewtCanvasJFX.getNativeWindow ( )

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

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

Implements com.jogamp.nativewindow.NativeWindowHolder.

Definition at line 481 of file NewtCanvasJFX.java.

◆ getNEWTChild()

Window com.jogamp.newt.javafx.NewtCanvasJFX.getNEWTChild ( )
Returns
the current NEWT child

Definition at line 472 of file NewtCanvasJFX.java.

◆ requestFocus()

void com.jogamp.newt.javafx.NewtCanvasJFX.requestFocus ( )

Definition at line 519 of file NewtCanvasJFX.java.

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

◆ setDefaultCloseOperation()

WindowClosingMode com.jogamp.newt.javafx.NewtCanvasJFX.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 496 of file NewtCanvasJFX.java.

◆ setNEWTChild()

Window com.jogamp.newt.javafx.NewtCanvasJFX.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.

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

Returns
the previous attached newt child.

Definition at line 389 of file NewtCanvasJFX.java.

Here is the caller graph for this function:

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