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