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

A screen may span multiple MonitorDevices representing their combined virtual size. More...

Collaboration diagram for com.jogamp.newt.Screen:

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 void createNative () throws NativeWindowException
 Manual trigger the native creation, if not done yet..
This is useful to be able to request the com.jogamp.nativewindow.AbstractGraphicsScreen, via getGraphicsScreen(). More...
 
abstract void destroy ()
 Manually trigger the destruction, incl. More...
 
abstract boolean isNativeValid ()
 
abstract int getReferenceCount ()
 
abstract int addReference () throws NativeWindowException
 See Display#addReference(). More...
 
abstract int removeReference ()
 See Display#removeReference(). More...
 
abstract AbstractGraphicsScreen getGraphicsScreen ()
 
abstract int getIndex ()
 
abstract int getX ()
 See Coordinate System. More...
 
abstract int getY ()
 See Coordinate System. More...
 
abstract int getWidth ()
 
abstract int getHeight ()
 
abstract RectangleImmutable getViewport ()
 See Coordinate System. More...
 
abstract RectangleImmutable getViewportInWindowUnits ()
 See Coordinate System. More...
 
abstract Display getDisplay ()
 
abstract String getFQName ()
 
abstract List< MonitorModegetMonitorModes ()
 Return a list of all MonitorModes for all MonitorDevices. More...
 
abstract List< MonitorDevicegetMonitorDevices ()
 Return a list of available MonitorDevices. More...
 
abstract MonitorDevice getPrimaryMonitor ()
 Returns the windowing manager's primary MonitorDevice, which holds the system menu bar, etc. More...
 
final MonitorDevice getMainMonitor (final RectangleImmutable r)
 Returns the MonitorDevice with the highest viewport coverage of the given rectangle in window units, which is not a clone. More...
 
final MonitorDevice getFullyEnteredMonitor (final RectangleImmutable r)
 Returns the MonitorDevice which completely which viewport completely coverage the given rectangle in window units, which is not a clone. More...
 
final MonitorDevice getMonitorById (final int monitorId)
 Returns the MonitorDevice which matches the given integer monitorId. More...
 
final MonitorDevice getMonitorByHandle (final long monitorHandle)
 Returns the MonitorDevice which matches the given long monitorHandle. More...
 
final MonitorDevice getMonitorByName (final String name)
 Returns the MonitorDevice which matches the given name. More...
 
final void unionOfMonitorViewports (final Rectangle viewport, final Rectangle viewportInWindowUnits)
 Calculates the union of all monitor's viewport in pixel- and window units. More...
 
abstract void addMonitorModeListener (MonitorModeListener sml)
 
abstract void removeMonitorModeListener (MonitorModeListener sml)
 

Static Public Member Functions

static Screen getFirstScreenOf (final Display display, final int idx, final int fromIndex)
 
static Screen getLastScreenOf (final Display display, final int idx, final int fromIndex)
 
static Collection< ScreengetAllScreens ()
 Returns the global screen collection. More...
 
static int getActiveScreenNumber ()
 

Static Public Attributes

static final int SCREEN_MODE_CHANGE_TIMEOUT = 10000
 A 10s timeout for screen mode change. More...
 
static final boolean DEBUG = Debug.debug("Screen")
 

Static Protected Member Functions

static void addScreen2List (final Screen screen)
 

Static Protected Attributes

static final ArrayList< WeakReference< Screen > > screenList = new ArrayList<WeakReference<Screen>>()
 
static int screensActive = 0
 

Detailed Description

A screen may span multiple MonitorDevices representing their combined virtual size.

All values of this interface are represented in pixel units, if not stated otherwise.

Coordinate System

Definition at line 58 of file Screen.java.

Member Function Documentation

◆ addMonitorModeListener()

abstract void com.jogamp.newt.Screen.addMonitorModeListener ( MonitorModeListener  sml)
abstract
Parameters
smlMonitorModeListener to be added for MonitorEvent
Here is the caller graph for this function:

◆ addReference()

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

See Display#addReference().

Returns
number of references post operation
Exceptions
NativeWindowExceptionif the native creation failed.
See also
removeReference()
#setDestroyWhenUnused(boolean)
#getDestroyWhenUnused()
Here is the caller graph for this function:

◆ addScreen2List()

static void com.jogamp.newt.Screen.addScreen2List ( final Screen  screen)
staticprotected

Definition at line 385 of file Screen.java.

◆ createNative()

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

Manual trigger the native creation, if not done yet..
This is useful to be able to request the com.jogamp.nativewindow.AbstractGraphicsScreen, via getGraphicsScreen().


Otherwise the abstract device won't be available before the dependent component (Window) is realized.

This method is usually invoke by addReference()

This method invokes Display#addReference() after creating the native peer,
which will issue Display#createNative() if the reference count was 0.

Exceptions
NativeWindowExceptionif the native creation failed.

◆ destroy()

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

Manually trigger the destruction, incl.

native destruction.

This method is usually invoke by removeReference()

This method invokes Display#removeReference() after it's own destruction,
which will issue Display#destroy() if the reference count becomes 0.

Here is the caller graph for this function:

◆ equals()

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

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

Definition at line 74 of file Screen.java.

Here is the call graph for this function:

◆ getActiveScreenNumber()

static int com.jogamp.newt.Screen.getActiveScreenNumber ( )
static

Definition at line 419 of file Screen.java.

◆ getAllScreens()

static Collection< Screen > com.jogamp.newt.Screen.getAllScreens ( )
static

Returns the global screen collection.

Definition at line 401 of file Screen.java.

◆ getDisplay()

abstract Display com.jogamp.newt.Screen.getDisplay ( )
abstract
Returns
the associated Display
Here is the caller graph for this function:

◆ getFirstScreenOf()

static Screen com.jogamp.newt.Screen.getFirstScreenOf ( final Display  display,
final int  idx,
final int  fromIndex 
)
static
Parameters
type
name
fromIndexstart index, then increasing until found or end of list *
Returns

Definition at line 346 of file Screen.java.

◆ getFQName()

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

◆ getFullyEnteredMonitor()

final MonitorDevice com.jogamp.newt.Screen.getFullyEnteredMonitor ( final RectangleImmutable  r)

Returns the MonitorDevice which completely which viewport completely coverage the given rectangle in window units, which is not a clone.

If no match is found, null is being returned

Parameters
rarbitrary rectangle in window units

Definition at line 255 of file Screen.java.

Here is the call graph for this function:

◆ getGraphicsScreen()

abstract AbstractGraphicsScreen com.jogamp.newt.Screen.getGraphicsScreen ( )
abstract

◆ getHeight()

abstract int com.jogamp.newt.Screen.getHeight ( )
abstract
Returns
the rotated virtual viewport's height in pixel units.
Here is the caller graph for this function:

◆ getIndex()

abstract int com.jogamp.newt.Screen.getIndex ( )
abstract
Returns
this Screen index of all Screens of getDisplay().
Here is the caller graph for this function:

◆ getLastScreenOf()

static Screen com.jogamp.newt.Screen.getLastScreenOf ( final Display  display,
final int  idx,
final int  fromIndex 
)
static
Parameters
type
name
fromIndexstart index, then decreasing until found or end of list. -1 is interpreted as size - 1.
Returns

Definition at line 357 of file Screen.java.

◆ getMainMonitor()

final MonitorDevice com.jogamp.newt.Screen.getMainMonitor ( final RectangleImmutable  r)

Returns the MonitorDevice with the highest viewport coverage of the given rectangle in window units, which is not a clone.

If no coverage is detected the first MonitorDevice is returned.

Parameters
rarbitrary rectangle in window units

Definition at line 227 of file Screen.java.

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

◆ getMonitorByHandle()

final MonitorDevice com.jogamp.newt.Screen.getMonitorByHandle ( final long  monitorHandle)

Returns the MonitorDevice which matches the given long monitorHandle.

If no match is found, null is being returned

Definition at line 285 of file Screen.java.

Here is the call graph for this function:

◆ getMonitorById()

final MonitorDevice com.jogamp.newt.Screen.getMonitorById ( final int  monitorId)

Returns the MonitorDevice which matches the given integer monitorId.

If no match is found, null is being returned

Definition at line 270 of file Screen.java.

Here is the call graph for this function:

◆ getMonitorByName()

final MonitorDevice com.jogamp.newt.Screen.getMonitorByName ( final String  name)

Returns the MonitorDevice which matches the given name.

If no match is found or the given name is null or empty, null is being returned

Definition at line 300 of file Screen.java.

Here is the call graph for this function:

◆ getMonitorDevices()

abstract List< MonitorDevice > com.jogamp.newt.Screen.getMonitorDevices ( )
abstract

Return a list of available MonitorDevices.

Here is the caller graph for this function:

◆ getMonitorModes()

abstract List< MonitorMode > com.jogamp.newt.Screen.getMonitorModes ( )
abstract

Return a list of all MonitorModes for all MonitorDevices.

The list is ordered in descending order, see MonitorMode#compareTo(MonitorMode).

Here is the caller graph for this function:

◆ getPrimaryMonitor()

abstract MonitorDevice com.jogamp.newt.Screen.getPrimaryMonitor ( )
abstract

Returns the windowing manager's primary MonitorDevice, which holds the system menu bar, etc.

See also
MonitorDevice::isPrimary()
Here is the caller graph for this function:

◆ getReferenceCount()

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

◆ getViewport()

abstract RectangleImmutable com.jogamp.newt.Screen.getViewport ( )
abstract

See Coordinate System.

Returns
the rotated virtual viewport, i.e. top-left origin and size, in pixel units.
See also
getViewportInWindowUnits()
Here is the caller graph for this function:

◆ getViewportInWindowUnits()

abstract RectangleImmutable com.jogamp.newt.Screen.getViewportInWindowUnits ( )
abstract

See Coordinate System.

Returns
the rotated virtual viewport, i.e. top-left origin and size, in window units.
See also
getViewport()
Here is the caller graph for this function:

◆ getWidth()

abstract int com.jogamp.newt.Screen.getWidth ( )
abstract
Returns
the rotated virtual viewport's width in pixel units.
Here is the caller graph for this function:

◆ getX()

abstract int com.jogamp.newt.Screen.getX ( )
abstract

See Coordinate System.

Returns
the x position of the virtual viewport's top-left origin in pixel units.

◆ getY()

abstract int com.jogamp.newt.Screen.getY ( )
abstract

See Coordinate System.

Returns
the y position of the virtual viewport's top-left origin in pixel units.

◆ hashCode()

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

return precomputed hashCode from FQN getFQName()

◆ isNativeValid()

abstract boolean com.jogamp.newt.Screen.isNativeValid ( )
abstract
Here is the caller graph for this function:

◆ removeMonitorModeListener()

abstract void com.jogamp.newt.Screen.removeMonitorModeListener ( MonitorModeListener  sml)
abstract
Parameters
smlMonitorModeListener to be removed from MonitorEvent

◆ removeReference()

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

See Display#removeReference().

Returns
number of references post operation
See also
addReference()
#setDestroyWhenUnused(boolean)
#getDestroyWhenUnused()
Here is the caller graph for this function:

◆ unionOfMonitorViewports()

final void com.jogamp.newt.Screen.unionOfMonitorViewports ( final Rectangle  viewport,
final Rectangle  viewportInWindowUnits 
)

Calculates the union of all monitor's viewport in pixel- and window units.

Should be equal to getX(), getY(), getWidth() and getHeight(), however, some native toolkits may choose a different virtual screen area.

Parameters
viewportstorage for result in pixel units, maybe null
viewportInWindowUnitsstorage for result in window units, maybe null

Definition at line 321 of file Screen.java.

Here is the call graph for this function:

Member Data Documentation

◆ DEBUG

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

Definition at line 66 of file Screen.java.

◆ SCREEN_MODE_CHANGE_TIMEOUT

final int com.jogamp.newt.Screen.SCREEN_MODE_CHANGE_TIMEOUT = 10000
static

A 10s timeout for screen mode change.

It is observed, that some platforms need a notable amount of time for this task, especially in case of rotation change.

Definition at line 64 of file Screen.java.

◆ screenList

final ArrayList<WeakReference<Screen> > com.jogamp.newt.Screen.screenList = new ArrayList<WeakReference<Screen>>()
staticprotected

Definition at line 336 of file Screen.java.

◆ screensActive

int com.jogamp.newt.Screen.screensActive = 0
staticprotected

Definition at line 337 of file Screen.java.


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