Package org.fest.swing.util
Class Platform
java.lang.Object
org.fest.swing.util.Platform
Understands platform-specific functionality.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic booleanstatic intReturn the modifier key for the appropriate accelerator key for menu shortcuts:(default) orKeyEvent.VK_CONTROL(MacOS.)KeyEvent.VK_METAstatic intReturn the modifier mask for the appropriate accelerator key for menu shortcuts:(default) orEvent.CTRL_MASK(MacOS.)Event.META_MASK(package private) static voidinitialize(OSIdentifier newOSIdentifier, ToolkitProvider newToolkitProvider) static booleanisHPUX()Indicates whether the operating system is HP-UX.static booleanisLinux()Indicates whether the operating system is Linux.static booleanIndicates whether the operating system is a Macintosh OS.static booleanisOSX()Indicates whether the operating system is Mac OS X.static booleanIndicates whether the operating system is Solaris.static booleanIndicates whether the operating system is Windows.static booleanIndicates whether the operating system is Windows 9x (95, 98 or ME.)static booleanIndicates whether the operating system is Windows XP.static booleanisX11()Indicates whether the operating system is using the X11 Windowing system.static OSFamilyosFamily()Returns the current operating system family.(package private) static voidreload()
-
Field Details
-
osIdentifier
-
toolkitProvider
-
-
Constructor Details
-
Platform
private Platform()
-
-
Method Details
-
reload
static void reload() -
initialize
-
controlOrCommandKey
public static int controlOrCommandKey()Return the modifier key for the appropriate accelerator key for menu shortcuts:(default) orKeyEvent.VK_CONTROL(MacOS.)KeyEvent.VK_META- Returns:
- the modifier key for the appropriate accelerator key for menu shortcuts.
- Throws:
AssertionError- if unable to find the appropriate key.HeadlessException- ifGraphicsEnvironment.isHeadless().
-
controlOrCommandMask
public static int controlOrCommandMask()Return the modifier mask for the appropriate accelerator key for menu shortcuts:(default) orEvent.CTRL_MASK(MacOS.)Event.META_MASK- Returns:
- the modifier mask for the appropriate accelerator key for menu shortcuts.
- Throws:
HeadlessException- ifGraphicsEnvironment.isHeadless().
-
canResizeWindows
public static boolean canResizeWindows()Indicates whether it is possible to resize windows that are not an instance oforFrame. Most X11 window managers will allow this, but stock Macintosh and Windows do not.Dialog- Returns:
trueif it is possible to resize windows other thanFrames orDialogs,falseotherwise.
-
canMoveWindows
public static boolean canMoveWindows()Indicates whether it is possible to move windows that are not an instance oforFrame. Most X11 window managers will allow this, but stock Macintosh and Windows do not.Dialog- Returns:
trueif it is possible to move windows other thanFrames orDialogs,falseotherwise.
-
isWindows
public static boolean isWindows()Indicates whether the operating system is Windows.- Returns:
trueif the operation system is Windows,falseotherwise.
-
isWindows9x
public static boolean isWindows9x()Indicates whether the operating system is Windows 9x (95, 98 or ME.)- Returns:
trueif the operating system is Windows 9x (95, 98 or ME,)falseotherwise.
-
isWindowsXP
public static boolean isWindowsXP()Indicates whether the operating system is Windows XP.- Returns:
trueif the operating system is Windows XP,falseotherwise.
-
isMacintosh
public static boolean isMacintosh()Indicates whether the operating system is a Macintosh OS.- Returns:
trueis the operating system is a Macintosh OS,falseotherwise.
-
isOSX
public static boolean isOSX()Indicates whether the operating system is Mac OS X.- Returns:
trueif the operating system is Mac OS X,falseotherwise.
-
isX11
public static boolean isX11()Indicates whether the operating system is using the X11 Windowing system.- Returns:
trueif the operating system is using the X11 Windowing system,falseotherwise.
-
isSolaris
public static boolean isSolaris()Indicates whether the operating system is Solaris.- Returns:
trueif the operating system is Solaris,falseotherwise.
-
isHPUX
public static boolean isHPUX()Indicates whether the operating system is HP-UX.- Returns:
trueif the operating system is HP-UX,falseotherwise.
-
isLinux
public static boolean isLinux()Indicates whether the operating system is Linux.- Returns:
trueif the operating system is Linux,falseotherwise.
-
osFamily
Returns the current operating system family.- Returns:
- the current operating system family.
- Since:
- 1.2
-