org.fest.swing.util
Class Platform

java.lang.Object
  extended by org.fest.swing.util.Platform

public final class Platform
extends Object

Understands platform-specific functionality.

Author:
Alex Ruiz

Method Summary
static boolean canMoveWindows()
          Indicates whether it is possible to move windows that are not an instance of Frame or Dialog.
static boolean canResizeWindows()
          Indicates whether it is possible to resize windows that are not an instance of Frame or Dialog.
static int controlOrCommandKey()
          Return the modifier key for the appropriate accelerator key for menu shortcuts: KeyEvent.VK_CONTROL (default) or KeyEvent.VK_META (MacOS.)
static int controlOrCommandMask()
          Return the modifier mask for the appropriate accelerator key for menu shortcuts: Event.CTRL_MASK (default) or Event.META_MASK (MacOS.)
static boolean isHPUX()
          Indicates whether the operating system is HP-UX.
static boolean isLinux()
          Indicates whether the operating system is Linux.
static boolean isMacintosh()
          Indicates whether the operating system is a Macintosh OS.
static boolean isOSX()
          Indicates whether the operating system is Mac OS X.
static boolean isSolaris()
          Indicates whether the operating system is Solaris.
static boolean isWindows()
          Indicates whether the operating system is Windows.
static boolean isWindows9x()
          Indicates whether the operating system is Windows 9x (95, 98 or ME.)
static boolean isWindowsXP()
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

controlOrCommandKey

public static int controlOrCommandKey()
Return the modifier key for the appropriate accelerator key for menu shortcuts: KeyEvent.VK_CONTROL (default) or KeyEvent.VK_META (MacOS.)

Returns:
the modifier key for the appropriate accelerator key for menu shortcuts.
Throws:
AssertionError - if unable to find the appropriate key.
HeadlessException - if GraphicsEnvironment.isHeadless().

controlOrCommandMask

public static int controlOrCommandMask()
Return the modifier mask for the appropriate accelerator key for menu shortcuts: Event.CTRL_MASK (default) or Event.META_MASK (MacOS.)

Returns:
the modifier mask for the appropriate accelerator key for menu shortcuts.
Throws:
HeadlessException - if GraphicsEnvironment.isHeadless().

canResizeWindows

public static boolean canResizeWindows()
Indicates whether it is possible to resize windows that are not an instance of Frame or Dialog. Most X11 window managers will allow this, but stock Macintosh and Windows do not.

Returns:
true if it is possible to resize windows other than Frames or Dialogs, false otherwise.

canMoveWindows

public static boolean canMoveWindows()
Indicates whether it is possible to move windows that are not an instance of Frame or Dialog. Most X11 window managers will allow this, but stock Macintosh and Windows do not.

Returns:
true if it is possible to move windows other than Frames or Dialogs, 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

public static OSFamily osFamily()
Returns the current operating system family.

Returns:
the current operating system family.
Since:
1.2


Copyright © 2007-2011 FEST (Fixtures for Easy Software Testing). All Rights Reserved.