Package com.jgoodies.common.base
Class SystemUtils
java.lang.Object
com.jgoodies.common.base.SystemUtils
Provides convenience behavior to determine the operating system
and Java version.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
static final boolean
True since Java 6 update 10.static final boolean
True if this is Java 6.static final boolean
True if this is Java 7.static final boolean
True if this is Java 7.x or later.static final boolean
True if this is Java 7.static final boolean
True if this is Java 8.x or later.static final boolean
True if the Windows XP Look&Feel is enabled.static final boolean
Is true if this environment's default toolkit reports a screen resolution below 120 dpi.static final boolean
Is true if this is Linux.static final boolean
True if this is the Mac OS.static final boolean
True if this is Solaris.static final boolean
True if this is Windows.static final boolean
True if this is Windows 2000.static final boolean
True if this is one of: Windows Vista, Windows Server 2008, Windows Server 2008 R2, Windows 7, Windows Server 2012, Windows 8, Windows Server 2012 R2, Windows 8.1static final boolean
True if this is Windows 7.static final boolean
True if this is Windows 8 or Windows Server 2012.static final boolean
True if this is Windows 98.static final boolean
True if this is Windows ME.static final boolean
True if this is Windows Vista or Server 2008.static final boolean
True if this is Windows XP.static final boolean
True if this is Windows XP 64-Bit edition or Windows Server 2003 or Windows Server 2003 R2.protected static final String
Theos.name
System Property.protected static final String
Theos.name
System Property.protected static final String
Theos.version
System Property. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static String
getSystemProperty
(String key) Tries to look up the System property for the given key.private static boolean
Checks and answers whether this Java runtime has a modern rasterizer or not.static boolean
Checks and answers whether an Aqua look&feel is active.private static boolean
private static boolean
Checks and answers whether the Windows XP style is enabled.protected static boolean
startsWith
(String str, String prefix)
-
Field Details
-
OS_NAME
Theos.name
System Property. Operating system name.Defaults to
null
, if the runtime does not have security access to read this property or the property does not exist. -
OS_VERSION
Theos.version
System Property. Operating system version.Defaults to
null
, if the runtime does not have security access to read this property or the property does not exist. -
JAVA_VERSION
Theos.name
System Property. Operating system name.Defaults to
null
, if the runtime does not have security access to read this property or the property does not exist. -
IS_OS_LINUX
public static final boolean IS_OS_LINUXIs true if this is Linux. -
IS_OS_MAC
public static final boolean IS_OS_MACTrue if this is the Mac OS. -
IS_OS_SOLARIS
public static final boolean IS_OS_SOLARISTrue if this is Solaris. -
IS_OS_WINDOWS
public static final boolean IS_OS_WINDOWSTrue if this is Windows. -
IS_OS_WINDOWS_98
public static final boolean IS_OS_WINDOWS_98True if this is Windows 98. -
IS_OS_WINDOWS_ME
public static final boolean IS_OS_WINDOWS_METrue if this is Windows ME. -
IS_OS_WINDOWS_2000
public static final boolean IS_OS_WINDOWS_2000True if this is Windows 2000. -
IS_OS_WINDOWS_XP
public static final boolean IS_OS_WINDOWS_XPTrue if this is Windows XP. -
IS_OS_WINDOWS_XP_64_BIT_OR_SERVER_2003
public static final boolean IS_OS_WINDOWS_XP_64_BIT_OR_SERVER_2003True if this is Windows XP 64-Bit edition or Windows Server 2003 or Windows Server 2003 R2.- Since:
- 1.8
-
IS_OS_WINDOWS_VISTA
public static final boolean IS_OS_WINDOWS_VISTATrue if this is Windows Vista or Server 2008. -
IS_OS_WINDOWS_7
public static final boolean IS_OS_WINDOWS_7True if this is Windows 7. -
IS_OS_WINDOWS_8
public static final boolean IS_OS_WINDOWS_8True if this is Windows 8 or Windows Server 2012. -
IS_OS_WINDOWS_6_OR_LATER
public static final boolean IS_OS_WINDOWS_6_OR_LATERTrue if this is one of: Windows Vista, Windows Server 2008, Windows Server 2008 R2, Windows 7, Windows Server 2012, Windows 8, Windows Server 2012 R2, Windows 8.1 -
IS_JAVA_6
public static final boolean IS_JAVA_6True if this is Java 6. We check for a prefix of 1.6. -
IS_JAVA_7
public static final boolean IS_JAVA_7True if this is Java 7. We check for a prefix of 1.7. -
IS_JAVA_7_OR_LATER
public static final boolean IS_JAVA_7_OR_LATERTrue if this is Java 7.x or later. We check that it's not 1.6. -
IS_JAVA_8
public static final boolean IS_JAVA_8True if this is Java 7. We check for a prefix of 1.7.- Since:
- 1.6
-
IS_JAVA_8_OR_LATER
public static final boolean IS_JAVA_8_OR_LATERTrue if this is Java 8.x or later. We check that it's neither 1.6 nor 1.7.- Since:
- 1.6
-
HAS_MODERN_RASTERIZER
public static final boolean HAS_MODERN_RASTERIZERTrue since Java 6 update 10.- Since:
- 1.2
-
IS_LAF_WINDOWS_XP_ENABLED
public static final boolean IS_LAF_WINDOWS_XP_ENABLEDTrue if the Windows XP Look&Feel is enabled.- Since:
- 1.2
-
IS_LOW_RESOLUTION
public static final boolean IS_LOW_RESOLUTIONIs true if this environment's default toolkit reports a screen resolution below 120 dpi.- Since:
- 1.2
-
AWT_UTILITIES_CLASS_NAME
- See Also:
-
-
Constructor Details
-
SystemUtils
protected SystemUtils()
-
-
Method Details
-
isLafAqua
public static boolean isLafAqua()Checks and answers whether an Aqua look&feel is active. This may be Apple's Aqua L&f, or a sub-L&f that uses the same ID, because it doesn't substantially change the look.- Returns:
true
if the current look&feel is Aqua-like- Since:
- 1.8
-
getSystemProperty
Tries to look up the System property for the given key. In untrusted environments this may throw a SecurityException. In this case we catch the exception and answer an empty string.- Parameters:
key
- the name of the system property- Returns:
- the system property's String value, or
null
if there's no such value, or an empty String when a SecurityException has been caught
-
startsWith
-
hasModernRasterizer
private static boolean hasModernRasterizer()Checks and answers whether this Java runtime has a modern rasterizer or not. More precisely this method aims to understand whether a good or poor rasterizer is used. Sun's Java runtime has improved its rasterizer in the 1.6 N series after build 12.- Returns:
true
if the AWTUtilities class is available,false
if this class is not in the class path.
-
isWindowsXPLafEnabled
private static boolean isWindowsXPLafEnabled()Checks and answers whether the Windows XP style is enabled. This method is intended to be called only if a Windows lookinvalid input: '&feel' is about to be installed or already active in the UIManager. The XP style of the Windows look&feel is enabled by default on Windows XP platforms since the J2SE 1.4.2; it can be disabled either in the Windows desktop as well as in the Java runtime by setting a System property.First checks the platform, platform version and Java version. Then checks whether the desktop property win.xpstyle.themeActive is set or not.
- Returns:
- true if the Windows XP style is enabled
-
isLowResolution
private static boolean isLowResolution()
-