com.jgoodies.uif.util
Class Modes

java.lang.Object
  extended by com.jgoodies.uif.util.Modes
All Implemented Interfaces:
Mode, Serializable

public final class Modes
extends Object
implements Mode, Serializable

A typesafe enumeration for a bunch of Modes useful for handling differences between platforms and looks. Note that some values require access to protected System properties that are only readable in safe environments.

The available modes are:

NameMeaning
ALWAYS Enabled on all operating systems and look&feels
NEVER Disabled on all operating systems and look&feels
LAF_AQUA Enabled for the Mac OS X Aqua L&F only, disabled for all other l&fs
LAF_WINDOWS Enabled for the Windows L&Fs, disabled for all other l&fs
LAF_NON_AQUA Disabled for the Mac OS X Aqua L&F only, enabled for all other l&fs
LAF_NON_WINDOWS Disabled for the Windows L&Fs, enabled for all other l&fs
OS_LINUX Enabled on Linux only, disabled on all other platforms
OS_MAC Enabled on Mac OS only, disabled on all other platforms
OS_WINDOWS Enabled on Windows only, disabled on all other platforms
OS_NON_LINUX Disabled on LINUX only, enabled on all other platforms
OS_NON_MAC Disabled on Mac OS only, enabled on all other platforms
OS_NON_WINDOWS Disabled on Windows only, enabled on all other platforms

Version:
$Revision: 1.6 $
Author:
Karsten Lentzsch
See Also:
Serialized Form

Field Summary
static Modes ALWAYS
          Describes a mode that is always enabled.
static Modes LAF_AQUA
          Describes a mode that is enabled if and only if the current look&feel is the Mac OS X Aqua look&feel.
static Modes LAF_NON_AQUA
          Describes a mode that is enabled if and only if the current look&feel is not the Mac OS X Aqua look&feel.
static Modes LAF_NON_WINDOWS
          Describes a mode that is enabled if and only if the current look&feel is not a Windows look&feel.
static Modes LAF_WINDOWS
          Describes a mode that is enabled if and only if the current look&feel is a Windows look&feel.
static Modes NEVER
          Describes a mode that is always disabled.
static Modes OS_LINUX
          Describes a mode that is enabled if and only if the OS is Linux.
static Modes OS_MAC
          Describes a mode that is enabled if and only if the OS is Mac.
static Modes OS_NON_LINUX
          Describes a mode that is enabled if and only if the OS is not Linux.
static Modes OS_NON_MAC
          Describes a mode that is enabled if and only if the OS is not Mac.
static Modes OS_NON_WINDOWS
          Describes a mode that is enabled if and only if the OS is not Windows.
static Modes OS_WINDOWS
          Describes a mode that is enabled if and only if the OS is Windows.
 
Method Summary
 boolean enabled()
          Checks and answers whether this mode is enabled or disabled.
static boolean isLafAqua()
          Lazily checks and answers whether the Aqua look&feel is active.
static boolean isLafWindows()
          Lazily checks and answers whether the Windows look&feel is active.
 String toString()
          Returns a human readable string representation for this mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALWAYS

public static final Modes ALWAYS
Describes a mode that is always enabled.


NEVER

public static final Modes NEVER
Describes a mode that is always disabled.


LAF_AQUA

public static final Modes LAF_AQUA
Describes a mode that is enabled if and only if the current look&feel is the Mac OS X Aqua look&feel.


LAF_WINDOWS

public static final Modes LAF_WINDOWS
Describes a mode that is enabled if and only if the current look&feel is a Windows look&feel.


LAF_NON_AQUA

public static final Modes LAF_NON_AQUA
Describes a mode that is enabled if and only if the current look&feel is not the Mac OS X Aqua look&feel. In other words: it is disabled for Aqua and enabled for all other l&fs.


LAF_NON_WINDOWS

public static final Modes LAF_NON_WINDOWS
Describes a mode that is enabled if and only if the current look&feel is not a Windows look&feel. In other words: it is disabled for Windows l&fs and enabled for all other l&fs.


OS_MAC

public static final Modes OS_MAC
Describes a mode that is enabled if and only if the OS is Mac.


OS_WINDOWS

public static final Modes OS_WINDOWS
Describes a mode that is enabled if and only if the OS is Windows.


OS_NON_MAC

public static final Modes OS_NON_MAC
Describes a mode that is enabled if and only if the OS is not Mac.


OS_NON_WINDOWS

public static final Modes OS_NON_WINDOWS
Describes a mode that is enabled if and only if the OS is not Windows.


OS_LINUX

public static final Modes OS_LINUX
Describes a mode that is enabled if and only if the OS is Linux.


OS_NON_LINUX

public static final Modes OS_NON_LINUX
Describes a mode that is enabled if and only if the OS is not Linux.

Method Detail

enabled

public boolean enabled()
Checks and answers whether this mode is enabled or disabled. Note that some enumeration values require to read protected System properties and so will work properly only in safe environments.

Specified by:
enabled in interface Mode
Returns:
true if enabled, false if disabled

toString

public String toString()
Returns a human readable string representation for this mode.

Overrides:
toString in class Object
Returns:
a human readable string representation for this mode

isLafAqua

public static boolean isLafAqua()
Lazily checks and answers whether the Aqua look&feel is active.

Returns:
true if the current look&feel is Aqua

isLafWindows

public static boolean isLafWindows()
Lazily checks and answers whether the Windows look&feel is active.

Returns:
true if the current look&feel is Windows


Copyright © 2000-2008 JGoodies Karsten Lentzsch. All Rights Reserved.