0N/A/*
2362N/A * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
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 *
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 *
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.
0N/A *
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
2362N/A * questions.
0N/A */
0N/A
0N/Apackage javax.swing.plaf.metal;
0N/A
0N/Aimport java.awt.*;
0N/Aimport java.beans.PropertyChangeEvent;
0N/Aimport java.beans.PropertyChangeListener;
0N/Aimport javax.swing.plaf.*;
0N/Aimport javax.swing.*;
0N/Aimport javax.swing.plaf.basic.*;
0N/Aimport javax.swing.text.DefaultEditorKit;
0N/A
0N/Aimport java.awt.Color;
0N/Aimport java.awt.event.KeyEvent;
0N/Aimport java.lang.reflect.*;
0N/Aimport java.lang.ref.ReferenceQueue;
0N/Aimport java.lang.ref.WeakReference;
0N/A
0N/Aimport java.security.AccessController;
0N/Aimport java.security.PrivilegedAction;
0N/A
0N/Aimport sun.awt.*;
0N/Aimport sun.security.action.GetPropertyAction;
0N/Aimport sun.swing.DefaultLayoutStyle;
0N/Aimport sun.swing.SwingLazyValue;
0N/Aimport sun.swing.SwingUtilities2;
0N/A
0N/A/**
0N/A * The Java Look and Feel, otherwise known as Metal.
0N/A * <p>
0N/A * Each of the {@code ComponentUI}s provided by {@code
0N/A * MetalLookAndFeel} derives its behavior from the defaults
0N/A * table. Unless otherwise noted each of the {@code ComponentUI}
0N/A * implementations in this package document the set of defaults they
0N/A * use. Unless otherwise noted the defaults are installed at the time
0N/A * {@code installUI} is invoked, and follow the recommendations
0N/A * outlined in {@code LookAndFeel} for installing defaults.
0N/A * <p>
0N/A * {@code MetalLookAndFeel} derives it's color palette and fonts from
0N/A * {@code MetalTheme}. The default theme is {@code OceanTheme}. The theme
0N/A * can be changed using the {@code setCurrentTheme} method, refer to it
0N/A * for details on changing the theme. Prior to 1.5 the default
0N/A * theme was {@code DefaultMetalTheme}. The system property
0N/A * {@code "swing.metalTheme"} can be set to {@code "steel"} to indicate
0N/A * the default should be {@code DefaultMetalTheme}.
0N/A * <p>
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 * Please see {@link java.beans.XMLEncoder}.
0N/A *
0N/A * @see MetalTheme
0N/A * @see DefaultMetalTheme
0N/A * @see OceanTheme
0N/A *
0N/A * @author Steve Wilson
0N/A */
0N/Apublic class MetalLookAndFeel extends BasicLookAndFeel
0N/A{
0N/A
0N/A private static boolean METAL_LOOK_AND_FEEL_INITED = false;
0N/A
0N/A
0N/A /**
0N/A * True if checked for windows yet.
0N/A */
0N/A private static boolean checkedWindows;
0N/A /**
0N/A * True if running on Windows.
0N/A */
0N/A private static boolean isWindows;
0N/A
0N/A /**
0N/A * Set to true first time we've checked swing.useSystemFontSettings.
0N/A */
0N/A private static boolean checkedSystemFontSettings;
0N/A
0N/A /**
0N/A * True indicates we should use system fonts, unless the developer has
0N/A * specified otherwise with Application.useSystemFontSettings.
0N/A */
0N/A private static boolean useSystemFonts;
0N/A
0N/A
0N/A /**
0N/A * Returns true if running on Windows.
0N/A */
0N/A static boolean isWindows() {
0N/A if (!checkedWindows) {
0N/A OSInfo.OSType osType = AccessController.doPrivileged(OSInfo.getOSTypeAction());
0N/A if (osType == OSInfo.OSType.WINDOWS) {
0N/A isWindows = true;
0N/A String systemFonts = AccessController.doPrivileged(
0N/A new GetPropertyAction("swing.useSystemFontSettings"));
0N/A useSystemFonts = (systemFonts != null &&
0N/A (Boolean.valueOf(systemFonts).booleanValue()));
0N/A }
0N/A checkedWindows = true;
0N/A }
0N/A return isWindows;
0N/A }
0N/A
0N/A /**
0N/A * Returns true if system fonts should be used, this is only useful
0N/A * for windows.
0N/A */
0N/A static boolean useSystemFonts() {
0N/A if (isWindows() && useSystemFonts) {
0N/A if (METAL_LOOK_AND_FEEL_INITED) {
0N/A Object value = UIManager.get(
0N/A "Application.useSystemFontSettings");
0N/A
0N/A return (value == null || Boolean.TRUE.equals(value));
0N/A }
0N/A // If an instanceof MetalLookAndFeel hasn't been inited yet, we
0N/A // don't want to trigger loading of a UI by asking the UIManager
0N/A // for a property, assume the user wants system fonts. This will
0N/A // be properly adjusted when install is invoked on the
0N/A // MetalTheme
0N/A return true;
0N/A }
0N/A return false;
0N/A }
0N/A
0N/A /**
0N/A * Returns true if the high contrast theme should be used as the default
0N/A * theme.
0N/A */
0N/A private static boolean useHighContrastTheme() {
0N/A if (isWindows() && useSystemFonts()) {
0N/A Boolean highContrast = (Boolean)Toolkit.getDefaultToolkit().
0N/A getDesktopProperty("win.highContrast.on");
0N/A
0N/A return (highContrast == null) ? false : highContrast.
0N/A booleanValue();
0N/A }
0N/A return false;
0N/A }
0N/A
0N/A /**
0N/A * Returns true if we're using the Ocean Theme.
0N/A */
0N/A static boolean usingOcean() {
0N/A return (getCurrentTheme() instanceof OceanTheme);
0N/A }
0N/A
0N/A /**
0N/A * Returns the name of this look and feel. This returns
0N/A * {@code "Metal"}.
0N/A *
0N/A * @return the name of this look and feel
0N/A */
0N/A public String getName() {
0N/A return "Metal";
0N/A }
0N/A
0N/A /**
0N/A * Returns an identifier for this look and feel. This returns
0N/A * {@code "Metal"}.
0N/A *
0N/A * @return the identifier of this look and feel
0N/A */
0N/A public String getID() {
0N/A return "Metal";
0N/A }
0N/A
0N/A /**
0N/A * Returns a short description of this look and feel. This returns
0N/A * {@code "The Java(tm) Look and Feel"}.
0N/A
0N/A * @return a short description for the look and feel
0N/A */
0N/A public String getDescription() {
0N/A return "The Java(tm) Look and Feel";
0N/A }
0N/A
0N/A /**
0N/A * Returns {@code false}; {@code MetalLookAndFeel} is not a native
0N/A * look and feel.
0N/A *
0N/A * @return {@code false}
0N/A */
0N/A public boolean isNativeLookAndFeel() {
0N/A return false;
0N/A }
0N/A
0N/A /**
0N/A * Returns {@code true}; {@code MetalLookAndFeel} can be run on
0N/A * any platform.
0N/A *
0N/A * @return {@code true}
0N/A */
0N/A public boolean isSupportedLookAndFeel() {
0N/A return true;
0N/A }
0N/A
0N/A /**
0N/A * Returns {@code true}; metal can provide {@code Window}
0N/A * decorations.
0N/A *
0N/A * @return {@code true}
0N/A *
0N/A * @see JDialog#setDefaultLookAndFeelDecorated
0N/A * @see JFrame#setDefaultLookAndFeelDecorated
0N/A * @see JRootPane#setWindowDecorationStyle
0N/A * @since 1.4
0N/A */
0N/A public boolean getSupportsWindowDecorations() {
0N/A return true;
0N/A }
0N/A
0N/A /**
0N/A * Populates {@code table} with mappings from {@code uiClassID} to
0N/A * the fully qualified name of the ui class. {@code
0N/A * MetalLookAndFeel} registers an entry for each of the classes in
0N/A * the package {@code javax.swing.plaf.metal} that are named
0N/A * MetalXXXUI. The string {@code XXX} is one of Swing's uiClassIDs. For
0N/A * the {@code uiClassIDs} that do not have a class in metal, the
0N/A * corresponding class in {@code javax.swing.plaf.basic} is
0N/A * used. For example, metal does not have a class named {@code
0N/A * "MetalColorChooserUI"}, as such, {@code
0N/A * javax.swing.plaf.basic.BasicColorChooserUI} is used.
0N/A *
0N/A * @param table the {@code UIDefaults} instance the entries are
0N/A * added to
0N/A * @throws NullPointerException if {@code table} is {@code null}
0N/A *
0N/A * @see javax.swing.plaf.basic.BasicLookAndFeel#initClassDefaults
0N/A */
0N/A protected void initClassDefaults(UIDefaults table)
0N/A {
0N/A super.initClassDefaults(table);
0N/A final String metalPackageName = "javax.swing.plaf.metal.";
0N/A
0N/A Object[] uiDefaults = {
0N/A "ButtonUI", metalPackageName + "MetalButtonUI",
0N/A "CheckBoxUI", metalPackageName + "MetalCheckBoxUI",
0N/A "ComboBoxUI", metalPackageName + "MetalComboBoxUI",
0N/A "DesktopIconUI", metalPackageName + "MetalDesktopIconUI",
0N/A "FileChooserUI", metalPackageName + "MetalFileChooserUI",
0N/A "InternalFrameUI", metalPackageName + "MetalInternalFrameUI",
0N/A "LabelUI", metalPackageName + "MetalLabelUI",
0N/A "PopupMenuSeparatorUI", metalPackageName + "MetalPopupMenuSeparatorUI",
0N/A "ProgressBarUI", metalPackageName + "MetalProgressBarUI",
0N/A "RadioButtonUI", metalPackageName + "MetalRadioButtonUI",
0N/A "ScrollBarUI", metalPackageName + "MetalScrollBarUI",
0N/A "ScrollPaneUI", metalPackageName + "MetalScrollPaneUI",
0N/A "SeparatorUI", metalPackageName + "MetalSeparatorUI",
0N/A "SliderUI", metalPackageName + "MetalSliderUI",
0N/A "SplitPaneUI", metalPackageName + "MetalSplitPaneUI",
0N/A "TabbedPaneUI", metalPackageName + "MetalTabbedPaneUI",
0N/A "TextFieldUI", metalPackageName + "MetalTextFieldUI",
0N/A "ToggleButtonUI", metalPackageName + "MetalToggleButtonUI",
0N/A "ToolBarUI", metalPackageName + "MetalToolBarUI",
0N/A "ToolTipUI", metalPackageName + "MetalToolTipUI",
0N/A "TreeUI", metalPackageName + "MetalTreeUI",
0N/A "RootPaneUI", metalPackageName + "MetalRootPaneUI",
0N/A };
0N/A
0N/A table.putDefaults(uiDefaults);
0N/A }
0N/A
0N/A /**
0N/A * Populates {@code table} with system colors. The following values are
0N/A * added to {@code table}:
0N/A * <table border="1" cellpadding="1" cellspacing="0"
0N/A * summary="Metal's system color mapping"
0N/A * valign="top" >
0N/A * <tr valign="top" align="left">
0N/A * <th bgcolor="#CCCCFF" align="left">Key
0N/A * <th bgcolor="#CCCCFF" align="left">Value
0N/A * <tr valign="top" align="left">
0N/A * <td>"desktop"
0N/A * <td>{@code theme.getDesktopColor()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"activeCaption"
0N/A * <td>{@code theme.getWindowTitleBackground()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"activeCaptionText"
0N/A * <td>{@code theme.getWindowTitleForeground()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"activeCaptionBorder"
0N/A * <td>{@code theme.getPrimaryControlShadow()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"inactiveCaption"
0N/A * <td>{@code theme.getWindowTitleInactiveBackground()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"inactiveCaptionText"
0N/A * <td>{@code theme.getWindowTitleInactiveForeground()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"inactiveCaptionBorder"
0N/A * <td>{@code theme.getControlShadow()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"window"
0N/A * <td>{@code theme.getWindowBackground()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"windowBorder"
0N/A * <td>{@code theme.getControl()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"windowText"
0N/A * <td>{@code theme.getUserTextColor()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"menu"
0N/A * <td>{@code theme.getMenuBackground()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"menuText"
0N/A * <td>{@code theme.getMenuForeground()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"text"
0N/A * <td>{@code theme.getWindowBackground()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"textText"
0N/A * <td>{@code theme.getUserTextColor()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"textHighlight"
0N/A * <td>{@code theme.getTextHighlightColor()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"textHighlightText"
0N/A * <td>{@code theme.getHighlightedTextColor()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"textInactiveText"
0N/A * <td>{@code theme.getInactiveSystemTextColor()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"control"
0N/A * <td>{@code theme.getControl()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"controlText"
0N/A * <td>{@code theme.getControlTextColor()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"controlHighlight"
0N/A * <td>{@code theme.getControlHighlight()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"controlLtHighlight"
0N/A * <td>{@code theme.getControlHighlight()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"controlShadow"
0N/A * <td>{@code theme.getControlShadow()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"controlDkShadow"
0N/A * <td>{@code theme.getControlDarkShadow()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"scrollbar"
0N/A * <td>{@code theme.getControl()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"info"
0N/A * <td>{@code theme.getPrimaryControl()}
0N/A * <tr valign="top" align="left">
0N/A * <td>"infoText"
0N/A * <td>{@code theme.getPrimaryControlInfo()}
0N/A * </table>
0N/A * The value {@code theme} corresponds to the current {@code MetalTheme}.
0N/A *
0N/A * @param table the {@code UIDefaults} object the values are added to
0N/A * @throws NullPointerException if {@code table} is {@code null}
0N/A */
0N/A protected void initSystemColorDefaults(UIDefaults table)
0N/A {
0N/A MetalTheme theme = getCurrentTheme();
0N/A Color control = theme.getControl();
0N/A Object[] systemColors = {
0N/A "desktop", theme.getDesktopColor(), /* Color of the desktop background */
0N/A "activeCaption", theme.getWindowTitleBackground(), /* Color for captions (title bars) when they are active. */
0N/A "activeCaptionText", theme.getWindowTitleForeground(), /* Text color for text in captions (title bars). */
0N/A "activeCaptionBorder", theme.getPrimaryControlShadow(), /* Border color for caption (title bar) window borders. */
0N/A "inactiveCaption", theme.getWindowTitleInactiveBackground(), /* Color for captions (title bars) when not active. */
0N/A "inactiveCaptionText", theme.getWindowTitleInactiveForeground(), /* Text color for text in inactive captions (title bars). */
0N/A "inactiveCaptionBorder", theme.getControlShadow(), /* Border color for inactive caption (title bar) window borders. */
0N/A "window", theme.getWindowBackground(), /* Default color for the interior of windows */
0N/A "windowBorder", control, /* ??? */
0N/A "windowText", theme.getUserTextColor(), /* ??? */
0N/A "menu", theme.getMenuBackground(), /* Background color for menus */
0N/A "menuText", theme.getMenuForeground(), /* Text color for menus */
0N/A "text", theme.getWindowBackground(), /* Text background color */
0N/A "textText", theme.getUserTextColor(), /* Text foreground color */
0N/A "textHighlight", theme.getTextHighlightColor(), /* Text background color when selected */
0N/A "textHighlightText", theme.getHighlightedTextColor(), /* Text color when selected */
0N/A "textInactiveText", theme.getInactiveSystemTextColor(), /* Text color when disabled */
0N/A "control", control, /* Default color for controls (buttons, sliders, etc) */
0N/A "controlText", theme.getControlTextColor(), /* Default color for text in controls */
0N/A "controlHighlight", theme.getControlHighlight(), /* Specular highlight (opposite of the shadow) */
0N/A "controlLtHighlight", theme.getControlHighlight(), /* Highlight color for controls */
0N/A "controlShadow", theme.getControlShadow(), /* Shadow color for controls */
0N/A "controlDkShadow", theme.getControlDarkShadow(), /* Dark shadow color for controls */
0N/A "scrollbar", control, /* Scrollbar background (usually the "track") */
0N/A "info", theme.getPrimaryControl(), /* ToolTip Background */
0N/A "infoText", theme.getPrimaryControlInfo() /* ToolTip Text */
0N/A };
0N/A
0N/A table.putDefaults(systemColors);
0N/A }
0N/A
0N/A /**
0N/A * Initialize the defaults table with the name of the ResourceBundle
0N/A * used for getting localized defaults.
0N/A */
0N/A private void initResourceBundle(UIDefaults table) {
0N/A table.addResourceBundle( "com.sun.swing.internal.plaf.metal.resources.metal" );
0N/A }
0N/A
0N/A /**
0N/A * Populates {@code table} with the defaults for metal.
0N/A *
0N/A * @param table the {@code UIDefaults} to add the values to
0N/A * @throws NullPointerException if {@code table} is {@code null}
0N/A */
0N/A protected void initComponentDefaults(UIDefaults table) {
0N/A super.initComponentDefaults( table );
0N/A
0N/A initResourceBundle(table);
0N/A
0N/A Color acceleratorForeground = getAcceleratorForeground();
0N/A Color acceleratorSelectedForeground = getAcceleratorSelectedForeground();
0N/A Color control = getControl();
0N/A Color controlHighlight = getControlHighlight();
0N/A Color controlShadow = getControlShadow();
0N/A Color controlDarkShadow = getControlDarkShadow();
0N/A Color controlTextColor = getControlTextColor();
0N/A Color focusColor = getFocusColor();
0N/A Color inactiveControlTextColor = getInactiveControlTextColor();
0N/A Color menuBackground = getMenuBackground();
0N/A Color menuSelectedBackground = getMenuSelectedBackground();
0N/A Color menuDisabledForeground = getMenuDisabledForeground();
0N/A Color menuSelectedForeground = getMenuSelectedForeground();
0N/A Color primaryControl = getPrimaryControl();
0N/A Color primaryControlDarkShadow = getPrimaryControlDarkShadow();
0N/A Color primaryControlShadow = getPrimaryControlShadow();
0N/A Color systemTextColor = getSystemTextColor();
0N/A
0N/A Insets zeroInsets = new InsetsUIResource(0, 0, 0, 0);
0N/A
215N/A Integer zero = Integer.valueOf(0);
0N/A
0N/A Object textFieldBorder =
0N/A new SwingLazyValue("javax.swing.plaf.metal.MetalBorders",
0N/A "getTextFieldBorder");
0N/A
0N/A Object dialogBorder = new MetalLazyValue(
0N/A "javax.swing.plaf.metal.MetalBorders$DialogBorder");
0N/A
0N/A Object questionDialogBorder = new MetalLazyValue(
0N/A "javax.swing.plaf.metal.MetalBorders$QuestionDialogBorder");
0N/A
0N/A Object fieldInputMap = new UIDefaults.LazyInputMap(new Object[] {
0N/A "ctrl C", DefaultEditorKit.copyAction,
0N/A "ctrl V", DefaultEditorKit.pasteAction,
0N/A "ctrl X", DefaultEditorKit.cutAction,
0N/A "COPY", DefaultEditorKit.copyAction,
0N/A "PASTE", DefaultEditorKit.pasteAction,
0N/A "CUT", DefaultEditorKit.cutAction,
0N/A "control INSERT", DefaultEditorKit.copyAction,
0N/A "shift INSERT", DefaultEditorKit.pasteAction,
0N/A "shift DELETE", DefaultEditorKit.cutAction,
0N/A "shift LEFT", DefaultEditorKit.selectionBackwardAction,
0N/A "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction,
0N/A "shift RIGHT", DefaultEditorKit.selectionForwardAction,
0N/A "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction,
0N/A "ctrl LEFT", DefaultEditorKit.previousWordAction,
0N/A "ctrl KP_LEFT", DefaultEditorKit.previousWordAction,
0N/A "ctrl RIGHT", DefaultEditorKit.nextWordAction,
0N/A "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction,
0N/A "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
0N/A "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction,
0N/A "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction,
0N/A "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction,
0N/A "ctrl A", DefaultEditorKit.selectAllAction,
0N/A "HOME", DefaultEditorKit.beginLineAction,
0N/A "END", DefaultEditorKit.endLineAction,
0N/A "shift HOME", DefaultEditorKit.selectionBeginLineAction,
0N/A "shift END", DefaultEditorKit.selectionEndLineAction,
0N/A "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
0N/A "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
0N/A "ctrl H", DefaultEditorKit.deletePrevCharAction,
0N/A "DELETE", DefaultEditorKit.deleteNextCharAction,
0N/A "ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
0N/A "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
0N/A "RIGHT", DefaultEditorKit.forwardAction,
0N/A "LEFT", DefaultEditorKit.backwardAction,
0N/A "KP_RIGHT", DefaultEditorKit.forwardAction,
0N/A "KP_LEFT", DefaultEditorKit.backwardAction,
0N/A "ENTER", JTextField.notifyAction,
0N/A "ctrl BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
0N/A "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
0N/A });
0N/A
0N/A Object passwordInputMap = new UIDefaults.LazyInputMap(new Object[] {
0N/A "ctrl C", DefaultEditorKit.copyAction,
0N/A "ctrl V", DefaultEditorKit.pasteAction,
0N/A "ctrl X", DefaultEditorKit.cutAction,
0N/A "COPY", DefaultEditorKit.copyAction,
0N/A "PASTE", DefaultEditorKit.pasteAction,
0N/A "CUT", DefaultEditorKit.cutAction,
0N/A "control INSERT", DefaultEditorKit.copyAction,
0N/A "shift INSERT", DefaultEditorKit.pasteAction,
0N/A "shift DELETE", DefaultEditorKit.cutAction,
0N/A "shift LEFT", DefaultEditorKit.selectionBackwardAction,
0N/A "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction,
0N/A "shift RIGHT", DefaultEditorKit.selectionForwardAction,
0N/A "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction,
0N/A "ctrl LEFT", DefaultEditorKit.beginLineAction,
0N/A "ctrl KP_LEFT", DefaultEditorKit.beginLineAction,
0N/A "ctrl RIGHT", DefaultEditorKit.endLineAction,
0N/A "ctrl KP_RIGHT", DefaultEditorKit.endLineAction,
0N/A "ctrl shift LEFT", DefaultEditorKit.selectionBeginLineAction,
0N/A "ctrl shift KP_LEFT", DefaultEditorKit.selectionBeginLineAction,
0N/A "ctrl shift RIGHT", DefaultEditorKit.selectionEndLineAction,
0N/A "ctrl shift KP_RIGHT", DefaultEditorKit.selectionEndLineAction,
0N/A "ctrl A", DefaultEditorKit.selectAllAction,
0N/A "HOME", DefaultEditorKit.beginLineAction,
0N/A "END", DefaultEditorKit.endLineAction,
0N/A "shift HOME", DefaultEditorKit.selectionBeginLineAction,
0N/A "shift END", DefaultEditorKit.selectionEndLineAction,
0N/A "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
0N/A "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
0N/A "ctrl H", DefaultEditorKit.deletePrevCharAction,
0N/A "DELETE", DefaultEditorKit.deleteNextCharAction,
0N/A "RIGHT", DefaultEditorKit.forwardAction,
0N/A "LEFT", DefaultEditorKit.backwardAction,
0N/A "KP_RIGHT", DefaultEditorKit.forwardAction,
0N/A "KP_LEFT", DefaultEditorKit.backwardAction,
0N/A "ENTER", JTextField.notifyAction,
0N/A "ctrl BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
0N/A "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
0N/A });
0N/A
0N/A Object multilineInputMap = new UIDefaults.LazyInputMap(new Object[] {
0N/A "ctrl C", DefaultEditorKit.copyAction,
0N/A "ctrl V", DefaultEditorKit.pasteAction,
0N/A "ctrl X", DefaultEditorKit.cutAction,
0N/A "COPY", DefaultEditorKit.copyAction,
0N/A "PASTE", DefaultEditorKit.pasteAction,
0N/A "CUT", DefaultEditorKit.cutAction,
0N/A "control INSERT", DefaultEditorKit.copyAction,
0N/A "shift INSERT", DefaultEditorKit.pasteAction,
0N/A "shift DELETE", DefaultEditorKit.cutAction,
0N/A "shift LEFT", DefaultEditorKit.selectionBackwardAction,
0N/A "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction,
0N/A "shift RIGHT", DefaultEditorKit.selectionForwardAction,
0N/A "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction,
0N/A "ctrl LEFT", DefaultEditorKit.previousWordAction,
0N/A "ctrl KP_LEFT", DefaultEditorKit.previousWordAction,
0N/A "ctrl RIGHT", DefaultEditorKit.nextWordAction,
0N/A "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction,
0N/A "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
0N/A "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction,
0N/A "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction,
0N/A "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction,
0N/A "ctrl A", DefaultEditorKit.selectAllAction,
0N/A "HOME", DefaultEditorKit.beginLineAction,
0N/A "END", DefaultEditorKit.endLineAction,
0N/A "shift HOME", DefaultEditorKit.selectionBeginLineAction,
0N/A "shift END", DefaultEditorKit.selectionEndLineAction,
0N/A
0N/A "UP", DefaultEditorKit.upAction,
0N/A "KP_UP", DefaultEditorKit.upAction,
0N/A "DOWN", DefaultEditorKit.downAction,
0N/A "KP_DOWN", DefaultEditorKit.downAction,
0N/A "PAGE_UP", DefaultEditorKit.pageUpAction,
0N/A "PAGE_DOWN", DefaultEditorKit.pageDownAction,
0N/A "shift PAGE_UP", "selection-page-up",
0N/A "shift PAGE_DOWN", "selection-page-down",
0N/A "ctrl shift PAGE_UP", "selection-page-left",
0N/A "ctrl shift PAGE_DOWN", "selection-page-right",
0N/A "shift UP", DefaultEditorKit.selectionUpAction,
0N/A "shift KP_UP", DefaultEditorKit.selectionUpAction,
0N/A "shift DOWN", DefaultEditorKit.selectionDownAction,
0N/A "shift KP_DOWN", DefaultEditorKit.selectionDownAction,
0N/A "ENTER", DefaultEditorKit.insertBreakAction,
0N/A "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
0N/A "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
0N/A "ctrl H", DefaultEditorKit.deletePrevCharAction,
0N/A "DELETE", DefaultEditorKit.deleteNextCharAction,
0N/A "ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
0N/A "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
0N/A "RIGHT", DefaultEditorKit.forwardAction,
0N/A "LEFT", DefaultEditorKit.backwardAction,
0N/A "KP_RIGHT", DefaultEditorKit.forwardAction,
0N/A "KP_LEFT", DefaultEditorKit.backwardAction,
0N/A "TAB", DefaultEditorKit.insertTabAction,
0N/A "ctrl BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
0N/A "ctrl HOME", DefaultEditorKit.beginAction,
0N/A "ctrl END", DefaultEditorKit.endAction,
0N/A "ctrl shift HOME", DefaultEditorKit.selectionBeginAction,
0N/A "ctrl shift END", DefaultEditorKit.selectionEndAction,
0N/A "ctrl T", "next-link-action",
0N/A "ctrl shift T", "previous-link-action",
0N/A "ctrl SPACE", "activate-link-action",
0N/A "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
0N/A });
0N/A
0N/A Object scrollPaneBorder = new SwingLazyValue("javax.swing.plaf.metal.MetalBorders$ScrollPaneBorder");
0N/A Object buttonBorder =
0N/A new SwingLazyValue("javax.swing.plaf.metal.MetalBorders",
0N/A "getButtonBorder");
0N/A
0N/A Object toggleButtonBorder =
0N/A new SwingLazyValue("javax.swing.plaf.metal.MetalBorders",
0N/A "getToggleButtonBorder");
0N/A
0N/A Object titledBorderBorder =
0N/A new SwingLazyValue(
0N/A "javax.swing.plaf.BorderUIResource$LineBorderUIResource",
0N/A new Object[] {controlShadow});
0N/A
0N/A Object desktopIconBorder =
0N/A new SwingLazyValue(
0N/A "javax.swing.plaf.metal.MetalBorders",
0N/A "getDesktopIconBorder");
0N/A
0N/A Object menuBarBorder =
0N/A new SwingLazyValue(
0N/A "javax.swing.plaf.metal.MetalBorders$MenuBarBorder");
0N/A
0N/A Object popupMenuBorder =
0N/A new SwingLazyValue(
0N/A "javax.swing.plaf.metal.MetalBorders$PopupMenuBorder");
0N/A Object menuItemBorder =
0N/A new SwingLazyValue(
0N/A "javax.swing.plaf.metal.MetalBorders$MenuItemBorder");
0N/A
0N/A Object menuItemAcceleratorDelimiter = "-";
0N/A Object toolBarBorder = new SwingLazyValue("javax.swing.plaf.metal.MetalBorders$ToolBarBorder");
0N/A
0N/A Object progressBarBorder = new SwingLazyValue(
0N/A "javax.swing.plaf.BorderUIResource$LineBorderUIResource",
0N/A new Object[] {controlDarkShadow, new Integer(1)});
0N/A
0N/A Object toolTipBorder = new SwingLazyValue(
0N/A "javax.swing.plaf.BorderUIResource$LineBorderUIResource",
0N/A new Object[] {primaryControlDarkShadow});
0N/A
0N/A Object toolTipBorderInactive = new SwingLazyValue(
0N/A "javax.swing.plaf.BorderUIResource$LineBorderUIResource",
0N/A new Object[] {controlDarkShadow});
0N/A
0N/A Object focusCellHighlightBorder = new SwingLazyValue(
0N/A "javax.swing.plaf.BorderUIResource$LineBorderUIResource",
0N/A new Object[] {focusColor});
0N/A
0N/A Object tabbedPaneTabAreaInsets = new InsetsUIResource(4, 2, 0, 6);
0N/A
0N/A Object tabbedPaneTabInsets = new InsetsUIResource(0, 9, 1, 9);
0N/A
0N/A final Object[] internalFrameIconArgs = new Object[1];
0N/A internalFrameIconArgs[0] = new Integer(16);
0N/A
0N/A Object[] defaultCueList = new Object[] {
0N/A "OptionPane.errorSound",
0N/A "OptionPane.informationSound",
0N/A "OptionPane.questionSound",
0N/A "OptionPane.warningSound" };
0N/A
0N/A MetalTheme theme = getCurrentTheme();
0N/A Object menuTextValue = new FontActiveValue(theme,
0N/A MetalTheme.MENU_TEXT_FONT);
0N/A Object controlTextValue = new FontActiveValue(theme,
0N/A MetalTheme.CONTROL_TEXT_FONT);
0N/A Object userTextValue = new FontActiveValue(theme,
0N/A MetalTheme.USER_TEXT_FONT);
0N/A Object windowTitleValue = new FontActiveValue(theme,
0N/A MetalTheme.WINDOW_TITLE_FONT);
0N/A Object subTextValue = new FontActiveValue(theme,
0N/A MetalTheme.SUB_TEXT_FONT);
0N/A Object systemTextValue = new FontActiveValue(theme,
0N/A MetalTheme.SYSTEM_TEXT_FONT);
0N/A //
0N/A // DEFAULTS TABLE
0N/A //
0N/A
0N/A Object[] defaults = {
0N/A // *** Auditory Feedback
0N/A "AuditoryCues.defaultCueList", defaultCueList,
0N/A // this key defines which of the various cues to render
0N/A // This is disabled until sound bugs can be resolved.
0N/A "AuditoryCues.playList", null, // defaultCueList,
0N/A
0N/A // Text (Note: many are inherited)
0N/A "TextField.border", textFieldBorder,
0N/A "TextField.font", userTextValue,
0N/A
0N/A "PasswordField.border", textFieldBorder,
0N/A // passwordField.font should actually map to
0N/A // win.ansiFixed.font.height on windows.
0N/A "PasswordField.font", userTextValue,
0N/A "PasswordField.echoChar", (char)0x2022,
0N/A
0N/A // TextArea.font should actually map to win.ansiFixed.font.height
0N/A // on windows.
0N/A "TextArea.font", userTextValue,
0N/A
0N/A "TextPane.background", table.get("window"),
0N/A "TextPane.font", userTextValue,
0N/A
0N/A "EditorPane.background", table.get("window"),
0N/A "EditorPane.font", userTextValue,
0N/A
0N/A "TextField.focusInputMap", fieldInputMap,
0N/A "PasswordField.focusInputMap", passwordInputMap,
0N/A "TextArea.focusInputMap", multilineInputMap,
0N/A "TextPane.focusInputMap", multilineInputMap,
0N/A "EditorPane.focusInputMap", multilineInputMap,
0N/A
0N/A // FormattedTextFields
0N/A "FormattedTextField.border", textFieldBorder,
0N/A "FormattedTextField.font", userTextValue,
0N/A "FormattedTextField.focusInputMap",
0N/A new UIDefaults.LazyInputMap(new Object[] {
0N/A "ctrl C", DefaultEditorKit.copyAction,
0N/A "ctrl V", DefaultEditorKit.pasteAction,
0N/A "ctrl X", DefaultEditorKit.cutAction,
0N/A "COPY", DefaultEditorKit.copyAction,
0N/A "PASTE", DefaultEditorKit.pasteAction,
0N/A "CUT", DefaultEditorKit.cutAction,
0N/A "control INSERT", DefaultEditorKit.copyAction,
0N/A "shift INSERT", DefaultEditorKit.pasteAction,
0N/A "shift DELETE", DefaultEditorKit.cutAction,
0N/A "shift LEFT", DefaultEditorKit.selectionBackwardAction,
0N/A "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction,
0N/A "shift RIGHT", DefaultEditorKit.selectionForwardAction,
0N/A "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction,
0N/A "ctrl LEFT", DefaultEditorKit.previousWordAction,
0N/A "ctrl KP_LEFT", DefaultEditorKit.previousWordAction,
0N/A "ctrl RIGHT", DefaultEditorKit.nextWordAction,
0N/A "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction,
0N/A "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
0N/A "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction,
0N/A "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction,
0N/A "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction,
0N/A "ctrl A", DefaultEditorKit.selectAllAction,
0N/A "HOME", DefaultEditorKit.beginLineAction,
0N/A "END", DefaultEditorKit.endLineAction,
0N/A "shift HOME", DefaultEditorKit.selectionBeginLineAction,
0N/A "shift END", DefaultEditorKit.selectionEndLineAction,
0N/A "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
0N/A "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
0N/A "ctrl H", DefaultEditorKit.deletePrevCharAction,
0N/A "DELETE", DefaultEditorKit.deleteNextCharAction,
0N/A "ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
0N/A "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
0N/A "RIGHT", DefaultEditorKit.forwardAction,
0N/A "LEFT", DefaultEditorKit.backwardAction,
0N/A "KP_RIGHT", DefaultEditorKit.forwardAction,
0N/A "KP_LEFT", DefaultEditorKit.backwardAction,
0N/A "ENTER", JTextField.notifyAction,
0N/A "ctrl BACK_SLASH", "unselect",
0N/A "control shift O", "toggle-componentOrientation",
0N/A "ESCAPE", "reset-field-edit",
0N/A "UP", "increment",
0N/A "KP_UP", "increment",
0N/A "DOWN", "decrement",
0N/A "KP_DOWN", "decrement",
0N/A }),
0N/A
0N/A
0N/A // Buttons
0N/A "Button.defaultButtonFollowsFocus", Boolean.FALSE,
0N/A "Button.disabledText", inactiveControlTextColor,
0N/A "Button.select", controlShadow,
0N/A "Button.border", buttonBorder,
0N/A "Button.font", controlTextValue,
0N/A "Button.focus", focusColor,
0N/A "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
0N/A "SPACE", "pressed",
0N/A "released SPACE", "released"
0N/A }),
0N/A
0N/A "CheckBox.disabledText", inactiveControlTextColor,
0N/A "Checkbox.select", controlShadow,
0N/A "CheckBox.font", controlTextValue,
0N/A "CheckBox.focus", focusColor,
0N/A "CheckBox.icon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getCheckBoxIcon"),
0N/A "CheckBox.focusInputMap",
0N/A new UIDefaults.LazyInputMap(new Object[] {
0N/A "SPACE", "pressed",
0N/A "released SPACE", "released"
0N/A }),
0N/A // margin is 2 all the way around, BasicBorders.RadioButtonBorder
0N/A // (checkbox uses RadioButtonBorder) is 2 all the way around too.
0N/A "CheckBox.totalInsets", new Insets(4, 4, 4, 4),
0N/A
0N/A "RadioButton.disabledText", inactiveControlTextColor,
0N/A "RadioButton.select", controlShadow,
0N/A "RadioButton.icon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getRadioButtonIcon"),
0N/A "RadioButton.font", controlTextValue,
0N/A "RadioButton.focus", focusColor,
0N/A "RadioButton.focusInputMap",
0N/A new UIDefaults.LazyInputMap(new Object[] {
0N/A "SPACE", "pressed",
0N/A "released SPACE", "released"
0N/A }),
0N/A // margin is 2 all the way around, BasicBorders.RadioButtonBorder
0N/A // is 2 all the way around too.
0N/A "RadioButton.totalInsets", new Insets(4, 4, 4, 4),
0N/A
0N/A "ToggleButton.select", controlShadow,
0N/A "ToggleButton.disabledText", inactiveControlTextColor,
0N/A "ToggleButton.focus", focusColor,
0N/A "ToggleButton.border", toggleButtonBorder,
0N/A "ToggleButton.font", controlTextValue,
0N/A "ToggleButton.focusInputMap",
0N/A new UIDefaults.LazyInputMap(new Object[] {
0N/A "SPACE", "pressed",
0N/A "released SPACE", "released"
0N/A }),
0N/A
0N/A
0N/A // File View
0N/A "FileView.directoryIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getTreeFolderIcon"),
0N/A "FileView.fileIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getTreeLeafIcon"),
0N/A "FileView.computerIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getTreeComputerIcon"),
0N/A "FileView.hardDriveIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getTreeHardDriveIcon"),
0N/A "FileView.floppyDriveIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getTreeFloppyDriveIcon"),
0N/A
0N/A // File Chooser
0N/A "FileChooser.detailsViewIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getFileChooserDetailViewIcon"),
0N/A "FileChooser.homeFolderIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getFileChooserHomeFolderIcon"),
0N/A "FileChooser.listViewIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getFileChooserListViewIcon"),
0N/A "FileChooser.newFolderIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getFileChooserNewFolderIcon"),
0N/A "FileChooser.upFolderIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getFileChooserUpFolderIcon"),
0N/A
0N/A "FileChooser.usesSingleFilePane", Boolean.TRUE,
0N/A "FileChooser.ancestorInputMap",
0N/A new UIDefaults.LazyInputMap(new Object[] {
0N/A "ESCAPE", "cancelSelection",
0N/A "F2", "editFileName",
0N/A "F5", "refresh",
346N/A "BACK_SPACE", "Go Up"
0N/A }),
0N/A
0N/A
0N/A // ToolTip
0N/A "ToolTip.font", systemTextValue,
0N/A "ToolTip.border", toolTipBorder,
0N/A "ToolTip.borderInactive", toolTipBorderInactive,
0N/A "ToolTip.backgroundInactive", control,
0N/A "ToolTip.foregroundInactive", controlDarkShadow,
0N/A "ToolTip.hideAccelerator", Boolean.FALSE,
0N/A
0N/A // ToolTipManager
0N/A "ToolTipManager.enableToolTipMode", "activeApplication",
0N/A
0N/A // Slider Defaults
0N/A "Slider.font", controlTextValue,
0N/A "Slider.border", null,
0N/A "Slider.foreground", primaryControlShadow,
0N/A "Slider.focus", focusColor,
0N/A "Slider.focusInsets", zeroInsets,
0N/A "Slider.trackWidth", new Integer( 7 ),
0N/A "Slider.majorTickLength", new Integer( 6 ),
0N/A "Slider.horizontalThumbIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getHorizontalSliderThumbIcon"),
0N/A "Slider.verticalThumbIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getVerticalSliderThumbIcon"),
0N/A "Slider.focusInputMap",
0N/A new UIDefaults.LazyInputMap(new Object[] {
0N/A "RIGHT", "positiveUnitIncrement",
0N/A "KP_RIGHT", "positiveUnitIncrement",
0N/A "DOWN", "negativeUnitIncrement",
0N/A "KP_DOWN", "negativeUnitIncrement",
0N/A "PAGE_DOWN", "negativeBlockIncrement",
0N/A "ctrl PAGE_DOWN", "negativeBlockIncrement",
0N/A "LEFT", "negativeUnitIncrement",
0N/A "KP_LEFT", "negativeUnitIncrement",
0N/A "UP", "positiveUnitIncrement",
0N/A "KP_UP", "positiveUnitIncrement",
0N/A "PAGE_UP", "positiveBlockIncrement",
0N/A "ctrl PAGE_UP", "positiveBlockIncrement",
0N/A "HOME", "minScroll",
0N/A "END", "maxScroll"
0N/A }),
0N/A
0N/A // Progress Bar
0N/A "ProgressBar.font", controlTextValue,
0N/A "ProgressBar.foreground", primaryControlShadow,
0N/A "ProgressBar.selectionBackground", primaryControlDarkShadow,
0N/A "ProgressBar.border", progressBarBorder,
0N/A "ProgressBar.cellSpacing", zero,
215N/A "ProgressBar.cellLength", Integer.valueOf(1),
0N/A
0N/A // Combo Box
0N/A "ComboBox.background", control,
0N/A "ComboBox.foreground", controlTextColor,
0N/A "ComboBox.selectionBackground", primaryControlShadow,
0N/A "ComboBox.selectionForeground", controlTextColor,
0N/A "ComboBox.font", controlTextValue,
0N/A "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
0N/A "ESCAPE", "hidePopup",
0N/A "PAGE_UP", "pageUpPassThrough",
0N/A "PAGE_DOWN", "pageDownPassThrough",
0N/A "HOME", "homePassThrough",
0N/A "END", "endPassThrough",
0N/A "DOWN", "selectNext",
0N/A "KP_DOWN", "selectNext",
0N/A "alt DOWN", "togglePopup",
0N/A "alt KP_DOWN", "togglePopup",
0N/A "alt UP", "togglePopup",
0N/A "alt KP_UP", "togglePopup",
0N/A "SPACE", "spacePopup",
0N/A "ENTER", "enterPressed",
0N/A "UP", "selectPrevious",
0N/A "KP_UP", "selectPrevious"
0N/A }),
0N/A
0N/A // Internal Frame Defaults
0N/A "InternalFrame.icon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getInternalFrameDefaultMenuIcon"),
0N/A "InternalFrame.border", new SwingLazyValue("javax.swing.plaf.metal.MetalBorders$InternalFrameBorder"),
0N/A "InternalFrame.optionDialogBorder", new SwingLazyValue("javax.swing.plaf.metal.MetalBorders$OptionDialogBorder"),
0N/A "InternalFrame.paletteBorder", new SwingLazyValue("javax.swing.plaf.metal.MetalBorders$PaletteBorder"),
0N/A "InternalFrame.paletteTitleHeight", new Integer(11),
0N/A "InternalFrame.paletteCloseIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory$PaletteCloseIcon"),
0N/A "InternalFrame.closeIcon",
0N/A new SwingLazyValue(
0N/A "javax.swing.plaf.metal.MetalIconFactory",
0N/A "getInternalFrameCloseIcon",
0N/A internalFrameIconArgs),
0N/A "InternalFrame.maximizeIcon",
0N/A new SwingLazyValue(
0N/A "javax.swing.plaf.metal.MetalIconFactory",
0N/A "getInternalFrameMaximizeIcon",
0N/A internalFrameIconArgs),
0N/A "InternalFrame.iconifyIcon",
0N/A new SwingLazyValue(
0N/A "javax.swing.plaf.metal.MetalIconFactory",
0N/A "getInternalFrameMinimizeIcon",
0N/A internalFrameIconArgs),
0N/A "InternalFrame.minimizeIcon",
0N/A new SwingLazyValue(
0N/A "javax.swing.plaf.metal.MetalIconFactory",
0N/A "getInternalFrameAltMaximizeIcon",
0N/A internalFrameIconArgs),
0N/A "InternalFrame.titleFont", windowTitleValue,
0N/A "InternalFrame.windowBindings", null,
0N/A // Internal Frame Auditory Cue Mappings
0N/A "InternalFrame.closeSound", "sounds/FrameClose.wav",
0N/A "InternalFrame.maximizeSound", "sounds/FrameMaximize.wav",
0N/A "InternalFrame.minimizeSound", "sounds/FrameMinimize.wav",
0N/A "InternalFrame.restoreDownSound", "sounds/FrameRestoreDown.wav",
0N/A "InternalFrame.restoreUpSound", "sounds/FrameRestoreUp.wav",
0N/A
0N/A // Desktop Icon
0N/A "DesktopIcon.border", desktopIconBorder,
0N/A "DesktopIcon.font", controlTextValue,
0N/A "DesktopIcon.foreground", controlTextColor,
0N/A "DesktopIcon.background", control,
215N/A "DesktopIcon.width", Integer.valueOf(160),
0N/A
0N/A "Desktop.ancestorInputMap",
0N/A new UIDefaults.LazyInputMap(new Object[] {
0N/A "ctrl F5", "restore",
0N/A "ctrl F4", "close",
0N/A "ctrl F7", "move",
0N/A "ctrl F8", "resize",
0N/A "RIGHT", "right",
0N/A "KP_RIGHT", "right",
0N/A "shift RIGHT", "shrinkRight",
0N/A "shift KP_RIGHT", "shrinkRight",
0N/A "LEFT", "left",
0N/A "KP_LEFT", "left",
0N/A "shift LEFT", "shrinkLeft",
0N/A "shift KP_LEFT", "shrinkLeft",
0N/A "UP", "up",
0N/A "KP_UP", "up",
0N/A "shift UP", "shrinkUp",
0N/A "shift KP_UP", "shrinkUp",
0N/A "DOWN", "down",
0N/A "KP_DOWN", "down",
0N/A "shift DOWN", "shrinkDown",
0N/A "shift KP_DOWN", "shrinkDown",
0N/A "ESCAPE", "escape",
0N/A "ctrl F9", "minimize",
0N/A "ctrl F10", "maximize",
0N/A "ctrl F6", "selectNextFrame",
0N/A "ctrl TAB", "selectNextFrame",
0N/A "ctrl alt F6", "selectNextFrame",
0N/A "shift ctrl alt F6", "selectPreviousFrame",
0N/A "ctrl F12", "navigateNext",
0N/A "shift ctrl F12", "navigatePrevious"
0N/A }),
0N/A
0N/A // Titled Border
0N/A "TitledBorder.font", controlTextValue,
0N/A "TitledBorder.titleColor", systemTextColor,
0N/A "TitledBorder.border", titledBorderBorder,
0N/A
0N/A // Label
0N/A "Label.font", controlTextValue,
0N/A "Label.foreground", systemTextColor,
0N/A "Label.disabledForeground", getInactiveSystemTextColor(),
0N/A
0N/A // List
0N/A "List.font", controlTextValue,
0N/A "List.focusCellHighlightBorder", focusCellHighlightBorder,
0N/A "List.focusInputMap",
0N/A new UIDefaults.LazyInputMap(new Object[] {
0N/A "ctrl C", "copy",
0N/A "ctrl V", "paste",
0N/A "ctrl X", "cut",
0N/A "COPY", "copy",
0N/A "PASTE", "paste",
0N/A "CUT", "cut",
0N/A "control INSERT", "copy",
0N/A "shift INSERT", "paste",
0N/A "shift DELETE", "cut",
0N/A "UP", "selectPreviousRow",
0N/A "KP_UP", "selectPreviousRow",
0N/A "shift UP", "selectPreviousRowExtendSelection",
0N/A "shift KP_UP", "selectPreviousRowExtendSelection",
0N/A "ctrl shift UP", "selectPreviousRowExtendSelection",
0N/A "ctrl shift KP_UP", "selectPreviousRowExtendSelection",
0N/A "ctrl UP", "selectPreviousRowChangeLead",
0N/A "ctrl KP_UP", "selectPreviousRowChangeLead",
0N/A "DOWN", "selectNextRow",
0N/A "KP_DOWN", "selectNextRow",
0N/A "shift DOWN", "selectNextRowExtendSelection",
0N/A "shift KP_DOWN", "selectNextRowExtendSelection",
0N/A "ctrl shift DOWN", "selectNextRowExtendSelection",
0N/A "ctrl shift KP_DOWN", "selectNextRowExtendSelection",
0N/A "ctrl DOWN", "selectNextRowChangeLead",
0N/A "ctrl KP_DOWN", "selectNextRowChangeLead",
0N/A "LEFT", "selectPreviousColumn",
0N/A "KP_LEFT", "selectPreviousColumn",
0N/A "shift LEFT", "selectPreviousColumnExtendSelection",
0N/A "shift KP_LEFT", "selectPreviousColumnExtendSelection",
0N/A "ctrl shift LEFT", "selectPreviousColumnExtendSelection",
0N/A "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
0N/A "ctrl LEFT", "selectPreviousColumnChangeLead",
0N/A "ctrl KP_LEFT", "selectPreviousColumnChangeLead",
0N/A "RIGHT", "selectNextColumn",
0N/A "KP_RIGHT", "selectNextColumn",
0N/A "shift RIGHT", "selectNextColumnExtendSelection",
0N/A "shift KP_RIGHT", "selectNextColumnExtendSelection",
0N/A "ctrl shift RIGHT", "selectNextColumnExtendSelection",
0N/A "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
0N/A "ctrl RIGHT", "selectNextColumnChangeLead",
0N/A "ctrl KP_RIGHT", "selectNextColumnChangeLead",
0N/A "HOME", "selectFirstRow",
0N/A "shift HOME", "selectFirstRowExtendSelection",
0N/A "ctrl shift HOME", "selectFirstRowExtendSelection",
0N/A "ctrl HOME", "selectFirstRowChangeLead",
0N/A "END", "selectLastRow",
0N/A "shift END", "selectLastRowExtendSelection",
0N/A "ctrl shift END", "selectLastRowExtendSelection",
0N/A "ctrl END", "selectLastRowChangeLead",
0N/A "PAGE_UP", "scrollUp",
0N/A "shift PAGE_UP", "scrollUpExtendSelection",
0N/A "ctrl shift PAGE_UP", "scrollUpExtendSelection",
0N/A "ctrl PAGE_UP", "scrollUpChangeLead",
0N/A "PAGE_DOWN", "scrollDown",
0N/A "shift PAGE_DOWN", "scrollDownExtendSelection",
0N/A "ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
0N/A "ctrl PAGE_DOWN", "scrollDownChangeLead",
0N/A "ctrl A", "selectAll",
0N/A "ctrl SLASH", "selectAll",
0N/A "ctrl BACK_SLASH", "clearSelection",
0N/A "SPACE", "addToSelection",
0N/A "ctrl SPACE", "toggleAndAnchor",
0N/A "shift SPACE", "extendTo",
0N/A "ctrl shift SPACE", "moveSelectionTo"
0N/A }),
0N/A
0N/A // ScrollBar
0N/A "ScrollBar.background", control,
0N/A "ScrollBar.highlight", controlHighlight,
0N/A "ScrollBar.shadow", controlShadow,
0N/A "ScrollBar.darkShadow", controlDarkShadow,
0N/A "ScrollBar.thumb", primaryControlShadow,
0N/A "ScrollBar.thumbShadow", primaryControlDarkShadow,
0N/A "ScrollBar.thumbHighlight", primaryControl,
0N/A "ScrollBar.width", new Integer( 17 ),
0N/A "ScrollBar.allowsAbsolutePositioning", Boolean.TRUE,
0N/A "ScrollBar.ancestorInputMap",
0N/A new UIDefaults.LazyInputMap(new Object[] {
0N/A "RIGHT", "positiveUnitIncrement",
0N/A "KP_RIGHT", "positiveUnitIncrement",
0N/A "DOWN", "positiveUnitIncrement",
0N/A "KP_DOWN", "positiveUnitIncrement",
0N/A "PAGE_DOWN", "positiveBlockIncrement",
0N/A "LEFT", "negativeUnitIncrement",
0N/A "KP_LEFT", "negativeUnitIncrement",
0N/A "UP", "negativeUnitIncrement",
0N/A "KP_UP", "negativeUnitIncrement",
0N/A "PAGE_UP", "negativeBlockIncrement",
0N/A "HOME", "minScroll",
0N/A "END", "maxScroll"
0N/A }),
0N/A
0N/A // ScrollPane
0N/A "ScrollPane.border", scrollPaneBorder,
0N/A "ScrollPane.ancestorInputMap",
0N/A new UIDefaults.LazyInputMap(new Object[] {
0N/A "RIGHT", "unitScrollRight",
0N/A "KP_RIGHT", "unitScrollRight",
0N/A "DOWN", "unitScrollDown",
0N/A "KP_DOWN", "unitScrollDown",
0N/A "LEFT", "unitScrollLeft",
0N/A "KP_LEFT", "unitScrollLeft",
0N/A "UP", "unitScrollUp",
0N/A "KP_UP", "unitScrollUp",
0N/A "PAGE_UP", "scrollUp",
0N/A "PAGE_DOWN", "scrollDown",
0N/A "ctrl PAGE_UP", "scrollLeft",
0N/A "ctrl PAGE_DOWN", "scrollRight",
0N/A "ctrl HOME", "scrollHome",
0N/A "ctrl END", "scrollEnd"
0N/A }),
0N/A
0N/A // Tabbed Pane
0N/A "TabbedPane.font", controlTextValue,
0N/A "TabbedPane.tabAreaBackground", control,
0N/A "TabbedPane.background", controlShadow,
0N/A "TabbedPane.light", control,
0N/A "TabbedPane.focus", primaryControlDarkShadow,
0N/A "TabbedPane.selected", control,
0N/A "TabbedPane.selectHighlight", controlHighlight,
0N/A "TabbedPane.tabAreaInsets", tabbedPaneTabAreaInsets,
0N/A "TabbedPane.tabInsets", tabbedPaneTabInsets,
0N/A "TabbedPane.focusInputMap",
0N/A new UIDefaults.LazyInputMap(new Object[] {
0N/A "RIGHT", "navigateRight",
0N/A "KP_RIGHT", "navigateRight",
0N/A "LEFT", "navigateLeft",
0N/A "KP_LEFT", "navigateLeft",
0N/A "UP", "navigateUp",
0N/A "KP_UP", "navigateUp",
0N/A "DOWN", "navigateDown",
0N/A "KP_DOWN", "navigateDown",
0N/A "ctrl DOWN", "requestFocusForVisibleComponent",
0N/A "ctrl KP_DOWN", "requestFocusForVisibleComponent",
0N/A }),
0N/A "TabbedPane.ancestorInputMap",
0N/A new UIDefaults.LazyInputMap(new Object[] {
0N/A "ctrl PAGE_DOWN", "navigatePageDown",
0N/A "ctrl PAGE_UP", "navigatePageUp",
0N/A "ctrl UP", "requestFocus",
0N/A "ctrl KP_UP", "requestFocus",
0N/A }),
0N/A
0N/A // Table
0N/A "Table.font", userTextValue,
0N/A "Table.focusCellHighlightBorder", focusCellHighlightBorder,
0N/A "Table.scrollPaneBorder", scrollPaneBorder,
0N/A "Table.dropLineColor", focusColor,
0N/A "Table.dropLineShortColor", primaryControlDarkShadow,
0N/A "Table.gridColor", controlShadow, // grid line color
0N/A "Table.ancestorInputMap",
0N/A new UIDefaults.LazyInputMap(new Object[] {
0N/A "ctrl C", "copy",
0N/A "ctrl V", "paste",
0N/A "ctrl X", "cut",
0N/A "COPY", "copy",
0N/A "PASTE", "paste",
0N/A "CUT", "cut",
0N/A "control INSERT", "copy",
0N/A "shift INSERT", "paste",
0N/A "shift DELETE", "cut",
0N/A "RIGHT", "selectNextColumn",
0N/A "KP_RIGHT", "selectNextColumn",
0N/A "shift RIGHT", "selectNextColumnExtendSelection",
0N/A "shift KP_RIGHT", "selectNextColumnExtendSelection",
0N/A "ctrl shift RIGHT", "selectNextColumnExtendSelection",
0N/A "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
0N/A "ctrl RIGHT", "selectNextColumnChangeLead",
0N/A "ctrl KP_RIGHT", "selectNextColumnChangeLead",
0N/A "LEFT", "selectPreviousColumn",
0N/A "KP_LEFT", "selectPreviousColumn",
0N/A "shift LEFT", "selectPreviousColumnExtendSelection",
0N/A "shift KP_LEFT", "selectPreviousColumnExtendSelection",
0N/A "ctrl shift LEFT", "selectPreviousColumnExtendSelection",
0N/A "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
0N/A "ctrl LEFT", "selectPreviousColumnChangeLead",
0N/A "ctrl KP_LEFT", "selectPreviousColumnChangeLead",
0N/A "DOWN", "selectNextRow",
0N/A "KP_DOWN", "selectNextRow",
0N/A "shift DOWN", "selectNextRowExtendSelection",
0N/A "shift KP_DOWN", "selectNextRowExtendSelection",
0N/A "ctrl shift DOWN", "selectNextRowExtendSelection",
0N/A "ctrl shift KP_DOWN", "selectNextRowExtendSelection",
0N/A "ctrl DOWN", "selectNextRowChangeLead",
0N/A "ctrl KP_DOWN", "selectNextRowChangeLead",
0N/A "UP", "selectPreviousRow",
0N/A "KP_UP", "selectPreviousRow",
0N/A "shift UP", "selectPreviousRowExtendSelection",
0N/A "shift KP_UP", "selectPreviousRowExtendSelection",
0N/A "ctrl shift UP", "selectPreviousRowExtendSelection",
0N/A "ctrl shift KP_UP", "selectPreviousRowExtendSelection",
0N/A "ctrl UP", "selectPreviousRowChangeLead",
0N/A "ctrl KP_UP", "selectPreviousRowChangeLead",
0N/A "HOME", "selectFirstColumn",
0N/A "shift HOME", "selectFirstColumnExtendSelection",
0N/A "ctrl shift HOME", "selectFirstRowExtendSelection",
0N/A "ctrl HOME", "selectFirstRow",
0N/A "END", "selectLastColumn",
0N/A "shift END", "selectLastColumnExtendSelection",
0N/A "ctrl shift END", "selectLastRowExtendSelection",
0N/A "ctrl END", "selectLastRow",
0N/A "PAGE_UP", "scrollUpChangeSelection",
0N/A "shift PAGE_UP", "scrollUpExtendSelection",
0N/A "ctrl shift PAGE_UP", "scrollLeftExtendSelection",
0N/A "ctrl PAGE_UP", "scrollLeftChangeSelection",
0N/A "PAGE_DOWN", "scrollDownChangeSelection",
0N/A "shift PAGE_DOWN", "scrollDownExtendSelection",
0N/A "ctrl shift PAGE_DOWN", "scrollRightExtendSelection",
0N/A "ctrl PAGE_DOWN", "scrollRightChangeSelection",
0N/A "TAB", "selectNextColumnCell",
0N/A "shift TAB", "selectPreviousColumnCell",
0N/A "ENTER", "selectNextRowCell",
0N/A "shift ENTER", "selectPreviousRowCell",
0N/A "ctrl A", "selectAll",
0N/A "ctrl SLASH", "selectAll",
0N/A "ctrl BACK_SLASH", "clearSelection",
0N/A "ESCAPE", "cancel",
0N/A "F2", "startEditing",
0N/A "SPACE", "addToSelection",
0N/A "ctrl SPACE", "toggleAndAnchor",
0N/A "shift SPACE", "extendTo",
0N/A "ctrl shift SPACE", "moveSelectionTo",
0N/A "F8", "focusHeader"
0N/A }),
0N/A "Table.ascendingSortIcon",
0N/A SwingUtilities2.makeIcon(getClass(), MetalLookAndFeel.class,
0N/A "icons/sortUp.png"),
0N/A "Table.descendingSortIcon",
0N/A SwingUtilities2.makeIcon(getClass(), MetalLookAndFeel.class,
0N/A "icons/sortDown.png"),
0N/A
0N/A "TableHeader.font", userTextValue,
0N/A "TableHeader.cellBorder", new SwingLazyValue(
0N/A "javax.swing.plaf.metal.MetalBorders$TableHeaderBorder"),
0N/A
0N/A // MenuBar
0N/A "MenuBar.border", menuBarBorder,
0N/A "MenuBar.font", menuTextValue,
0N/A "MenuBar.windowBindings", new Object[] {
0N/A "F10", "takeFocus" },
0N/A
0N/A // Menu
0N/A "Menu.border", menuItemBorder,
0N/A "Menu.borderPainted", Boolean.TRUE,
0N/A "Menu.menuPopupOffsetX", zero,
0N/A "Menu.menuPopupOffsetY", zero,
0N/A "Menu.submenuPopupOffsetX", new Integer(-4),
0N/A "Menu.submenuPopupOffsetY", new Integer(-3),
0N/A "Menu.font", menuTextValue,
0N/A "Menu.selectionForeground", menuSelectedForeground,
0N/A "Menu.selectionBackground", menuSelectedBackground,
0N/A "Menu.disabledForeground", menuDisabledForeground,
0N/A "Menu.acceleratorFont", subTextValue,
0N/A "Menu.acceleratorForeground", acceleratorForeground,
0N/A "Menu.acceleratorSelectionForeground", acceleratorSelectedForeground,
0N/A "Menu.checkIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getMenuItemCheckIcon"),
0N/A "Menu.arrowIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getMenuArrowIcon"),
0N/A
0N/A // Menu Item
0N/A "MenuItem.border", menuItemBorder,
0N/A "MenuItem.borderPainted", Boolean.TRUE,
0N/A "MenuItem.font", menuTextValue,
0N/A "MenuItem.selectionForeground", menuSelectedForeground,
0N/A "MenuItem.selectionBackground", menuSelectedBackground,
0N/A "MenuItem.disabledForeground", menuDisabledForeground,
0N/A "MenuItem.acceleratorFont", subTextValue,
0N/A "MenuItem.acceleratorForeground", acceleratorForeground,
0N/A "MenuItem.acceleratorSelectionForeground", acceleratorSelectedForeground,
0N/A "MenuItem.acceleratorDelimiter", menuItemAcceleratorDelimiter,
0N/A "MenuItem.checkIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getMenuItemCheckIcon"),
0N/A "MenuItem.arrowIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getMenuItemArrowIcon"),
0N/A // Menu Item Auditory Cue Mapping
0N/A "MenuItem.commandSound", "sounds/MenuItemCommand.wav",
0N/A
0N/A // OptionPane.
0N/A "OptionPane.windowBindings", new Object[] {
0N/A "ESCAPE", "close" },
0N/A // Option Pane Auditory Cue Mappings
0N/A "OptionPane.informationSound", "sounds/OptionPaneInformation.wav",
0N/A "OptionPane.warningSound", "sounds/OptionPaneWarning.wav",
0N/A "OptionPane.errorSound", "sounds/OptionPaneError.wav",
0N/A "OptionPane.questionSound", "sounds/OptionPaneQuestion.wav",
0N/A
0N/A // Option Pane Special Dialog Colors, used when MetalRootPaneUI
0N/A // is providing window manipulation widgets.
0N/A "OptionPane.errorDialog.border.background",
0N/A new ColorUIResource(153, 51, 51),
0N/A "OptionPane.errorDialog.titlePane.foreground",
0N/A new ColorUIResource(51, 0, 0),
0N/A "OptionPane.errorDialog.titlePane.background",
0N/A new ColorUIResource(255, 153, 153),
0N/A "OptionPane.errorDialog.titlePane.shadow",
0N/A new ColorUIResource(204, 102, 102),
0N/A "OptionPane.questionDialog.border.background",
0N/A new ColorUIResource(51, 102, 51),
0N/A "OptionPane.questionDialog.titlePane.foreground",
0N/A new ColorUIResource(0, 51, 0),
0N/A "OptionPane.questionDialog.titlePane.background",
0N/A new ColorUIResource(153, 204, 153),
0N/A "OptionPane.questionDialog.titlePane.shadow",
0N/A new ColorUIResource(102, 153, 102),
0N/A "OptionPane.warningDialog.border.background",
0N/A new ColorUIResource(153, 102, 51),
0N/A "OptionPane.warningDialog.titlePane.foreground",
0N/A new ColorUIResource(102, 51, 0),
0N/A "OptionPane.warningDialog.titlePane.background",
0N/A new ColorUIResource(255, 204, 153),
0N/A "OptionPane.warningDialog.titlePane.shadow",
0N/A new ColorUIResource(204, 153, 102),
0N/A // OptionPane fonts are defined below
0N/A
0N/A // Separator
0N/A "Separator.background", getSeparatorBackground(),
0N/A "Separator.foreground", getSeparatorForeground(),
0N/A
0N/A // Popup Menu
0N/A "PopupMenu.border", popupMenuBorder,
0N/A // Popup Menu Auditory Cue Mappings
0N/A "PopupMenu.popupSound", "sounds/PopupMenuPopup.wav",
0N/A "PopupMenu.font", menuTextValue,
0N/A
0N/A // CB & RB Menu Item
0N/A "CheckBoxMenuItem.border", menuItemBorder,
0N/A "CheckBoxMenuItem.borderPainted", Boolean.TRUE,
0N/A "CheckBoxMenuItem.font", menuTextValue,
0N/A "CheckBoxMenuItem.selectionForeground", menuSelectedForeground,
0N/A "CheckBoxMenuItem.selectionBackground", menuSelectedBackground,
0N/A "CheckBoxMenuItem.disabledForeground", menuDisabledForeground,
0N/A "CheckBoxMenuItem.acceleratorFont", subTextValue,
0N/A "CheckBoxMenuItem.acceleratorForeground", acceleratorForeground,
0N/A "CheckBoxMenuItem.acceleratorSelectionForeground", acceleratorSelectedForeground,
0N/A "CheckBoxMenuItem.checkIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getCheckBoxMenuItemIcon"),
0N/A "CheckBoxMenuItem.arrowIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getMenuItemArrowIcon"),
0N/A "CheckBoxMenuItem.commandSound", "sounds/MenuItemCommand.wav",
0N/A
0N/A "RadioButtonMenuItem.border", menuItemBorder,
0N/A "RadioButtonMenuItem.borderPainted", Boolean.TRUE,
0N/A "RadioButtonMenuItem.font", menuTextValue,
0N/A "RadioButtonMenuItem.selectionForeground", menuSelectedForeground,
0N/A "RadioButtonMenuItem.selectionBackground", menuSelectedBackground,
0N/A "RadioButtonMenuItem.disabledForeground", menuDisabledForeground,
0N/A "RadioButtonMenuItem.acceleratorFont", subTextValue,
0N/A "RadioButtonMenuItem.acceleratorForeground", acceleratorForeground,
0N/A "RadioButtonMenuItem.acceleratorSelectionForeground", acceleratorSelectedForeground,
0N/A "RadioButtonMenuItem.checkIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getRadioButtonMenuItemIcon"),
0N/A "RadioButtonMenuItem.arrowIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getMenuItemArrowIcon"),
0N/A "RadioButtonMenuItem.commandSound", "sounds/MenuItemCommand.wav",
0N/A
0N/A "Spinner.ancestorInputMap",
0N/A new UIDefaults.LazyInputMap(new Object[] {
0N/A "UP", "increment",
0N/A "KP_UP", "increment",
0N/A "DOWN", "decrement",
0N/A "KP_DOWN", "decrement",
0N/A }),
0N/A "Spinner.arrowButtonInsets", zeroInsets,
0N/A "Spinner.border", textFieldBorder,
0N/A "Spinner.arrowButtonBorder", buttonBorder,
0N/A "Spinner.font", controlTextValue,
0N/A
0N/A // SplitPane
0N/A
0N/A "SplitPane.dividerSize", new Integer(10),
0N/A "SplitPane.ancestorInputMap",
0N/A new UIDefaults.LazyInputMap(new Object[] {
0N/A "UP", "negativeIncrement",
0N/A "DOWN", "positiveIncrement",
0N/A "LEFT", "negativeIncrement",
0N/A "RIGHT", "positiveIncrement",
0N/A "KP_UP", "negativeIncrement",
0N/A "KP_DOWN", "positiveIncrement",
0N/A "KP_LEFT", "negativeIncrement",
0N/A "KP_RIGHT", "positiveIncrement",
0N/A "HOME", "selectMin",
0N/A "END", "selectMax",
0N/A "F8", "startResize",
0N/A "F6", "toggleFocus",
0N/A "ctrl TAB", "focusOutForward",
0N/A "ctrl shift TAB", "focusOutBackward"
0N/A }),
0N/A "SplitPane.centerOneTouchButtons", Boolean.FALSE,
0N/A "SplitPane.dividerFocusColor", primaryControl,
0N/A
0N/A // Tree
0N/A // Tree.font was mapped to system font pre 1.4.1
0N/A "Tree.font", userTextValue,
0N/A "Tree.textBackground", getWindowBackground(),
0N/A "Tree.selectionBorderColor", focusColor,
0N/A "Tree.openIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getTreeFolderIcon"),
0N/A "Tree.closedIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getTreeFolderIcon"),
0N/A "Tree.leafIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getTreeLeafIcon"),
0N/A "Tree.expandedIcon", new SwingLazyValue(
0N/A "javax.swing.plaf.metal.MetalIconFactory",
0N/A "getTreeControlIcon",
0N/A new Object[] {Boolean.valueOf(MetalIconFactory.DARK)}),
0N/A "Tree.collapsedIcon", new SwingLazyValue(
0N/A "javax.swing.plaf.metal.MetalIconFactory",
0N/A "getTreeControlIcon",
0N/A new Object[] {Boolean.valueOf( MetalIconFactory.LIGHT )}),
0N/A
0N/A "Tree.line", primaryControl, // horiz lines
0N/A "Tree.hash", primaryControl, // legs
0N/A "Tree.rowHeight", zero,
0N/A "Tree.focusInputMap",
0N/A new UIDefaults.LazyInputMap(new Object[] {
0N/A "ADD", "expand",
0N/A "SUBTRACT", "collapse",
0N/A "ctrl C", "copy",
0N/A "ctrl V", "paste",
0N/A "ctrl X", "cut",
0N/A "COPY", "copy",
0N/A "PASTE", "paste",
0N/A "CUT", "cut",
0N/A "control INSERT", "copy",
0N/A "shift INSERT", "paste",
0N/A "shift DELETE", "cut",
0N/A "UP", "selectPrevious",
0N/A "KP_UP", "selectPrevious",
0N/A "shift UP", "selectPreviousExtendSelection",
0N/A "shift KP_UP", "selectPreviousExtendSelection",
0N/A "ctrl shift UP", "selectPreviousExtendSelection",
0N/A "ctrl shift KP_UP", "selectPreviousExtendSelection",
0N/A "ctrl UP", "selectPreviousChangeLead",
0N/A "ctrl KP_UP", "selectPreviousChangeLead",
0N/A "DOWN", "selectNext",
0N/A "KP_DOWN", "selectNext",
0N/A "shift DOWN", "selectNextExtendSelection",
0N/A "shift KP_DOWN", "selectNextExtendSelection",
0N/A "ctrl shift DOWN", "selectNextExtendSelection",
0N/A "ctrl shift KP_DOWN", "selectNextExtendSelection",
0N/A "ctrl DOWN", "selectNextChangeLead",
0N/A "ctrl KP_DOWN", "selectNextChangeLead",
0N/A "RIGHT", "selectChild",
0N/A "KP_RIGHT", "selectChild",
0N/A "LEFT", "selectParent",
0N/A "KP_LEFT", "selectParent",
0N/A "PAGE_UP", "scrollUpChangeSelection",
0N/A "shift PAGE_UP", "scrollUpExtendSelection",
0N/A "ctrl shift PAGE_UP", "scrollUpExtendSelection",
0N/A "ctrl PAGE_UP", "scrollUpChangeLead",
0N/A "PAGE_DOWN", "scrollDownChangeSelection",
0N/A "shift PAGE_DOWN", "scrollDownExtendSelection",
0N/A "ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
0N/A "ctrl PAGE_DOWN", "scrollDownChangeLead",
0N/A "HOME", "selectFirst",
0N/A "shift HOME", "selectFirstExtendSelection",
0N/A "ctrl shift HOME", "selectFirstExtendSelection",
0N/A "ctrl HOME", "selectFirstChangeLead",
0N/A "END", "selectLast",
0N/A "shift END", "selectLastExtendSelection",
0N/A "ctrl shift END", "selectLastExtendSelection",
0N/A "ctrl END", "selectLastChangeLead",
0N/A "F2", "startEditing",
0N/A "ctrl A", "selectAll",
0N/A "ctrl SLASH", "selectAll",
0N/A "ctrl BACK_SLASH", "clearSelection",
0N/A "ctrl LEFT", "scrollLeft",
0N/A "ctrl KP_LEFT", "scrollLeft",
0N/A "ctrl RIGHT", "scrollRight",
0N/A "ctrl KP_RIGHT", "scrollRight",
0N/A "SPACE", "addToSelection",
0N/A "ctrl SPACE", "toggleAndAnchor",
0N/A "shift SPACE", "extendTo",
0N/A "ctrl shift SPACE", "moveSelectionTo"
0N/A }),
0N/A "Tree.ancestorInputMap",
0N/A new UIDefaults.LazyInputMap(new Object[] {
0N/A "ESCAPE", "cancel"
0N/A }),
0N/A
0N/A // ToolBar
0N/A "ToolBar.border", toolBarBorder,
0N/A "ToolBar.background", menuBackground,
0N/A "ToolBar.foreground", getMenuForeground(),
0N/A "ToolBar.font", menuTextValue,
0N/A "ToolBar.dockingBackground", menuBackground,
0N/A "ToolBar.floatingBackground", menuBackground,
0N/A "ToolBar.dockingForeground", primaryControlDarkShadow,
0N/A "ToolBar.floatingForeground", primaryControl,
0N/A "ToolBar.rolloverBorder", new MetalLazyValue(
0N/A "javax.swing.plaf.metal.MetalBorders",
0N/A "getToolBarRolloverBorder"),
0N/A "ToolBar.nonrolloverBorder", new MetalLazyValue(
0N/A "javax.swing.plaf.metal.MetalBorders",
0N/A "getToolBarNonrolloverBorder"),
0N/A "ToolBar.ancestorInputMap",
0N/A new UIDefaults.LazyInputMap(new Object[] {
0N/A "UP", "navigateUp",
0N/A "KP_UP", "navigateUp",
0N/A "DOWN", "navigateDown",
0N/A "KP_DOWN", "navigateDown",
0N/A "LEFT", "navigateLeft",
0N/A "KP_LEFT", "navigateLeft",
0N/A "RIGHT", "navigateRight",
0N/A "KP_RIGHT", "navigateRight"
0N/A }),
0N/A
0N/A // RootPane
0N/A "RootPane.frameBorder", new MetalLazyValue(
0N/A "javax.swing.plaf.metal.MetalBorders$FrameBorder"),
0N/A "RootPane.plainDialogBorder", dialogBorder,
0N/A "RootPane.informationDialogBorder", dialogBorder,
0N/A "RootPane.errorDialogBorder", new MetalLazyValue(
0N/A "javax.swing.plaf.metal.MetalBorders$ErrorDialogBorder"),
0N/A "RootPane.colorChooserDialogBorder", questionDialogBorder,
0N/A "RootPane.fileChooserDialogBorder", questionDialogBorder,
0N/A "RootPane.questionDialogBorder", questionDialogBorder,
0N/A "RootPane.warningDialogBorder", new MetalLazyValue(
0N/A "javax.swing.plaf.metal.MetalBorders$WarningDialogBorder"),
0N/A // These bindings are only enabled when there is a default
0N/A // button set on the rootpane.
0N/A "RootPane.defaultButtonWindowKeyBindings", new Object[] {
0N/A "ENTER", "press",
0N/A "released ENTER", "release",
0N/A "ctrl ENTER", "press",
0N/A "ctrl released ENTER", "release"
0N/A },
0N/A };
0N/A
0N/A table.putDefaults(defaults);
0N/A
0N/A if (isWindows() && useSystemFonts() && theme.isSystemTheme()) {
0N/A Object messageFont = new MetalFontDesktopProperty(
1620N/A "win.messagebox.font.height", MetalTheme.CONTROL_TEXT_FONT);
0N/A
0N/A defaults = new Object[] {
0N/A "OptionPane.messageFont", messageFont,
0N/A "OptionPane.buttonFont", messageFont,
0N/A };
0N/A table.putDefaults(defaults);
0N/A }
0N/A
0N/A flushUnreferenced(); // Remove old listeners
0N/A
0N/A boolean lafCond = SwingUtilities2.isLocalDisplay();
0N/A Object aaTextInfo = SwingUtilities2.AATextInfo.getAATextInfo(lafCond);
0N/A table.put(SwingUtilities2.AA_TEXT_PROPERTY_KEY, aaTextInfo);
0N/A new AATextListener(this);
0N/A }
0N/A
0N/A /**
0N/A * Ensures the current {@code MetalTheme} is {@code non-null}. This is
0N/A * a cover method for {@code getCurrentTheme}.
0N/A *
0N/A * @see #getCurrentTheme
0N/A */
0N/A protected void createDefaultTheme() {
0N/A getCurrentTheme();
0N/A }
0N/A
0N/A /**
0N/A * Returns the look and feel defaults. This invokes, in order,
0N/A * {@code createDefaultTheme()}, {@code super.getDefaults()} and
0N/A * {@code getCurrentTheme().addCustomEntriesToTable(table)}.
0N/A * <p>
0N/A * While this method is public, it should only be invoked by the
0N/A * {@code UIManager} when the look and feel is set as the current
0N/A * look and feel and after {@code initialize} has been invoked.
0N/A *
0N/A * @return the look and feel defaults
0N/A *
0N/A * @see #createDefaultTheme
0N/A * @see javax.swing.plaf.basic.BasicLookAndFeel#getDefaults()
0N/A * @see MetalTheme#addCustomEntriesToTable(UIDefaults)
0N/A */
0N/A public UIDefaults getDefaults() {
0N/A // PENDING: move this to initialize when API changes are allowed
0N/A METAL_LOOK_AND_FEEL_INITED = true;
0N/A
0N/A createDefaultTheme();
0N/A UIDefaults table = super.getDefaults();
0N/A MetalTheme currentTheme = getCurrentTheme();
0N/A currentTheme.addCustomEntriesToTable(table);
0N/A currentTheme.install();
0N/A return table;
0N/A }
0N/A
0N/A /**
0N/A * {@inheritDoc}
0N/A *
0N/A * @since 1.4
0N/A */
0N/A public void provideErrorFeedback(Component component) {
0N/A super.provideErrorFeedback(component);
0N/A }
0N/A
0N/A /**
0N/A * Set the theme used by <code>MetalLookAndFeel</code>.
0N/A * <p>
0N/A * After the theme is set, {@code MetalLookAndFeel} needs to be
0N/A * re-installed and the uis need to be recreated. The following
0N/A * shows how to do this:
0N/A * <pre>
0N/A * MetalLookAndFeel.setCurrentTheme(theme);
0N/A *
0N/A * // re-install the Metal Look and Feel
0N/A * UIManager.setLookAndFeel(new MetalLookAndFeel());
0N/A *
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 * </pre>
0N/A * If this is not done the results are undefined.
0N/A *
0N/A * @param theme the theme to use
0N/A * @throws NullPointerException if {@code theme} is {@code null}
0N/A * @see #getCurrentTheme
0N/A */
0N/A public static void setCurrentTheme(MetalTheme theme) {
0N/A // NOTE: because you need to recreate the look and feel after
0N/A // this step, we don't bother blowing away any potential windows
0N/A // values.
0N/A if (theme == null) {
0N/A throw new NullPointerException("Can't have null theme");
0N/A }
0N/A AppContext.getAppContext().put( "currentMetalTheme", theme );
0N/A }
0N/A
0N/A /**
0N/A * Return the theme currently being used by <code>MetalLookAndFeel</code>.
0N/A * If the current theme is {@code null}, the default theme is created.
0N/A *
0N/A * @return the current theme
0N/A * @see #setCurrentTheme
0N/A * @since 1.5
0N/A */
0N/A public static MetalTheme getCurrentTheme() {
0N/A MetalTheme currentTheme;
0N/A AppContext context = AppContext.getAppContext();
0N/A currentTheme = (MetalTheme) context.get( "currentMetalTheme" );
0N/A if (currentTheme == null) {
0N/A // This will happen in two cases:
0N/A // . When MetalLookAndFeel is first being initialized.
0N/A // . When a new AppContext has been created that hasn't
0N/A // triggered UIManager to load a LAF. Rather than invoke
0N/A // a method on the UIManager, which would trigger the loading
0N/A // of a potentially different LAF, we directly set the
0N/A // Theme here.
0N/A if (useHighContrastTheme()) {
0N/A currentTheme = new MetalHighContrastTheme();
0N/A }
0N/A else {
0N/A // Create the default theme. We prefer Ocean, but will
0N/A // use DefaultMetalTheme if told to.
0N/A String theme = AccessController.doPrivileged(
0N/A new GetPropertyAction("swing.metalTheme"));
0N/A if ("steel".equals(theme)) {
0N/A currentTheme = new DefaultMetalTheme();
0N/A }
0N/A else {
0N/A currentTheme = new OceanTheme();
0N/A }
0N/A }
0N/A setCurrentTheme(currentTheme);
0N/A }
0N/A return currentTheme;
0N/A }
0N/A
0N/A /**
0N/A * Returns an <code>Icon</code> with a disabled appearance.
0N/A * This method is used to generate a disabled <code>Icon</code> when
0N/A * one has not been specified. For example, if you create a
0N/A * <code>JButton</code> and only specify an <code>Icon</code> via
0N/A * <code>setIcon</code> this method will be called to generate the
0N/A * disabled <code>Icon</code>. If null is passed as <code>icon</code>
0N/A * this method returns null.
0N/A * <p>
0N/A * Some look and feels might not render the disabled Icon, in which
0N/A * case they will ignore this.
0N/A *
0N/A * @param component JComponent that will display the Icon, may be null
0N/A * @param icon Icon to generate disable icon from.
0N/A * @return Disabled icon, or null if a suitable Icon can not be
0N/A * generated.
0N/A * @since 1.5
0N/A */
0N/A public Icon getDisabledIcon(JComponent component, Icon icon) {
0N/A if ((icon instanceof ImageIcon) && MetalLookAndFeel.usingOcean()) {
0N/A return MetalUtils.getOceanDisabledButtonIcon(
0N/A ((ImageIcon)icon).getImage());
0N/A }
0N/A return super.getDisabledIcon(component, icon);
0N/A }
0N/A
0N/A /**
0N/A * Returns an <code>Icon</code> for use by disabled
0N/A * components that are also selected. This method is used to generate an
0N/A * <code>Icon</code> for components that are in both the disabled and
0N/A * selected states but do not have a specific <code>Icon</code> for this
0N/A * state. For example, if you create a <code>JButton</code> and only
0N/A * specify an <code>Icon</code> via <code>setIcon</code> this method
0N/A * will be called to generate the disabled and selected
0N/A * <code>Icon</code>. If null is passed as <code>icon</code> this method
0N/A * returns null.
0N/A * <p>
0N/A * Some look and feels might not render the disabled and selected Icon,
0N/A * in which case they will ignore this.
0N/A *
0N/A * @param component JComponent that will display the Icon, may be null
0N/A * @param icon Icon to generate disabled and selected icon from.
0N/A * @return Disabled and Selected icon, or null if a suitable Icon can not
0N/A * be generated.
0N/A * @since 1.5
0N/A */
0N/A public Icon getDisabledSelectedIcon(JComponent component, Icon icon) {
0N/A if ((icon instanceof ImageIcon) && MetalLookAndFeel.usingOcean()) {
0N/A return MetalUtils.getOceanDisabledButtonIcon(
0N/A ((ImageIcon)icon).getImage());
0N/A }
0N/A return super.getDisabledSelectedIcon(component, icon);
0N/A }
0N/A
0N/A /**
0N/A * Returns the control text font of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getControlTextColor()}.
0N/A *
0N/A * @return the control text font
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static FontUIResource getControlTextFont() { return getCurrentTheme().getControlTextFont();}
0N/A
0N/A /**
0N/A * Returns the sytem text font of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getSystemTextFont()}.
0N/A *
0N/A * @return the system text font
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static FontUIResource getSystemTextFont() { return getCurrentTheme().getSystemTextFont();}
0N/A
0N/A /**
0N/A * Returns the user text font of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getUserTextFont()}.
0N/A *
0N/A * @return the user text font
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static FontUIResource getUserTextFont() { return getCurrentTheme().getUserTextFont();}
0N/A
0N/A /**
0N/A * Returns the menu text font of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getMenuTextFont()}.
0N/A *
0N/A * @return the menu text font
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static FontUIResource getMenuTextFont() { return getCurrentTheme().getMenuTextFont();}
0N/A
0N/A /**
0N/A * Returns the window title font of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getWindowTitleFont()}.
0N/A *
0N/A * @return the window title font
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static FontUIResource getWindowTitleFont() { return getCurrentTheme().getWindowTitleFont();}
0N/A
0N/A /**
0N/A * Returns the sub-text font of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getSubTextFont()}.
0N/A *
0N/A * @return the sub-text font
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static FontUIResource getSubTextFont() { return getCurrentTheme().getSubTextFont();}
0N/A
0N/A /**
0N/A * Returns the desktop color of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getDesktopColor()}.
0N/A *
0N/A * @return the desktop color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getDesktopColor() { return getCurrentTheme().getDesktopColor(); }
0N/A
0N/A /**
0N/A * Returns the focus color of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getFocusColor()}.
0N/A *
0N/A * @return the focus color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getFocusColor() { return getCurrentTheme().getFocusColor(); }
0N/A
0N/A /**
0N/A * Returns the white color of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getWhite()}.
0N/A *
0N/A * @return the white color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getWhite() { return getCurrentTheme().getWhite(); }
0N/A
0N/A /**
0N/A * Returns the black color of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getBlack()}.
0N/A *
0N/A * @return the black color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getBlack() { return getCurrentTheme().getBlack(); }
0N/A
0N/A /**
0N/A * Returns the control color of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getControl()}.
0N/A *
0N/A * @return the control color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getControl() { return getCurrentTheme().getControl(); }
0N/A
0N/A /**
0N/A * Returns the control shadow color of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getControlShadow()}.
0N/A *
0N/A * @return the control shadow color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getControlShadow() { return getCurrentTheme().getControlShadow(); }
0N/A
0N/A /**
0N/A * Returns the control dark shadow color of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getControlDarkShadow()}.
0N/A *
0N/A * @return the control dark shadow color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getControlDarkShadow() { return getCurrentTheme().getControlDarkShadow(); }
0N/A
0N/A /**
0N/A * Returns the control info color of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getControlInfo()}.
0N/A *
0N/A * @return the control info color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getControlInfo() { return getCurrentTheme().getControlInfo(); }
0N/A
0N/A /**
0N/A * Returns the control highlight color of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getControlHighlight()}.
0N/A *
0N/A * @return the control highlight color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getControlHighlight() { return getCurrentTheme().getControlHighlight(); }
0N/A
0N/A /**
0N/A * Returns the control disabled color of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getControlDisabled()}.
0N/A *
0N/A * @return the control disabled color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getControlDisabled() { return getCurrentTheme().getControlDisabled(); }
0N/A
0N/A /**
0N/A * Returns the primary control color of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getPrimaryControl()}.
0N/A *
0N/A * @return the primary control color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getPrimaryControl() { return getCurrentTheme().getPrimaryControl(); }
0N/A
0N/A /**
0N/A * Returns the primary control shadow color of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getPrimaryControlShadow()}.
0N/A *
0N/A * @return the primary control shadow color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getPrimaryControlShadow() { return getCurrentTheme().getPrimaryControlShadow(); }
0N/A
0N/A /**
0N/A * Returns the primary control dark shadow color of the current
0N/A * theme. This is a cover method for {@code
0N/A * getCurrentTheme().getPrimaryControlDarkShadow()}.
0N/A *
0N/A * @return the primary control dark shadow color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getPrimaryControlDarkShadow() { return getCurrentTheme().getPrimaryControlDarkShadow(); }
0N/A
0N/A /**
0N/A * Returns the primary control info color of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getPrimaryControlInfo()}.
0N/A *
0N/A * @return the primary control info color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getPrimaryControlInfo() { return getCurrentTheme().getPrimaryControlInfo(); }
0N/A
0N/A /**
0N/A * Returns the primary control highlight color of the current
0N/A * theme. This is a cover method for {@code
0N/A * getCurrentTheme().getPrimaryControlHighlight()}.
0N/A *
0N/A * @return the primary control highlight color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getPrimaryControlHighlight() { return getCurrentTheme().getPrimaryControlHighlight(); }
0N/A
0N/A /**
0N/A * Returns the system text color of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getSystemTextColor()}.
0N/A *
0N/A * @return the system text color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getSystemTextColor() { return getCurrentTheme().getSystemTextColor(); }
0N/A
0N/A /**
0N/A * Returns the control text color of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getControlTextColor()}.
0N/A *
0N/A * @return the control text color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getControlTextColor() { return getCurrentTheme().getControlTextColor(); }
0N/A
0N/A /**
0N/A * Returns the inactive control text color of the current theme. This is a
0N/A * cover method for {@code
0N/A * getCurrentTheme().getInactiveControlTextColor()}.
0N/A *
0N/A * @return the inactive control text color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getInactiveControlTextColor() { return getCurrentTheme().getInactiveControlTextColor(); }
0N/A
0N/A /**
0N/A * Returns the inactive system text color of the current theme. This is a
0N/A * cover method for {@code
0N/A * getCurrentTheme().getInactiveSystemTextColor()}.
0N/A *
0N/A * @return the inactive system text color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getInactiveSystemTextColor() { return getCurrentTheme().getInactiveSystemTextColor(); }
0N/A
0N/A /**
0N/A * Returns the user text color of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getUserTextColor()}.
0N/A *
0N/A * @return the user text color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getUserTextColor() { return getCurrentTheme().getUserTextColor(); }
0N/A
0N/A /**
0N/A * Returns the text highlight color of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getTextHighlightColor()}.
0N/A *
0N/A * @return the text highlight color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getTextHighlightColor() { return getCurrentTheme().getTextHighlightColor(); }
0N/A
0N/A /**
0N/A * Returns the highlighted text color of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getHighlightedTextColor()}.
0N/A *
0N/A * @return the highlighted text color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getHighlightedTextColor() { return getCurrentTheme().getHighlightedTextColor(); }
0N/A
0N/A /**
0N/A * Returns the window background color of the current theme. This is a
0N/A * cover method for {@code getCurrentTheme().getWindowBackground()}.
0N/A *
0N/A * @return the window background color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getWindowBackground() { return getCurrentTheme().getWindowBackground(); }
0N/A
0N/A /**
0N/A * Returns the window title background color of the current
0N/A * theme. This is a cover method for {@code
0N/A * getCurrentTheme().getWindowTitleBackground()}.
0N/A *
0N/A * @return the window title background color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getWindowTitleBackground() { return getCurrentTheme().getWindowTitleBackground(); }
0N/A
0N/A /**
0N/A * Returns the window title foreground color of the current
0N/A * theme. This is a cover method for {@code
0N/A * getCurrentTheme().getWindowTitleForeground()}.
0N/A *
0N/A * @return the window title foreground color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getWindowTitleForeground() { return getCurrentTheme().getWindowTitleForeground(); }
0N/A
0N/A /**
0N/A * Returns the window title inactive background color of the current
0N/A * theme. This is a cover method for {@code
0N/A * getCurrentTheme().getWindowTitleInactiveBackground()}.
0N/A *
0N/A * @return the window title inactive background color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getWindowTitleInactiveBackground() { return getCurrentTheme().getWindowTitleInactiveBackground(); }
0N/A
0N/A /**
0N/A * Returns the window title inactive foreground color of the current
0N/A * theme. This is a cover method for {@code
0N/A * getCurrentTheme().getWindowTitleInactiveForeground()}.
0N/A *
0N/A * @return the window title inactive foreground color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getWindowTitleInactiveForeground() { return getCurrentTheme().getWindowTitleInactiveForeground(); }
0N/A
0N/A /**
0N/A * Returns the menu background color of the current theme. This is
0N/A * a cover method for {@code getCurrentTheme().getMenuBackground()}.
0N/A *
0N/A * @return the menu background color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getMenuBackground() { return getCurrentTheme().getMenuBackground(); }
0N/A
0N/A /**
0N/A * Returns the menu foreground color of the current theme. This is
0N/A * a cover method for {@code getCurrentTheme().getMenuForeground()}.
0N/A *
0N/A * @return the menu foreground color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getMenuForeground() { return getCurrentTheme().getMenuForeground(); }
0N/A
0N/A /**
0N/A * Returns the menu selected background color of the current theme. This is
0N/A * a cover method for
0N/A * {@code getCurrentTheme().getMenuSelectedBackground()}.
0N/A *
0N/A * @return the menu selected background color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getMenuSelectedBackground() { return getCurrentTheme().getMenuSelectedBackground(); }
0N/A
0N/A /**
0N/A * Returns the menu selected foreground color of the current theme. This is
0N/A * a cover method for
0N/A * {@code getCurrentTheme().getMenuSelectedForeground()}.
0N/A *
0N/A * @return the menu selected foreground color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getMenuSelectedForeground() { return getCurrentTheme().getMenuSelectedForeground(); }
0N/A
0N/A /**
0N/A * Returns the menu disabled foreground color of the current theme. This is
0N/A * a cover method for
0N/A * {@code getCurrentTheme().getMenuDisabledForeground()}.
0N/A *
0N/A * @return the menu disabled foreground color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getMenuDisabledForeground() { return getCurrentTheme().getMenuDisabledForeground(); }
0N/A
0N/A /**
0N/A * Returns the separator background color of the current theme. This is
0N/A * a cover method for {@code getCurrentTheme().getSeparatorBackground()}.
0N/A *
0N/A * @return the separator background color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getSeparatorBackground() { return getCurrentTheme().getSeparatorBackground(); }
0N/A
0N/A /**
0N/A * Returns the separator foreground color of the current theme. This is
0N/A * a cover method for {@code getCurrentTheme().getSeparatorForeground()}.
0N/A *
0N/A * @return the separator foreground color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getSeparatorForeground() { return getCurrentTheme().getSeparatorForeground(); }
0N/A
0N/A /**
0N/A * Returns the accelerator foreground color of the current theme. This is
0N/A * a cover method for {@code getCurrentTheme().getAcceleratorForeground()}.
0N/A *
0N/A * @return the separator accelerator foreground color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getAcceleratorForeground() { return getCurrentTheme().getAcceleratorForeground(); }
0N/A
0N/A /**
0N/A * Returns the accelerator selected foreground color of the
0N/A * current theme. This is a cover method for {@code
0N/A * getCurrentTheme().getAcceleratorSelectedForeground()}.
0N/A *
0N/A * @return the accelerator selected foreground color
0N/A *
0N/A * @see MetalTheme
0N/A */
0N/A public static ColorUIResource getAcceleratorSelectedForeground() { return getCurrentTheme().getAcceleratorSelectedForeground(); }
0N/A
0N/A
0N/A /**
0N/A * Returns a {@code LayoutStyle} implementing the Java look and feel
0N/A * design guidelines as specified at
0N/A * <a href="http://java.sun.com/products/jlf/ed2/book/HIG.Visual2.html">http://java.sun.com/products/jlf/ed2/book/HIG.Visual2.html</a>.
0N/A *
0N/A * @return LayoutStyle implementing the Java look and feel design
0N/A * guidelines
0N/A * @since 1.6
0N/A */
0N/A public LayoutStyle getLayoutStyle() {
0N/A return MetalLayoutStyle.INSTANCE;
0N/A }
0N/A
0N/A
0N/A /**
0N/A * MetalLazyValue is a slimmed down version of <code>ProxyLaxyValue</code>.
0N/A * The code is duplicate so that it can get at the package private
0N/A * classes in metal.
0N/A */
0N/A private static class MetalLazyValue implements UIDefaults.LazyValue {
0N/A /**
0N/A * Name of the class to create.
0N/A */
0N/A private String className;
0N/A private String methodName;
0N/A
0N/A MetalLazyValue(String name) {
0N/A this.className = name;
0N/A }
0N/A
0N/A MetalLazyValue(String name, String methodName) {
0N/A this(name);
0N/A this.methodName = methodName;
0N/A }
0N/A
0N/A public Object createValue(UIDefaults table) {
0N/A try {
0N/A final Class c = Class.forName(className);
0N/A
0N/A if (methodName == null) {
0N/A return c.newInstance();
0N/A }
614N/A Method method = AccessController.doPrivileged(
614N/A new PrivilegedAction<Method>() {
614N/A public Method run() {
0N/A Method[] methods = c.getDeclaredMethods();
0N/A for (int counter = methods.length - 1; counter >= 0;
0N/A counter--) {
0N/A if (methods[counter].getName().equals(methodName)){
0N/A methods[counter].setAccessible(true);
0N/A return methods[counter];
0N/A }
0N/A }
0N/A return null;
0N/A }
0N/A });
0N/A if (method != null) {
0N/A return method.invoke(null, (Object[])null);
0N/A }
0N/A } catch (ClassNotFoundException cnfe) {
0N/A } catch (InstantiationException ie) {
0N/A } catch (IllegalAccessException iae) {
0N/A } catch (InvocationTargetException ite) {
0N/A }
0N/A return null;
0N/A }
0N/A }
0N/A
0N/A
0N/A /**
0N/A * FontActiveValue redirects to the appropriate metal theme method.
0N/A */
0N/A private static class FontActiveValue implements UIDefaults.ActiveValue {
0N/A private int type;
0N/A private MetalTheme theme;
0N/A
0N/A FontActiveValue(MetalTheme theme, int type) {
0N/A this.theme = theme;
0N/A this.type = type;
0N/A }
0N/A
0N/A public Object createValue(UIDefaults table) {
0N/A Object value = null;
0N/A switch (type) {
0N/A case MetalTheme.CONTROL_TEXT_FONT:
0N/A value = theme.getControlTextFont();
0N/A break;
0N/A case MetalTheme.SYSTEM_TEXT_FONT:
0N/A value = theme.getSystemTextFont();
0N/A break;
0N/A case MetalTheme.USER_TEXT_FONT:
0N/A value = theme.getUserTextFont();
0N/A break;
0N/A case MetalTheme.MENU_TEXT_FONT:
0N/A value = theme.getMenuTextFont();
0N/A break;
0N/A case MetalTheme.WINDOW_TITLE_FONT:
0N/A value = theme.getWindowTitleFont();
0N/A break;
0N/A case MetalTheme.SUB_TEXT_FONT:
0N/A value = theme.getSubTextFont();
0N/A break;
0N/A }
0N/A return value;
0N/A }
0N/A }
0N/A
614N/A static ReferenceQueue<LookAndFeel> queue = new ReferenceQueue<LookAndFeel>();
0N/A
0N/A static void flushUnreferenced() {
0N/A AATextListener aatl;
0N/A while ((aatl = (AATextListener)queue.poll()) != null) {
0N/A aatl.dispose();
0N/A }
0N/A }
0N/A
0N/A static class AATextListener
614N/A extends WeakReference<LookAndFeel> implements PropertyChangeListener {
0N/A
0N/A private String key = SunToolkit.DESKTOPFONTHINTS;
0N/A
0N/A AATextListener(LookAndFeel laf) {
0N/A super(laf, queue);
0N/A Toolkit tk = Toolkit.getDefaultToolkit();
0N/A tk.addPropertyChangeListener(key, this);
0N/A }
0N/A
0N/A public void propertyChange(PropertyChangeEvent pce) {
614N/A LookAndFeel laf = get();
0N/A if (laf == null || laf != UIManager.getLookAndFeel()) {
0N/A dispose();
0N/A return;
0N/A }
0N/A UIDefaults defaults = UIManager.getLookAndFeelDefaults();
0N/A boolean lafCond = SwingUtilities2.isLocalDisplay();
0N/A Object aaTextInfo =
0N/A SwingUtilities2.AATextInfo.getAATextInfo(lafCond);
0N/A defaults.put(SwingUtilities2.AA_TEXT_PROPERTY_KEY, aaTextInfo);
0N/A updateUI();
0N/A }
0N/A
0N/A void dispose() {
0N/A Toolkit tk = Toolkit.getDefaultToolkit();
0N/A tk.removePropertyChangeListener(key, this);
0N/A }
0N/A
0N/A /**
0N/A * Updates the UI of the passed in window and all its children.
0N/A */
0N/A private static void updateWindowUI(Window window) {
0N/A SwingUtilities.updateComponentTreeUI(window);
0N/A Window ownedWins[] = window.getOwnedWindows();
614N/A for (Window w : ownedWins) {
614N/A updateWindowUI(w);
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Updates the UIs of all the known Frames.
0N/A */
0N/A private static void updateAllUIs() {
0N/A Frame appFrames[] = Frame.getFrames();
614N/A for (Frame frame : appFrames) {
614N/A updateWindowUI(frame);
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Indicates if an updateUI call is pending.
0N/A */
0N/A private static boolean updatePending;
0N/A
0N/A /**
0N/A * Sets whether or not an updateUI call is pending.
0N/A */
0N/A private static synchronized void setUpdatePending(boolean update) {
0N/A updatePending = update;
0N/A }
0N/A
0N/A /**
0N/A * Returns true if a UI update is pending.
0N/A */
0N/A private static synchronized boolean isUpdatePending() {
0N/A return updatePending;
0N/A }
0N/A
0N/A protected void updateUI() {
0N/A if (!isUpdatePending()) {
0N/A setUpdatePending(true);
0N/A Runnable uiUpdater = new Runnable() {
0N/A public void run() {
0N/A updateAllUIs();
0N/A setUpdatePending(false);
0N/A }
0N/A };
0N/A SwingUtilities.invokeLater(uiUpdater);
0N/A }
0N/A }
0N/A }
0N/A
0N/A // From the JLF Design Guidelines:
0N/A // http://java.sun.com/products/jlf/ed2/book/HIG.Visual2.html
0N/A private static class MetalLayoutStyle extends DefaultLayoutStyle {
0N/A private static MetalLayoutStyle INSTANCE = new MetalLayoutStyle();
0N/A
0N/A @Override
0N/A public int getPreferredGap(JComponent component1,
0N/A JComponent component2, ComponentPlacement type, int position,
0N/A Container parent) {
0N/A // Checks args
0N/A super.getPreferredGap(component1, component2, type, position,
0N/A parent);
0N/A
0N/A int offset = 0;
0N/A
0N/A switch(type) {
0N/A case INDENT:
0N/A // Metal doesn't spec this.
0N/A if (position == SwingConstants.EAST ||
0N/A position == SwingConstants.WEST) {
0N/A int indent = getIndent(component1, position);
0N/A if (indent > 0) {
0N/A return indent;
0N/A }
0N/A return 12;
0N/A }
0N/A // Fall through to related.
0N/A case RELATED:
0N/A if (component1.getUIClassID() == "ToggleButtonUI" &&
0N/A component2.getUIClassID() == "ToggleButtonUI") {
0N/A ButtonModel sourceModel = ((JToggleButton)component1).
0N/A getModel();
0N/A ButtonModel targetModel = ((JToggleButton)component2).
0N/A getModel();
0N/A if ((sourceModel instanceof DefaultButtonModel) &&
0N/A (targetModel instanceof DefaultButtonModel) &&
0N/A (((DefaultButtonModel)sourceModel).getGroup() ==
0N/A ((DefaultButtonModel)targetModel).getGroup()) &&
0N/A ((DefaultButtonModel)sourceModel).getGroup() != null) {
0N/A // When toggle buttons are exclusive (that is,
0N/A // they form a radio button set), separate
0N/A // them with 2 pixels. This rule applies
0N/A // whether the toggle buttons appear in a
0N/A // toolbar or elsewhere in the interface.
0N/A // Note: this number does not appear to
0N/A // include any borders and so is not adjusted
0N/A // by the border of the toggle button
0N/A return 2;
0N/A }
0N/A // When toggle buttons are independent (like
0N/A // checkboxes) and used outside a toolbar,
0N/A // separate them with 5 pixels.
0N/A if (usingOcean()) {
0N/A return 6;
0N/A }
0N/A return 5;
0N/A }
0N/A offset = 6;
0N/A break;
0N/A case UNRELATED:
0N/A offset = 12;
0N/A break;
0N/A }
0N/A if (isLabelAndNonlabel(component1, component2, position)) {
0N/A // Insert 12 pixels between the trailing edge of a
0N/A // label and any associated components. Insert 12
0N/A // pixels between the trailing edge of a label and the
0N/A // component it describes when labels are
0N/A // right-aligned. When labels are left-aligned, insert
0N/A // 12 pixels between the trailing edge of the longest
0N/A // label and its associated component
0N/A return getButtonGap(component1, component2, position,
0N/A offset + 6);
0N/A }
0N/A return getButtonGap(component1, component2, position, offset);
0N/A }
0N/A
0N/A @Override
0N/A public int getContainerGap(JComponent component, int position,
0N/A Container parent) {
0N/A super.getContainerGap(component, position, parent);
0N/A // Include 11 pixels between the bottom and right
0N/A // borders of a dialog box and its command
0N/A // buttons. (To the eye, the 11-pixel spacing appears
0N/A // to be 12 pixels because the white borders on the
0N/A // lower and right edges of the button components are
0N/A // not visually significant.)
0N/A // NOTE: this last text was designed with Steel in mind,
0N/A // not Ocean.
0N/A //
0N/A // Insert 12 pixels between the edges of the panel and the
0N/A // titled border. Insert 11 pixels between the top of the
0N/A // title and the component above the titled border. Insert 12
0N/A // pixels between the bottom of the title and the top of the
0N/A // first label in the panel. Insert 11 pixels between
0N/A // component groups and between the bottom of the last
0N/A // component and the lower border.
0N/A return getButtonGap(component, position, 12 -
0N/A getButtonAdjustment(component, position));
0N/A }
0N/A
0N/A @Override
0N/A protected int getButtonGap(JComponent source, JComponent target,
0N/A int position, int offset) {
0N/A offset = super.getButtonGap(source, target, position, offset);
0N/A if (offset > 0) {
0N/A int buttonAdjustment = getButtonAdjustment(source, position);
0N/A if (buttonAdjustment == 0) {
0N/A buttonAdjustment = getButtonAdjustment(
0N/A target, flipDirection(position));
0N/A }
0N/A offset -= buttonAdjustment;
0N/A }
0N/A if (offset < 0) {
0N/A return 0;
0N/A }
0N/A return offset;
0N/A }
0N/A
0N/A private int getButtonAdjustment(JComponent source, int edge) {
0N/A String classID = source.getUIClassID();
0N/A if (classID == "ButtonUI" || classID == "ToggleButtonUI") {
0N/A if (!usingOcean() && (edge == SwingConstants.EAST ||
0N/A edge == SwingConstants.SOUTH)) {
0N/A if (source.getBorder() instanceof UIResource) {
0N/A return 1;
0N/A }
0N/A }
0N/A }
0N/A else if (edge == SwingConstants.SOUTH) {
0N/A if ((classID == "RadioButtonUI" || classID == "CheckBoxUI") &&
0N/A !usingOcean()) {
0N/A return 1;
0N/A }
0N/A }
0N/A return 0;
0N/A }
0N/A }
0N/A}