Package com.sun.glass.ui.monocle
Class NativePlatformFactory
java.lang.Object
com.sun.glass.ui.monocle.NativePlatformFactory
- Direct Known Subclasses:
EGLPlatformFactory
Abstract factory class to instantiate a NativePlatform
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract NativePlatformCreates a NativePlatform.protected abstract intQueries the major version number supported by this NativePlatformFactory.protected abstract intQueries the minor version number supported by this NativePlatformFactory.static NativePlatformObtains a NativePlatform that matches the platform on which we are running.protected abstract booleanmatches()Checks whether this NativePlatformFactory can work with the platform on which we are running
-
Constructor Details
-
NativePlatformFactory
public NativePlatformFactory()
-
-
Method Details
-
matches
protected abstract boolean matches()Checks whether this NativePlatformFactory can work with the platform on which we are running- Returns:
- true if we can run on this platform.
-
createNativePlatform
Creates a NativePlatform. This is only called if matches() was previously called and returned true.- Returns:
- a new NativePlatform.
-
getMajorVersion
protected abstract int getMajorVersion()Queries the major version number supported by this NativePlatformFactory.- Returns:
- the major version supported
-
getMinorVersion
protected abstract int getMinorVersion()Queries the minor version number supported by this NativePlatformFactory.- Returns:
- the minor version supported
-
getNativePlatform
Obtains a NativePlatform that matches the platform on which we are running. The system property monocle.platform defines a series of cascading fallbacks for what NativePlatform types to attempt to create. monocle .platform can be overridden to select a specific platform. For example, running with -Dmonocle.platform=Dispman, Linux selects the NativePlatform that works with the dispmanx libraries on the Raspberry Pi, but falls back to a generic software-rendered Linux framebuffer implementation if we are not running on a device with dispmanx libraries.- Returns:
- a new NativePlatform
-