Class Display
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract int
The 1st call will initiate native creation, since we follow the lazy creation pattern.abstract void
Manual trigger the native creation, if it is not done yet.
This is useful to be able to request theAbstractGraphicsDevice
, viagetGraphicsDevice()
.
Otherwise the abstract device won't be available before the dependent components (Screen and Window) are realized.abstract Display.PointerIcon
createPointerIcon
(com.jogamp.common.util.IOUtil.ClassResources pngResource, int hotX, int hotY) Returns the newly createdDisplay.PointerIcon
ornull
if not implemented on platform.abstract Display.PointerIcon
createPointerIcon
(PixelRectangle pixelrect, int hotX, int hotY) Returns the newly createdDisplay.PointerIcon
ornull
if not implemented on platform.abstract void
destroy()
Manually trigger the destruction, incl.abstract void
static void
dumpDisplayList
(String prefix) boolean
return true if obj is of type Display and both FQNgetFQName()
equalsstatic int
static Collection<Display>
Returns the global display collectionabstract EDTUtil
static Display
getFirstDisplayOf
(String type, String name, int fromIndex, boolean shared) abstract String
abstract AbstractGraphicsDevice
Return theAbstractGraphicsDevice
used for depending resources lifecycle, i.e.abstract long
Return the handle of theAbstractGraphicsDevice
as returned bygetGraphicsDevice()
.abstract int
getId()
static Display
getLastDisplayOf
(String type, String name, int fromIndex, boolean shared) abstract String
getName()
abstract boolean
Returns the native platform's direct NIO buffer requirement pointer-icon pixel data.abstract PixelFormat
Returns the native platform'sPixelFormat
for pointer-icon pixel data.abstract int
static String
abstract String
getType()
abstract int
hashCode()
return precomputed hashCode from FQNgetFQName()
static int
abstract boolean
abstract boolean
Return true if this instance is exclusive, i.e.abstract boolean
abstract int
The last call may destroy this instance, if#getDestroyWhenUnused()
returnstrue
.abstract EDTUtil
setEDTUtil
(EDTUtil usrEDTUtil) Sets a newEDTUtil
and returns the previous one.static String
toHexString
(int hex) static String
toHexString
(long hex) abstract boolean
Validate EDT running state.
Stop the running EDT in case this display is destroyed already.
-
Field Details
-
DEBUG
public static final boolean DEBUG
-
-
Constructor Details
-
Display
public Display()
-
-
Method Details
-
hashCode
public abstract int hashCode()return precomputed hashCode from FQNgetFQName()
-
equals
return true if obj is of type Display and both FQNgetFQName()
equals -
getNativePointerIconPixelFormat
Returns the native platform'sPixelFormat
for pointer-icon pixel data.Using this value will avoid conversion within
createPointerIcon(PixelRectangle, int, int)
.Known native pixel formats are:
- X11:
PixelFormat.BGRA8888
- Windows:
PixelFormat.BGRA8888
- OSX:
PixelFormat.RGBA8888
- X11:
-
getNativePointerIconForceDirectNIO
public abstract boolean getNativePointerIconForceDirectNIO()Returns the native platform's direct NIO buffer requirement pointer-icon pixel data.Using this value will avoid conversion within
createPointerIcon(PixelRectangle, int, int)
. -
createPointerIcon
public abstract Display.PointerIcon createPointerIcon(com.jogamp.common.util.IOUtil.ClassResources pngResource, int hotX, int hotY) throws IllegalArgumentException, IllegalStateException, IOException Returns the newly createdDisplay.PointerIcon
ornull
if not implemented on platform.See
Display.PointerIcon
for lifecycle semantics.- Parameters:
pngResource
- single PNG resource for theDisplay.PointerIcon
. Only the first entry ofIOUtil.ClassResources.resourcePaths
is used.hotX
- pointer hotspot x-coord, origin is upper-left cornerhotY
- pointer hotspot y-coord, origin is upper-left corner- Throws:
IllegalArgumentException
- if pngResource is null or invalidIllegalStateException
- if this Display instance is notvalid yet
.IOException
- if thepngResource
could not beresolved
or via the PNG parser processing the input stream.- See Also:
-
createPointerIcon
public abstract Display.PointerIcon createPointerIcon(PixelRectangle pixelrect, int hotX, int hotY) throws IllegalArgumentException, IllegalStateException Returns the newly createdDisplay.PointerIcon
ornull
if not implemented on platform.See
Display.PointerIcon
for lifecycle semantics.In case
getNativePointerIconPixelFormat()
orgetNativePointerIconForceDirectNIO()
is not matched by the givenpixelrect
, thepixelrect
is converted into the requiredPixelFormat
and NIO type.- Parameters:
pixelrect
-PixelRectangle
source for theDisplay.PointerIcon
hotX
- pointer hotspot x-coord, origin is upper-left cornerhotY
- pointer hotspot y-coord, origin is upper-left corner- Throws:
IllegalArgumentException
- if pixelrect is null.IllegalStateException
- if this Display instance is notvalid yet
.- See Also:
-
createNative
Manual trigger the native creation, if it is not done yet.
This is useful to be able to request theAbstractGraphicsDevice
, viagetGraphicsDevice()
.
Otherwise the abstract device won't be available before the dependent components (Screen and Window) are realized.This method is usually invoke by
addReference()
- Throws:
NativeWindowException
- if the native creation failed.
-
destroy
public abstract void destroy()Manually trigger the destruction, incl. native destruction.
This method is usually invoke by
removeReference()
-
validateEDTStopped
public abstract boolean validateEDTStopped()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.
-
isNativeValid
public abstract boolean isNativeValid()- Returns:
- true if the native display handle is valid and ready to operate, otherwise false.
- See Also:
-
getReferenceCount
public abstract int getReferenceCount()- Returns:
- number of references
-
addReference
The 1st call will initiate native creation, since we follow the lazy creation pattern.- Returns:
- number of references post operation
- Throws:
NativeWindowException
- if the native creation failed.- See Also:
-
removeReference
public abstract int removeReference()The last call may destroy this instance, if#getDestroyWhenUnused()
returnstrue
.- Returns:
- number of references post operation
- See Also:
-
addReference()
#getDestroyWhenUnused()
#setDestroyWhenUnused(boolean)
-
getGraphicsDevice
Return theAbstractGraphicsDevice
used for depending resources lifecycle, i.e.Screen
andWindow
, as well as the event dispatching (EDT). -
getHandle
public abstract long getHandle()Return the handle of theAbstractGraphicsDevice
as returned bygetGraphicsDevice()
. -
getFQName
-
getId
public abstract int getId()- Returns:
- this display internal serial id
-
getName
- 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:
-
getType
- Returns:
- the native display type, ie
NativeWindowFactory.getNativeWindowType(boolean)
-
isExclusive
public abstract boolean isExclusive()Return true if this instance is exclusive, i.e. will not be shared. -
setEDTUtil
Sets a newEDTUtil
and returns the previous one.If
usrEDTUtil
isnull
, 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. -
getEDTUtil
-
isEDTRunning
public abstract boolean isEDTRunning()- Returns:
- true if EDT is running and not subject to be stopped, otherwise false.
-
dispatchMessages
public abstract void dispatchMessages() -
dumpDisplayList
-
getFirstDisplayOf
- Parameters:
type
-name
-fromIndex
- start index, then increasing until found or end of list- Returns:
-
getLastDisplayOf
- Parameters:
type
-name
-fromIndex
- start index, then decreasing until found or end of list. -1 is interpreted as size - 1.shared
- if true, only shared instances are found, otherwise also exclusive- Returns:
-
getAllDisplays
Returns the global display collection -
getActiveDisplayNumber
public static int getActiveDisplayNumber() -
getThreadName
-
toHexString
-
toHexString
-
hashCodeNullSafe
-