UIManager.java revision 2362
2362N/A * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * {@code UIManager} manages the current look and feel, the set of 0N/A * available look and feels, {@code PropertyChangeListeners} that 0N/A * are notified when the look and feel changes, look and feel defaults, and 0N/A * convenience methods for obtaining various default values. 0N/A * <h3>Specifying the look and feel</h3> 0N/A * The look and feel can be specified in two distinct ways: by 0N/A * specifying the fully qualified name of the class for the look and 0N/A * feel, or by creating an instance of {@code LookAndFeel} and passing 0N/A * it to {@code setLookAndFeel}. The following example illustrates 0N/A * setting the look and feel to the system look and feel: 0N/A * UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 0N/A * The following example illustrates setting the look and feel based on 0N/A * UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); 0N/A * Once the look and feel has been changed it is imperative to invoke 0N/A * {@code updateUI} on all {@code JComponents}. The method {@link 0N/A * SwingUtilities#updateComponentTreeUI} makes it easy to apply {@code 0N/A * updateUI} to a containment hierarchy. Refer to it for 0N/A * details. The exact behavior of not invoking {@code 0N/A * updateUI} after changing the look and feel is 0N/A * unspecified. It is very possible to receive unexpected exceptions, 0N/A * painting problems, or worse. 0N/A * <h3>Default look and feel</h3> 0N/A * The class used for the default look and feel is chosen in the following 0N/A * <li>If the system property <code>swing.defaultlaf</code> is 0N/A * {@code non-null}, use its value as the default look and feel class 0N/A * exists and contains the key <code>swing.defaultlaf</code>, 0N/A * use its value as the default look and feel class name. The location 0N/A * upon the implementation of the Java platform. In Sun's implementation 0N/A * Refer to the release notes of the implementation being used for 0N/A * <li>Otherwise use the cross platform look and feel. 0N/A * {@code UIManager} manages three sets of {@code UIDefaults}. In order, they 0N/A * <li>Developer defaults. With few exceptions Swing does not 0N/A * alter the developer defaults; these are intended to be modified 0N/A * and used by the developer. 0N/A * <li>Look and feel defaults. The look and feel defaults are 0N/A * supplied by the look and feel at the time it is installed as the 0N/A * current look and feel ({@code setLookAndFeel()} is invoked). The 0N/A * look and feel defaults can be obtained using the {@code 0N/A * getLookAndFeelDefaults()} method. 0N/A * <li>Sytem defaults. The system defaults are provided by Swing. 0N/A * Invoking any of the various {@code get} methods 0N/A * results in checking each of the defaults, in order, returning 0N/A * the first {@code non-null} value. For example, invoking 0N/A * {@code UIManager.getString("Table.foreground")} results in first 0N/A * checking developer defaults. If the developer defaults contain 0N/A * a value for {@code "Table.foreground"} it is returned, otherwise 0N/A * the look and feel defaults are checked, followed by the system defaults. 0N/A * It's important to note that {@code getDefaults} returns a custom 0N/A * instance of {@code UIDefaults} with this resolution logic built into it. 0N/A * For example, {@code UIManager.getDefaults().getString("Table.foreground")} 0N/A * is equivalent to {@code UIManager.getString("Table.foreground")}. Both 0N/A * resolve using the algorithm just described. In many places the 0N/A * documentation uses the word defaults to refer to the custom instance 0N/A * of {@code UIDefaults} with the resolution logic as previously described. 0N/A * When the look and feel is changed, {@code UIManager} alters only the 0N/A * look and feel defaults; the developer and system defaults are not 0N/A * altered by the {@code UIManager} in any way. 0N/A * The set of defaults a particular look and feel supports is defined 0N/A * and documented by that look and feel. In addition, each look and 0N/A * feel, or {@code ComponentUI} provided by a look and feel, may 0N/A * access the defaults at different times in their life cycle. Some 0N/A * look and feels may agressively look up defaults, so that changing a 0N/A * default may not have an effect after installing the look and feel. 0N/A * Other look and feels may lazily access defaults so that a change to 0N/A * the defaults may effect an existing look and feel. Finally, other look 0N/A * and feels might not configure themselves from the defaults table in 0N/A * any way. None-the-less it is usually the case that a look and feel 0N/A * expects certain defaults, so that in general 0N/A * a {@code ComponentUI} provided by one look and feel will not 0N/A * work with another look and feel. 0N/A * <strong>Warning:</strong> 0N/A * Serialized objects of this class will not be compatible with 0N/A * future Swing releases. The current serialization support is 0N/A * appropriate for short term storage or RMI between applications running 0N/A * the same version of Swing. As of 1.4, support for long term storage 0N/A * of all JavaBeans<sup><font size="-2">TM</font></sup> 0N/A * has been added to the <code>java.beans</code> package. 0N/A * @author Thomas Ball 0N/A * @author Hans Muller 0N/A * This class defines the state managed by the <code>UIManager</code>. For 0N/A * Swing applications the fields in this class could just as well 0N/A * be static members of <code>UIManager</code> however we give them 0N/A * scope instead so that applets (and potentially multiple lightweight 0N/A * applications running in a single VM) have their own state. For example, 0N/A * an applet can alter its look and feel, see <code>setLookAndFeel</code>. 0N/A * Doing so has no affect on other applets (or the browser). 0N/A * Returns the SwingPropertyChangeSupport for the current 0N/A * AppContext. If <code>create</code> is a true, a non-null 0N/A * <code>SwingPropertyChangeSupport</code> will be returned, if 0N/A * <code>create</code> is false and this has not been invoked 0N/A * with true, null will be returned. 0N/A /* Lock object used in place of class object for synchronization. (4187686) 0N/A * Return the <code>LAFState</code> object, lazily create one if necessary. 0N/A * All access to the <code>LAFState</code> fields is done via this method, 0N/A * getLAFState().initialized = true; 0N/A * See loadUserProperties(), initialize(). 0N/A * look and feel. The attr is either "name" or "class", a typical 0N/A * key would be: "swing.installedlaf.windows.name" 0N/A * filename if java.home isn't defined. 0N/A // No need to wrap this in a doPrivileged as it's called from 0N/A * Provides a little information about an installed 0N/A * <code>LookAndFeel</code> for the sake of configuring a menu or 0N/A * for initial application set up. 0N/A * @see UIManager#getInstalledLookAndFeels 0N/A * Constructs a <code>UIManager</code>s 0N/A * <code>LookAndFeelInfo</code> object. 0N/A * @param name a <code>String</code> specifying the name of 0N/A * @param className a <code>String</code> specifiying the name of 0N/A * the class that implements the look and feel 0N/A * Returns the name of the look and feel in a form suitable 0N/A * for a menu or other presentation 0N/A * @return a <code>String</code> containing the name 0N/A * @see LookAndFeel#getName 0N/A * Returns the name of the class that implements this look and feel. 0N/A * @return the name of the class that implements this 0N/A * <code>LookAndFeel</code> 0N/A * Returns a string that displays and identifies this 0N/A * object's properties. 0N/A * @return a <code>String</code> representation of this object 0N/A * The default value of <code>installedLAFS</code> is used when no 0N/A * file is available or if the file doesn't contain a "swing.installedlafs" 0N/A * @see #initializeInstalledLAFs 0N/A "Metal",
"javax.swing.plaf.metal.MetalLookAndFeel"));
0N/A "Nimbus",
"javax.swing.plaf.nimbus.NimbusLookAndFeel"));
0N/A // Only include windows on Windows boxs. 0N/A "win.xpstyle.themeActive") !=
null) {
0N/A // GTK is not shipped on Windows. 0N/A * Returns an array of {@code LookAndFeelInfo}s representing the 0N/A * {@code LookAndFeel} implementations currently available. The 0N/A * <code>LookAndFeelInfo</code> objects can be used by an 0N/A * application to construct a menu of look and feel options for 0N/A * the user, or to determine which look and feel to set at startup 0N/A * time. To avoid the penalty of creating numerous {@code 0N/A * LookAndFeel} objects, {@code LookAndFeelInfo} maintains the 0N/A * class name of the {@code LookAndFeel} class, not the actual 0N/A * {@code LookAndFeel} instance. 0N/A * The following example illustrates setting the current look and feel 0N/A * from an instance of {@code LookAndFeelInfo}: 0N/A * UIManager.setLookAndFeel(info.getClassName()); 0N/A * @return an array of <code>LookAndFeelInfo</code> objects 0N/A * @see #setLookAndFeel 0N/A * Sets the set of available look and feels. While this method does 0N/A * not check to ensure all of the {@code LookAndFeelInfos} are 0N/A * {@code non-null}, it is strongly recommended that only {@code non-null} 0N/A * values are supplied in the {@code infos} array. 0N/A * @param infos set of <code>LookAndFeelInfo</code> objects specifying 0N/A * the available look and feels 0N/A * @see #getInstalledLookAndFeels 0N/A * @throws NullPointerException if {@code infos} is {@code null} 0N/A * Adds the specified look and feel to the set of available look 0N/A * and feels. While this method allows a {@code null} {@code info}, 0N/A * it is strongly recommended that a {@code non-null} value be used. 0N/A * @param info a <code>LookAndFeelInfo</code> object that names the 0N/A * look and feel and identifies the class that implements it 0N/A * @see #setInstalledLookAndFeels 0N/A * Adds the specified look and feel to the set of available look 0N/A * and feels. While this method does not check the 0N/A * arguments in any way, it is strongly recommended that {@code 0N/A * non-null} values be supplied. 0N/A * @param name descriptive name of the look and feel 0N/A * @param className name of the class that implements the look and feel 0N/A * @see #setInstalledLookAndFeels 0N/A * Returns the current look and feel or <code>null</code>. 0N/A * @return current look and feel, or <code>null</code> 0N/A * @see #setLookAndFeel 0N/A * Sets the current look and feel to {@code newLookAndFeel}. 0N/A * If the current look and feel is {@code non-null} {@code 0N/A * uninitialize} is invoked on it. If {@code newLookAndFeel} is 0N/A * {@code non-null}, {@code initialize} is invoked on it followed 0N/A * by {@code getDefaults}. The defaults returned from {@code 0N/A * newLookAndFeel.getDefaults()} replace those of the defaults 0N/A * from the previous look and feel. If the {@code newLookAndFeel} is 0N/A * {@code null}, the look and feel defaults are set to {@code null}. 0N/A * A value of {@code null} can be used to set the look and feel 0N/A * to {@code null}. As the {@code LookAndFeel} is required for 0N/A * most of Swing to function, setting the {@code LookAndFeel} to 0N/A * {@code null} is strongly discouraged. 0N/A * This is a JavaBeans bound property. 0N/A * @param newLookAndFeel {@code LookAndFeel} to install 0N/A * @throws UnsupportedLookAndFeelException if 0N/A * {@code newLookAndFeel} is {@code non-null} and 0N/A * {@code newLookAndFeel.isSupportedLookAndFeel()} returns 0N/A * @see #getLookAndFeel 0N/A * Loads the {@code LookAndFeel} specified by the given class 0N/A * name, using the current thread's context class loader, and 0N/A * passes it to {@code setLookAndFeel(LookAndFeel)}. 0N/A * @param className a string specifying the name of the class that implements 0N/A * @exception ClassNotFoundException if the <code>LookAndFeel</code> 0N/A * class could not be found 0N/A * @exception InstantiationException if a new instance of the class 0N/A * couldn't be created 0N/A * @exception IllegalAccessException if the class or initializer isn't accessible 0N/A * @exception UnsupportedLookAndFeelException if 0N/A * <code>lnf.isSupportedLookAndFeel()</code> is false 0N/A * @throws ClassCastException if {@code className} does not identify 0N/A * a class that extends {@code LookAndFeel} 0N/A // Avoid reflection for the common case of metal. 0N/A * Returns the name of the <code>LookAndFeel</code> class that implements 0N/A * the native system look and feel if there is one, otherwise 0N/A * the name of the default cross platform <code>LookAndFeel</code> 0N/A * class. This value can be overriden by setting the 2700N/A * <code>swing.systemlaf</code> system property. 0N/A * @return the <code>String</code> of the <code>LookAndFeel</code> 0N/A * @see #setLookAndFeel 0N/A * @see #getCrossPlatformLookAndFeelClassName 0N/A // May be set on Linux and Solaris boxs. 0N/A * Returns the name of the <code>LookAndFeel</code> class that implements 0N/A * the default cross platform look and feel -- the Java 0N/A * Look and Feel (JLF). This value can be overriden by setting the 0N/A * <code>swing.crossplatformlaf</code> system property. 0N/A * @return a string with the JLF implementation-class 0N/A * @see #setLookAndFeel 0N/A * @see #getSystemLookAndFeelClassName 0N/A return "javax.swing.plaf.metal.MetalLookAndFeel";
0N/A * Returns the defaults. The returned defaults resolve using the 0N/A * logic specified in the class documentation. 0N/A * @return a <code>UIDefaults</code> object containing the default values 0N/A * Returns a font from the defaults. If the value for {@code key} is 0N/A * not a {@code Font}, {@code null} is returned. 0N/A * @param key an <code>Object</code> specifying the font 0N/A * @return the <code>Font</code> object 0N/A * @throws NullPointerException if {@code key} is {@code null} 0N/A * Returns a font from the defaults that is appropriate 0N/A * for the given locale. If the value for {@code key} is 0N/A * not a {@code Font}, {@code null} is returned. 0N/A * @param key an <code>Object</code> specifying the font 0N/A * @param l the <code>Locale</code> for which the font is desired; refer 0N/A * to {@code UIDefaults} for details on how a {@code null} 0N/A * {@code Locale} is handled 0N/A * @return the <code>Font</code> object 0N/A * @throws NullPointerException if {@code key} is {@code null} 893N/A * Returns a color from the defaults. If the value for {@code key} is 893N/A * not a {@code Color}, {@code null} is returned. 893N/A * @param key an <code>Object</code> specifying the color 893N/A * @return the <code>Color</code> object 893N/A * @throws NullPointerException if {@code key} is {@code null} 1319N/A * Returns a color from the defaults that is appropriate 893N/A * for the given locale. If the value for {@code key} is 893N/A * not a {@code Color}, {@code null} is returned. 893N/A * @param key an <code>Object</code> specifying the color 893N/A * @param l the <code>Locale</code> for which the color is desired; refer 893N/A * to {@code UIDefaults} for details on how a {@code null} 893N/A * {@code Locale} is handled 893N/A * @return the <code>Color</code> object 893N/A * @throws NullPointerException if {@code key} is {@code null} 893N/A * Returns an <code>Icon</code> from the defaults. If the value for 893N/A * {@code key} is not an {@code Icon}, {@code null} is returned. 893N/A * @param key an <code>Object</code> specifying the icon 893N/A * @return the <code>Icon</code> object 1319N/A * @throws NullPointerException if {@code key} is {@code null} 0N/A * Returns an <code>Icon</code> from the defaults that is appropriate 0N/A * for the given locale. If the value for 0N/A * {@code key} is not an {@code Icon}, {@code null} is returned. 0N/A * @param key an <code>Object</code> specifying the icon 0N/A * @param l the <code>Locale</code> for which the icon is desired; refer 0N/A * to {@code UIDefaults} for details on how a {@code null} 0N/A * {@code Locale} is handled 0N/A * @return the <code>Icon</code> object 0N/A * @throws NullPointerException if {@code key} is {@code null} 0N/A * Returns a border from the defaults. If the value for 0N/A * {@code key} is not a {@code Border}, {@code null} is returned. 0N/A * @param key an <code>Object</code> specifying the border 0N/A * @return the <code>Border</code> object 0N/A * @throws NullPointerException if {@code key} is {@code null} 0N/A * Returns a border from the defaults that is appropriate 0N/A * for the given locale. If the value for 0N/A * {@code key} is not a {@code Border}, {@code null} is returned. 0N/A * @param key an <code>Object</code> specifying the border 0N/A * @param l the <code>Locale</code> for which the border is desired; refer 0N/A * to {@code UIDefaults} for details on how a {@code null} 0N/A * {@code Locale} is handled 0N/A * @return the <code>Border</code> object 0N/A * @throws NullPointerException if {@code key} is {@code null} 0N/A * Returns a string from the defaults. If the value for 0N/A * {@code key} is not a {@code String}, {@code null} is returned. 0N/A * @param key an <code>Object</code> specifying the string 0N/A * @return the <code>String</code> 0N/A * @throws NullPointerException if {@code key} is {@code null} 0N/A * Returns a string from the defaults that is appropriate for the 0N/A * given locale. If the value for 0N/A * {@code key} is not a {@code String}, {@code null} is returned. 0N/A * @param key an <code>Object</code> specifying the string 0N/A * @param l the <code>Locale</code> for which the string is desired; refer 0N/A * to {@code UIDefaults} for details on how a {@code null} 0N/A * {@code Locale} is handled 0N/A * @return the <code>String</code> 0N/A * @throws NullPointerException if {@code key} is {@code null} 0N/A * Returns a string from the defaults that is appropriate for the 0N/A * given locale. If the value for 0N/A * {@code key} is not a {@code String}, {@code null} is returned. 0N/A * @param key an <code>Object</code> specifying the string 0N/A * @param c {@code Component} used to determine the locale; 0N/A * {@code null} implies the default locale as 0N/A * returned by {@code Locale.getDefault()} 0N/A * @return the <code>String</code> 0N/A * @throws NullPointerException if {@code key} is {@code null} 0N/A * Returns an integer from the defaults. If the value for 0N/A * {@code key} is not an {@code Integer}, or does not exist, 0N/A * {@code 0} is returned. 0N/A * @param key an <code>Object</code> specifying the int 0N/A * @throws NullPointerException if {@code key} is {@code null} 0N/A * Returns an integer from the defaults that is appropriate 0N/A * for the given locale. If the value for 0N/A * {@code key} is not an {@code Integer}, or does not exist, 0N/A * {@code 0} is returned. 0N/A * @param key an <code>Object</code> specifying the int 0N/A * @param l the <code>Locale</code> for which the int is desired; refer 0N/A * to {@code UIDefaults} for details on how a {@code null} 0N/A * {@code Locale} is handled 0N/A * @throws NullPointerException if {@code key} is {@code null} 0N/A * Returns a boolean from the defaults which is associated with 0N/A * the key value. If the key is not found or the key doesn't represent 0N/A * a boolean value then {@code false} is returned. 0N/A * @param key an <code>Object</code> specifying the key for the desired boolean value 0N/A * @return the boolean value corresponding to the key 0N/A * @throws NullPointerException if {@code key} is {@code null} 0N/A * Returns a boolean from the defaults which is associated with 0N/A * the key value and the given <code>Locale</code>. If the key is not 0N/A * found or the key doesn't represent 0N/A * a boolean value then {@code false} will be returned. 0N/A * @param key an <code>Object</code> specifying the key for the desired 0N/A * @param l the <code>Locale</code> for which the boolean is desired; refer 0N/A * to {@code UIDefaults} for details on how a {@code null} 0N/A * {@code Locale} is handled 0N/A * @return the boolean value corresponding to the key 0N/A * @throws NullPointerException if {@code key} is {@code null} 0N/A * Returns an <code>Insets</code> object from the defaults. If the value 0N/A * for {@code key} is not an {@code Insets}, {@code null} is returned. 0N/A * @param key an <code>Object</code> specifying the <code>Insets</code> object 0N/A * @return the <code>Insets</code> object 0N/A * @throws NullPointerException if {@code key} is {@code null} 0N/A * Returns an <code>Insets</code> object from the defaults that is 0N/A * appropriate for the given locale. If the value 0N/A * for {@code key} is not an {@code Insets}, {@code null} is returned. 0N/A * @param key an <code>Object</code> specifying the <code>Insets</code> object 0N/A * @param l the <code>Locale</code> for which the object is desired; refer 0N/A * to {@code UIDefaults} for details on how a {@code null} 0N/A * {@code Locale} is handled 0N/A * @return the <code>Insets</code> object 0N/A * @throws NullPointerException if {@code key} is {@code null} 0N/A * Returns a dimension from the defaults. If the value 0N/A * for {@code key} is not a {@code Dimension}, {@code null} is returned. 0N/A * @param key an <code>Object</code> specifying the dimension object 0N/A * @return the <code>Dimension</code> object 0N/A * @throws NullPointerException if {@code key} is {@code null} 0N/A * Returns a dimension from the defaults that is appropriate 0N/A * for the given locale. If the value 0N/A * for {@code key} is not a {@code Dimension}, {@code null} is returned. 0N/A * @param key an <code>Object</code> specifying the dimension object 0N/A * @param l the <code>Locale</code> for which the object is desired; refer 0N/A * to {@code UIDefaults} for details on how a {@code null} 0N/A * {@code Locale} is handled 0N/A * @return the <code>Dimension</code> object 0N/A * @throws NullPointerException if {@code key} is {@code null} 0N/A * Returns an object from the defaults. 0N/A * @param key an <code>Object</code> specifying the desired object 0N/A * @return the <code>Object</code> 0N/A * @throws NullPointerException if {@code key} is {@code null} 0N/A * Returns an object from the defaults that is appropriate for 0N/A * @param key an <code>Object</code> specifying the desired object 0N/A * @param l the <code>Locale</code> for which the object is desired; refer 0N/A * to {@code UIDefaults} for details on how a {@code null} 0N/A * {@code Locale} is handled 0N/A * @return the <code>Object</code> 0N/A * @throws NullPointerException if {@code key} is {@code null} 0N/A * Stores an object in the developer defaults. This is a cover method 0N/A * for {@code getDefaults().put(key, value)}. This only effects the 0N/A * developer defaults, not the system or look and feel defaults. 0N/A * @param key an <code>Object</code> specifying the retrieval key 0N/A * @param value the <code>Object</code> to store; refer to 0N/A * {@code UIDefaults} for details on how {@code null} is 0N/A * @return the <code>Object</code> returned by {@link UIDefaults#put} 0N/A * @throws NullPointerException if {@code key} is {@code null} 0N/A * @see UIDefaults#put 0N/A * Returns the appropriate {@code ComponentUI} implementation for 0N/A * {@code target}. Typically, this is a cover for 0N/A * {@code getDefaults().getUI(target)}. However, if an auxiliary 0N/A * look and feel has been installed, this first invokes 0N/A * {@code getUI(target)} on the multiplexing look and feel's 0N/A * defaults, and returns that value if it is {@code non-null}. 0N/A * @param target the <code>JComponent</code> to return the 0N/A * {@code ComponentUI} for 0N/A * @return the <code>ComponentUI</code> object for {@code target} 0N/A * @throws NullPointerException if {@code target} is {@code null} 0N/A * @see UIDefaults#getUI 0N/A // This can return null if the multiplexing look and feel 0N/A // doesn't support a particular UI. 0N/A * Returns the {@code UIDefaults} from the current look and feel, 0N/A * that were obtained at the time the look and feel was installed. 0N/A * In general, developers should use the {@code UIDefaults} returned from 0N/A * {@code getDefaults()}. As the current look and feel may expect 0N/A * certain values to exist, altering the {@code UIDefaults} returned 0N/A * from this method could have unexpected results. 0N/A * @return <code>UIDefaults</code> from the current look and feel 0N/A * @see #setLookAndFeel(LookAndFeel) 0N/A * @see LookAndFeel#getDefaults 0N/A * Finds the Multiplexing <code>LookAndFeel</code>. 0N/A * Adds a <code>LookAndFeel</code> to the list of auxiliary look and feels. 0N/A * The auxiliary look and feels tell the multiplexing look and feel what 0N/A * other <code>LookAndFeel</code> classes for a component instance are to be used 0N/A * in addition to the default <code>LookAndFeel</code> class when creating a 0N/A * multiplexing UI. The change will only take effect when a new 0N/A * UI class is created or when the default look and feel is changed 0N/A * on a component instance. 0N/A * <p>Note these are not the same as the installed look and feels. 0N/A * @param laf the <code>LookAndFeel</code> object 0N/A * @see #removeAuxiliaryLookAndFeel 0N/A * @see #setLookAndFeel 0N/A * @see #getAuxiliaryLookAndFeels 0N/A * @see #getInstalledLookAndFeels 0N/A // Ideally we would throw an exception here, but it's too late 0N/A * Removes a <code>LookAndFeel</code> from the list of auxiliary look and feels. 0N/A * The auxiliary look and feels tell the multiplexing look and feel what 0N/A * other <code>LookAndFeel</code> classes for a component instance are to be used 0N/A * in addition to the default <code>LookAndFeel</code> class when creating a 0N/A * multiplexing UI. The change will only take effect when a new 0N/A * UI class is created or when the default look and feel is changed 0N/A * on a component instance. 0N/A * <p>Note these are not the same as the installed look and feels. 0N/A * @return true if the <code>LookAndFeel</code> was removed from the list 0N/A * @see #removeAuxiliaryLookAndFeel 0N/A * @see #getAuxiliaryLookAndFeels 0N/A * @see #setLookAndFeel 0N/A * @see #getInstalledLookAndFeels 0N/A * Returns the list of auxiliary look and feels (can be <code>null</code>). 0N/A * The auxiliary look and feels tell the multiplexing look and feel what 0N/A * other <code>LookAndFeel</code> classes for a component instance are 0N/A * to be used in addition to the default LookAndFeel class when creating a 0N/A * <p>Note these are not the same as the installed look and feels. 0N/A * @return list of auxiliary <code>LookAndFeel</code>s or <code>null</code> 0N/A * @see #addAuxiliaryLookAndFeel 0N/A * @see #removeAuxiliaryLookAndFeel 0N/A * @see #setLookAndFeel 0N/A * @see #getInstalledLookAndFeels 0N/A * Adds a <code>PropertyChangeListener</code> to the listener list. 0N/A * The listener is registered for all properties. 0N/A * @param listener the <code>PropertyChangeListener</code> to be added 0N/A * @see java.beans.PropertyChangeSupport 0N/A * Removes a <code>PropertyChangeListener</code> from the listener list. 0N/A * This removes a <code>PropertyChangeListener</code> that was registered 0N/A * for all properties. 0N/A * @param listener the <code>PropertyChangeListener</code> to be removed 0N/A * @see java.beans.PropertyChangeSupport 0N/A * Returns an array of all the <code>PropertyChangeListener</code>s added 0N/A * to this UIManager with addPropertyChangeListener(). 0N/A * @return all of the <code>PropertyChangeListener</code>s added or an empty 0N/A * array if no listeners have been added 0N/A /* Don't bother checking for Swing properties if untrusted, as 0N/A * there's no way to look them up without triggering SecurityExceptions. 0N/A // InputStream has been buffered in Properties 0N/A // No such file, or file is otherwise non-readable. 0N/A // Check whether any properties were overridden at the 0N/A // Don't care about return value. 0N/A // No need to do catch the SecurityException here, this runs 0N/A // in a doPrivileged. 0N/A * then initialize the <code>installedLAFs</code> field. 0N/A * @see #getInstalledLookAndFeels 0N/A /* Create a vector that contains the value of the swing.installedlafs 0N/A * property. For example given "swing.installedlafs=motif,windows" 0N/A * lafs = {"motif", "windows"}. 0N/A /* Look up the name and class for each name in the "swing.installedlafs" 0N/A * list. If they both exist then add a LookAndFeelInfo to 0N/A * the installedLafs array. 0N/A * If the user has specified a default look and feel, use that. 0N/A * Otherwise use the look and feel that's native to this platform. 0N/A * If this code is called after the application has explicitly 0N/A * set it's look and feel, do nothing. 0N/A * @see #maybeInitialize 0N/A // Try to get default LAF from system property, then from AppContext 0N/A // (6653395), then use cross-platform one by default. 0N/A // Set any properties passed through AppContext (6653395). 0N/A /* Try to load each LookAndFeel subclass in the list. 0N/A /* If there were problems and no auxiliary look and feels were 0N/A * loaded, make sure we reset auxLookAndFeels to null. 0N/A * Otherwise, we are going to use the MultiLookAndFeel to get 0N/A * all component UI's, so we need to load it now. 0N/A * This method is called before any code that depends on the 0N/A * <code>AppContext</code> specific LAFState object runs. When the AppContext 0N/A * corresponds to a set of applets it's possible for this method 0N/A * to be re-entered, which is why we grab a lock before calling 0N/A * Only called by maybeInitialize(). 0N/A // Enable the Swing default LayoutManager. 0N/A // don't set default policy if this is XAWT. 0N/A // Install Swing's PaintEventDispatcher 0N/A // Install a hook that will be invoked if no one consumes the 0N/A // KeyEvent. If the source isn't a JComponent this will process 0N/A // key bindings, if the source is a JComponent it implies that 0N/A // processKeyEvent was already invoked and thus no need to process 0N/A // the bindings again, unless the Component is disabled, in which 0N/A // case KeyEvents will no longer be dispatched to it so that we