com.jgoodies.clearlook
Class ClearLookManager

java.lang.Object
  extended bycom.jgoodies.clearlook.ClearLookManager

public final class ClearLookManager
extends Object

Manages the JGoodies ClearLook(tm) technology; provides access to the ClearLookMode, ClearLookPolicy, and delegates the component analysis to the current policy.

ClearLook can automatically improve an application's visual appearance. Therefore it detects typical GUI problems, for example, nested borders. It then removes or replaces obsolete decorators and visual clutter.

The concrete detection and replacement is performed by an implementation of ClearLookPolicy.

Users can choose the ClearLook mode and policy by setting System properties. To set the mode, specify its name under key ClearLook.mode; to set the policy, specify its class name under ClearLook.policy.

Author:
Karsten Lentzsch
See Also:
ClearLookMode, ClearLookPolicy, DefaultClearLookPolicy, Options

Method Summary
static ClearLookMode getMode()
          Returns the current ClearLook mode.
static ClearLookPolicy getPolicy()
          Returns the current ClearLook policy.
static void installDefaultMode()
          Detects and answers the default ClearLook mode.
static void log(String message)
          Logs a message to the System output if we are in verbose mode.
static Border replaceBorder(JComponent component)
          Detects if ClearLook should replace the component's Border.
static void setMode(ClearLookMode newMode)
          Sets a new ClearLookMode.
static void setPolicy(ClearLookPolicy newPolicy)
          Sets a new ClearLook policy.
static void setPolicy(String policyClassName)
          Sets a new ClearLook policy using an instance of the specified class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

replaceBorder

public static Border replaceBorder(JComponent component)
Detects if ClearLook should replace the component's Border. In this case it replaces the border and returns the original border. Otherwise it returns null.

Parameters:
component - the decorated component to inspec
Returns:
the original border if it will be replaced, null otherwise

getMode

public static ClearLookMode getMode()
Returns the current ClearLook mode.

Returns:
the current ClearLookMode instance.

setMode

public static void setMode(ClearLookMode newMode)
Sets a new ClearLookMode.

Parameters:
newMode - the ClearLookMode to be set

installDefaultMode

public static void installDefaultMode()
Detects and answers the default ClearLook mode. Default is OFF, unless we are in NetBeans, where it defaults to ON.

The default can be overridden by setting the mode in the UIDefaults table at key ClearLook.mode, which in turn can be overridden by the system properties using the same key.

In case the user has set a system property or we detect a problem, we log a message about the choosen style.


getPolicy

public static ClearLookPolicy getPolicy()
Returns the current ClearLook policy.

Returns:
the current ClearLookPolicy

setPolicy

public static void setPolicy(ClearLookPolicy newPolicy)
Sets a new ClearLook policy.

Parameters:
newPolicy - the ClearLookPolicy to be set

setPolicy

public static void setPolicy(String policyClassName)
Sets a new ClearLook policy using an instance of the specified class.

In case we detect a problem, we log a message.

Parameters:
policyClassName - the class name of the ClearLook policy to be set

log

public static void log(String message)
Logs a message to the System output if we are in verbose mode.

Parameters:
message - the string to log


Copyright © 2001-2004 JGoodies Karsten Lentzsch. All Rights Reserved.