JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.newt.Display Class Referenceabstract
Collaboration diagram for com.jogamp.newt.Display:

Classes

interface  PointerIcon
 Native PointerIcon handle. More...
 

Public Member Functions

abstract int hashCode ()
 return precomputed hashCode from FQN getFQName() More...
 
boolean equals (final Object obj)
 return true if obj is of type Display and both FQN getFQName() equals More...
 
abstract PixelFormat getNativePointerIconPixelFormat ()
 Returns the native platform's PixelFormat for pointer-icon pixel data. More...
 
abstract boolean getNativePointerIconForceDirectNIO ()
 Returns the native platform's direct NIO buffer requirement pointer-icon pixel data. More...
 
abstract PointerIcon createPointerIcon (final IOUtil.ClassResources pngResource, final int hotX, final int hotY) throws IllegalArgumentException, IllegalStateException, IOException
 Returns the newly created PointerIcon or null if not implemented on platform. More...
 
abstract PointerIcon createPointerIcon (final PixelRectangle pixelrect, final int hotX, final int hotY) throws IllegalArgumentException, IllegalStateException
 Returns the newly created PointerIcon or null if not implemented on platform. More...
 
abstract void createNative () throws NativeWindowException
 Manual trigger the native creation, if it is not done yet. More...
 
abstract void destroy ()
 Manually trigger the destruction, incl. More...
 
abstract boolean validateEDTStopped ()
 Validate EDT running state. More...
 
abstract boolean isNativeValid ()
 
abstract int getReferenceCount ()
 
abstract int addReference () throws NativeWindowException
 The 1st call will initiate native creation, since we follow the lazy creation pattern. More...
 
abstract int removeReference ()
 The last call may destroy this instance, if getDestroyWhenUnused() returns true. More...
 
abstract AbstractGraphicsDevice getGraphicsDevice ()
 Return the AbstractGraphicsDevice used for depending resources lifecycle, i.e. More...
 
abstract long getHandle ()
 Return the handle of the AbstractGraphicsDevice as returned by getGraphicsDevice(). More...
 
abstract String getFQName ()
 
abstract int getId ()
 
abstract String getName ()
 
abstract String getType ()
 
abstract boolean isExclusive ()
 Return true if this instance is exclusive, i.e. More...
 
abstract EDTUtil setEDTUtil (EDTUtil usrEDTUtil)
 Sets a new EDTUtil and returns the previous one. More...
 
abstract EDTUtil getEDTUtil ()
 
abstract boolean isEDTRunning ()
 
abstract void dispatchMessages ()
 

Static Public Member Functions

static void dumpDisplayList (final String prefix)
 
static Display getFirstDisplayOf (final String type, final String name, final int fromIndex, final boolean shared)
 
static Display getLastDisplayOf (final String type, final String name, final int fromIndex, final boolean shared)
 
static Collection< DisplaygetAllDisplays ()
 Returns the global display collection. More...
 
static int getActiveDisplayNumber ()
 
static String getThreadName ()
 
static String toHexString (final int hex)
 
static String toHexString (final long hex)
 
static int hashCodeNullSafe (final Object o)
 

Static Public Attributes

static final boolean DEBUG = Debug.debug("Display")
 

Static Protected Member Functions

static void addDisplay2List (final Display display)
 

Static Protected Attributes

static final boolean DEBUG_POINTER_ICON = Debug.debug("Display.PointerIcon")
 
static final ArrayList< WeakReference< Display > > displayList = new ArrayList<WeakReference<Display>>()
 
static int displaysActive = 0
 

Detailed Description

Definition at line 48 of file Display.java.

Member Function Documentation

◆ addDisplay2List()

static void com.jogamp.newt.Display.addDisplay2List ( final Display  display)
staticprotected

Definition at line 418 of file Display.java.

◆ addReference()

abstract int com.jogamp.newt.Display.addReference ( ) throws NativeWindowException
abstract

The 1st call will initiate native creation, since we follow the lazy creation pattern.

Returns
number of references post operation
Exceptions
NativeWindowExceptionif the native creation failed.
See also
removeReference()

◆ createNative()

abstract void com.jogamp.newt.Display.createNative ( ) throws NativeWindowException
abstract

Manual trigger the native creation, if it is not done yet.


This is useful to be able to request the com.jogamp.nativewindow.AbstractGraphicsDevice, via getGraphicsDevice().
Otherwise the abstract device won't be available before the dependent components (Screen and Window) are realized.

This method is usually invoke by addReference()

Exceptions
NativeWindowExceptionif the native creation failed.
Here is the caller graph for this function:

◆ createPointerIcon() [1/2]

abstract PointerIcon com.jogamp.newt.Display.createPointerIcon ( final IOUtil.ClassResources  pngResource,
final int  hotX,
final int  hotY 
) throws IllegalArgumentException, IllegalStateException, IOException
abstract

Returns the newly created PointerIcon or null if not implemented on platform.

See PointerIcon for lifecycle semantics.

Parameters
pngResourcesingle PNG resource for the PointerIcon. Only the first entry of IOUtil.ClassResources#resourcePaths is used.
hotXpointer hotspot x-coord, origin is upper-left corner
hotYpointer hotspot y-coord, origin is upper-left corner
Exceptions
IllegalArgumentExceptionif pngResource is null or invalid
IllegalStateExceptionif this Display instance is not valid yet.
IOExceptionif the pngResource could not be resolved or via the PNG parser processing the input stream.
See also
PointerIcon
Window::setPointerIcon(PointerIcon)
Here is the caller graph for this function:

◆ createPointerIcon() [2/2]

abstract PointerIcon com.jogamp.newt.Display.createPointerIcon ( final PixelRectangle  pixelrect,
final int  hotX,
final int  hotY 
) throws IllegalArgumentException, IllegalStateException
abstract

Returns the newly created PointerIcon or null if not implemented on platform.

See PointerIcon for lifecycle semantics.

In case getNativePointerIconPixelFormat() or getNativePointerIconForceDirectNIO() is not matched by the given pixelrect, the pixelrect is converted into the required PixelFormat and NIO type.

Parameters
pixelrectPixelRectangle source for the PointerIcon
hotXpointer hotspot x-coord, origin is upper-left corner
hotYpointer hotspot y-coord, origin is upper-left corner
Exceptions
IllegalArgumentExceptionif pixelrect is null.
IllegalStateExceptionif this Display instance is not valid yet.
See also
PointerIcon
Window::setPointerIcon(PointerIcon)
getNativePointerIconPixelFormat()
getNativePointerIconForceDirectNIO()

◆ destroy()

abstract void com.jogamp.newt.Display.destroy ( )
abstract

Manually trigger the destruction, incl.

native destruction.

This method is usually invoke by removeReference()

Here is the caller graph for this function:

◆ dispatchMessages()

abstract void com.jogamp.newt.Display.dispatchMessages ( )
abstract

◆ dumpDisplayList()

static void com.jogamp.newt.Display.dumpDisplayList ( final String  prefix)
static

Definition at line 357 of file Display.java.

Here is the call graph for this function:

◆ equals()

boolean com.jogamp.newt.Display.equals ( final Object  obj)

return true if obj is of type Display and both FQN getFQName() equals

Definition at line 58 of file Display.java.

Here is the call graph for this function:

◆ getActiveDisplayNumber()

static int com.jogamp.newt.Display.getActiveDisplayNumber ( )
static

Definition at line 452 of file Display.java.

Here is the caller graph for this function:

◆ getAllDisplays()

static Collection< Display > com.jogamp.newt.Display.getAllDisplays ( )
static

Returns the global display collection.

Definition at line 434 of file Display.java.

◆ getEDTUtil()

abstract EDTUtil com.jogamp.newt.Display.getEDTUtil ( )
abstract
Here is the caller graph for this function:

◆ getFirstDisplayOf()

static Display com.jogamp.newt.Display.getFirstDisplayOf ( final String  type,
final String  name,
final int  fromIndex,
final boolean  shared 
)
static
Parameters
type
name
fromIndexstart index, then increasing until found or end of list @paran shared if true, only shared instances are found, otherwise also exclusive
Returns

Definition at line 376 of file Display.java.

◆ getFQName()

abstract String com.jogamp.newt.Display.getFQName ( )
abstract
Returns
The fully qualified Display name, which is a key of getType() + getName() + getId().
Here is the caller graph for this function:

◆ getGraphicsDevice()

abstract AbstractGraphicsDevice com.jogamp.newt.Display.getGraphicsDevice ( )
abstract

Return the AbstractGraphicsDevice used for depending resources lifecycle, i.e.

Screen and Window, as well as the event dispatching (EDT).

Here is the caller graph for this function:

◆ getHandle()

abstract long com.jogamp.newt.Display.getHandle ( )
abstract

Return the handle of the AbstractGraphicsDevice as returned by getGraphicsDevice().

◆ getId()

abstract int com.jogamp.newt.Display.getId ( )
abstract
Returns
this display internal serial id

◆ getLastDisplayOf()

static Display com.jogamp.newt.Display.getLastDisplayOf ( final String  type,
final String  name,
final int  fromIndex,
final boolean  shared 
)
static
Parameters
type
name
fromIndexstart index, then decreasing until found or end of list. -1 is interpreted as size - 1.
sharedif true, only shared instances are found, otherwise also exclusive
Returns

Definition at line 388 of file Display.java.

◆ getName()

abstract String com.jogamp.newt.Display.getName ( )
abstract
Returns
This display connection name as defined at creation time. The display connection name is a technical platform specific detail, see AbstractGraphicsDevice#getConnection().
See also
AbstractGraphicsDevice::getConnection()
Here is the caller graph for this function:

◆ getNativePointerIconForceDirectNIO()

abstract boolean com.jogamp.newt.Display.getNativePointerIconForceDirectNIO ( )
abstract

Returns the native platform's direct NIO buffer requirement pointer-icon pixel data.

Using this value will avoid conversion within createPointerIcon(PixelRectangle, int, int).

◆ getNativePointerIconPixelFormat()

abstract PixelFormat com.jogamp.newt.Display.getNativePointerIconPixelFormat ( )
abstract

Returns the native platform's PixelFormat for pointer-icon pixel data.

Using this value will avoid conversion within createPointerIcon(PixelRectangle, int, int).

Known native pixel formats are:

◆ getReferenceCount()

abstract int com.jogamp.newt.Display.getReferenceCount ( )
abstract
Returns
number of references
Here is the caller graph for this function:

◆ getThreadName()

static String com.jogamp.newt.Display.getThreadName ( )
static

Definition at line 458 of file Display.java.

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

◆ getType()

abstract String com.jogamp.newt.Display.getType ( )
abstract

◆ hashCode()

abstract int com.jogamp.newt.Display.hashCode ( )
abstract

return precomputed hashCode from FQN getFQName()

◆ hashCodeNullSafe()

static int com.jogamp.newt.Display.hashCodeNullSafe ( final Object  o)
static

Definition at line 471 of file Display.java.

◆ isEDTRunning()

abstract boolean com.jogamp.newt.Display.isEDTRunning ( )
abstract
Returns
true if EDT is running and not subject to be stopped, otherwise false.

◆ isExclusive()

abstract boolean com.jogamp.newt.Display.isExclusive ( )
abstract

Return true if this instance is exclusive, i.e.

will not be shared.

◆ isNativeValid()

abstract boolean com.jogamp.newt.Display.isNativeValid ( )
abstract
Returns
true if the native display handle is valid and ready to operate, otherwise false.
See also
destroy()
Here is the caller graph for this function:

◆ removeReference()

abstract int com.jogamp.newt.Display.removeReference ( )
abstract

The last call may destroy this instance, if getDestroyWhenUnused() returns true.

Returns
number of references post operation
See also
addReference()
#getDestroyWhenUnused()
#setDestroyWhenUnused(boolean)

◆ setEDTUtil()

abstract EDTUtil com.jogamp.newt.Display.setEDTUtil ( EDTUtil  usrEDTUtil)
abstract

Sets a new EDTUtil and returns the previous one.

If usrEDTUtil is null, the device's default EDTUtil is created and used.

If a previous one exists and it differs from usrEDTUtil, it's being stopped, wait-until-idle.

If usrEDTUtil is not null and equals the previous one, no change is being made.

Here is the caller graph for this function:

◆ toHexString() [1/2]

static String com.jogamp.newt.Display.toHexString ( final int  hex)
static

Definition at line 463 of file Display.java.

Here is the caller graph for this function:

◆ toHexString() [2/2]

static String com.jogamp.newt.Display.toHexString ( final long  hex)
static

Definition at line 467 of file Display.java.

◆ validateEDTStopped()

abstract boolean com.jogamp.newt.Display.validateEDTStopped ( )
abstract

Validate EDT running state.


Stop the running EDT in case this display is destroyed already.

Returns
true if EDT has been stopped (destroyed but running), otherwise false.

Member Data Documentation

◆ DEBUG

final boolean com.jogamp.newt.Display.DEBUG = Debug.debug("Display")
static

Definition at line 49 of file Display.java.

◆ DEBUG_POINTER_ICON

final boolean com.jogamp.newt.Display.DEBUG_POINTER_ICON = Debug.debug("Display.PointerIcon")
staticprotected

Definition at line 50 of file Display.java.

◆ displayList

final ArrayList<WeakReference<Display> > com.jogamp.newt.Display.displayList = new ArrayList<WeakReference<Display>>()
staticprotected

Definition at line 354 of file Display.java.

◆ displaysActive

int com.jogamp.newt.Display.displaysActive = 0
staticprotected

Definition at line 355 of file Display.java.


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