2362N/A * Copyright (c) 1998, 2008, 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 * A concrete implementation of {@code MetalTheme} providing 0N/A * the original look of the Java Look and Feel, code-named "Steel". Refer 0N/A * to {@link MetalLookAndFeel#setCurrentTheme} for details on changing 0N/A * the default theme. 0N/A * All colors returned by {@code DefaultMetalTheme} are completely 0N/A * <h3><a name="fontStyle"></a>Font Style</h3> 0N/A * {@code DefaultMetalTheme} uses bold fonts for many controls. To make all 0N/A * controls (with the exception of the internal frame title bars and 0N/A * client decorated frame title bars) use plain fonts you can do either of 0N/A * <li>Set the system property <code>swing.boldMetal</code> to 0N/A * <code>false</code>. For example, 0N/A * <code>java -Dswing.boldMetal=false MyApp</code>. 0N/A * <li>Set the defaults property <code>swing.boldMetal</code> to 0N/A * <code>Boolean.FALSE</code>. For example: 0N/A * <code>UIManager.put("swing.boldMetal", Boolean.FALSE);</code> 0N/A * The defaults property <code>swing.boldMetal</code>, if set, 0N/A * takes precendence over the system property of the same name. After 0N/A * setting this defaults property you need to re-install 0N/A * <code>MetalLookAndFeel</code>, as well as update the UI 0N/A * of any previously created widgets. Otherwise the results are undefined. 0N/A * The following illustrates how to do this: 0N/A * // turn off bold fonts 0N/A * UIManager.put("swing.boldMetal", Boolean.FALSE); 0N/A * // re-install the Metal Look and Feel 0N/A * UIManager.setLookAndFeel(new MetalLookAndFeel()); 0N/A * // Update the ComponentUIs for all Components. This 0N/A * // needs to be invoked for all windows. 0N/A * SwingUtilities.updateComponentTreeUI(rootComponent); 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 * @see MetalLookAndFeel 0N/A * @see MetalLookAndFeel#setCurrentTheme 0N/A * @author Steve Wilson 0N/A * Whether or not fonts should be plain. This is only used if 0N/A * the defaults property 'swing.boldMetal' == "false". 0N/A * Names of the fonts to use. 0N/A * Styles for the fonts. This is ignored if the defaults property 0N/A * <code>swing.boldMetal</code> is false, or PLAIN_FONTS is true. 0N/A * Sizes for the fonts. 0N/A 12,
12,
12,
12,
12,
10 0N/A // note the properties listed here can currently be used by people 0N/A // providing runtimes to hint what fonts are good. For example the bold 0N/A // dialog font looks bad on a Mac, so Apple could use this property to 0N/A // hint at a good font. 0N/A // However, we don't promise to support these forever. We may move 0N/A * System property names used to look up fonts. 0N/A "swing.plaf.metal.controlFont",
0N/A "swing.plaf.metal.systemFont",
0N/A "swing.plaf.metal.userFont",
0N/A "swing.plaf.metal.controlFont",
0N/A "swing.plaf.metal.controlFont",
0N/A "swing.plaf.metal.smallFont" 0N/A * Returns the ideal font name for the font identified by key. 0N/A * Returns the ideal font size for the font identified by key. 0N/A * Returns the ideal font style for the font identified by key. 0N/A // Only access the boldMetal key if a look and feel has 0N/A // been loaded, otherwise we'll trigger loading the look 0N/A * Returns the default used to look up the specified font. 0N/A * Returns the name of this theme. This returns {@code "Steel"}. 0N/A * @return the name of this theme. 0N/A * Creates and returns an instance of {@code DefaultMetalTheme}. 0N/A * Returns the primary 1 color. This returns a color with rgb values 0N/A * of 102, 102, and 153, respectively. 0N/A * @return the primary 1 color 0N/A * Returns the primary 2 color. This returns a color with rgb values 0N/A * of 153, 153, 204, respectively. 0N/A * @return the primary 2 color 0N/A * Returns the primary 3 color. This returns a color with rgb values 0N/A * 204, 204, 255, respectively. 0N/A * @return the primary 3 color 0N/A * Returns the secondary 1 color. This returns a color with rgb values 0N/A * 102, 102, and 102, respectively. 0N/A * @return the secondary 1 color 0N/A * Returns the secondary 2 color. This returns a color with rgb values 0N/A * 153, 153, and 153, respectively. 0N/A * @return the secondary 2 color 0N/A * Returns the secondary 3 color. This returns a color with rgb values 0N/A * 204, 204, and 204, respectively. 0N/A * @return the secondary 3 color 0N/A * Returns the control text font. This returns Dialog, 12pt. If 0N/A * plain fonts have been enabled as described in <a href="#fontStyle"> 0N/A * font style</a>, the font style is plain. Otherwise the font style is 0N/A * @return the control text font 0N/A * Returns the system text font. This returns Dialog, 12pt, plain. 0N/A * @return the sytem text font 0N/A * Returns the user text font. This returns Dialog, 12pt, plain. 0N/A * @return the user text font 0N/A * Returns the menu text font. This returns Dialog, 12pt. If 0N/A * plain fonts have been enabled as described in <a href="#fontStyle"> 0N/A * font style</a>, the font style is plain. Otherwise the font style is 0N/A * @return the menu text font 0N/A * Returns the window title font. This returns Dialog, 12pt, bold. 0N/A * @return the window title font 0N/A * Returns the sub-text font. This returns Dialog, 10pt, plain. 0N/A * @return the sub-text font 0N/A * Returns true if this is a theme provided by the core platform. 0N/A * FontDelegates add an extra level of indirection to obtaining fonts. 0N/A // menu and window are mapped to controlFont 0N/A * This is the same as invoking 0N/A * <code>Font.getFont(key)</code>, with the exception 0N/A * that it is wrapped inside a <code>doPrivileged</code> call. 0N/A * The WindowsFontDelegate uses DesktopProperties to obtain fonts. 0N/A // While passing null may seem bad, we don't actually use 0N/A // the table and looking it up is rather expensive.