properties for Prism and Glass
johan.vos at gluonhq.com
Fri Feb 22 12:31:49 UTC 2019
Both Prism and Glass provide a top-level API and rely on specific
implementations. On desktop, the specific implementations do not require
properties to be set, as the defaults are obtained from properties like "
os.name" etc. However, they can be overruled.
On embedded, it is more likely that users have to specify the properties.
For example, on the Raspberry Pi one would typically use
(note the lowercase monocle versus Monocle)
Currently, there are inconsistencies in how the properties for Glass and
Prism are obtained.
Prism: the base class for determining properties is
com.sun.javafx.PlatformUtil, in the javafx.base module. A property named
"embeddedType" is used to determine which native library to load (e.g.
prism_es2_monocle) and to determine which GLFactory has to be used (e.g.
Glass: the base class for determining properties is
com.sun.glass.ui.Platform, in the javafx.graphics module. The return value
of determinePlatform() (which can be macosx, windows, linux, gtk, ios or
anything user-specified defined via a property named "glass.platform" e.g.
Monocle) is used to determine which class implements the PlatformFactory
While Glass and Prism are clearly 2 different things, I think the
properties that ultimately decides which factories and native libs to be
loaded could belong in the same module (instead of javafx.base AND
Further, I think it would be good to be more consistent in the naming and
use for example "prism.platform" .
More information about the openjfx-dev