Quaqua 5.4.1 2009-07-14

ch.randelshofer.quaqua
Class QuaquaManager

java.lang.Object
  extended by ch.randelshofer.quaqua.QuaquaManager

public class QuaquaManager
extends java.lang.Object

The QuaquaManager provides bug fixes and enhancements for the Mac Look and Feel and for the Aqua Look and Feel on Mac OS X.

Usage for Java Applications:

 UIManager.setLookAndFeel(QuaquaManager.getLookAndFeelClassName());
 

Usage for Java Applets:

 UIManager.put("ClassLoader", getClass().getClassLoader());
 UIManager.setLookAndFeel(QuaquaManager.getLookAndFeel());
 

System Properties for Java Applications:
You can customize the Quaqua Look and Feel using the following system properties:

Example:
 System.setProperty("Quaqua.design", "panther");
 System.setProperty("Quaqua.TabbedPane.design", "jaguar");
 System.setProperty("Quaqua.FileChooser.autovalidate", "true");
 

System Properties for Java Applets:
In a secure environment, you are not allowed to change system properties. Use QuaquaManager.setProperty to specify (or override) system properties that are used by Quaqua (that is, for all system properties listed above).

Example:

 QuaquaManager.setProperty("Quaqua.design", "panther");
 QuaquaManager.setProperty("Quaqua.TabbedPane.design", "jaguar");
 QuaquaManager.setProperty("Quaqua.FileChooser.autovalidate", "true");
 

Client Properties:
You can customize some of the components by specifying client properties.

Specifying class loader (Java Applets):
If your code runs as an Applet in a Java 1.3 VM, Swing attempts to load the UI classes from the system class loader instead of from the class loader which loads the applet classes. To have Swing load the UI classes using the same class loader as your code, use the following code to set the Quaqua look and feel on Swing's UIManager.
 UIManager.put("ClassLoader", getClass().getClassLoader());
 UIManager.setLookAndFeel(QuaquaManager.getLookAndFeel());
 

Version:
$Id: QuaquaManager.java 99 2009-07-05 10:38:11Z wrandelshofer $
Author:
Werner Randelshofer

Field Summary
static int CHEETAH
          Mac OS X 10.0 Cheetah.
static int DARWIN
          Darwin.
static int JAGUAR
          Mac OS X 10.2 Jaguar.
static int LEOPARD
          Mac OS X 10.5 Leopard or Darwin 9.1.0.
static int LINUX
          Generic Linux.
static int PANTHER
          Mac OS X 10.3 Panther.
static int PUMA
          Mac OS X 10.1 Puma.
static int SNOW_LEOPARD
          Mac OS X 10.6 Snow Leopard.
static int TIGER
          Mac OS X 10.4 Tiger.
static int UNKNOWN
          Unknown.
static int WINDOWS
          Windows.
 
Method Summary
static boolean getBoolean(java.lang.String key)
          This method returns a boolean UIManager property.
static int getDesign()
          Returns the current design of Mac OS X.
static java.util.Set getExcludedUIs()
          Gets the excluded UI delegates, or null, if all Quaqua UI delegates shall be excluded from the QuaquaLookAndFeel.
static java.util.Set getIncludedUIs()
          Gets the included UI delegates, or null, if all Quaqua UI delegates shall be included into the QuaquaLookAndFeel.
static javax.swing.LookAndFeel getLookAndFeel()
          Returns a Quaqua look and feel, if workarounds for the system look and feel are available.
static java.lang.String getLookAndFeelClassName()
          Returns the class name of a Quaqua look and feel.
static int getOS()
          Returns the current operating system.
static java.lang.String getProperty(java.lang.String key)
          This method returns a locally specified property, if it has been set using method setProperty.
static int[] getProperty(java.lang.String key, int[] def)
          This method returns a locally specified property, if it has been set using method setProperty.
static java.lang.String getProperty(java.lang.String key, java.lang.String def)
          This method returns a locally specified property, if it has been set using method setProperty.
static java.lang.String getVersion()
          Returns the version string of Quaqua.
static boolean isNativeCodeAvailable()
          Returns true, if Quaqua uses native code for some of its functionality.
static boolean isOSX()
          Returns true if the current operating system is know to be a Mac OS X.
static void main(java.lang.String[] args)
           
static void removeProperty(java.lang.String key)
          Removes a locally defined property.
static void setExcludedUIs(java.util.Set excludes)
          Excludes UI delegates with the specified names.
static void setIncludedUIs(java.util.Set includes)
          Include only UI delegates with the specified names.
static java.lang.String setProperty(java.lang.String key, java.lang.String value)
          Locally defines a property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHEETAH

public static final int CHEETAH
Mac OS X 10.0 Cheetah.

See Also:
Constant Field Values

PUMA

public static final int PUMA
Mac OS X 10.1 Puma.

See Also:
Constant Field Values

JAGUAR

public static final int JAGUAR
Mac OS X 10.2 Jaguar.

See Also:
Constant Field Values

PANTHER

public static final int PANTHER
Mac OS X 10.3 Panther.

See Also:
Constant Field Values

TIGER

public static final int TIGER
Mac OS X 10.4 Tiger.

See Also:
Constant Field Values

LEOPARD

public static final int LEOPARD
Mac OS X 10.5 Leopard or Darwin 9.1.0.

See Also:
Constant Field Values

SNOW_LEOPARD

public static final int SNOW_LEOPARD
Mac OS X 10.6 Snow Leopard.

See Also:
Constant Field Values

LINUX

public static final int LINUX
Generic Linux.

See Also:
Constant Field Values

DARWIN

public static final int DARWIN
Darwin.

See Also:
Constant Field Values

WINDOWS

public static final int WINDOWS
Windows.

See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
Unknown.

See Also:
Constant Field Values
Method Detail

getOS

public static int getOS()
Returns the current operating system.

Returns:
one of the OS constants: CHEETAH..SNOW_LEOPARD, DARWIN, WINDOWS or UNKNOWN.

isOSX

public static boolean isOSX()
Returns true if the current operating system is know to be a Mac OS X.


getDesign

public static int getDesign()
Returns the current design of Mac OS X.

Returns:
one of the OS constants: CHEETAH..TIGER or UNKNOWN.

getLookAndFeelClassName

public static java.lang.String getLookAndFeelClassName()
Returns the class name of a Quaqua look and feel. The class name depends on the JVM, Quaqua is running on, and on the visual design of the operating system.


getLookAndFeel

public static javax.swing.LookAndFeel getLookAndFeel()
Returns a Quaqua look and feel, if workarounds for the system look and feel are available. Returns a UIManager.getSystemLookAndFeelClassName() instance if no workaround is available.


getBoolean

public static boolean getBoolean(java.lang.String key)
This method returns a boolean UIManager property. This method has been moved here, because Java 1.3 does not support this directly.


getProperty

public static java.lang.String getProperty(java.lang.String key)
This method returns a locally specified property, if it has been set using method setProperty. If no local property has been found, a system property using method java.lang.System.getProperty(String,String is returned.

This method is used to specify properties for Quaqua, when, due to security reasons, system properties can not be used, e.g. in a secure Applet environment.

See Also:
setProperty(java.lang.String, java.lang.String)

getProperty

public static java.lang.String getProperty(java.lang.String key,
                                           java.lang.String def)
This method returns a locally specified property, if it has been set using method setProperty. If no local property has been found, a system property using method java.lang.System.getProperty(String,String is returned.

This method is used to specify properties for Quaqua, when, due to security reasons, system properties can not be used, e.g. in a secure Applet environment.

See Also:
setProperty(java.lang.String, java.lang.String)

getProperty

public static int[] getProperty(java.lang.String key,
                                int[] def)
This method returns a locally specified property, if it has been set using method setProperty. If no local property has been found, a system property using method java.lang.System.getProperty(String,String is returned.

This method is used to specify properties for Quaqua, when, due to security reasons, system properties can not be used, e.g. in a secure Applet environment.

See Also:
setProperty(java.lang.String, java.lang.String)

setProperty

public static java.lang.String setProperty(java.lang.String key,
                                           java.lang.String value)
Locally defines a property.

Use method clearProperty to clear a local property.

This method is used to specify properties for Quaqua, when, due to security reasons, system properties can not be used, e.g. in a secure Applet environment.

See Also:
getProperty(java.lang.String)

removeProperty

public static void removeProperty(java.lang.String key)
Removes a locally defined property.

This method is used to specify properties for Quaqua, when, due to security reasons, system properties can not be used, e.g. in a secure Applet environment.

See Also:
setProperty(java.lang.String, java.lang.String)

getVersion

public static java.lang.String getVersion()
Returns the version string of Quaqua. The version string is a sequence of numbers separated by full stops, followed by a blank character and a release date in ISO-format. e.g. "3.6.1 2006-03-12"


main

public static void main(java.lang.String[] args)

isNativeCodeAvailable

public static boolean isNativeCodeAvailable()
Returns true, if Quaqua uses native code for some of its functionality.


setIncludedUIs

public static void setIncludedUIs(java.util.Set includes)
Include only UI delegates with the specified names. This method must be called, before setting the QuaquaLookAndFeel to the UIManager.

Usage:

 HashSet includes = new HashSet();
 includes.add("Button");
 QuaquaManager.setIncludeUIs(includes);
 

Parameters:
includes - Set Only include UI delegates, which are in this list. Specify null to include all UIs.

setExcludedUIs

public static void setExcludedUIs(java.util.Set excludes)
Excludes UI delegates with the specified names. This method must be called, before setting the QuaquaLookAndFeel to the UIManager.

Usage:

 HashSet excludes = new HashSet();
 excludes.add("TextField");
 QuaquaManager.setExcludeUIs(excludes);
 

Parameters:
excludes - Set Exclude UI delegates, which are in this list. Specify null to exclude all UIs.

getIncludedUIs

public static java.util.Set getIncludedUIs()
Gets the included UI delegates, or null, if all Quaqua UI delegates shall be included into the QuaquaLookAndFeel.

Returns:
Set.

getExcludedUIs

public static java.util.Set getExcludedUIs()
Gets the excluded UI delegates, or null, if all Quaqua UI delegates shall be excluded from the QuaquaLookAndFeel.

Returns:
Set.

Copyright 2003-2007 (c) Werner Randelshofer.
All rights reserved.