jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java
author xdono
Wed, 02 Jul 2008 12:55:45 -0700
changeset 715 f16baef3a20e
parent 680 eaff686e34f7
child 1299 027d966d5658
permissions -rw-r--r--
6719955: Update copyright year Summary: Update copyright year for files that have been modified in 2008 Reviewed-by: ohair, tbell
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
715
f16baef3a20e 6719955: Update copyright year
xdono
parents: 680
diff changeset
     2
 * Copyright 1998-2008 Sun Microsystems, Inc.  All Rights Reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.swing.plaf.metal;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.awt.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.beans.PropertyChangeEvent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.beans.PropertyChangeListener;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import javax.swing.plaf.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import javax.swing.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import javax.swing.plaf.basic.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import javax.swing.text.DefaultEditorKit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import java.awt.Color;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import java.awt.event.KeyEvent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import java.lang.reflect.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
import java.lang.ref.ReferenceQueue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
import java.lang.ref.WeakReference;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
import java.security.AccessController;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
import java.security.PrivilegedAction;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
import sun.awt.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
import sun.security.action.GetPropertyAction;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
import sun.swing.DefaultLayoutStyle;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
import sun.swing.SwingLazyValue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
import sun.swing.SwingUtilities2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * The Java Look and Feel, otherwise known as Metal.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * Each of the {@code ComponentUI}s provided by {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * MetalLookAndFeel} derives its behavior from the defaults
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * table. Unless otherwise noted each of the {@code ComponentUI}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * implementations in this package document the set of defaults they
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * use. Unless otherwise noted the defaults are installed at the time
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * {@code installUI} is invoked, and follow the recommendations
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * outlined in {@code LookAndFeel} for installing defaults.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * {@code MetalLookAndFeel} derives it's color palette and fonts from
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * {@code MetalTheme}. The default theme is {@code OceanTheme}. The theme
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 * can be changed using the {@code setCurrentTheme} method, refer to it
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 * for details on changing the theme. Prior to 1.5 the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 * theme was {@code DefaultMetalTheme}. The system property
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 * {@code "swing.metalTheme"} can be set to {@code "steel"} to indicate
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 * the default should be {@code DefaultMetalTheme}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 * <strong>Warning:</strong>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 * Serialized objects of this class will not be compatible with
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 * future Swing releases. The current serialization support is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 * appropriate for short term storage or RMI between applications running
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 * the same version of Swing.  As of 1.4, support for long term storage
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 * of all JavaBeans<sup><font size="-2">TM</font></sup>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 * has been added to the <code>java.beans</code> package.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 * Please see {@link java.beans.XMLEncoder}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 * @see DefaultMetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 * @see OceanTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
 * @author Steve Wilson
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
public class MetalLookAndFeel extends BasicLookAndFeel
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    private static boolean METAL_LOOK_AND_FEEL_INITED = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * True if checked for windows yet.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    private static boolean checkedWindows;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * True if running on Windows.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    private static boolean isWindows;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * Set to true first time we've checked swing.useSystemFontSettings.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    private static boolean checkedSystemFontSettings;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * True indicates we should use system fonts, unless the developer has
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * specified otherwise with Application.useSystemFontSettings.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    private static boolean useSystemFonts;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     * Returns true if running on Windows.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
    static boolean isWindows() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        if (!checkedWindows) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
            OSInfo.OSType osType = AccessController.doPrivileged(OSInfo.getOSTypeAction());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
            if (osType == OSInfo.OSType.WINDOWS) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
                isWindows = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
                String systemFonts = AccessController.doPrivileged(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
                    new GetPropertyAction("swing.useSystemFontSettings"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
                useSystemFonts = (systemFonts != null &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                               (Boolean.valueOf(systemFonts).booleanValue()));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
            checkedWindows = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        return isWindows;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * Returns true if system fonts should be used, this is only useful
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * for windows.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
    static boolean useSystemFonts() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        if (isWindows() && useSystemFonts) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
            if (METAL_LOOK_AND_FEEL_INITED) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
                Object value = UIManager.get(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
                                 "Application.useSystemFontSettings");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
                return (value == null || Boolean.TRUE.equals(value));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
            // If an instanceof MetalLookAndFeel hasn't been inited yet, we
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
            // don't want to trigger loading of a UI by asking the UIManager
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
            // for a property, assume the user wants system fonts. This will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
            // be properly adjusted when install is invoked on the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
            // MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
            return true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * Returns true if the high contrast theme should be used as the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * theme.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    private static boolean useHighContrastTheme() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
        if (isWindows() && useSystemFonts()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
            Boolean highContrast = (Boolean)Toolkit.getDefaultToolkit().
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
                                  getDesktopProperty("win.highContrast.on");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
            return (highContrast == null) ? false : highContrast.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
                                            booleanValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     * Returns true if we're using the Ocean Theme.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
    static boolean usingOcean() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        return (getCurrentTheme() instanceof OceanTheme);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * Returns the name of this look and feel. This returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     * {@code "Metal"}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * @return the name of this look and feel
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    public String getName() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        return "Metal";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     * Returns an identifier for this look and feel. This returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     * {@code "Metal"}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * @return the identifier of this look and feel
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
    public String getID() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
        return "Metal";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     * Returns a short description of this look and feel. This returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * {@code "The Java(tm) Look and Feel"}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     * @return a short description for the look and feel
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
    public String getDescription() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
        return "The Java(tm) Look and Feel";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     * Returns {@code false}; {@code MetalLookAndFeel} is not a native
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     * look and feel.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * @return {@code false}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    public boolean isNativeLookAndFeel() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * Returns {@code true}; {@code MetalLookAndFeel} can be run on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * any platform.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     * @return {@code true}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    public boolean isSupportedLookAndFeel() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        return true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     * Returns {@code true}; metal can provide {@code Window}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     * decorations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
     * @return {@code true}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     * @see JDialog#setDefaultLookAndFeelDecorated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     * @see JFrame#setDefaultLookAndFeelDecorated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     * @see JRootPane#setWindowDecorationStyle
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
    public boolean getSupportsWindowDecorations() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
        return true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     * Populates {@code table} with mappings from {@code uiClassID} to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     * the fully qualified name of the ui class. {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     * MetalLookAndFeel} registers an entry for each of the classes in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     * the package {@code javax.swing.plaf.metal} that are named
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     * MetalXXXUI. The string {@code XXX} is one of Swing's uiClassIDs. For
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     * the {@code uiClassIDs} that do not have a class in metal, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     * corresponding class in {@code javax.swing.plaf.basic} is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     * used. For example, metal does not have a class named {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     * "MetalColorChooserUI"}, as such, {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
     * javax.swing.plaf.basic.BasicColorChooserUI} is used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     * @param table the {@code UIDefaults} instance the entries are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     *        added to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     * @throws NullPointerException if {@code table} is {@code null}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     * @see javax.swing.plaf.basic.BasicLookAndFeel#initClassDefaults
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
    protected void initClassDefaults(UIDefaults table)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
        super.initClassDefaults(table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
        final String metalPackageName = "javax.swing.plaf.metal.";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
        Object[] uiDefaults = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
                   "ButtonUI", metalPackageName + "MetalButtonUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
                 "CheckBoxUI", metalPackageName + "MetalCheckBoxUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
                 "ComboBoxUI", metalPackageName + "MetalComboBoxUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
              "DesktopIconUI", metalPackageName + "MetalDesktopIconUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
              "FileChooserUI", metalPackageName + "MetalFileChooserUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
            "InternalFrameUI", metalPackageName + "MetalInternalFrameUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
                    "LabelUI", metalPackageName + "MetalLabelUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
       "PopupMenuSeparatorUI", metalPackageName + "MetalPopupMenuSeparatorUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
              "ProgressBarUI", metalPackageName + "MetalProgressBarUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
              "RadioButtonUI", metalPackageName + "MetalRadioButtonUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
                "ScrollBarUI", metalPackageName + "MetalScrollBarUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
               "ScrollPaneUI", metalPackageName + "MetalScrollPaneUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
                "SeparatorUI", metalPackageName + "MetalSeparatorUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
                   "SliderUI", metalPackageName + "MetalSliderUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
                "SplitPaneUI", metalPackageName + "MetalSplitPaneUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
               "TabbedPaneUI", metalPackageName + "MetalTabbedPaneUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
                "TextFieldUI", metalPackageName + "MetalTextFieldUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
             "ToggleButtonUI", metalPackageName + "MetalToggleButtonUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
                  "ToolBarUI", metalPackageName + "MetalToolBarUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
                  "ToolTipUI", metalPackageName + "MetalToolTipUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
                     "TreeUI", metalPackageName + "MetalTreeUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
                 "RootPaneUI", metalPackageName + "MetalRootPaneUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
        };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
        table.putDefaults(uiDefaults);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     * Populates {@code table} with system colors. The following values are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     * added to {@code table}:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     * <table border="1" cellpadding="1" cellspacing="0"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     *         summary="Metal's system color mapping"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     *         valign="top" >
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     *    <th bgcolor="#CCCCFF" align="left">Key
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
     *    <th bgcolor="#CCCCFF" align="left">Value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     *    <td>"desktop"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     *    <td>{@code theme.getDesktopColor()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     *    <td>"activeCaption"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
     *    <td>{@code theme.getWindowTitleBackground()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     *    <td>"activeCaptionText"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     *    <td>{@code theme.getWindowTitleForeground()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     *    <td>"activeCaptionBorder"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
     *    <td>{@code theme.getPrimaryControlShadow()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     *    <td>"inactiveCaption"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     *    <td>{@code theme.getWindowTitleInactiveBackground()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
     *    <td>"inactiveCaptionText"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
     *    <td>{@code theme.getWindowTitleInactiveForeground()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
     *    <td>"inactiveCaptionBorder"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
     *    <td>{@code theme.getControlShadow()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
     *    <td>"window"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
     *    <td>{@code theme.getWindowBackground()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     *    <td>"windowBorder"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
     *    <td>{@code theme.getControl()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
     *    <td>"windowText"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     *    <td>{@code theme.getUserTextColor()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     *    <td>"menu"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     *    <td>{@code theme.getMenuBackground()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     *    <td>"menuText"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     *    <td>{@code theme.getMenuForeground()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
     *    <td>"text"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
     *    <td>{@code theme.getWindowBackground()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
     *    <td>"textText"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
     *    <td>{@code theme.getUserTextColor()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
     *    <td>"textHighlight"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
     *    <td>{@code theme.getTextHighlightColor()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
     *    <td>"textHighlightText"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
     *    <td>{@code theme.getHighlightedTextColor()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
     *    <td>"textInactiveText"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
     *    <td>{@code theme.getInactiveSystemTextColor()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
     *    <td>"control"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
     *    <td>{@code theme.getControl()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     *    <td>"controlText"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
     *    <td>{@code theme.getControlTextColor()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
     *    <td>"controlHighlight"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
     *    <td>{@code theme.getControlHighlight()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
     *    <td>"controlLtHighlight"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
     *    <td>{@code theme.getControlHighlight()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     *    <td>"controlShadow"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     *    <td>{@code theme.getControlShadow()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     *    <td>"controlDkShadow"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     *    <td>{@code theme.getControlDarkShadow()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     *    <td>"scrollbar"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
     *    <td>{@code theme.getControl()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
     *    <td>"info"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
     *    <td>{@code theme.getPrimaryControl()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
     *  <tr valign="top"  align="left">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     *    <td>"infoText"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     *    <td>{@code theme.getPrimaryControlInfo()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     * </table>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     * The value {@code theme} corresponds to the current {@code MetalTheme}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
     * @param table the {@code UIDefaults} object the values are added to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
     * @throws NullPointerException if {@code table} is {@code null}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
    protected void initSystemColorDefaults(UIDefaults table)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
        MetalTheme theme = getCurrentTheme();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
        Color control = theme.getControl();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
        Object[] systemColors = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
                "desktop", theme.getDesktopColor(), /* Color of the desktop background */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
          "activeCaption", theme.getWindowTitleBackground(), /* Color for captions (title bars) when they are active. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
      "activeCaptionText", theme.getWindowTitleForeground(), /* Text color for text in captions (title bars). */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
    "activeCaptionBorder", theme.getPrimaryControlShadow(), /* Border color for caption (title bar) window borders. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
        "inactiveCaption", theme.getWindowTitleInactiveBackground(), /* Color for captions (title bars) when not active. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
    "inactiveCaptionText", theme.getWindowTitleInactiveForeground(), /* Text color for text in inactive captions (title bars). */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
  "inactiveCaptionBorder", theme.getControlShadow(), /* Border color for inactive caption (title bar) window borders. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
                 "window", theme.getWindowBackground(), /* Default color for the interior of windows */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
           "windowBorder", control, /* ??? */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
             "windowText", theme.getUserTextColor(), /* ??? */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
                   "menu", theme.getMenuBackground(), /* Background color for menus */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
               "menuText", theme.getMenuForeground(), /* Text color for menus  */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
                   "text", theme.getWindowBackground(), /* Text background color */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
               "textText", theme.getUserTextColor(), /* Text foreground color */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
          "textHighlight", theme.getTextHighlightColor(), /* Text background color when selected */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
      "textHighlightText", theme.getHighlightedTextColor(), /* Text color when selected */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
       "textInactiveText", theme.getInactiveSystemTextColor(), /* Text color when disabled */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
                "control", control, /* Default color for controls (buttons, sliders, etc) */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
            "controlText", theme.getControlTextColor(), /* Default color for text in controls */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
       "controlHighlight", theme.getControlHighlight(), /* Specular highlight (opposite of the shadow) */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
     "controlLtHighlight", theme.getControlHighlight(), /* Highlight color for controls */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
          "controlShadow", theme.getControlShadow(), /* Shadow color for controls */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
        "controlDkShadow", theme.getControlDarkShadow(), /* Dark shadow color for controls */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
              "scrollbar", control, /* Scrollbar background (usually the "track") */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
                   "info", theme.getPrimaryControl(), /* ToolTip Background */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
               "infoText", theme.getPrimaryControlInfo()  /* ToolTip Text */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
        };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
        table.putDefaults(systemColors);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     * Initialize the defaults table with the name of the ResourceBundle
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     * used for getting localized defaults.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
    private void initResourceBundle(UIDefaults table) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
        table.addResourceBundle( "com.sun.swing.internal.plaf.metal.resources.metal" );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     * Populates {@code table} with the defaults for metal.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     * @param table the {@code UIDefaults} to add the values to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     * @throws NullPointerException if {@code table} is {@code null}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
    protected void initComponentDefaults(UIDefaults table) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
        super.initComponentDefaults( table );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
        initResourceBundle(table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
        Color acceleratorForeground = getAcceleratorForeground();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
        Color acceleratorSelectedForeground = getAcceleratorSelectedForeground();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
        Color control = getControl();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
        Color controlHighlight = getControlHighlight();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
        Color controlShadow = getControlShadow();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
        Color controlDarkShadow = getControlDarkShadow();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
        Color controlTextColor = getControlTextColor();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
        Color focusColor = getFocusColor();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
        Color inactiveControlTextColor = getInactiveControlTextColor();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
        Color menuBackground = getMenuBackground();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
        Color menuSelectedBackground = getMenuSelectedBackground();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
        Color menuDisabledForeground = getMenuDisabledForeground();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
        Color menuSelectedForeground = getMenuSelectedForeground();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
        Color primaryControl = getPrimaryControl();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
        Color primaryControlDarkShadow = getPrimaryControlDarkShadow();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
        Color primaryControlShadow = getPrimaryControlShadow();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
        Color systemTextColor = getSystemTextColor();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
        Insets zeroInsets = new InsetsUIResource(0, 0, 0, 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
438
2ae294e4518c 6613529: Avoid duplicate object creation within JDK packages
dav
parents: 2
diff changeset
   458
        Integer zero = Integer.valueOf(0);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
        Object textFieldBorder =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
            new SwingLazyValue("javax.swing.plaf.metal.MetalBorders",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
                                          "getTextFieldBorder");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
        Object dialogBorder = new MetalLazyValue(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
                          "javax.swing.plaf.metal.MetalBorders$DialogBorder");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
        Object questionDialogBorder = new MetalLazyValue(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
                  "javax.swing.plaf.metal.MetalBorders$QuestionDialogBorder");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
        Object fieldInputMap = new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
                           "ctrl C", DefaultEditorKit.copyAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
                           "ctrl V", DefaultEditorKit.pasteAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
                           "ctrl X", DefaultEditorKit.cutAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
                             "COPY", DefaultEditorKit.copyAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
                            "PASTE", DefaultEditorKit.pasteAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
                              "CUT", DefaultEditorKit.cutAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
                   "control INSERT", DefaultEditorKit.copyAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
                     "shift INSERT", DefaultEditorKit.pasteAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
                     "shift DELETE", DefaultEditorKit.cutAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
                       "shift LEFT", DefaultEditorKit.selectionBackwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
                    "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
                      "shift RIGHT", DefaultEditorKit.selectionForwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
                   "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
                        "ctrl LEFT", DefaultEditorKit.previousWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
                     "ctrl KP_LEFT", DefaultEditorKit.previousWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
                       "ctrl RIGHT", DefaultEditorKit.nextWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
                    "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
                  "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
               "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
                 "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
              "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
                           "ctrl A", DefaultEditorKit.selectAllAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
                             "HOME", DefaultEditorKit.beginLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
                              "END", DefaultEditorKit.endLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
                       "shift HOME", DefaultEditorKit.selectionBeginLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
                        "shift END", DefaultEditorKit.selectionEndLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
                       "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
                 "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
                           "ctrl H", DefaultEditorKit.deletePrevCharAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
                           "DELETE", DefaultEditorKit.deleteNextCharAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
                      "ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
                  "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
                            "RIGHT", DefaultEditorKit.forwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
                             "LEFT", DefaultEditorKit.backwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
                         "KP_RIGHT", DefaultEditorKit.forwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
                          "KP_LEFT", DefaultEditorKit.backwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
                            "ENTER", JTextField.notifyAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
                  "ctrl BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
                   "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
        });
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
        Object passwordInputMap = new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
                           "ctrl C", DefaultEditorKit.copyAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
                           "ctrl V", DefaultEditorKit.pasteAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
                           "ctrl X", DefaultEditorKit.cutAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
                             "COPY", DefaultEditorKit.copyAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
                            "PASTE", DefaultEditorKit.pasteAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
                              "CUT", DefaultEditorKit.cutAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
                   "control INSERT", DefaultEditorKit.copyAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
                     "shift INSERT", DefaultEditorKit.pasteAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
                     "shift DELETE", DefaultEditorKit.cutAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
                       "shift LEFT", DefaultEditorKit.selectionBackwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
                    "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
                      "shift RIGHT", DefaultEditorKit.selectionForwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
                   "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
                        "ctrl LEFT", DefaultEditorKit.beginLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
                     "ctrl KP_LEFT", DefaultEditorKit.beginLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
                       "ctrl RIGHT", DefaultEditorKit.endLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
                    "ctrl KP_RIGHT", DefaultEditorKit.endLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
                  "ctrl shift LEFT", DefaultEditorKit.selectionBeginLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
               "ctrl shift KP_LEFT", DefaultEditorKit.selectionBeginLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
                 "ctrl shift RIGHT", DefaultEditorKit.selectionEndLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
              "ctrl shift KP_RIGHT", DefaultEditorKit.selectionEndLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
                           "ctrl A", DefaultEditorKit.selectAllAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
                             "HOME", DefaultEditorKit.beginLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
                              "END", DefaultEditorKit.endLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
                       "shift HOME", DefaultEditorKit.selectionBeginLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
                        "shift END", DefaultEditorKit.selectionEndLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
                       "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
                 "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
                           "ctrl H", DefaultEditorKit.deletePrevCharAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
                           "DELETE", DefaultEditorKit.deleteNextCharAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
                            "RIGHT", DefaultEditorKit.forwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
                             "LEFT", DefaultEditorKit.backwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
                         "KP_RIGHT", DefaultEditorKit.forwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
                          "KP_LEFT", DefaultEditorKit.backwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
                            "ENTER", JTextField.notifyAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
                  "ctrl BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
                   "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
        });
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
        Object multilineInputMap = new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
                           "ctrl C", DefaultEditorKit.copyAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
                           "ctrl V", DefaultEditorKit.pasteAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
                           "ctrl X", DefaultEditorKit.cutAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
                             "COPY", DefaultEditorKit.copyAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
                            "PASTE", DefaultEditorKit.pasteAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
                              "CUT", DefaultEditorKit.cutAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
                   "control INSERT", DefaultEditorKit.copyAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
                     "shift INSERT", DefaultEditorKit.pasteAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
                     "shift DELETE", DefaultEditorKit.cutAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
                       "shift LEFT", DefaultEditorKit.selectionBackwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
                    "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
                      "shift RIGHT", DefaultEditorKit.selectionForwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
                   "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
                        "ctrl LEFT", DefaultEditorKit.previousWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
                     "ctrl KP_LEFT", DefaultEditorKit.previousWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
                       "ctrl RIGHT", DefaultEditorKit.nextWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
                    "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
                  "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
               "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
                 "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
              "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
                           "ctrl A", DefaultEditorKit.selectAllAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
                             "HOME", DefaultEditorKit.beginLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
                              "END", DefaultEditorKit.endLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
                       "shift HOME", DefaultEditorKit.selectionBeginLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
                        "shift END", DefaultEditorKit.selectionEndLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
                               "UP", DefaultEditorKit.upAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
                            "KP_UP", DefaultEditorKit.upAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
                             "DOWN", DefaultEditorKit.downAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
                          "KP_DOWN", DefaultEditorKit.downAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
                          "PAGE_UP", DefaultEditorKit.pageUpAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
                        "PAGE_DOWN", DefaultEditorKit.pageDownAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
                    "shift PAGE_UP", "selection-page-up",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
                  "shift PAGE_DOWN", "selection-page-down",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
               "ctrl shift PAGE_UP", "selection-page-left",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
             "ctrl shift PAGE_DOWN", "selection-page-right",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
                         "shift UP", DefaultEditorKit.selectionUpAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
                      "shift KP_UP", DefaultEditorKit.selectionUpAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
                       "shift DOWN", DefaultEditorKit.selectionDownAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
                    "shift KP_DOWN", DefaultEditorKit.selectionDownAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
                            "ENTER", DefaultEditorKit.insertBreakAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
                       "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
                 "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
                           "ctrl H", DefaultEditorKit.deletePrevCharAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
                           "DELETE", DefaultEditorKit.deleteNextCharAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
                      "ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
                  "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
                            "RIGHT", DefaultEditorKit.forwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
                             "LEFT", DefaultEditorKit.backwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
                         "KP_RIGHT", DefaultEditorKit.forwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
                          "KP_LEFT", DefaultEditorKit.backwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
                              "TAB", DefaultEditorKit.insertTabAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
                  "ctrl BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
                        "ctrl HOME", DefaultEditorKit.beginAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
                         "ctrl END", DefaultEditorKit.endAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
                  "ctrl shift HOME", DefaultEditorKit.selectionBeginAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
                   "ctrl shift END", DefaultEditorKit.selectionEndAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
                           "ctrl T", "next-link-action",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
                     "ctrl shift T", "previous-link-action",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
                       "ctrl SPACE", "activate-link-action",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
                   "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
        });
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
        Object scrollPaneBorder = new SwingLazyValue("javax.swing.plaf.metal.MetalBorders$ScrollPaneBorder");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
        Object buttonBorder =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
                    new SwingLazyValue("javax.swing.plaf.metal.MetalBorders",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
                                          "getButtonBorder");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
        Object toggleButtonBorder =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
            new SwingLazyValue("javax.swing.plaf.metal.MetalBorders",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
                                          "getToggleButtonBorder");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
        Object titledBorderBorder =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
            new SwingLazyValue(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
                          "javax.swing.plaf.BorderUIResource$LineBorderUIResource",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
                          new Object[] {controlShadow});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
        Object desktopIconBorder =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
            new SwingLazyValue(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
                          "javax.swing.plaf.metal.MetalBorders",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
                          "getDesktopIconBorder");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
        Object menuBarBorder =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
            new SwingLazyValue(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
                          "javax.swing.plaf.metal.MetalBorders$MenuBarBorder");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
        Object popupMenuBorder =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
            new SwingLazyValue(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
                         "javax.swing.plaf.metal.MetalBorders$PopupMenuBorder");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
        Object menuItemBorder =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
            new SwingLazyValue(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
                         "javax.swing.plaf.metal.MetalBorders$MenuItemBorder");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
        Object menuItemAcceleratorDelimiter = "-";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
        Object toolBarBorder = new SwingLazyValue("javax.swing.plaf.metal.MetalBorders$ToolBarBorder");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
        Object progressBarBorder = new SwingLazyValue(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
                          "javax.swing.plaf.BorderUIResource$LineBorderUIResource",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
                          new Object[] {controlDarkShadow, new Integer(1)});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
        Object toolTipBorder = new SwingLazyValue(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
                          "javax.swing.plaf.BorderUIResource$LineBorderUIResource",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
                          new Object[] {primaryControlDarkShadow});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
        Object toolTipBorderInactive = new SwingLazyValue(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
                          "javax.swing.plaf.BorderUIResource$LineBorderUIResource",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
                          new Object[] {controlDarkShadow});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
        Object focusCellHighlightBorder = new SwingLazyValue(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
                          "javax.swing.plaf.BorderUIResource$LineBorderUIResource",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
                          new Object[] {focusColor});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
        Object tabbedPaneTabAreaInsets = new InsetsUIResource(4, 2, 0, 6);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
        Object tabbedPaneTabInsets = new InsetsUIResource(0, 9, 1, 9);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
        final Object[] internalFrameIconArgs = new Object[1];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
        internalFrameIconArgs[0] = new Integer(16);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
        Object[] defaultCueList = new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
                "OptionPane.errorSound",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
                "OptionPane.informationSound",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
                "OptionPane.questionSound",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
                "OptionPane.warningSound" };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   678
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
        MetalTheme theme = getCurrentTheme();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
        Object menuTextValue = new FontActiveValue(theme,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
                                                   MetalTheme.MENU_TEXT_FONT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
        Object controlTextValue = new FontActiveValue(theme,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
                               MetalTheme.CONTROL_TEXT_FONT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
        Object userTextValue = new FontActiveValue(theme,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
                                                   MetalTheme.USER_TEXT_FONT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
        Object windowTitleValue = new FontActiveValue(theme,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
                               MetalTheme.WINDOW_TITLE_FONT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
        Object subTextValue = new FontActiveValue(theme,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
                                                  MetalTheme.SUB_TEXT_FONT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
        Object systemTextValue = new FontActiveValue(theme,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
                                                 MetalTheme.SYSTEM_TEXT_FONT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
        // DEFAULTS TABLE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
        Object[] defaults = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
            // *** Auditory Feedback
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
            "AuditoryCues.defaultCueList", defaultCueList,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   699
            // this key defines which of the various cues to render
90ce3da70b43 Initial load
duke
parents:
diff changeset
   700
            // This is disabled until sound bugs can be resolved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
            "AuditoryCues.playList", null, // defaultCueList,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   702
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
            // Text (Note: many are inherited)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   704
            "TextField.border", textFieldBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
            "TextField.font", userTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
90ce3da70b43 Initial load
duke
parents:
diff changeset
   707
            "PasswordField.border", textFieldBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
            // passwordField.font should actually map to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
            // win.ansiFixed.font.height on windows.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
            "PasswordField.font", userTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
            "PasswordField.echoChar", (char)0x2022,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   712
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
            // TextArea.font should actually map to win.ansiFixed.font.height
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
            // on windows.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
            "TextArea.font", userTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   716
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
            "TextPane.background", table.get("window"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   718
            "TextPane.font", userTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
            "EditorPane.background", table.get("window"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   721
            "EditorPane.font", userTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   722
90ce3da70b43 Initial load
duke
parents:
diff changeset
   723
            "TextField.focusInputMap", fieldInputMap,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
            "PasswordField.focusInputMap", passwordInputMap,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   725
            "TextArea.focusInputMap", multilineInputMap,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   726
            "TextPane.focusInputMap", multilineInputMap,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   727
            "EditorPane.focusInputMap", multilineInputMap,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   728
90ce3da70b43 Initial load
duke
parents:
diff changeset
   729
            // FormattedTextFields
90ce3da70b43 Initial load
duke
parents:
diff changeset
   730
            "FormattedTextField.border", textFieldBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   731
            "FormattedTextField.font", userTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   732
            "FormattedTextField.focusInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   733
              new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   734
                           "ctrl C", DefaultEditorKit.copyAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   735
                           "ctrl V", DefaultEditorKit.pasteAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   736
                           "ctrl X", DefaultEditorKit.cutAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   737
                             "COPY", DefaultEditorKit.copyAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   738
                            "PASTE", DefaultEditorKit.pasteAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   739
                              "CUT", DefaultEditorKit.cutAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   740
                   "control INSERT", DefaultEditorKit.copyAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   741
                     "shift INSERT", DefaultEditorKit.pasteAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   742
                     "shift DELETE", DefaultEditorKit.cutAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   743
                       "shift LEFT", DefaultEditorKit.selectionBackwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   744
                    "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   745
                      "shift RIGHT", DefaultEditorKit.selectionForwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   746
                   "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   747
                        "ctrl LEFT", DefaultEditorKit.previousWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   748
                     "ctrl KP_LEFT", DefaultEditorKit.previousWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   749
                       "ctrl RIGHT", DefaultEditorKit.nextWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   750
                    "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   751
                  "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   752
               "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   753
                 "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   754
              "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   755
                           "ctrl A", DefaultEditorKit.selectAllAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   756
                             "HOME", DefaultEditorKit.beginLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   757
                              "END", DefaultEditorKit.endLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   758
                       "shift HOME", DefaultEditorKit.selectionBeginLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   759
                        "shift END", DefaultEditorKit.selectionEndLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   760
                       "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   761
                 "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   762
                           "ctrl H", DefaultEditorKit.deletePrevCharAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   763
                           "DELETE", DefaultEditorKit.deleteNextCharAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   764
                      "ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   765
                  "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   766
                            "RIGHT", DefaultEditorKit.forwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   767
                             "LEFT", DefaultEditorKit.backwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   768
                         "KP_RIGHT", DefaultEditorKit.forwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   769
                          "KP_LEFT", DefaultEditorKit.backwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   770
                            "ENTER", JTextField.notifyAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   771
                  "ctrl BACK_SLASH", "unselect",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   772
                   "control shift O", "toggle-componentOrientation",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   773
                           "ESCAPE", "reset-field-edit",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   774
                               "UP", "increment",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   775
                            "KP_UP", "increment",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   776
                             "DOWN", "decrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   777
                          "KP_DOWN", "decrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   778
              }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   779
90ce3da70b43 Initial load
duke
parents:
diff changeset
   780
90ce3da70b43 Initial load
duke
parents:
diff changeset
   781
            // Buttons
90ce3da70b43 Initial load
duke
parents:
diff changeset
   782
            "Button.defaultButtonFollowsFocus", Boolean.FALSE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   783
            "Button.disabledText", inactiveControlTextColor,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   784
            "Button.select", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   785
            "Button.border", buttonBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   786
            "Button.font", controlTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   787
            "Button.focus", focusColor,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   788
            "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   789
                          "SPACE", "pressed",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   790
                 "released SPACE", "released"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   791
              }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   792
90ce3da70b43 Initial load
duke
parents:
diff changeset
   793
            "CheckBox.disabledText", inactiveControlTextColor,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   794
            "Checkbox.select", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   795
            "CheckBox.font", controlTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   796
            "CheckBox.focus", focusColor,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   797
            "CheckBox.icon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getCheckBoxIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   798
            "CheckBox.focusInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   799
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   800
                            "SPACE", "pressed",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   801
                   "released SPACE", "released"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   802
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   803
            // margin is 2 all the way around, BasicBorders.RadioButtonBorder
90ce3da70b43 Initial load
duke
parents:
diff changeset
   804
            // (checkbox uses RadioButtonBorder) is 2 all the way around too.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   805
            "CheckBox.totalInsets", new Insets(4, 4, 4, 4),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   806
90ce3da70b43 Initial load
duke
parents:
diff changeset
   807
            "RadioButton.disabledText", inactiveControlTextColor,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   808
            "RadioButton.select", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   809
            "RadioButton.icon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getRadioButtonIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   810
            "RadioButton.font", controlTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   811
            "RadioButton.focus", focusColor,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   812
            "RadioButton.focusInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   813
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   814
                          "SPACE", "pressed",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   815
                 "released SPACE", "released"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   816
              }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   817
            // margin is 2 all the way around, BasicBorders.RadioButtonBorder
90ce3da70b43 Initial load
duke
parents:
diff changeset
   818
            // is 2 all the way around too.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   819
            "RadioButton.totalInsets", new Insets(4, 4, 4, 4),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   820
90ce3da70b43 Initial load
duke
parents:
diff changeset
   821
            "ToggleButton.select", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   822
            "ToggleButton.disabledText", inactiveControlTextColor,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   823
            "ToggleButton.focus", focusColor,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   824
            "ToggleButton.border", toggleButtonBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   825
            "ToggleButton.font", controlTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   826
            "ToggleButton.focusInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   827
              new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   828
                            "SPACE", "pressed",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   829
                   "released SPACE", "released"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   830
                }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   831
90ce3da70b43 Initial load
duke
parents:
diff changeset
   832
90ce3da70b43 Initial load
duke
parents:
diff changeset
   833
            // File View
90ce3da70b43 Initial load
duke
parents:
diff changeset
   834
            "FileView.directoryIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getTreeFolderIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   835
            "FileView.fileIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getTreeLeafIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   836
            "FileView.computerIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getTreeComputerIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   837
            "FileView.hardDriveIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getTreeHardDriveIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   838
            "FileView.floppyDriveIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getTreeFloppyDriveIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   839
90ce3da70b43 Initial load
duke
parents:
diff changeset
   840
            // File Chooser
90ce3da70b43 Initial load
duke
parents:
diff changeset
   841
            "FileChooser.detailsViewIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getFileChooserDetailViewIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   842
            "FileChooser.homeFolderIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getFileChooserHomeFolderIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   843
            "FileChooser.listViewIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getFileChooserListViewIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   844
            "FileChooser.newFolderIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getFileChooserNewFolderIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   845
            "FileChooser.upFolderIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getFileChooserUpFolderIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   846
90ce3da70b43 Initial load
duke
parents:
diff changeset
   847
            "FileChooser.lookInLabelMnemonic", new Integer(KeyEvent.VK_I),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   848
            "FileChooser.fileNameLabelMnemonic", new Integer(KeyEvent.VK_N),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   849
            "FileChooser.filesOfTypeLabelMnemonic", new Integer(KeyEvent.VK_T),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   850
            "FileChooser.usesSingleFilePane", Boolean.TRUE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   851
            "FileChooser.ancestorInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   852
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   853
                     "ESCAPE", "cancelSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   854
                     "F2", "editFileName",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   855
                     "F5", "refresh",
680
eaff686e34f7 5035693: "Open" button should be a default one in JFileChooser under Windows XP LAF
rupashka
parents: 438
diff changeset
   856
                     "BACK_SPACE", "Go Up"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   857
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   858
90ce3da70b43 Initial load
duke
parents:
diff changeset
   859
90ce3da70b43 Initial load
duke
parents:
diff changeset
   860
            // ToolTip
90ce3da70b43 Initial load
duke
parents:
diff changeset
   861
            "ToolTip.font", systemTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   862
            "ToolTip.border", toolTipBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   863
            "ToolTip.borderInactive", toolTipBorderInactive,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   864
            "ToolTip.backgroundInactive", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   865
            "ToolTip.foregroundInactive", controlDarkShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   866
            "ToolTip.hideAccelerator", Boolean.FALSE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   867
90ce3da70b43 Initial load
duke
parents:
diff changeset
   868
            // ToolTipManager
90ce3da70b43 Initial load
duke
parents:
diff changeset
   869
            "ToolTipManager.enableToolTipMode", "activeApplication",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   870
90ce3da70b43 Initial load
duke
parents:
diff changeset
   871
            // Slider Defaults
90ce3da70b43 Initial load
duke
parents:
diff changeset
   872
            "Slider.font", controlTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   873
            "Slider.border", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   874
            "Slider.foreground", primaryControlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   875
            "Slider.focus", focusColor,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   876
            "Slider.focusInsets", zeroInsets,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   877
            "Slider.trackWidth", new Integer( 7 ),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   878
            "Slider.majorTickLength", new Integer( 6 ),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   879
            "Slider.horizontalThumbIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getHorizontalSliderThumbIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   880
            "Slider.verticalThumbIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getVerticalSliderThumbIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   881
            "Slider.focusInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   882
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   883
                       "RIGHT", "positiveUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   884
                    "KP_RIGHT", "positiveUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   885
                        "DOWN", "negativeUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   886
                     "KP_DOWN", "negativeUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   887
                   "PAGE_DOWN", "negativeBlockIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   888
              "ctrl PAGE_DOWN", "negativeBlockIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   889
                        "LEFT", "negativeUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   890
                     "KP_LEFT", "negativeUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   891
                          "UP", "positiveUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   892
                       "KP_UP", "positiveUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   893
                     "PAGE_UP", "positiveBlockIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   894
                "ctrl PAGE_UP", "positiveBlockIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   895
                        "HOME", "minScroll",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   896
                         "END", "maxScroll"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   897
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   898
90ce3da70b43 Initial load
duke
parents:
diff changeset
   899
            // Progress Bar
90ce3da70b43 Initial load
duke
parents:
diff changeset
   900
            "ProgressBar.font", controlTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   901
            "ProgressBar.foreground", primaryControlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   902
            "ProgressBar.selectionBackground", primaryControlDarkShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   903
            "ProgressBar.border", progressBarBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   904
            "ProgressBar.cellSpacing", zero,
438
2ae294e4518c 6613529: Avoid duplicate object creation within JDK packages
dav
parents: 2
diff changeset
   905
            "ProgressBar.cellLength", Integer.valueOf(1),
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   906
90ce3da70b43 Initial load
duke
parents:
diff changeset
   907
            // Combo Box
90ce3da70b43 Initial load
duke
parents:
diff changeset
   908
            "ComboBox.background", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   909
            "ComboBox.foreground", controlTextColor,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   910
            "ComboBox.selectionBackground", primaryControlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   911
            "ComboBox.selectionForeground", controlTextColor,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   912
            "ComboBox.font", controlTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   913
            "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   914
                     "ESCAPE", "hidePopup",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   915
                    "PAGE_UP", "pageUpPassThrough",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   916
                  "PAGE_DOWN", "pageDownPassThrough",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   917
                       "HOME", "homePassThrough",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   918
                        "END", "endPassThrough",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   919
                       "DOWN", "selectNext",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   920
                    "KP_DOWN", "selectNext",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   921
                   "alt DOWN", "togglePopup",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   922
                "alt KP_DOWN", "togglePopup",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   923
                     "alt UP", "togglePopup",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   924
                  "alt KP_UP", "togglePopup",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   925
                      "SPACE", "spacePopup",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   926
                     "ENTER", "enterPressed",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   927
                         "UP", "selectPrevious",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   928
                      "KP_UP", "selectPrevious"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   929
              }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   930
90ce3da70b43 Initial load
duke
parents:
diff changeset
   931
            // Internal Frame Defaults
90ce3da70b43 Initial load
duke
parents:
diff changeset
   932
            "InternalFrame.icon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getInternalFrameDefaultMenuIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   933
            "InternalFrame.border", new SwingLazyValue("javax.swing.plaf.metal.MetalBorders$InternalFrameBorder"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   934
            "InternalFrame.optionDialogBorder", new SwingLazyValue("javax.swing.plaf.metal.MetalBorders$OptionDialogBorder"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   935
            "InternalFrame.paletteBorder", new SwingLazyValue("javax.swing.plaf.metal.MetalBorders$PaletteBorder"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   936
            "InternalFrame.paletteTitleHeight", new Integer(11),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   937
            "InternalFrame.paletteCloseIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory$PaletteCloseIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   938
            "InternalFrame.closeIcon",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   939
                  new SwingLazyValue(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   940
                                     "javax.swing.plaf.metal.MetalIconFactory",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   941
                                     "getInternalFrameCloseIcon",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   942
                                     internalFrameIconArgs),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   943
            "InternalFrame.maximizeIcon",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   944
                  new SwingLazyValue(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   945
                                     "javax.swing.plaf.metal.MetalIconFactory",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   946
                                     "getInternalFrameMaximizeIcon",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   947
                                     internalFrameIconArgs),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   948
            "InternalFrame.iconifyIcon",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   949
                  new SwingLazyValue(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   950
                                     "javax.swing.plaf.metal.MetalIconFactory",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   951
                                     "getInternalFrameMinimizeIcon",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   952
                                     internalFrameIconArgs),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   953
            "InternalFrame.minimizeIcon",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   954
                  new SwingLazyValue(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   955
                                     "javax.swing.plaf.metal.MetalIconFactory",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   956
                                     "getInternalFrameAltMaximizeIcon",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   957
                                     internalFrameIconArgs),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   958
            "InternalFrame.titleFont",  windowTitleValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   959
            "InternalFrame.windowBindings", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   960
            // Internal Frame Auditory Cue Mappings
90ce3da70b43 Initial load
duke
parents:
diff changeset
   961
            "InternalFrame.closeSound", "sounds/FrameClose.wav",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   962
            "InternalFrame.maximizeSound", "sounds/FrameMaximize.wav",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   963
            "InternalFrame.minimizeSound", "sounds/FrameMinimize.wav",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   964
            "InternalFrame.restoreDownSound", "sounds/FrameRestoreDown.wav",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   965
            "InternalFrame.restoreUpSound", "sounds/FrameRestoreUp.wav",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   966
90ce3da70b43 Initial load
duke
parents:
diff changeset
   967
            // Desktop Icon
90ce3da70b43 Initial load
duke
parents:
diff changeset
   968
            "DesktopIcon.border", desktopIconBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   969
            "DesktopIcon.font", controlTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   970
            "DesktopIcon.foreground", controlTextColor,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   971
            "DesktopIcon.background", control,
438
2ae294e4518c 6613529: Avoid duplicate object creation within JDK packages
dav
parents: 2
diff changeset
   972
            "DesktopIcon.width", Integer.valueOf(160),
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   973
90ce3da70b43 Initial load
duke
parents:
diff changeset
   974
            "Desktop.ancestorInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   975
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   976
                 "ctrl F5", "restore",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   977
                 "ctrl F4", "close",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   978
                 "ctrl F7", "move",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   979
                 "ctrl F8", "resize",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   980
                   "RIGHT", "right",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   981
                "KP_RIGHT", "right",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   982
             "shift RIGHT", "shrinkRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   983
          "shift KP_RIGHT", "shrinkRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   984
                    "LEFT", "left",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   985
                 "KP_LEFT", "left",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   986
              "shift LEFT", "shrinkLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   987
           "shift KP_LEFT", "shrinkLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   988
                      "UP", "up",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   989
                   "KP_UP", "up",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   990
                "shift UP", "shrinkUp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   991
             "shift KP_UP", "shrinkUp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   992
                    "DOWN", "down",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   993
                 "KP_DOWN", "down",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   994
              "shift DOWN", "shrinkDown",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   995
           "shift KP_DOWN", "shrinkDown",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   996
                  "ESCAPE", "escape",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   997
                 "ctrl F9", "minimize",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   998
                "ctrl F10", "maximize",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   999
                 "ctrl F6", "selectNextFrame",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1000
                "ctrl TAB", "selectNextFrame",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1001
             "ctrl alt F6", "selectNextFrame",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1002
       "shift ctrl alt F6", "selectPreviousFrame",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1003
                "ctrl F12", "navigateNext",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1004
           "shift ctrl F12", "navigatePrevious"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1005
              }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1006
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1007
            // Titled Border
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1008
            "TitledBorder.font", controlTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1009
            "TitledBorder.titleColor", systemTextColor,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1010
            "TitledBorder.border", titledBorderBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1011
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1012
            // Label
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1013
            "Label.font", controlTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1014
            "Label.foreground", systemTextColor,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1015
            "Label.disabledForeground", getInactiveSystemTextColor(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1016
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1017
            // List
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1018
            "List.font", controlTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1019
            "List.focusCellHighlightBorder", focusCellHighlightBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1020
            "List.focusInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1021
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1022
                           "ctrl C", "copy",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1023
                           "ctrl V", "paste",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1024
                           "ctrl X", "cut",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1025
                             "COPY", "copy",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1026
                            "PASTE", "paste",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1027
                              "CUT", "cut",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1028
                   "control INSERT", "copy",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1029
                     "shift INSERT", "paste",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1030
                     "shift DELETE", "cut",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1031
                               "UP", "selectPreviousRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1032
                            "KP_UP", "selectPreviousRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1033
                         "shift UP", "selectPreviousRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1034
                      "shift KP_UP", "selectPreviousRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1035
                    "ctrl shift UP", "selectPreviousRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1036
                 "ctrl shift KP_UP", "selectPreviousRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1037
                          "ctrl UP", "selectPreviousRowChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1038
                       "ctrl KP_UP", "selectPreviousRowChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1039
                             "DOWN", "selectNextRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1040
                          "KP_DOWN", "selectNextRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1041
                       "shift DOWN", "selectNextRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1042
                    "shift KP_DOWN", "selectNextRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1043
                  "ctrl shift DOWN", "selectNextRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1044
               "ctrl shift KP_DOWN", "selectNextRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1045
                        "ctrl DOWN", "selectNextRowChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1046
                     "ctrl KP_DOWN", "selectNextRowChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1047
                             "LEFT", "selectPreviousColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1048
                          "KP_LEFT", "selectPreviousColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1049
                       "shift LEFT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1050
                    "shift KP_LEFT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1051
                  "ctrl shift LEFT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1052
               "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1053
                        "ctrl LEFT", "selectPreviousColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1054
                     "ctrl KP_LEFT", "selectPreviousColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1055
                            "RIGHT", "selectNextColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1056
                         "KP_RIGHT", "selectNextColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1057
                      "shift RIGHT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1058
                   "shift KP_RIGHT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1059
                 "ctrl shift RIGHT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1060
              "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1061
                       "ctrl RIGHT", "selectNextColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1062
                    "ctrl KP_RIGHT", "selectNextColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1063
                             "HOME", "selectFirstRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1064
                       "shift HOME", "selectFirstRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1065
                  "ctrl shift HOME", "selectFirstRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1066
                        "ctrl HOME", "selectFirstRowChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1067
                              "END", "selectLastRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1068
                        "shift END", "selectLastRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1069
                   "ctrl shift END", "selectLastRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1070
                         "ctrl END", "selectLastRowChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1071
                          "PAGE_UP", "scrollUp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1072
                    "shift PAGE_UP", "scrollUpExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1073
               "ctrl shift PAGE_UP", "scrollUpExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1074
                     "ctrl PAGE_UP", "scrollUpChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1075
                        "PAGE_DOWN", "scrollDown",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1076
                  "shift PAGE_DOWN", "scrollDownExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1077
             "ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1078
                   "ctrl PAGE_DOWN", "scrollDownChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1079
                           "ctrl A", "selectAll",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1080
                       "ctrl SLASH", "selectAll",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1081
                  "ctrl BACK_SLASH", "clearSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1082
                            "SPACE", "addToSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1083
                       "ctrl SPACE", "toggleAndAnchor",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1084
                      "shift SPACE", "extendTo",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1085
                 "ctrl shift SPACE", "moveSelectionTo"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1086
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1087
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1088
            // ScrollBar
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1089
            "ScrollBar.background", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1090
            "ScrollBar.highlight", controlHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1091
            "ScrollBar.shadow", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1092
            "ScrollBar.darkShadow", controlDarkShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1093
            "ScrollBar.thumb", primaryControlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1094
            "ScrollBar.thumbShadow", primaryControlDarkShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1095
            "ScrollBar.thumbHighlight", primaryControl,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1096
            "ScrollBar.width", new Integer( 17 ),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1097
            "ScrollBar.allowsAbsolutePositioning", Boolean.TRUE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1098
            "ScrollBar.ancestorInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1099
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1100
                       "RIGHT", "positiveUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1101
                    "KP_RIGHT", "positiveUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1102
                        "DOWN", "positiveUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1103
                     "KP_DOWN", "positiveUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1104
                   "PAGE_DOWN", "positiveBlockIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1105
                        "LEFT", "negativeUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1106
                     "KP_LEFT", "negativeUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1107
                          "UP", "negativeUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1108
                       "KP_UP", "negativeUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1109
                     "PAGE_UP", "negativeBlockIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1110
                        "HOME", "minScroll",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1111
                         "END", "maxScroll"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1112
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1113
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1114
            // ScrollPane
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1115
            "ScrollPane.border", scrollPaneBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1116
            "ScrollPane.ancestorInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1117
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1118
                           "RIGHT", "unitScrollRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1119
                        "KP_RIGHT", "unitScrollRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1120
                            "DOWN", "unitScrollDown",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1121
                         "KP_DOWN", "unitScrollDown",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1122
                            "LEFT", "unitScrollLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1123
                         "KP_LEFT", "unitScrollLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1124
                              "UP", "unitScrollUp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1125
                           "KP_UP", "unitScrollUp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1126
                         "PAGE_UP", "scrollUp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1127
                       "PAGE_DOWN", "scrollDown",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1128
                    "ctrl PAGE_UP", "scrollLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1129
                  "ctrl PAGE_DOWN", "scrollRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1130
                       "ctrl HOME", "scrollHome",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1131
                        "ctrl END", "scrollEnd"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1132
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1133
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1134
            // Tabbed Pane
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1135
            "TabbedPane.font", controlTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1136
            "TabbedPane.tabAreaBackground", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1137
            "TabbedPane.background", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1138
            "TabbedPane.light", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1139
            "TabbedPane.focus", primaryControlDarkShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1140
            "TabbedPane.selected", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1141
            "TabbedPane.selectHighlight", controlHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1142
            "TabbedPane.tabAreaInsets", tabbedPaneTabAreaInsets,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1143
            "TabbedPane.tabInsets", tabbedPaneTabInsets,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1144
            "TabbedPane.focusInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1145
              new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1146
                         "RIGHT", "navigateRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1147
                      "KP_RIGHT", "navigateRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1148
                          "LEFT", "navigateLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1149
                       "KP_LEFT", "navigateLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1150
                            "UP", "navigateUp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1151
                         "KP_UP", "navigateUp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1152
                          "DOWN", "navigateDown",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1153
                       "KP_DOWN", "navigateDown",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1154
                     "ctrl DOWN", "requestFocusForVisibleComponent",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1155
                  "ctrl KP_DOWN", "requestFocusForVisibleComponent",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1156
                }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1157
            "TabbedPane.ancestorInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1158
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1159
                   "ctrl PAGE_DOWN", "navigatePageDown",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1160
                     "ctrl PAGE_UP", "navigatePageUp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1161
                          "ctrl UP", "requestFocus",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1162
                       "ctrl KP_UP", "requestFocus",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1163
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1164
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1165
            // Table
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1166
            "Table.font", userTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1167
            "Table.focusCellHighlightBorder", focusCellHighlightBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1168
            "Table.scrollPaneBorder", scrollPaneBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1169
            "Table.dropLineColor", focusColor,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1170
            "Table.dropLineShortColor", primaryControlDarkShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1171
            "Table.gridColor", controlShadow,  // grid line color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1172
            "Table.ancestorInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1173
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1174
                               "ctrl C", "copy",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1175
                               "ctrl V", "paste",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1176
                               "ctrl X", "cut",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1177
                                 "COPY", "copy",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1178
                                "PASTE", "paste",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1179
                                  "CUT", "cut",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1180
                       "control INSERT", "copy",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1181
                         "shift INSERT", "paste",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1182
                         "shift DELETE", "cut",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1183
                                "RIGHT", "selectNextColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1184
                             "KP_RIGHT", "selectNextColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1185
                          "shift RIGHT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1186
                       "shift KP_RIGHT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1187
                     "ctrl shift RIGHT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1188
                  "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1189
                           "ctrl RIGHT", "selectNextColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1190
                        "ctrl KP_RIGHT", "selectNextColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1191
                                 "LEFT", "selectPreviousColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1192
                              "KP_LEFT", "selectPreviousColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1193
                           "shift LEFT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1194
                        "shift KP_LEFT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1195
                      "ctrl shift LEFT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1196
                   "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1197
                            "ctrl LEFT", "selectPreviousColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1198
                         "ctrl KP_LEFT", "selectPreviousColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1199
                                 "DOWN", "selectNextRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1200
                              "KP_DOWN", "selectNextRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1201
                           "shift DOWN", "selectNextRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1202
                        "shift KP_DOWN", "selectNextRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1203
                      "ctrl shift DOWN", "selectNextRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1204
                   "ctrl shift KP_DOWN", "selectNextRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1205
                            "ctrl DOWN", "selectNextRowChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1206
                         "ctrl KP_DOWN", "selectNextRowChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1207
                                   "UP", "selectPreviousRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1208
                                "KP_UP", "selectPreviousRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1209
                             "shift UP", "selectPreviousRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1210
                          "shift KP_UP", "selectPreviousRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1211
                        "ctrl shift UP", "selectPreviousRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1212
                     "ctrl shift KP_UP", "selectPreviousRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1213
                              "ctrl UP", "selectPreviousRowChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1214
                           "ctrl KP_UP", "selectPreviousRowChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1215
                                 "HOME", "selectFirstColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1216
                           "shift HOME", "selectFirstColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1217
                      "ctrl shift HOME", "selectFirstRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1218
                            "ctrl HOME", "selectFirstRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1219
                                  "END", "selectLastColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1220
                            "shift END", "selectLastColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1221
                       "ctrl shift END", "selectLastRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1222
                             "ctrl END", "selectLastRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1223
                              "PAGE_UP", "scrollUpChangeSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1224
                        "shift PAGE_UP", "scrollUpExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1225
                   "ctrl shift PAGE_UP", "scrollLeftExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1226
                         "ctrl PAGE_UP", "scrollLeftChangeSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1227
                            "PAGE_DOWN", "scrollDownChangeSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1228
                      "shift PAGE_DOWN", "scrollDownExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1229
                 "ctrl shift PAGE_DOWN", "scrollRightExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1230
                       "ctrl PAGE_DOWN", "scrollRightChangeSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1231
                                  "TAB", "selectNextColumnCell",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1232
                            "shift TAB", "selectPreviousColumnCell",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1233
                                "ENTER", "selectNextRowCell",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1234
                          "shift ENTER", "selectPreviousRowCell",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1235
                               "ctrl A", "selectAll",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1236
                           "ctrl SLASH", "selectAll",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1237
                      "ctrl BACK_SLASH", "clearSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1238
                               "ESCAPE", "cancel",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1239
                                   "F2", "startEditing",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1240
                                "SPACE", "addToSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1241
                           "ctrl SPACE", "toggleAndAnchor",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1242
                          "shift SPACE", "extendTo",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1243
                     "ctrl shift SPACE", "moveSelectionTo",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1244
                                   "F8", "focusHeader"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1245
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1246
            "Table.ascendingSortIcon",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1247
                SwingUtilities2.makeIcon(getClass(), MetalLookAndFeel.class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1248
                "icons/sortUp.png"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1249
            "Table.descendingSortIcon",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1250
                SwingUtilities2.makeIcon(getClass(), MetalLookAndFeel.class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1251
                "icons/sortDown.png"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1252
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1253
            "TableHeader.font", userTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1254
            "TableHeader.cellBorder", new SwingLazyValue(
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1255
                                          "javax.swing.plaf.metal.MetalBorders$TableHeaderBorder"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1256
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1257
            // MenuBar
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1258
            "MenuBar.border", menuBarBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1259
            "MenuBar.font", menuTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1260
            "MenuBar.windowBindings", new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1261
                "F10", "takeFocus" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1262
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1263
            // Menu
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1264
            "Menu.border", menuItemBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1265
            "Menu.borderPainted", Boolean.TRUE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1266
            "Menu.menuPopupOffsetX", zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1267
            "Menu.menuPopupOffsetY", zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1268
            "Menu.submenuPopupOffsetX", new Integer(-4),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1269
            "Menu.submenuPopupOffsetY", new Integer(-3),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1270
            "Menu.font", menuTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1271
            "Menu.selectionForeground", menuSelectedForeground,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1272
            "Menu.selectionBackground", menuSelectedBackground,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1273
            "Menu.disabledForeground", menuDisabledForeground,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1274
            "Menu.acceleratorFont", subTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1275
            "Menu.acceleratorForeground", acceleratorForeground,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1276
            "Menu.acceleratorSelectionForeground", acceleratorSelectedForeground,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1277
            "Menu.checkIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getMenuItemCheckIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1278
            "Menu.arrowIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getMenuArrowIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1279
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1280
            // Menu Item
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1281
            "MenuItem.border", menuItemBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1282
            "MenuItem.borderPainted", Boolean.TRUE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1283
            "MenuItem.font", menuTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1284
            "MenuItem.selectionForeground", menuSelectedForeground,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1285
            "MenuItem.selectionBackground", menuSelectedBackground,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1286
            "MenuItem.disabledForeground", menuDisabledForeground,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1287
            "MenuItem.acceleratorFont", subTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1288
            "MenuItem.acceleratorForeground", acceleratorForeground,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1289
            "MenuItem.acceleratorSelectionForeground", acceleratorSelectedForeground,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1290
            "MenuItem.acceleratorDelimiter", menuItemAcceleratorDelimiter,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1291
            "MenuItem.checkIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getMenuItemCheckIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1292
            "MenuItem.arrowIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getMenuItemArrowIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1293
                 // Menu Item Auditory Cue Mapping
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1294
            "MenuItem.commandSound", "sounds/MenuItemCommand.wav",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1295
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1296
            // OptionPane.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1297
            "OptionPane.windowBindings", new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1298
                "ESCAPE", "close" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1299
            // Option Pane Auditory Cue Mappings
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1300
            "OptionPane.informationSound", "sounds/OptionPaneInformation.wav",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1301
            "OptionPane.warningSound", "sounds/OptionPaneWarning.wav",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1302
            "OptionPane.errorSound", "sounds/OptionPaneError.wav",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1303
            "OptionPane.questionSound", "sounds/OptionPaneQuestion.wav",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1304
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1305
            // Option Pane Special Dialog Colors, used when MetalRootPaneUI
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1306
            // is providing window manipulation widgets.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1307
            "OptionPane.errorDialog.border.background",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1308
                        new ColorUIResource(153, 51, 51),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1309
            "OptionPane.errorDialog.titlePane.foreground",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1310
                        new ColorUIResource(51, 0, 0),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1311
            "OptionPane.errorDialog.titlePane.background",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1312
                        new ColorUIResource(255, 153, 153),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1313
            "OptionPane.errorDialog.titlePane.shadow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1314
                        new ColorUIResource(204, 102, 102),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1315
            "OptionPane.questionDialog.border.background",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1316
                        new ColorUIResource(51, 102, 51),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1317
            "OptionPane.questionDialog.titlePane.foreground",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1318
                        new ColorUIResource(0, 51, 0),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1319
            "OptionPane.questionDialog.titlePane.background",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1320
                        new ColorUIResource(153, 204, 153),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1321
            "OptionPane.questionDialog.titlePane.shadow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1322
                        new ColorUIResource(102, 153, 102),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1323
            "OptionPane.warningDialog.border.background",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1324
                        new ColorUIResource(153, 102, 51),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1325
            "OptionPane.warningDialog.titlePane.foreground",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1326
                        new ColorUIResource(102, 51, 0),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1327
            "OptionPane.warningDialog.titlePane.background",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1328
                        new ColorUIResource(255, 204, 153),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1329
            "OptionPane.warningDialog.titlePane.shadow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1330
                        new ColorUIResource(204, 153, 102),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1331
            // OptionPane fonts are defined below
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1332
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1333
            // Separator
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1334
            "Separator.background", getSeparatorBackground(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1335
            "Separator.foreground", getSeparatorForeground(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1336
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1337
            // Popup Menu
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1338
            "PopupMenu.border", popupMenuBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1339
                 // Popup Menu Auditory Cue Mappings
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1340
            "PopupMenu.popupSound", "sounds/PopupMenuPopup.wav",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1341
            "PopupMenu.font", menuTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1342
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1343
            // CB & RB Menu Item
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1344
            "CheckBoxMenuItem.border", menuItemBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1345
            "CheckBoxMenuItem.borderPainted", Boolean.TRUE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1346
            "CheckBoxMenuItem.font", menuTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1347
            "CheckBoxMenuItem.selectionForeground", menuSelectedForeground,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1348
            "CheckBoxMenuItem.selectionBackground", menuSelectedBackground,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1349
            "CheckBoxMenuItem.disabledForeground", menuDisabledForeground,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1350
            "CheckBoxMenuItem.acceleratorFont", subTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1351
            "CheckBoxMenuItem.acceleratorForeground", acceleratorForeground,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1352
            "CheckBoxMenuItem.acceleratorSelectionForeground", acceleratorSelectedForeground,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1353
            "CheckBoxMenuItem.checkIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getCheckBoxMenuItemIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1354
            "CheckBoxMenuItem.arrowIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getMenuItemArrowIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1355
            "CheckBoxMenuItem.commandSound", "sounds/MenuItemCommand.wav",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1356
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1357
            "RadioButtonMenuItem.border", menuItemBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1358
            "RadioButtonMenuItem.borderPainted", Boolean.TRUE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1359
            "RadioButtonMenuItem.font", menuTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1360
            "RadioButtonMenuItem.selectionForeground", menuSelectedForeground,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1361
            "RadioButtonMenuItem.selectionBackground", menuSelectedBackground,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1362
            "RadioButtonMenuItem.disabledForeground", menuDisabledForeground,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1363
            "RadioButtonMenuItem.acceleratorFont", subTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1364
            "RadioButtonMenuItem.acceleratorForeground", acceleratorForeground,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1365
            "RadioButtonMenuItem.acceleratorSelectionForeground", acceleratorSelectedForeground,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1366
            "RadioButtonMenuItem.checkIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getRadioButtonMenuItemIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1367
            "RadioButtonMenuItem.arrowIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getMenuItemArrowIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1368
            "RadioButtonMenuItem.commandSound", "sounds/MenuItemCommand.wav",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1369
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1370
            "Spinner.ancestorInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1371
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1372
                               "UP", "increment",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1373
                            "KP_UP", "increment",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1374
                             "DOWN", "decrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1375
                          "KP_DOWN", "decrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1376
               }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1377
            "Spinner.arrowButtonInsets", zeroInsets,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1378
            "Spinner.border", textFieldBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1379
            "Spinner.arrowButtonBorder", buttonBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1380
            "Spinner.font", controlTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1381
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1382
            // SplitPane
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1383
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1384
            "SplitPane.dividerSize", new Integer(10),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1385
            "SplitPane.ancestorInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1386
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1387
                        "UP", "negativeIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1388
                      "DOWN", "positiveIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1389
                      "LEFT", "negativeIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1390
                     "RIGHT", "positiveIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1391
                     "KP_UP", "negativeIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1392
                   "KP_DOWN", "positiveIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1393
                   "KP_LEFT", "negativeIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1394
                  "KP_RIGHT", "positiveIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1395
                      "HOME", "selectMin",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1396
                       "END", "selectMax",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1397
                        "F8", "startResize",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1398
                        "F6", "toggleFocus",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1399
                  "ctrl TAB", "focusOutForward",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1400
            "ctrl shift TAB", "focusOutBackward"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1401
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1402
            "SplitPane.centerOneTouchButtons", Boolean.FALSE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1403
            "SplitPane.dividerFocusColor", primaryControl,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1404
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1405
            // Tree
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1406
            // Tree.font was mapped to system font pre 1.4.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1407
            "Tree.font", userTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1408
            "Tree.textBackground", getWindowBackground(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1409
            "Tree.selectionBorderColor", focusColor,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1410
            "Tree.openIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getTreeFolderIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1411
            "Tree.closedIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getTreeFolderIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1412
            "Tree.leafIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getTreeLeafIcon"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1413
            "Tree.expandedIcon", new SwingLazyValue(
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1414
                                     "javax.swing.plaf.metal.MetalIconFactory",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1415
                                     "getTreeControlIcon",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1416
                                     new Object[] {Boolean.valueOf(MetalIconFactory.DARK)}),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1417
            "Tree.collapsedIcon", new SwingLazyValue(
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1418
                                     "javax.swing.plaf.metal.MetalIconFactory",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1419
                                     "getTreeControlIcon",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1420
                                     new Object[] {Boolean.valueOf( MetalIconFactory.LIGHT )}),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1421
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1422
            "Tree.line", primaryControl, // horiz lines
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1423
            "Tree.hash", primaryControl,  // legs
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1424
            "Tree.rowHeight", zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1425
            "Tree.focusInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1426
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1427
                                    "ADD", "expand",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1428
                               "SUBTRACT", "collapse",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1429
                                 "ctrl C", "copy",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1430
                                 "ctrl V", "paste",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1431
                                 "ctrl X", "cut",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1432
                                   "COPY", "copy",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1433
                                  "PASTE", "paste",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1434
                                    "CUT", "cut",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1435
                         "control INSERT", "copy",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1436
                           "shift INSERT", "paste",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1437
                           "shift DELETE", "cut",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1438
                                     "UP", "selectPrevious",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1439
                                  "KP_UP", "selectPrevious",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1440
                               "shift UP", "selectPreviousExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1441
                            "shift KP_UP", "selectPreviousExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1442
                          "ctrl shift UP", "selectPreviousExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1443
                       "ctrl shift KP_UP", "selectPreviousExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1444
                                "ctrl UP", "selectPreviousChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1445
                             "ctrl KP_UP", "selectPreviousChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1446
                                   "DOWN", "selectNext",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1447
                                "KP_DOWN", "selectNext",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1448
                             "shift DOWN", "selectNextExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1449
                          "shift KP_DOWN", "selectNextExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1450
                        "ctrl shift DOWN", "selectNextExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1451
                     "ctrl shift KP_DOWN", "selectNextExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1452
                              "ctrl DOWN", "selectNextChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1453
                           "ctrl KP_DOWN", "selectNextChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1454
                                  "RIGHT", "selectChild",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1455
                               "KP_RIGHT", "selectChild",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1456
                                   "LEFT", "selectParent",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1457
                                "KP_LEFT", "selectParent",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1458
                                "PAGE_UP", "scrollUpChangeSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1459
                          "shift PAGE_UP", "scrollUpExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1460
                     "ctrl shift PAGE_UP", "scrollUpExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1461
                           "ctrl PAGE_UP", "scrollUpChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1462
                              "PAGE_DOWN", "scrollDownChangeSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1463
                        "shift PAGE_DOWN", "scrollDownExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1464
                   "ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1465
                         "ctrl PAGE_DOWN", "scrollDownChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1466
                                   "HOME", "selectFirst",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1467
                             "shift HOME", "selectFirstExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1468
                        "ctrl shift HOME", "selectFirstExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1469
                              "ctrl HOME", "selectFirstChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1470
                                    "END", "selectLast",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1471
                              "shift END", "selectLastExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1472
                         "ctrl shift END", "selectLastExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1473
                               "ctrl END", "selectLastChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1474
                                     "F2", "startEditing",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1475
                                 "ctrl A", "selectAll",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1476
                             "ctrl SLASH", "selectAll",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1477
                        "ctrl BACK_SLASH", "clearSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1478
                              "ctrl LEFT", "scrollLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1479
                           "ctrl KP_LEFT", "scrollLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1480
                             "ctrl RIGHT", "scrollRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1481
                          "ctrl KP_RIGHT", "scrollRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1482
                                  "SPACE", "addToSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1483
                             "ctrl SPACE", "toggleAndAnchor",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1484
                            "shift SPACE", "extendTo",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1485
                       "ctrl shift SPACE", "moveSelectionTo"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1486
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1487
            "Tree.ancestorInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1488
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1489
                     "ESCAPE", "cancel"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1490
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1491
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1492
            // ToolBar
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1493
            "ToolBar.border", toolBarBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1494
            "ToolBar.background", menuBackground,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1495
            "ToolBar.foreground", getMenuForeground(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1496
            "ToolBar.font", menuTextValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1497
            "ToolBar.dockingBackground", menuBackground,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1498
            "ToolBar.floatingBackground", menuBackground,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1499
            "ToolBar.dockingForeground", primaryControlDarkShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1500
            "ToolBar.floatingForeground", primaryControl,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1501
            "ToolBar.rolloverBorder", new MetalLazyValue(
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1502
                         "javax.swing.plaf.metal.MetalBorders",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1503
                         "getToolBarRolloverBorder"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1504
            "ToolBar.nonrolloverBorder", new MetalLazyValue(
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1505
                         "javax.swing.plaf.metal.MetalBorders",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1506
                         "getToolBarNonrolloverBorder"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1507
            "ToolBar.ancestorInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1508
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1509
                        "UP", "navigateUp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1510
                     "KP_UP", "navigateUp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1511
                      "DOWN", "navigateDown",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1512
                   "KP_DOWN", "navigateDown",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1513
                      "LEFT", "navigateLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1514
                   "KP_LEFT", "navigateLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1515
                     "RIGHT", "navigateRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1516
                  "KP_RIGHT", "navigateRight"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1517
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1518
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1519
            // RootPane
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1520
            "RootPane.frameBorder", new MetalLazyValue(
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1521
                      "javax.swing.plaf.metal.MetalBorders$FrameBorder"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1522
            "RootPane.plainDialogBorder", dialogBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1523
            "RootPane.informationDialogBorder", dialogBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1524
            "RootPane.errorDialogBorder", new MetalLazyValue(
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1525
                      "javax.swing.plaf.metal.MetalBorders$ErrorDialogBorder"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1526
            "RootPane.colorChooserDialogBorder", questionDialogBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1527
            "RootPane.fileChooserDialogBorder", questionDialogBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1528
            "RootPane.questionDialogBorder", questionDialogBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1529
            "RootPane.warningDialogBorder", new MetalLazyValue(
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1530
                    "javax.swing.plaf.metal.MetalBorders$WarningDialogBorder"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1531
            // These bindings are only enabled when there is a default
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1532
            // button set on the rootpane.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1533
            "RootPane.defaultButtonWindowKeyBindings", new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1534
                             "ENTER", "press",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1535
                    "released ENTER", "release",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1536
                        "ctrl ENTER", "press",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1537
               "ctrl released ENTER", "release"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1538
              },
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1539
        };
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1540
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1541
        table.putDefaults(defaults);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1542
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1543
        if (isWindows() && useSystemFonts() && theme.isSystemTheme()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1544
            Toolkit kit = Toolkit.getDefaultToolkit();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1545
            Object messageFont = new MetalFontDesktopProperty(
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1546
                              "win.messagebox.font.height", kit, MetalTheme.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1547
                              CONTROL_TEXT_FONT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1548
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1549
            defaults = new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1550
                "OptionPane.messageFont", messageFont,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1551
                "OptionPane.buttonFont", messageFont,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1552
            };
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1553
            table.putDefaults(defaults);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1554
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1555
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1556
        flushUnreferenced(); // Remove old listeners
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1557
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1558
        boolean lafCond = SwingUtilities2.isLocalDisplay();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1559
        Object aaTextInfo = SwingUtilities2.AATextInfo.getAATextInfo(lafCond);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1560
        table.put(SwingUtilities2.AA_TEXT_PROPERTY_KEY, aaTextInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1561
        new AATextListener(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1562
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1563
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1564
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1565
     * Ensures the current {@code MetalTheme} is {@code non-null}. This is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1566
     * a cover method for {@code getCurrentTheme}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1567
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1568
     * @see #getCurrentTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1569
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1570
    protected void createDefaultTheme() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1571
        getCurrentTheme();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1572
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1573
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1574
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1575
     * Returns the look and feel defaults. This invokes, in order,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1576
     * {@code createDefaultTheme()}, {@code super.getDefaults()} and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1577
     * {@code getCurrentTheme().addCustomEntriesToTable(table)}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1578
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1579
     * While this method is public, it should only be invoked by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1580
     * {@code UIManager} when the look and feel is set as the current
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1581
     * look and feel and after {@code initialize} has been invoked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1582
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1583
     * @return the look and feel defaults
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1584
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1585
     * @see #createDefaultTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1586
     * @see javax.swing.plaf.basic.BasicLookAndFeel#getDefaults()
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1587
     * @see MetalTheme#addCustomEntriesToTable(UIDefaults)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1588
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1589
    public UIDefaults getDefaults() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1590
        // PENDING: move this to initialize when API changes are allowed
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1591
        METAL_LOOK_AND_FEEL_INITED = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1592
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1593
        createDefaultTheme();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1594
        UIDefaults table = super.getDefaults();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1595
        MetalTheme currentTheme = getCurrentTheme();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1596
        currentTheme.addCustomEntriesToTable(table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1597
        currentTheme.install();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1598
        return table;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1599
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1600
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1601
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1602
     * {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1603
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1604
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1605
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1606
    public void provideErrorFeedback(Component component) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1607
        super.provideErrorFeedback(component);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1608
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1609
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1610
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1611
     * Set the theme used by <code>MetalLookAndFeel</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1612
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1613
     * After the theme is set, {@code MetalLookAndFeel} needs to be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1614
     * re-installed and the uis need to be recreated. The following
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1615
     * shows how to do this:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1616
     * <pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1617
     *   MetalLookAndFeel.setCurrentTheme(theme);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1618
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1619
     *   // re-install the Metal Look and Feel
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1620
     *   UIManager.setLookAndFeel(new MetalLookAndFeel());
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1621
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1622
     *   // Update the ComponentUIs for all Components. This
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1623
     *   // needs to be invoked for all windows.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1624
     *   SwingUtilities.updateComponentTreeUI(rootComponent);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1625
     * </pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1626
     * If this is not done the results are undefined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1627
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1628
     * @param theme the theme to use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1629
     * @throws NullPointerException if {@code theme} is {@code null}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1630
     * @see #getCurrentTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1631
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1632
    public static void setCurrentTheme(MetalTheme theme) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1633
        // NOTE: because you need to recreate the look and feel after
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1634
        // this step, we don't bother blowing away any potential windows
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1635
        // values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1636
        if (theme == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1637
            throw new NullPointerException("Can't have null theme");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1638
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1639
        AppContext.getAppContext().put( "currentMetalTheme", theme );
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1640
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1641
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1642
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1643
     * Return the theme currently being used by <code>MetalLookAndFeel</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1644
     * If the current theme is {@code null}, the default theme is created.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1645
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1646
     * @return the current theme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1647
     * @see #setCurrentTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1648
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1649
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1650
    public static MetalTheme getCurrentTheme() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1651
        MetalTheme currentTheme;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1652
        AppContext context = AppContext.getAppContext();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1653
        currentTheme = (MetalTheme) context.get( "currentMetalTheme" );
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1654
        if (currentTheme == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1655
            // This will happen in two cases:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1656
            // . When MetalLookAndFeel is first being initialized.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1657
            // . When a new AppContext has been created that hasn't
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1658
            //   triggered UIManager to load a LAF. Rather than invoke
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1659
            //   a method on the UIManager, which would trigger the loading
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1660
            //   of a potentially different LAF, we directly set the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1661
            //   Theme here.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1662
            if (useHighContrastTheme()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1663
                currentTheme = new MetalHighContrastTheme();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1664
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1665
            else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1666
                // Create the default theme. We prefer Ocean, but will
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1667
                // use DefaultMetalTheme if told to.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1668
                String theme = AccessController.doPrivileged(
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1669
                               new GetPropertyAction("swing.metalTheme"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1670
                if ("steel".equals(theme)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1671
                    currentTheme = new DefaultMetalTheme();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1672
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1673
                else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1674
                    currentTheme = new OceanTheme();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1675
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1676
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1677
            setCurrentTheme(currentTheme);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1678
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1679
        return currentTheme;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1680
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1681
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1682
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1683
     * Returns an <code>Icon</code> with a disabled appearance.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1684
     * This method is used to generate a disabled <code>Icon</code> when
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1685
     * one has not been specified.  For example, if you create a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1686
     * <code>JButton</code> and only specify an <code>Icon</code> via
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1687
     * <code>setIcon</code> this method will be called to generate the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1688
     * disabled <code>Icon</code>. If null is passed as <code>icon</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1689
     * this method returns null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1690
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1691
     * Some look and feels might not render the disabled Icon, in which
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1692
     * case they will ignore this.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1693
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1694
     * @param component JComponent that will display the Icon, may be null
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1695
     * @param icon Icon to generate disable icon from.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1696
     * @return Disabled icon, or null if a suitable Icon can not be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1697
     *         generated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1698
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1699
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1700
    public Icon getDisabledIcon(JComponent component, Icon icon) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1701
        if ((icon instanceof ImageIcon) && MetalLookAndFeel.usingOcean()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1702
            return MetalUtils.getOceanDisabledButtonIcon(
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1703
                                  ((ImageIcon)icon).getImage());
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1704
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1705
        return super.getDisabledIcon(component, icon);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1706
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1707
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1708
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1709
     * Returns an <code>Icon</code> for use by disabled
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1710
     * components that are also selected. This method is used to generate an
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1711
     * <code>Icon</code> for components that are in both the disabled and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1712
     * selected states but do not have a specific <code>Icon</code> for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1713
     * state.  For example, if you create a <code>JButton</code> and only
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1714
     * specify an <code>Icon</code> via <code>setIcon</code> this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1715
     * will be called to generate the disabled and selected
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1716
     * <code>Icon</code>. If null is passed as <code>icon</code> this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1717
     * returns null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1718
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1719
     * Some look and feels might not render the disabled and selected Icon,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1720
     * in which case they will ignore this.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1721
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1722
     * @param component JComponent that will display the Icon, may be null
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1723
     * @param icon Icon to generate disabled and selected icon from.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1724
     * @return Disabled and Selected icon, or null if a suitable Icon can not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1725
     *         be generated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1726
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1727
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1728
    public Icon getDisabledSelectedIcon(JComponent component, Icon icon) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1729
        if ((icon instanceof ImageIcon) && MetalLookAndFeel.usingOcean()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1730
            return MetalUtils.getOceanDisabledButtonIcon(
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1731
                                  ((ImageIcon)icon).getImage());
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1732
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1733
        return super.getDisabledSelectedIcon(component, icon);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1734
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1735
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1736
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1737
     * Returns the control text font of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1738
     * cover method for {@code getCurrentTheme().getControlTextColor()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1739
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1740
     * @return the control text font
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1741
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1742
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1743
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1744
    public static FontUIResource getControlTextFont() { return getCurrentTheme().getControlTextFont();}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1745
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1746
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1747
     * Returns the sytem text font of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1748
     * cover method for {@code getCurrentTheme().getSystemTextFont()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1749
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1750
     * @return the system text font
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1751
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1752
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1753
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1754
    public static FontUIResource getSystemTextFont() { return getCurrentTheme().getSystemTextFont();}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1755
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1756
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1757
     * Returns the user text font of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1758
     * cover method for {@code getCurrentTheme().getUserTextFont()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1759
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1760
     * @return the user text font
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1761
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1762
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1763
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1764
    public static FontUIResource getUserTextFont() { return getCurrentTheme().getUserTextFont();}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1765
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1766
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1767
     * Returns the menu text font of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1768
     * cover method for {@code getCurrentTheme().getMenuTextFont()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1769
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1770
     * @return the menu text font
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1771
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1772
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1773
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1774
    public static FontUIResource getMenuTextFont() { return getCurrentTheme().getMenuTextFont();}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1775
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1776
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1777
     * Returns the window title font of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1778
     * cover method for {@code getCurrentTheme().getWindowTitleFont()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1779
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1780
     * @return the window title font
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1781
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1782
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1783
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1784
    public static FontUIResource getWindowTitleFont() { return getCurrentTheme().getWindowTitleFont();}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1785
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1786
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1787
     * Returns the sub-text font of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1788
     * cover method for {@code getCurrentTheme().getSubTextFont()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1789
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1790
     * @return the sub-text font
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1791
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1792
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1793
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1794
    public static FontUIResource getSubTextFont() { return getCurrentTheme().getSubTextFont();}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1795
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1796
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1797
     * Returns the desktop color of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1798
     * cover method for {@code getCurrentTheme().getDesktopColor()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1799
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1800
     * @return the desktop color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1801
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1802
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1803
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1804
    public static ColorUIResource getDesktopColor() { return getCurrentTheme().getDesktopColor(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1805
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1806
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1807
     * Returns the focus color of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1808
     * cover method for {@code getCurrentTheme().getFocusColor()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1809
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1810
     * @return the focus color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1811
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1812
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1813
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1814
    public static ColorUIResource getFocusColor() { return getCurrentTheme().getFocusColor(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1815
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1816
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1817
     * Returns the white color of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1818
     * cover method for {@code getCurrentTheme().getWhite()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1819
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1820
     * @return the white color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1821
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1822
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1823
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1824
    public static ColorUIResource getWhite() { return getCurrentTheme().getWhite(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1825
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1826
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1827
     * Returns the black color of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1828
     * cover method for {@code getCurrentTheme().getBlack()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1829
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1830
     * @return the black color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1831
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1832
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1833
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1834
    public static ColorUIResource getBlack() { return getCurrentTheme().getBlack(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1835
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1836
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1837
     * Returns the control color of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1838
     * cover method for {@code getCurrentTheme().getControl()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1839
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1840
     * @return the control color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1841
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1842
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1843
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1844
    public static ColorUIResource getControl() { return getCurrentTheme().getControl(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1845
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1846
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1847
     * Returns the control shadow color of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1848
     * cover method for {@code getCurrentTheme().getControlShadow()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1849
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1850
     * @return the control shadow color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1851
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1852
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1853
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1854
    public static ColorUIResource getControlShadow() { return getCurrentTheme().getControlShadow(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1855
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1856
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1857
     * Returns the control dark shadow color of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1858
     * cover method for {@code getCurrentTheme().getControlDarkShadow()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1859
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1860
     * @return the control dark shadow color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1861
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1862
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1863
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1864
    public static ColorUIResource getControlDarkShadow() { return getCurrentTheme().getControlDarkShadow(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1865
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1866
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1867
     * Returns the control info color of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1868
     * cover method for {@code getCurrentTheme().getControlInfo()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1869
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1870
     * @return the control info color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1871
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1872
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1873
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1874
    public static ColorUIResource getControlInfo() { return getCurrentTheme().getControlInfo(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1875
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1876
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1877
     * Returns the control highlight color of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1878
     * cover method for {@code getCurrentTheme().getControlHighlight()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1879
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1880
     * @return the control highlight color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1881
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1882
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1883
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1884
    public static ColorUIResource getControlHighlight() { return getCurrentTheme().getControlHighlight(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1885
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1886
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1887
     * Returns the control disabled color of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1888
     * cover method for {@code getCurrentTheme().getControlDisabled()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1889
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1890
     * @return the control disabled color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1891
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1892
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1893
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1894
    public static ColorUIResource getControlDisabled() { return getCurrentTheme().getControlDisabled(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1895
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1896
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1897
     * Returns the primary control color of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1898
     * cover method for {@code getCurrentTheme().getPrimaryControl()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1899
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1900
     * @return the primary control color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1901
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1902
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1903
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1904
    public static ColorUIResource getPrimaryControl() { return getCurrentTheme().getPrimaryControl(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1905
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1906
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1907
     * Returns the primary control shadow color of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1908
     * cover method for {@code getCurrentTheme().getPrimaryControlShadow()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1909
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1910
     * @return the primary control shadow color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1911
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1912
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1913
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1914
    public static ColorUIResource getPrimaryControlShadow() { return getCurrentTheme().getPrimaryControlShadow(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1915
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1916
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1917
     * Returns the primary control dark shadow color of the current
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1918
     * theme. This is a cover method for {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1919
     * getCurrentTheme().getPrimaryControlDarkShadow()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1920
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1921
     * @return the primary control dark shadow color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1922
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1923
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1924
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1925
    public static ColorUIResource getPrimaryControlDarkShadow() { return getCurrentTheme().getPrimaryControlDarkShadow(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1926
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1927
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1928
     * Returns the primary control info color of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1929
     * cover method for {@code getCurrentTheme().getPrimaryControlInfo()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1930
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1931
     * @return the primary control info color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1932
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1933
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1934
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1935
    public static ColorUIResource getPrimaryControlInfo() { return getCurrentTheme().getPrimaryControlInfo(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1936
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1937
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1938
     * Returns the primary control highlight color of the current
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1939
     * theme. This is a cover method for {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1940
     * getCurrentTheme().getPrimaryControlHighlight()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1941
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1942
     * @return the primary control highlight color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1943
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1944
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1945
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1946
    public static ColorUIResource getPrimaryControlHighlight() { return getCurrentTheme().getPrimaryControlHighlight(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1947
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1948
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1949
     * Returns the system text color of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1950
     * cover method for {@code getCurrentTheme().getSystemTextColor()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1951
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1952
     * @return the system text color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1953
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1954
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1955
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1956
    public static ColorUIResource getSystemTextColor() { return getCurrentTheme().getSystemTextColor(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1957
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1958
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1959
     * Returns the control text color of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1960
     * cover method for {@code getCurrentTheme().getControlTextColor()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1961
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1962
     * @return the control text color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1963
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1964
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1965
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1966
    public static ColorUIResource getControlTextColor() { return getCurrentTheme().getControlTextColor(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1967
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1968
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1969
     * Returns the inactive control text color of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1970
     * cover method for {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1971
     * getCurrentTheme().getInactiveControlTextColor()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1972
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1973
     * @return the inactive control text color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1974
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1975
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1976
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1977
    public static ColorUIResource getInactiveControlTextColor() { return getCurrentTheme().getInactiveControlTextColor(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1978
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1979
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1980
     * Returns the inactive system text color of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1981
     * cover method for {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1982
     * getCurrentTheme().getInactiveSystemTextColor()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1983
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1984
     * @return the inactive system text color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1985
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1986
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1987
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1988
    public static ColorUIResource getInactiveSystemTextColor() { return getCurrentTheme().getInactiveSystemTextColor(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1989
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1990
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1991
     * Returns the user text color of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1992
     * cover method for {@code getCurrentTheme().getUserTextColor()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1993
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1994
     * @return the user text color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1995
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1996
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1997
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1998
    public static ColorUIResource getUserTextColor() { return getCurrentTheme().getUserTextColor(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1999
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2000
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2001
     * Returns the text highlight color of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2002
     * cover method for {@code getCurrentTheme().getTextHighlightColor()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2003
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2004
     * @return the text highlight color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2005
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2006
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2007
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2008
    public static ColorUIResource getTextHighlightColor() { return getCurrentTheme().getTextHighlightColor(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2009
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2010
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2011
     * Returns the highlighted text color of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2012
     * cover method for {@code getCurrentTheme().getHighlightedTextColor()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2013
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2014
     * @return the highlighted text color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2015
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2016
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2017
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2018
    public static ColorUIResource getHighlightedTextColor() { return getCurrentTheme().getHighlightedTextColor(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2019
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2020
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2021
     * Returns the window background color of the current theme. This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2022
     * cover method for {@code getCurrentTheme().getWindowBackground()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2023
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2024
     * @return the window background color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2025
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2026
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2027
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2028
    public static ColorUIResource getWindowBackground() { return getCurrentTheme().getWindowBackground(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2029
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2030
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2031
     * Returns the window title background color of the current
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2032
     * theme. This is a cover method for {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2033
     * getCurrentTheme().getWindowTitleBackground()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2034
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2035
     * @return the window title background color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2036
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2037
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2038
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2039
    public static ColorUIResource getWindowTitleBackground() { return getCurrentTheme().getWindowTitleBackground(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2040
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2041
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2042
     * Returns the window title foreground color of the current
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2043
     * theme. This is a cover method for {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2044
     * getCurrentTheme().getWindowTitleForeground()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2045
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2046
     * @return the window title foreground color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2047
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2048
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2049
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2050
    public static ColorUIResource getWindowTitleForeground() { return getCurrentTheme().getWindowTitleForeground(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2051
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2052
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2053
     * Returns the window title inactive background color of the current
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2054
     * theme. This is a cover method for {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2055
     * getCurrentTheme().getWindowTitleInactiveBackground()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2056
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2057
     * @return the window title inactive background color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2058
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2059
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2060
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2061
    public static ColorUIResource getWindowTitleInactiveBackground() { return getCurrentTheme().getWindowTitleInactiveBackground(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2062
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2063
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2064
     * Returns the window title inactive foreground color of the current
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2065
     * theme. This is a cover method for {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2066
     * getCurrentTheme().getWindowTitleInactiveForeground()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2067
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2068
     * @return the window title inactive foreground color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2069
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2070
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2071
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2072
    public static ColorUIResource getWindowTitleInactiveForeground() { return getCurrentTheme().getWindowTitleInactiveForeground(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2073
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2074
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2075
     * Returns the menu background color of the current theme. This is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2076
     * a cover method for {@code getCurrentTheme().getMenuBackground()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2077
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2078
     * @return the menu background color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2079
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2080
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2081
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2082
    public static ColorUIResource getMenuBackground() { return getCurrentTheme().getMenuBackground(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2083
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2084
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2085
     * Returns the menu foreground color of the current theme. This is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2086
     * a cover method for {@code getCurrentTheme().getMenuForeground()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2087
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2088
     * @return the menu foreground color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2089
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2090
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2091
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2092
    public static ColorUIResource getMenuForeground() { return getCurrentTheme().getMenuForeground(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2093
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2094
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2095
     * Returns the menu selected background color of the current theme. This is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2096
     * a cover method for
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2097
     * {@code getCurrentTheme().getMenuSelectedBackground()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2098
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2099
     * @return the menu selected background color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2100
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2101
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2102
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2103
    public static ColorUIResource getMenuSelectedBackground() { return getCurrentTheme().getMenuSelectedBackground(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2104
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2105
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2106
     * Returns the menu selected foreground color of the current theme. This is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2107
     * a cover method for
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2108
     * {@code getCurrentTheme().getMenuSelectedForeground()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2109
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2110
     * @return the menu selected foreground color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2111
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2112
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2113
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2114
    public static ColorUIResource getMenuSelectedForeground() { return getCurrentTheme().getMenuSelectedForeground(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2115
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2116
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2117
     * Returns the menu disabled foreground color of the current theme. This is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2118
     * a cover method for
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2119
     * {@code getCurrentTheme().getMenuDisabledForeground()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2120
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2121
     * @return the menu disabled foreground color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2122
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2123
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2124
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2125
    public static ColorUIResource getMenuDisabledForeground() { return getCurrentTheme().getMenuDisabledForeground(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2126
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2127
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2128
     * Returns the separator background color of the current theme. This is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2129
     * a cover method for {@code getCurrentTheme().getSeparatorBackground()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2130
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2131
     * @return the separator background color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2132
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2133
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2134
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2135
    public static ColorUIResource getSeparatorBackground() { return getCurrentTheme().getSeparatorBackground(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2136
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2137
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2138
     * Returns the separator foreground color of the current theme. This is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2139
     * a cover method for {@code getCurrentTheme().getSeparatorForeground()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2140
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2141
     * @return the separator foreground color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2142
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2143
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2144
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2145
    public static ColorUIResource getSeparatorForeground() { return getCurrentTheme().getSeparatorForeground(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2146
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2147
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2148
     * Returns the accelerator foreground color of the current theme. This is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2149
     * a cover method for {@code getCurrentTheme().getAcceleratorForeground()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2150
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2151
     * @return the separator accelerator foreground color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2152
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2153
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2154
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2155
    public static ColorUIResource getAcceleratorForeground() { return getCurrentTheme().getAcceleratorForeground(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2156
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2157
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2158
     * Returns the accelerator selected foreground color of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2159
     * current theme. This is a cover method for {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2160
     * getCurrentTheme().getAcceleratorSelectedForeground()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2161
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2162
     * @return the accelerator selected foreground color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2163
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2164
     * @see MetalTheme
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2165
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2166
    public static ColorUIResource getAcceleratorSelectedForeground() { return getCurrentTheme().getAcceleratorSelectedForeground(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2167
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2168
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2169
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2170
     * Returns a {@code LayoutStyle} implementing the Java look and feel
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2171
     * design guidelines as specified at
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2172
     * <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>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2173
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2174
     * @return LayoutStyle implementing the Java look and feel design
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2175
     *         guidelines
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2176
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2177
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2178
    public LayoutStyle getLayoutStyle() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2179
        return MetalLayoutStyle.INSTANCE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2180
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2181
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2182
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2183
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2184
     * MetalLazyValue is a slimmed down version of <code>ProxyLaxyValue</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2185
     * The code is duplicate so that it can get at the package private
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2186
     * classes in metal.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2187
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2188
    private static class MetalLazyValue implements UIDefaults.LazyValue {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2189
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2190
         * Name of the class to create.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2191
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2192
        private String className;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2193
        private String methodName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2194
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2195
        MetalLazyValue(String name) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2196
            this.className = name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2197
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2198
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2199
        MetalLazyValue(String name, String methodName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2200
            this(name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2201
            this.methodName = methodName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2202
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2203
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2204
        public Object createValue(UIDefaults table) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2205
            try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2206
                final Class c = Class.forName(className);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2207
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2208
                if (methodName == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2209
                    return c.newInstance();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2210
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2211
                Method method = (Method)AccessController.doPrivileged(
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2212
                    new PrivilegedAction() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2213
                    public Object run() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2214
                        Method[] methods = c.getDeclaredMethods();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2215
                        for (int counter = methods.length - 1; counter >= 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2216
                             counter--) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2217
                            if (methods[counter].getName().equals(methodName)){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2218
                                methods[counter].setAccessible(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2219
                                return methods[counter];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2220
                            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2221
                        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2222
                        return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2223
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2224
                });
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2225
                if (method != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2226
                    return method.invoke(null, (Object[])null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2227
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2228
            } catch (ClassNotFoundException cnfe) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2229
            } catch (InstantiationException ie) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2230
            } catch (IllegalAccessException iae) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2231
            } catch (InvocationTargetException ite) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2232
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2233
            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2234
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2235
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2236
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2237
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2238
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2239
     * FontActiveValue redirects to the appropriate metal theme method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2240
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2241
    private static class FontActiveValue implements UIDefaults.ActiveValue {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2242
        private int type;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2243
        private MetalTheme theme;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2244
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2245
        FontActiveValue(MetalTheme theme, int type) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2246
            this.theme = theme;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2247
            this.type = type;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2248
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2249
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2250
        public Object createValue(UIDefaults table) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2251
            Object value = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2252
            switch (type) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2253
            case MetalTheme.CONTROL_TEXT_FONT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2254
                value = theme.getControlTextFont();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2255
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2256
            case MetalTheme.SYSTEM_TEXT_FONT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2257
                value = theme.getSystemTextFont();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2258
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2259
            case MetalTheme.USER_TEXT_FONT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2260
                value = theme.getUserTextFont();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2261
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2262
            case MetalTheme.MENU_TEXT_FONT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2263
                value = theme.getMenuTextFont();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2264
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2265
            case MetalTheme.WINDOW_TITLE_FONT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2266
                value = theme.getWindowTitleFont();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2267
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2268
            case MetalTheme.SUB_TEXT_FONT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2269
                value = theme.getSubTextFont();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2270
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2271
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2272
            return value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2273
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2274
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2275
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2276
    static ReferenceQueue queue = new ReferenceQueue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2277
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2278
    static void flushUnreferenced() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2279
        AATextListener aatl;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2280
        while ((aatl = (AATextListener)queue.poll()) != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2281
            aatl.dispose();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2282
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2283
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2284
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2285
    static class AATextListener
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2286
        extends WeakReference implements PropertyChangeListener {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2287
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2288
        private String key = SunToolkit.DESKTOPFONTHINTS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2289
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2290
        AATextListener(LookAndFeel laf) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2291
            super(laf, queue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2292
            Toolkit tk = Toolkit.getDefaultToolkit();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2293
            tk.addPropertyChangeListener(key, this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2294
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2295
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2296
        public void propertyChange(PropertyChangeEvent pce) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2297
            LookAndFeel laf = (LookAndFeel)get();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2298
            if (laf == null || laf != UIManager.getLookAndFeel()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2299
                dispose();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2300
                return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2301
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2302
            UIDefaults defaults = UIManager.getLookAndFeelDefaults();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2303
            boolean lafCond = SwingUtilities2.isLocalDisplay();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2304
            Object aaTextInfo =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2305
                SwingUtilities2.AATextInfo.getAATextInfo(lafCond);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2306
            defaults.put(SwingUtilities2.AA_TEXT_PROPERTY_KEY, aaTextInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2307
            updateUI();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2308
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2309
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2310
        void dispose() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2311
            Toolkit tk = Toolkit.getDefaultToolkit();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2312
            tk.removePropertyChangeListener(key, this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2313
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2314
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2315
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2316
         * Updates the UI of the passed in window and all its children.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2317
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2318
        private static void updateWindowUI(Window window) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2319
            SwingUtilities.updateComponentTreeUI(window);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2320
            Window ownedWins[] = window.getOwnedWindows();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2321
            for (int i=0; i < ownedWins.length; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2322
                updateWindowUI(ownedWins[i]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2323
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2324
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2325
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2326
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2327
         * Updates the UIs of all the known Frames.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2328
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2329
        private static void updateAllUIs() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2330
            Frame appFrames[] = Frame.getFrames();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2331
            for (int j=0; j < appFrames.length; j++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2332
                updateWindowUI(appFrames[j]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2333
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2334
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2335
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2336
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2337
         * Indicates if an updateUI call is pending.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2338
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2339
        private static boolean updatePending;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2340
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2341
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2342
         * Sets whether or not an updateUI call is pending.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2343
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2344
        private static synchronized void setUpdatePending(boolean update) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2345
            updatePending = update;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2346
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2347
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2348
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2349
         * Returns true if a UI update is pending.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2350
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2351
        private static synchronized boolean isUpdatePending() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2352
            return updatePending;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2353
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2354
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2355
        protected void updateUI() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2356
            if (!isUpdatePending()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2357
                setUpdatePending(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2358
                Runnable uiUpdater = new Runnable() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2359
                        public void run() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2360
                            updateAllUIs();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2361
                            setUpdatePending(false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2362
                        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2363
                    };
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2364
                SwingUtilities.invokeLater(uiUpdater);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2365
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2366
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2367
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2368
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2369
    // From the JLF Design Guidelines:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2370
    // http://java.sun.com/products/jlf/ed2/book/HIG.Visual2.html
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2371
    private static class MetalLayoutStyle extends DefaultLayoutStyle {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2372
        private static MetalLayoutStyle INSTANCE = new MetalLayoutStyle();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2373
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2374
        @Override
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2375
        public int getPreferredGap(JComponent component1,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2376
                JComponent component2, ComponentPlacement type, int position,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2377
                Container parent) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2378
            // Checks args
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2379
            super.getPreferredGap(component1, component2, type, position,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2380
                                  parent);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2381
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2382
            int offset = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2383
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2384
            switch(type) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2385
            case INDENT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2386
                // Metal doesn't spec this.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2387
                if (position == SwingConstants.EAST ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2388
                        position == SwingConstants.WEST) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2389
                    int indent = getIndent(component1, position);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2390
                    if (indent > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2391
                        return indent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2392
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2393
                    return 12;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2394
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2395
                // Fall through to related.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2396
            case RELATED:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2397
                if (component1.getUIClassID() == "ToggleButtonUI" &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2398
                        component2.getUIClassID() == "ToggleButtonUI") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2399
                    ButtonModel sourceModel = ((JToggleButton)component1).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2400
                            getModel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2401
                    ButtonModel targetModel = ((JToggleButton)component2).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2402
                            getModel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2403
                    if ((sourceModel instanceof DefaultButtonModel) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2404
                        (targetModel instanceof DefaultButtonModel) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2405
                        (((DefaultButtonModel)sourceModel).getGroup() ==
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2406
                         ((DefaultButtonModel)targetModel).getGroup()) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2407
                        ((DefaultButtonModel)sourceModel).getGroup() != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2408
                        // When toggle buttons are exclusive (that is,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2409
                        // they form a radio button set), separate
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2410
                        // them with 2 pixels. This rule applies
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2411
                        // whether the toggle buttons appear in a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2412
                        // toolbar or elsewhere in the interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2413
                        // Note: this number does not appear to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2414
                        // include any borders and so is not adjusted
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2415
                        // by the border of the toggle button
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2416
                        return 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2417
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2418
                    // When toggle buttons are independent (like
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2419
                    // checkboxes) and used outside a toolbar,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2420
                    // separate them with 5 pixels.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2421
                    if (usingOcean()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2422
                        return 6;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2423
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2424
                    return 5;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2425
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2426
                offset = 6;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2427
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2428
            case UNRELATED:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2429
                offset = 12;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2430
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2431
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2432
            if (isLabelAndNonlabel(component1, component2, position)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2433
                // Insert 12 pixels between the trailing edge of a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2434
                // label and any associated components. Insert 12
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2435
                // pixels between the trailing edge of a label and the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2436
                // component it describes when labels are
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2437
                // right-aligned. When labels are left-aligned, insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2438
                // 12 pixels between the trailing edge of the longest
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2439
                // label and its associated component
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2440
                return getButtonGap(component1, component2, position,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2441
                                    offset + 6);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2442
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2443
            return getButtonGap(component1, component2, position, offset);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2444
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2445
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2446
        @Override
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2447
        public int getContainerGap(JComponent component, int position,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2448
                                   Container parent) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2449
            super.getContainerGap(component, position, parent);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2450
            // Include 11 pixels between the bottom and right
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2451
            // borders of a dialog box and its command
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2452
            // buttons. (To the eye, the 11-pixel spacing appears
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2453
            // to be 12 pixels because the white borders on the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2454
            // lower and right edges of the button components are
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2455
            // not visually significant.)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2456
            // NOTE: this last text was designed with Steel in mind,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2457
            // not Ocean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2458
            //
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2459
            // Insert 12 pixels between the edges of the panel and the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2460
            // titled border. Insert 11 pixels between the top of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2461
            // title and the component above the titled border. Insert 12
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2462
            // pixels between the bottom of the title and the top of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2463
            // first label in the panel. Insert 11 pixels between
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2464
            // component groups and between the bottom of the last
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2465
            // component and the lower border.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2466
            return getButtonGap(component, position, 12 -
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2467
                                getButtonAdjustment(component, position));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2468
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2469
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2470
        @Override
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2471
        protected int getButtonGap(JComponent source, JComponent target,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2472
                                   int position, int offset) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2473
            offset = super.getButtonGap(source, target, position, offset);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2474
            if (offset > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2475
                int buttonAdjustment = getButtonAdjustment(source, position);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2476
                if (buttonAdjustment == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2477
                    buttonAdjustment = getButtonAdjustment(
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2478
                            target, flipDirection(position));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2479
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2480
                offset -= buttonAdjustment;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2481
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2482
            if (offset < 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2483
                return 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2484
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2485
            return offset;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2486
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2487
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2488
        private int getButtonAdjustment(JComponent source, int edge) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2489
            String classID = source.getUIClassID();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2490
            if (classID == "ButtonUI" || classID == "ToggleButtonUI") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2491
                if (!usingOcean() && (edge == SwingConstants.EAST ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2492
                                      edge == SwingConstants.SOUTH)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2493
                    if (source.getBorder() instanceof UIResource) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2494
                        return 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2495
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2496
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2497
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2498
            else if (edge == SwingConstants.SOUTH) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2499
                if ((classID == "RadioButtonUI" || classID == "CheckBoxUI") &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2500
                        !usingOcean()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2501
                    return 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2502
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2503
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2504
            return 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2505
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2506
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2507
}