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

Visual output device, i.e. More...

Collaboration diagram for com.jogamp.newt.MonitorDevice:

Classes

enum  Orientation
 

Public Member Functions

final Orientation getOrientationTo (final MonitorDevice other, final int move_diff[])
 Returns the orientation of this monitor to the other. More...
 
final Screen getScreen ()
 Returns the Screen owning this monitor. More...
 
final boolean equals (final Object obj)
 Tests equality of two MonitorDevice objects by evaluating equality of it's components:
More...
 
final int hashCode ()
 Returns a combined hash code of it's elements:
More...
 
final long getHandle ()
 
final int getId ()
 
final String getName ()
 
final boolean isClone ()
 
final boolean isPrimary ()
 Returns true if this device represents the primary device, otherwise return false. More...
 
final DimensionImmutable getSizeMM ()
 
final float[] getPixelsPerMM (final float[] ppmmStore)
 Returns the pixels per millimeter value according to the current mode's surface resolution. More...
 
final float[] getPixelsPerMM (final MonitorMode mode, final float[] ppmmStore)
 Returns the pixels per millimeter value according to the given mode's surface resolution. More...
 
final MonitorMode getOriginalMode ()
 Returns the immutable original com.jogamp.newt.MonitorMode, as used at NEWT initialization. More...
 
final List< MonitorModegetSupportedModes ()
 Returns a list of immutable MonitorModes supported by this monitor. More...
 
final RectangleImmutable getViewport ()
 Returns the current rectangular portion of the rotated virtual Screen size in pixel units represented by this monitor, i.e. More...
 
final RectangleImmutable getViewportInWindowUnits ()
 Returns the current rectangular portion of the rotated virtual Screen size in window units represented by this monitor, i.e. More...
 
float[] getPixelScale (final float[] result)
 Returns the current rotated pixel-scale of this monitor, i.e. More...
 
final boolean contains (final int x, final int y)
 Returns true if given screen coordinates in pixel units are contained by this viewport, otherwise false. More...
 
final boolean isOriginalMode ()
 
final boolean isModeChangedByUs ()
 Returns true</true> if the MonitorMode has been changed programmatic via this API only, otherwise false. More...
 
final MonitorMode getCurrentMode ()
 Returns the cached current MonitorMode w/o native query. More...
 
abstract MonitorMode queryCurrentMode () throws IllegalStateException
 Returns the current MonitorMode resulting from a native query. More...
 
abstract boolean setCurrentMode (MonitorMode mode) throws IllegalStateException
 Set the current com.jogamp.newt.MonitorMode. More...
 
String toString ()
 

Static Public Member Functions

static float[] perMMToPerInch (final float[] ppmm)
 Converts [1/mm] to [1/inch] in place. More...
 
static void unionOfViewports (final Rectangle viewport, final Rectangle viewportInWindowUnits, final List< MonitorDevice > monitors)
 Calculates the union of the given monitor's viewport in pixel- and window units. More...
 

Protected Member Functions

 MonitorDevice (final Screen screen, final long nativeHandle, final int nativeId, final String name, final boolean isClone, final boolean isPrimary, final DimensionImmutable sizeMM, final MonitorMode currentMode, final float[] pixelScale, final Rectangle viewportPU, final Rectangle viewportWU, final ArrayHashSet< MonitorMode > supportedModes)
 

Protected Attributes

final Screen screen
 
final long nativeHandle
 
final int nativeId
 
final String name
 
final DimensionImmutable sizeMM
 
final MonitorMode originalMode
 
final ArrayHashSet< MonitorModesupportedModes
 
final float[] pixelScale
 
final Rectangle viewportPU
 
final Rectangle viewportWU
 
boolean isClone
 
boolean isPrimary
 
MonitorMode currentMode
 
boolean modeChanged
 

Detailed Description

Visual output device, i.e.

a CRT, LED ..consisting of it's components:
<ui> Immutable

Mutable

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

Definition at line 61 of file MonitorDevice.java.

Constructor & Destructor Documentation

◆ MonitorDevice()

com.jogamp.newt.MonitorDevice.MonitorDevice ( final Screen  screen,
final long  nativeHandle,
final int  nativeId,
final String  name,
final boolean  isClone,
final boolean  isPrimary,
final DimensionImmutable  sizeMM,
final MonitorMode  currentMode,
final float[]  pixelScale,
final Rectangle  viewportPU,
final Rectangle  viewportWU,
final ArrayHashSet< MonitorMode supportedModes 
)
protected
Parameters
screenassociated Screen
nativeHandleunique monitor device long handle, implementation specific
nativeIdunique monitor device integer Id, implementation specific
nameoptional monitor name, maybe null
isCloneflag
isPrimaryflag
sizeMMsize in millimeters
currentMode
pixelScalepre-fetched current pixel-scale, maybe null for ScalableSurface#IDENTITY_PIXELSCALE.
viewportPUviewport in pixel-units
viewportWUviewport in window-units
supportedModesall supported MonitorModes

Definition at line 145 of file MonitorDevice.java.

Here is the caller graph for this function:

Member Function Documentation

◆ contains()

final boolean com.jogamp.newt.MonitorDevice.contains ( final int  x,
final int  y 
)

Returns true if given screen coordinates in pixel units are contained by this viewport, otherwise false.

Parameters
xx-coord in pixel units
yy-coord in pixel units

Definition at line 337 of file MonitorDevice.java.

Here is the call graph for this function:

◆ equals()

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

Tests equality of two MonitorDevice objects by evaluating equality of it's components:

  • nativeID


Definition at line 184 of file MonitorDevice.java.

Here is the call graph for this function:

◆ getCurrentMode()

final MonitorMode com.jogamp.newt.MonitorDevice.getCurrentMode ( )

Returns the cached current MonitorMode w/o native query.

The returned MonitorMode is element of the lists getSupportedModes() and Screen#getMonitorModes().

See also
queryCurrentMode()

Definition at line 402 of file MonitorDevice.java.

Here is the caller graph for this function:

◆ getHandle()

final long com.jogamp.newt.MonitorDevice.getHandle ( )
Returns
the immutable unique native long handle of this monitor device, implementation specific.

Definition at line 205 of file MonitorDevice.java.

Here is the caller graph for this function:

◆ getId()

final int com.jogamp.newt.MonitorDevice.getId ( )
Returns
the immutable unique native integer Id of this monitor device, implementation specific.

Definition at line 208 of file MonitorDevice.java.

Here is the caller graph for this function:

◆ getName()

final String com.jogamp.newt.MonitorDevice.getName ( )
Returns
optional monitor name, maybe an empty string but never null.

Definition at line 211 of file MonitorDevice.java.

Here is the caller graph for this function:

◆ getOrientationTo()

final Orientation com.jogamp.newt.MonitorDevice.getOrientationTo ( final MonitorDevice  other,
final int  move_diff[] 
)

Returns the orientation of this monitor to the other.

Parameters
otherthe other monitor
move_diffint[2] to store the move delta for each axis from this-monitor to the other.
Returns
Orientation of this-monitor to the other

Definition at line 97 of file MonitorDevice.java.

Here is the call graph for this function:

◆ getOriginalMode()

final MonitorMode com.jogamp.newt.MonitorDevice.getOriginalMode ( )

Returns the immutable original com.jogamp.newt.MonitorMode, as used at NEWT initialization.

The returned MonitorMode is element of the lists getSupportedModes() and Screen#getMonitorModes().

Definition at line 279 of file MonitorDevice.java.

Here is the caller graph for this function:

◆ getPixelScale()

float[] com.jogamp.newt.MonitorDevice.getPixelScale ( final float[]  result)

Returns the current rotated pixel-scale of this monitor, i.e.

horizontal and vertical.

See also
getViewportInWindowUnits()
getViewport()
ScalableSurface::getMaximumSurfaceScale(float[])

Definition at line 326 of file MonitorDevice.java.

◆ getPixelsPerMM() [1/2]

final float[] com.jogamp.newt.MonitorDevice.getPixelsPerMM ( final float[]  ppmmStore)

Returns the pixels per millimeter value according to the current mode's surface resolution.

To convert the result to dpi, i.e. dots-per-inch, multiply both components with 25.4f, see perMMToPerInch(float[]).

Parameters
ppmmStorefloat[2] storage for the ppmm result
Returns
the passed storage containing the ppmm for chaining
See also
perMMToPerInch(float[])

Definition at line 240 of file MonitorDevice.java.

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

◆ getPixelsPerMM() [2/2]

final float[] com.jogamp.newt.MonitorDevice.getPixelsPerMM ( final MonitorMode  mode,
final float[]  ppmmStore 
)

Returns the pixels per millimeter value according to the given mode's surface resolution.

To convert the result to dpi, i.e. dots-per-inch, multiply both components with 25.4f.

Parameters
mode
ppmmStorefloat[2] storage for the ppmm result
Returns
the passed storage containing the ppmm for chaining

Definition at line 254 of file MonitorDevice.java.

Here is the call graph for this function:

◆ getScreen()

final Screen com.jogamp.newt.MonitorDevice.getScreen ( )

Returns the Screen owning this monitor.

Definition at line 171 of file MonitorDevice.java.

Here is the caller graph for this function:

◆ getSizeMM()

final DimensionImmutable com.jogamp.newt.MonitorDevice.getSizeMM ( )
Returns
the immutable monitor size in millimeters.

Definition at line 225 of file MonitorDevice.java.

Here is the caller graph for this function:

◆ getSupportedModes()

final List< MonitorMode > com.jogamp.newt.MonitorDevice.getSupportedModes ( )

Returns a list of immutable MonitorModes supported by this monitor.

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

Use w/ care, it's not a copy!

Definition at line 293 of file MonitorDevice.java.

Here is the caller graph for this function:

◆ getViewport()

final RectangleImmutable com.jogamp.newt.MonitorDevice.getViewport ( )

Returns the current rectangular portion of the rotated virtual Screen size in pixel units represented by this monitor, i.e.

top-left origin and size.

See also
getPixelScale()
Screen::getViewport()

Definition at line 304 of file MonitorDevice.java.

Here is the caller graph for this function:

◆ getViewportInWindowUnits()

final RectangleImmutable com.jogamp.newt.MonitorDevice.getViewportInWindowUnits ( )

Returns the current rectangular portion of the rotated virtual Screen size in window units represented by this monitor, i.e.

top-left origin and size.

See also
getPixelScale()
Screen::getViewportInWindowUnits()

Definition at line 315 of file MonitorDevice.java.

Here is the caller graph for this function:

◆ hashCode()

final int com.jogamp.newt.MonitorDevice.hashCode ( )

Returns a combined hash code of it's elements:

  • nativeID

Definition at line 200 of file MonitorDevice.java.

Here is the caller graph for this function:

◆ isClone()

final boolean com.jogamp.newt.MonitorDevice.isClone ( )
Returns
true if this device represents a clone, otherwise return false.

Definition at line 214 of file MonitorDevice.java.

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

◆ isModeChangedByUs()

final boolean com.jogamp.newt.MonitorDevice.isModeChangedByUs ( )

Returns true</true> if the MonitorMode has been changed programmatic via this API only, otherwise false.

Note: We cannot guarantee that we won't interfere w/ another running application's screen mode change or vice versa.

Definition at line 391 of file MonitorDevice.java.

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

◆ isOriginalMode()

final boolean com.jogamp.newt.MonitorDevice.isOriginalMode ( )

Definition at line 379 of file MonitorDevice.java.

Here is the caller graph for this function:

◆ isPrimary()

final boolean com.jogamp.newt.MonitorDevice.isPrimary ( )

Returns true if this device represents the primary device, otherwise return false.

See also
Screen::getPrimaryMonitor()

Definition at line 220 of file MonitorDevice.java.

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

◆ perMMToPerInch()

static float[] com.jogamp.newt.MonitorDevice.perMMToPerInch ( final float[]  ppmm)
static

Converts [1/mm] to [1/inch] in place.

Parameters
ppmmfloat[2] [1/mm] value
Returns
return [1/inch] value

Definition at line 267 of file MonitorDevice.java.

Here is the caller graph for this function:

◆ queryCurrentMode()

abstract MonitorMode com.jogamp.newt.MonitorDevice.queryCurrentMode ( ) throws IllegalStateException
abstract

Returns the current MonitorMode resulting from a native query.

The returned MonitorMode is element of the lists getSupportedModes() and Screen#getMonitorModes().

Exceptions
IllegalStateExceptionif the associated screen is not valid natively.
See also
getCurrentMode()
Here is the caller graph for this function:

◆ setCurrentMode()

abstract boolean com.jogamp.newt.MonitorDevice.setCurrentMode ( MonitorMode  mode) throws IllegalStateException
abstract

Set the current com.jogamp.newt.MonitorMode.

This method is lifecycle heavy.

Parameters
modeto be made current, must be element of the list getSupportedModes() and Screen#getMonitorModes().
Returns
true if successful, otherwise false
Exceptions
IllegalStateExceptionif the associated screen is not valid natively.
Here is the caller graph for this function:

◆ toString()

String com.jogamp.newt.MonitorDevice.toString ( )

Definition at line 426 of file MonitorDevice.java.

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

◆ unionOfViewports()

static void com.jogamp.newt.MonitorDevice.unionOfViewports ( final Rectangle  viewport,
final Rectangle  viewportInWindowUnits,
final List< MonitorDevice monitors 
)
static

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

Parameters
viewportstorage for result in pixel units, maybe null
viewportInWindowUnitsstorage for result in window units, maybe null
monitorsgiven list of monitors

Definition at line 350 of file MonitorDevice.java.

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

Member Data Documentation

◆ currentMode

MonitorMode com.jogamp.newt.MonitorDevice.currentMode
protected

Definition at line 74 of file MonitorDevice.java.

◆ isClone

boolean com.jogamp.newt.MonitorDevice.isClone
protected

Definition at line 72 of file MonitorDevice.java.

◆ isPrimary

boolean com.jogamp.newt.MonitorDevice.isPrimary
protected

Definition at line 73 of file MonitorDevice.java.

◆ modeChanged

boolean com.jogamp.newt.MonitorDevice.modeChanged
protected

Definition at line 75 of file MonitorDevice.java.

◆ name

final String com.jogamp.newt.MonitorDevice.name
protected

Definition at line 65 of file MonitorDevice.java.

◆ nativeHandle

final long com.jogamp.newt.MonitorDevice.nativeHandle
protected

Definition at line 63 of file MonitorDevice.java.

◆ nativeId

final int com.jogamp.newt.MonitorDevice.nativeId
protected

Definition at line 64 of file MonitorDevice.java.

◆ originalMode

final MonitorMode com.jogamp.newt.MonitorDevice.originalMode
protected

Definition at line 67 of file MonitorDevice.java.

◆ pixelScale

final float [] com.jogamp.newt.MonitorDevice.pixelScale
protected

Definition at line 69 of file MonitorDevice.java.

◆ screen

final Screen com.jogamp.newt.MonitorDevice.screen
protected

Definition at line 62 of file MonitorDevice.java.

◆ sizeMM

final DimensionImmutable com.jogamp.newt.MonitorDevice.sizeMM
protected

Definition at line 66 of file MonitorDevice.java.

◆ supportedModes

final ArrayHashSet<MonitorMode> com.jogamp.newt.MonitorDevice.supportedModes
protected

Definition at line 68 of file MonitorDevice.java.

◆ viewportPU

final Rectangle com.jogamp.newt.MonitorDevice.viewportPU
protected

Definition at line 70 of file MonitorDevice.java.

◆ viewportWU

final Rectangle com.jogamp.newt.MonitorDevice.viewportWU
protected

Definition at line 71 of file MonitorDevice.java.


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