Package com.sun.glass.ui.monocle
Class NativePlatformFactory
- java.lang.Object
-
- com.sun.glass.ui.monocle.NativePlatformFactory
-
public abstract class NativePlatformFactory extends java.lang.ObjectAbstract factory class to instantiate a NativePlatform
-
-
Constructor Summary
Constructors Constructor Description NativePlatformFactory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract NativePlatformcreateNativePlatform()Creates a NativePlatform.protected abstract intgetMajorVersion()Queries the major version number supported by this NativePlatformFactory.protected abstract intgetMinorVersion()Queries the minor version number supported by this NativePlatformFactory.static NativePlatformgetNativePlatform()Obtains 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
-
-
-
Method Detail
-
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
protected abstract NativePlatform 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
public static NativePlatform 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
-
-