Top Fields Constructors Methods
jogamp.newt

public abstract Class ScreenImpl

extends Screen
implements MonitorModeListener
Class Inheritance
All Implemented Interfaces
com.jogamp.newt.event.MonitorModeListener
Known Direct Subclasses
jogamp.newt.driver.awt.ScreenDriver, jogamp.newt.driver.bcm.egl.ScreenDriver, jogamp.newt.driver.bcm.vc.iv.ScreenDriver, jogamp.newt.driver.intel.gdl.ScreenDriver, jogamp.newt.driver.kd.ScreenDriver, jogamp.newt.driver.macosx.ScreenDriver, jogamp.newt.driver.windows.ScreenDriver, jogamp.newt.driver.x11.ScreenDriver
Imports
java.util.ArrayList, .Iterator, .List, com.jogamp.nativewindow.AbstractGraphicsScreen, .NativeWindowException, com.jogamp.nativewindow.util.Dimension, .Rectangle, .RectangleImmutable, com.jogamp.common.util.ArrayHashSet, .PropertyAccess, com.jogamp.newt.Display, .MonitorDevice, .MonitorMode, .NewtFactory, .Screen, com.jogamp.newt.event.MonitorEvent, .MonitorModeListener, com.jogamp.newt.util.MonitorModeUtil

Field Summary

Modifier and TypeField and Description
protected AbstractGraphicsScreen
protected static final boolean
public static final int
public static final int
public static final int
public static final int
public static final int
protected DisplayImpl
protected String
protected int
protected int
private final ArrayList<MonitorModeListener>
protected int
private long
protected static Dimension
protected static volatile boolean
protected Rectangle
protected Rectangle
Inherited from com.jogamp.newt.Screen:
DEBUGSCREEN_MODE_CHANGE_TIMEOUTscreenListscreensActive

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final synchronized void
public final synchronized int
protected void
calcVirtualScreenOriginAndSize(final Rectangle
storage for result in pixel units
viewport
,
final Rectangle
storage for result in window units
viewportInWindowUnits
)

Calculates the virtual rotated viewport in pixel- and window units.

protected abstract void
private final int
collectNativeMonitorModes(final MonitorModeProps.Cache cache)

Returns the number of successful collected MonitorDevices.

protected abstract void
collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache
memory pool caching the result
cache
)

To be implemented by the native specification.

public static Screen
create(final Display display, int idx)

public final synchronized void
createNative()

Implements abstract com.jogamp.newt.Screen.createNative.

Manual trigger the native creation, if not done yet..
protected abstract void
public final synchronized void
destroy()

Implements abstract com.jogamp.newt.Screen.destroy.

Manually trigger the destruction, incl.
public boolean
equals(final Object
the reference object with which to compare.
obj
)

Overrides com.jogamp.newt.Screen.equals.

return true if obj is of type Display and both FQN getFQName() equals
public final Display
public final String
public final AbstractGraphicsScreen
public final int
public final int
public final List<MonitorDevice>
getMonitorDevices()

Implements abstract com.jogamp.newt.Screen.getMonitorDevices.

Return a list of available MonitorDevices.
public final List<MonitorMode>
getMonitorModes()

Implements abstract com.jogamp.newt.Screen.getMonitorModes.

Return a list of all MonitorModes for all MonitorDevices.
public MonitorDevice
getPrimaryMonitor()

Implements abstract com.jogamp.newt.Screen.getPrimaryMonitor.

Returns the windowing manager's primary MonitorDevice, which holds the system menu bar, etc.
public final synchronized int
private static Class<?>
getScreenClass(final String type)

pack-priv final ScreenMonitorState
getScreenMonitorStatus(final boolean throwException)

public final RectangleImmutable
public final RectangleImmutable
private final MonitorDevice
getVirtualMonitorDevice(final MonitorModeProps.Cache
mandatory !
cache
,
final int monitorId, final MonitorMode currentMode)

private final MonitorMode
getVirtualMonitorMode(final MonitorModeProps.Cache
optional ..
cache
,
final int modeId)

public final int
public final int
public final int
public int
hashCode()

Implements abstract com.jogamp.newt.Screen.hashCode.

return precomputed hashCode from FQN getFQName()
private final ScreenMonitorState
pack-priv static void
initSingleton()

Ensure static init has been run.

protected void
instantiationFinished()

Notifies the driver impl.

public final synchronized boolean
public void
monitorModeChanged(final MonitorEvent me, final boolean success)

Implements com.jogamp.newt.event.MonitorModeListener.monitorModeChanged.

called after the monitor mode has been changed
public void
monitorModeChangeNotify(final MonitorEvent me)

Implements com.jogamp.newt.event.MonitorModeListener.monitorModeChangeNotify.

called before the monitor mode will be changed
protected abstract MonitorMode
queryCurrentMonitorModeImpl(MonitorDevice monitor)

To be implemented by the native specification.

protected final MonitorMode
queryCurrentMonitorModeIntern(final MonitorDevice monitor)

Utilizes getCurrentMonitorModeImpl(), if the latter returns null it uses the current screen size and dummy values.

private final void
public final synchronized void
public final synchronized int
protected abstract boolean
setCurrentMonitorModeImpl(MonitorDevice monitor, MonitorMode mode)

To be implemented by the native specification.

private final void
pack-priv static final void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
private void
protected boolean
updateNativeMonitorDeviceViewportImpl(final MonitorDevice monitor, final float[] pixelScale, final Rectangle viewportPU, final Rectangle viewportWU)

protected void
updateVirtualScreenOriginAndSize()

Updates the rotated virtual viewport, may use native impl.

protected abstract int
validateScreenIndex(int idx)

Returns the validated screen index, which is either the passed idx value or 0.

Inherited from com.jogamp.newt.Screen:
addScreen2ListgetActiveScreenNumbergetAllScreensgetFirstScreenOfgetLastScreenOfgetMainMonitorgetMonitorunionOfMonitorViewports

Field Detail

aScreenback to summary
protected AbstractGraphicsScreen aScreen
DEBUG_TEST_SCREENMODE_DISABLEDback to summary
protected static final boolean DEBUG_TEST_SCREENMODE_DISABLED
default_sm_bppback to summary
public static final int default_sm_bpp
default_sm_heightmmback to summary
public static final int default_sm_heightmm
default_sm_rateback to summary
public static final int default_sm_rate
default_sm_rotationback to summary
public static final int default_sm_rotation
default_sm_widthmmback to summary
public static final int default_sm_widthmm
displayback to summary
protected DisplayImpl display
fqnameback to summary
protected String fqname
hashCodeback to summary
protected int hashCode
refCountback to summary
protected int refCount
refMonitorModeListenerback to summary
private final ArrayList<MonitorModeListener> refMonitorModeListener
screen_idxback to summary
protected int screen_idx
tCreatedback to summary
private long tCreated
usrSizeback to summary
protected static Dimension usrSize
usrSizeQueriedback to summary
protected static volatile boolean usrSizeQueried
virtViewportPUback to summary
protected Rectangle virtViewportPU
virtViewportWUback to summary
protected Rectangle virtViewportWU

Constructor Detail

ScreenImplback to summary
public ScreenImpl()

Method Detail

addMonitorModeListenerback to summary
public final synchronized void addMonitorModeListener(final MonitorModeListener sml)

Implements abstract com.jogamp.newt.Screen.addMonitorModeListener.

Parameters
sml:MonitorModeListener

Doc from com.jogamp.newt.Screen.addMonitorModeListener.

MonitorModeListener to be added for MonitorEvent

Annotations
@Override
addReferenceback to summary
public final synchronized int addReference() throws NativeWindowException

Implements abstract com.jogamp.newt.Screen.addReference.

Doc from com.jogamp.newt.Screen.addReference.

See Display#addReference()

Returns:int

number of references post operation

Annotations
@Override
Exceptions
NativeWindowException:
if the native creation failed.
calcVirtualScreenOriginAndSizeback to summary
protected void calcVirtualScreenOriginAndSize(final Rectangle viewport, final Rectangle viewportInWindowUnits)

Calculates the virtual rotated viewport in pixel- and window units.

This method is called after the MonitorMode has been set or changed, hence you may utilize it.

Default implementation uses the union of all monitor's viewport, calculated via unionOfMonitorViewportSize(), however driver impl. may chose a different methodology.

Parameters
viewport:Rectangle

storage for result in pixel units

viewportInWindowUnits:Rectangle

storage for result in window units

closeNativeImplback to summary
protected abstract void closeNativeImpl()
collectNativeMonitorModesback to summary
private final int collectNativeMonitorModes(final MonitorModeProps.Cache cache)

Returns the number of successful collected MonitorDevices.

Collects MonitorDevices and MonitorModes within the given cache.

collectNativeMonitorModesAndDevicesImplback to summary
protected abstract void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache)

To be implemented by the native specification.
Is called within a thread safe environment.
Is called only to collect the MonitorModes and MonitorDevices, usually at startup setting up modes.

WARNING: must be synchronized with

, i.e.
Parameters
cache:MonitorModeProps.Cache

memory pool caching the result

createback to summary
public static Screen create(final Display display, int idx)
createNativeback to summary
public final synchronized void createNative() throws NativeWindowException

Implements abstract com.jogamp.newt.Screen.createNative.

Doc from com.jogamp.newt.Screen.createNative.

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.

Annotations
@Override
Exceptions
NativeWindowException:
if the native creation failed.
createNativeImplback to summary
protected abstract void createNativeImpl()
destroyback to summary
public final synchronized void destroy()

Implements abstract com.jogamp.newt.Screen.destroy.

Doc from com.jogamp.newt.Screen.destroy.

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.

Annotations
@Override
equalsback to summary
public boolean equals(final Object obj)

Overrides com.jogamp.newt.Screen.equals.

Doc from com.jogamp.newt.Screen.equals.

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

Parameters
obj:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getDisplayback to summary
public final Display getDisplay()

Implements abstract com.jogamp.newt.Screen.getDisplay.

Returns:Display

Doc from com.jogamp.newt.Screen.getDisplay.

the associated Display

Annotations
@Override
getFQNameback to summary
public final String getFQName()

Implements abstract com.jogamp.newt.Screen.getFQName.

Returns:String

Doc from com.jogamp.newt.Screen.getFQName.

The screen fully qualified Screen name, which is a key of com.jogamp.newt.Display#getFQName() + getIndex().

Annotations
@Override
getGraphicsScreenback to summary
public final AbstractGraphicsScreen getGraphicsScreen()

Implements abstract com.jogamp.newt.Screen.getGraphicsScreen.

Annotations
@Override
getHeightback to summary
public final int getHeight()

Implements abstract com.jogamp.newt.Screen.getHeight.

Returns:int

Doc from com.jogamp.newt.Screen.getHeight.

the rotated virtual viewport's height in pixel units.

Annotations
@Override
getIndexback to summary
public final int getIndex()

Implements abstract com.jogamp.newt.Screen.getIndex.

Returns:int

Doc from com.jogamp.newt.Screen.getIndex.

this Screen index of all Screens of getDisplay().

Annotations
@Override
getMonitorDevicesback to summary
public final List<MonitorDevice> getMonitorDevices()

Implements abstract com.jogamp.newt.Screen.getMonitorDevices.

Doc from com.jogamp.newt.Screen.getMonitorDevices.

Return a list of available MonitorDevices.

Annotations
@Override
getMonitorModesback to summary
public final List<MonitorMode> getMonitorModes()

Implements abstract com.jogamp.newt.Screen.getMonitorModes.

Doc from com.jogamp.newt.Screen.getMonitorModes.

Return a list of all MonitorModes for all MonitorDevices.

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

Annotations
@Override
getPrimaryMonitorback to summary
public MonitorDevice getPrimaryMonitor()

Implements abstract com.jogamp.newt.Screen.getPrimaryMonitor.

Doc from com.jogamp.newt.Screen.getPrimaryMonitor.

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

Annotations
@Override
getReferenceCountback to summary
public final synchronized int getReferenceCount()

Implements abstract com.jogamp.newt.Screen.getReferenceCount.

Returns:int

Doc from com.jogamp.newt.Screen.getReferenceCount.

number of references

Annotations
@Override
getScreenClassback to summary
private static Class<?> getScreenClass(final String type) throws ClassNotFoundException
getScreenMonitorStatusback to summary
pack-priv final ScreenMonitorState getScreenMonitorStatus(final boolean throwException)
getViewportback to summary
public final RectangleImmutable getViewport()

Implements abstract com.jogamp.newt.Screen.getViewport.

Doc from com.jogamp.newt.Screen.getViewport.

See Coordinate System.

Returns:RectangleImmutable

the rotated virtual viewport, i.e. top-left origin and size, in pixel units.

Annotations
@Override
getViewportInWindowUnitsback to summary
public final RectangleImmutable getViewportInWindowUnits()

Implements abstract com.jogamp.newt.Screen.getViewportInWindowUnits.

Doc from com.jogamp.newt.Screen.getViewportInWindowUnits.

See Coordinate System.

Returns:RectangleImmutable

the rotated virtual viewport, i.e. top-left origin and size, in window units.

Annotations
@Override
getVirtualMonitorDeviceback to summary
private final MonitorDevice getVirtualMonitorDevice(final MonitorModeProps.Cache cache, final int monitorId, final MonitorMode currentMode)
Parameters
cache:MonitorModeProps.Cache

mandatory !

getVirtualMonitorModeback to summary
private final MonitorMode getVirtualMonitorMode(final MonitorModeProps.Cache cache, final int modeId)
Parameters
cache:MonitorModeProps.Cache

optional ..

getWidthback to summary
public final int getWidth()

Implements abstract com.jogamp.newt.Screen.getWidth.

Returns:int

Doc from com.jogamp.newt.Screen.getWidth.

the rotated virtual viewport's width in pixel units.

Annotations
@Override
getXback to summary
public final int getX()

Implements abstract com.jogamp.newt.Screen.getX.

Doc from com.jogamp.newt.Screen.getX.

See Coordinate System.

Returns:int

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

Annotations
@Override
getYback to summary
public final int getY()

Implements abstract com.jogamp.newt.Screen.getY.

Doc from com.jogamp.newt.Screen.getY.

See Coordinate System.

Returns:int

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

Annotations
@Override
hashCodeback to summary
public int hashCode()

Implements abstract com.jogamp.newt.Screen.hashCode.

Doc from com.jogamp.newt.Screen.hashCode.

return precomputed hashCode from FQN getFQName()

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object

Annotations
@Override
initMonitorStateback to summary
private final ScreenMonitorState initMonitorState()
initSingletonback to summary
pack-priv static void initSingleton()

Ensure static init has been run.

instantiationFinishedback to summary
protected void instantiationFinished()

Notifies the driver impl. that the instantiation is finished, ie. instance created and all fields set.

isNativeValidback to summary
public final synchronized boolean isNativeValid()

Implements abstract com.jogamp.newt.Screen.isNativeValid.

Annotations
@Override
monitorModeChangedback to summary
public void monitorModeChanged(final MonitorEvent me, final boolean success)

Implements com.jogamp.newt.event.MonitorModeListener.monitorModeChanged.

Doc from com.jogamp.newt.event.MonitorModeListener.monitorModeChanged.

called after the monitor mode has been changed

Annotations
@Override
monitorModeChangeNotifyback to summary
public void monitorModeChangeNotify(final MonitorEvent me)

Implements com.jogamp.newt.event.MonitorModeListener.monitorModeChangeNotify.

Doc from com.jogamp.newt.event.MonitorModeListener.monitorModeChangeNotify.

called before the monitor mode will be changed

Annotations
@Override
queryCurrentMonitorModeImplback to summary
protected abstract MonitorMode queryCurrentMonitorModeImpl(MonitorDevice monitor)

To be implemented by the native specification.
Is called within a thread safe environment.

Implementation shall not unify the result w/ monitor's supported modes or a locally saved MonitorModeProps.Cache, since caller will perform such tasks.

queryCurrentMonitorModeInternback to summary
protected final MonitorMode queryCurrentMonitorModeIntern(final MonitorDevice monitor)

Utilizes getCurrentMonitorModeImpl(), if the latter returns null it uses the current screen size and dummy values.

releaseMonitorStateback to summary
private final void releaseMonitorState()
removeMonitorModeListenerback to summary
public final synchronized void removeMonitorModeListener(final MonitorModeListener sml)

Implements abstract com.jogamp.newt.Screen.removeMonitorModeListener.

Parameters
sml:MonitorModeListener

Doc from com.jogamp.newt.Screen.removeMonitorModeListener.

MonitorModeListener to be removed from MonitorEvent

Annotations
@Override
removeReferenceback to summary
public final synchronized int removeReference()

Implements abstract com.jogamp.newt.Screen.removeReference.

Doc from com.jogamp.newt.Screen.removeReference.

See Display#removeReference()

Returns:int

number of references post operation

Annotations
@Override
setCurrentMonitorModeImplback to summary
protected abstract boolean setCurrentMonitorModeImpl(MonitorDevice monitor, MonitorMode mode)

To be implemented by the native specification.
Is called within a thread safe environment.

shutdownback to summary
private final void shutdown()
shutdownAllback to summary
pack-priv static final void shutdownAll()

pp

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
updateNativeMonitorDevicesViewportback to summary
private void updateNativeMonitorDevicesViewport()
updateNativeMonitorDeviceViewportImplback to summary
protected boolean updateNativeMonitorDeviceViewportImpl(final MonitorDevice monitor, final float[] pixelScale, final Rectangle viewportPU, final Rectangle viewportWU)
updateVirtualScreenOriginAndSizeback to summary
protected void updateVirtualScreenOriginAndSize()

Updates the rotated virtual viewport, may use native impl.

validateScreenIndexback to summary
protected abstract int validateScreenIndex(int idx)

Returns the validated screen index, which is either the passed idx value or 0.

On big-desktops this shall return always 0.