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 boolean
static boolean
static int
Return the modifier key for the appropriate accelerator key for menu shortcuts:
(default) orKeyEvent.VK_CONTROL
(MacOS.)KeyEvent.VK_META
static int
Return the modifier mask for the appropriate accelerator key for menu shortcuts:
(default) orEvent.CTRL_MASK
(MacOS.)Event.META_MASK
(package private) static void
initialize
(OSIdentifier newOSIdentifier, ToolkitProvider newToolkitProvider) static boolean
isHPUX()
Indicates whether the operating system is HP-UX.static boolean
isLinux()
Indicates whether the operating system is Linux.static boolean
Indicates whether the operating system is a Macintosh OS.static boolean
isOSX()
Indicates whether the operating system is Mac OS X.static boolean
Indicates whether the operating system is Solaris.static boolean
Indicates whether the operating system is Windows.static boolean
Indicates whether the operating system is Windows 9x (95, 98 or ME.)static boolean
Indicates whether the operating system is Windows XP.static boolean
isX11()
Indicates whether the operating system is using the X11 Windowing system.static OSFamily
osFamily()
Returns the current operating system family.(package private) static void
reload()
-
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 of
orFrame
. Most X11 window managers will allow this, but stock Macintosh and Windows do not.Dialog
- Returns:
true
if it is possible to resize windows other thanFrame
s orDialog
s,false
otherwise.
-
canMoveWindows
public static boolean canMoveWindows()Indicates whether it is possible to move windows that are not an instance of
orFrame
. Most X11 window managers will allow this, but stock Macintosh and Windows do not.Dialog
- Returns:
true
if it is possible to move windows other thanFrame
s orDialog
s,false
otherwise.
-
isWindows
public static boolean isWindows()Indicates whether the operating system is Windows.- Returns:
true
if the operation system is Windows,false
otherwise.
-
isWindows9x
public static boolean isWindows9x()Indicates whether the operating system is Windows 9x (95, 98 or ME.)- Returns:
true
if the operating system is Windows 9x (95, 98 or ME,)false
otherwise.
-
isWindowsXP
public static boolean isWindowsXP()Indicates whether the operating system is Windows XP.- Returns:
true
if the operating system is Windows XP,false
otherwise.
-
isMacintosh
public static boolean isMacintosh()Indicates whether the operating system is a Macintosh OS.- Returns:
true
is the operating system is a Macintosh OS,false
otherwise.
-
isOSX
public static boolean isOSX()Indicates whether the operating system is Mac OS X.- Returns:
true
if the operating system is Mac OS X,false
otherwise.
-
isX11
public static boolean isX11()Indicates whether the operating system is using the X11 Windowing system.- Returns:
true
if the operating system is using the X11 Windowing system,false
otherwise.
-
isSolaris
public static boolean isSolaris()Indicates whether the operating system is Solaris.- Returns:
true
if the operating system is Solaris,false
otherwise.
-
isHPUX
public static boolean isHPUX()Indicates whether the operating system is HP-UX.- Returns:
true
if the operating system is HP-UX,false
otherwise.
-
isLinux
public static boolean isLinux()Indicates whether the operating system is Linux.- Returns:
true
if the operating system is Linux,false
otherwise.
-
osFamily
Returns the current operating system family.- Returns:
- the current operating system family.
- Since:
- 1.2
-