Top Fields Constructors Methods
com.jogamp.newt

public Class NewtFactory

extends Object
Class Inheritance
Known Direct Subclasses
jogamp.newt.awt.NewtFactoryAWT
Imports
java.security.AccessController, .PrivilegedAction, java.util.Arrays, com.jogamp.nativewindow.AbstractGraphicsConfiguration, .AbstractGraphicsDevice, .AbstractGraphicsScreen, .CapabilitiesImmutable, .NativeWindow, .NativeWindowFactory, com.jogamp.common.util.IOUtil, .PropertyAccess, jogamp.newt.Debug, .DisplayImpl, .ScreenImpl, .WindowImpl

Field Summary

Modifier and TypeField and Description
public static final boolean
private static IOUtil.ClassResources
public static final String
private static String
private static boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Screen
public static Screen
createCompatibleScreen(final NativeWindow parent, final Screen childScreen)

public static Display

Returns:

the new or reused Display instance
createDisplay
(final String
the display connection name which is a technical platform specific detail, see AbstractGraphicsDevice#getConnection(). Use null for default.
name
)

Create a Display entity.

public static Display

Returns:

the new or reused Display instance
createDisplay
(final String
the display connection name which is a technical platform specific detail, see AbstractGraphicsDevice#getConnection(). Use null for default.
name
,
final boolean
attempt to reuse an existing Display with same name if set true, otherwise create a new instance.
reuse
)

Create a Display entity.

public static Display

Returns:

the new or reused Display instance
createDisplay
(final String
explicit NativeWindow type eg. NativeWindowFactory#TYPE_AWT
type
,
final String
the display connection name which is a technical platform specific detail, see AbstractGraphicsDevice#getConnection(). Use null for default.
name
)

Create a Display entity.

public static Display

Returns:

the new or reused Display instance
createDisplay
(final String
explicit NativeWindow type eg. NativeWindowFactory#TYPE_AWT
type
,
final String
the display connection name which is a technical platform specific detail, see AbstractGraphicsDevice#getConnection(). Use null for default.
name
,
final boolean
attempt to reuse an existing Display with same name if set true, otherwise create a new instance.
reuse
)

Create a Display entity.

public static Display
createDisplay(final String type, final long handle, final boolean reuse)

Instantiate a Display entity using the native handle.

public static Screen
createScreen(final Display display, final int index)

Create a Screen entity.

public static Window
createWindow(final CapabilitiesImmutable caps)

Create a top level Window entity on the default Display and default Screen.

public static Window
createWindow(final Screen screen, final CapabilitiesImmutable caps)

Create a top level Window entity.

public static Window
createWindow(final NativeWindow
either a NativeWindow instance
parentWindow
,
final CapabilitiesImmutable caps)

Create a child Window entity attached to the given parent.

public static Window
createWindow(final String
the parent window's display connection
displayConnection
,
final int
the desired screen index
screenIdx
,
final long
the native parent window handle
parentWindowHandle
,
final CapabilitiesImmutable
the desired capabilities
caps
)

Create a child Window entity attached to the given parent, incl native creation

public static Window
createWindow(final Object[]
only impacts if the window is in top-level state, while attached to a parent window it's rendered undecorated always
cstrArguments
,
final Screen screen, final CapabilitiesImmutable caps)

Ability to try a Window type with a constructor argument, if supported ..

private static Window
public static Class<?>
getCustomClass(final String packageName, final String classBaseName)

public static IOUtil.ClassResources
getWindowIcons()

Returns the application window icon resources to be used.

public static boolean
isScreenCompatible(final NativeWindow parent, final Screen childScreen)

public static synchronized void
setUseEDT(final boolean onoff)

Toggles the usage of an EventDispatchThread while creating a Display.

public static void
setWindowIcons(final IOUtil.ClassResources cres)

Allow user to set custom window icons, only applicable at application start before creating any NEWT instance.

public static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEBUG_IMPLEMENTATIONback to summary
public static final boolean DEBUG_IMPLEMENTATION
defaultWindowIconsback to summary
private static IOUtil.ClassResources defaultWindowIcons
DRIVER_DEFAULT_ROOT_PACKAGEback to summary
public static final String DRIVER_DEFAULT_ROOT_PACKAGE
sysPathsback to summary
private static String sysPaths
useEDTback to summary
private static boolean useEDT

Constructor Detail

NewtFactoryback to summary
public NewtFactory()

Method Detail

createCompatibleScreenback to summary
public static Screen createCompatibleScreen(final NativeWindow parent)
createCompatibleScreenback to summary
public static Screen createCompatibleScreen(final NativeWindow parent, final Screen childScreen)
createDisplayback to summary
public static Display createDisplay(final String name)

Create a Display entity.

Native creation is lazily done at usage, ie. Display#addReference().

An already existing display connection of the same name will be reused.

Parameters
name:String

the display connection name which is a technical platform specific detail, see AbstractGraphicsDevice#getConnection(). Use null for default.

Returns:Display

the new or reused Display instance

createDisplayback to summary
public static Display createDisplay(final String name, final boolean reuse)

Create a Display entity.

Native creation is lazily done at usage, ie. Display#addReference().

An already existing display connection of the same name will be reused if reuse is true, otherwise a new instance is being created.

Parameters
name:String

the display connection name which is a technical platform specific detail, see AbstractGraphicsDevice#getConnection(). Use null for default.

reuse:boolean

attempt to reuse an existing Display with same name if set true, otherwise create a new instance.

Returns:Display

the new or reused Display instance

createDisplayback to summary
public static Display createDisplay(final String type, final String name)

Create a Display entity.

Native creation is lazily done at usage, ie. Display#addReference().

An already existing display connection of the same name will be reused.

Parameters
type:String

explicit NativeWindow type eg. NativeWindowFactory#TYPE_AWT

name:String

the display connection name which is a technical platform specific detail, see AbstractGraphicsDevice#getConnection(). Use null for default.

Returns:Display

the new or reused Display instance

createDisplayback to summary
public static Display createDisplay(final String type, final String name, final boolean reuse)

Create a Display entity.

Native creation is lazily done at usage, ie. Display#addReference().

An already existing display connection of the same name will be reused if reuse is true, otherwise a new instance is being created.

Parameters
type:String

explicit NativeWindow type eg. NativeWindowFactory#TYPE_AWT

name:String

the display connection name which is a technical platform specific detail, see AbstractGraphicsDevice#getConnection(). Use null for default.

reuse:boolean

attempt to reuse an existing Display with same name if set true, otherwise create a new instance.

Returns:Display

the new or reused Display instance

createDisplayback to summary
public static Display createDisplay(final String type, final long handle, final boolean reuse)

Instantiate a Display entity using the native handle.

createScreenback to summary
public static Screen createScreen(final Display display, final int index)

Create a Screen entity.

Native creation is lazily done at usage, ie. Screen#addReference().

The lifecycle of this Screen's Display is handled via Display#addReference() and Display#removeReference().

createWindowback to summary
public static Window createWindow(final CapabilitiesImmutable caps)

Create a top level Window entity on the default Display and default Screen.

Native creation is lazily done at usage, ie. Window#setVisible(boolean).

An already existing default Display will be reused.

The lifecycle of this Window's Screen and Display is handled via Screen#addReference() and Screen#removeReference().

createWindowback to summary
public static Window createWindow(final Screen screen, final CapabilitiesImmutable caps)

Create a top level Window entity.

Native creation is lazily done at usage, ie. Window#setVisible(boolean).

The lifecycle of this Window's Screen and Display is handled via Screen#addReference() and Screen#removeReference().

createWindowback to summary
public static Window createWindow(final NativeWindow parentWindow, final CapabilitiesImmutable caps)

Create a child Window entity attached to the given parent.
The Screen and Display information is regenerated utilizing the parents information, while reusing an existing Display.

In case parentWindowObject is a com.jogamp.newt.Window instance,
the new window is added to it's list of children.
This assures proper handling of visibility, creation and destruction.
com.jogamp.newt.event.WindowEvent#EVENT_WINDOW_RESIZED is not propagated to the child window for layout
, you have to add an appropriate com.jogamp.newt.event.WindowListener for this use case.
The parents visibility is passed to the new Window

In case parentWindowObject is a different com.jogamp.nativewindow.NativeWindow implementation,
you have to handle all events appropriate.

The lifecycle of this Window's Screen and Display is handled via Screen#addReference() and Screen#removeReference().

Parameters
parentWindow:NativeWindow

either a NativeWindow instance

createWindowback to summary
public static Window createWindow(final String displayConnection, final int screenIdx, final long parentWindowHandle, final CapabilitiesImmutable caps)

Create a child Window entity attached to the given parent, incl native creation

Parameters
displayConnection:String

the parent window's display connection

screenIdx:int

the desired screen index

parentWindowHandle:long

the native parent window handle

caps:CapabilitiesImmutable

the desired capabilities

createWindowback to summary
public static Window createWindow(final Object[] cstrArguments, final Screen screen, final CapabilitiesImmutable caps)

Ability to try a Window type with a constructor argument, if supported ..

Currently only valid is AWTWindow(Frame frame) , to support an external created AWT Frame, ie the browsers embedded frame.

Parameters
cstrArguments:Object[]

only impacts if the window is in top-level state, while attached to a parent window it's rendered undecorated always

createWindowImplback to summary
private static Window createWindowImpl(final String type, final CapabilitiesImmutable caps)
getCustomClassback to summary
public static Class<?> getCustomClass(final String packageName, final String classBaseName)
getWindowIconsback to summary
public static IOUtil.ClassResources getWindowIcons()

Returns the application window icon resources to be used.

Property newt.window.icons may define a list of PNG icons separated by one whitespace or one comma character. Shall reference at least two PNG icons, from lower (16x16) to higher (>= 32x32) resolution.

Users may also specify application window icons using setWindowIcons(com.jogamp.common.util.IOUtil.ClassResources).

isScreenCompatibleback to summary
public static boolean isScreenCompatible(final NativeWindow parent, final Screen childScreen)
setUseEDTback to summary
public static synchronized void setUseEDT(final boolean onoff)

Toggles the usage of an EventDispatchThread while creating a Display.
The default is enabled.
The EventDispatchThread is thread local to the Display instance.

setWindowIconsback to summary
public static void setWindowIcons(final IOUtil.ClassResources cres)

Allow user to set custom window icons, only applicable at application start before creating any NEWT instance.

Shall reference at least two PNG icons, from lower (16x16) to higher (>= 32x32) resolution.

useEDTback to summary
public static boolean useEDT()
See Also
setUseEDT(boolean)