jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java
author weijun
Thu, 11 Dec 2014 15:19:12 +0800
changeset 28228 be83f404724d
parent 25859 3317bb8137f4
child 39542 1073ea3df2c7
permissions -rw-r--r--
8067207: Replace concat String to append in StringBuilder parameters (client) Reviewed-by: serb Contributed-by: Otavio Santana <otaviojava@java.net>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
22574
7f8ce0c8c20a 8032627: Add @SuppressWarnings("serial") to appropriate javax.swing classes
darcy
parents: 21278
diff changeset
     2
 * Copyright (c) 1997, 2014, 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: 1299
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: 1299
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: 1299
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1299
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1299
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.basic;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.awt.Font;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.awt.Color;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.awt.SystemColor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.awt.event.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.awt.Insets;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.awt.Component;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.awt.Container;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import java.awt.FocusTraversalPolicy;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import java.awt.AWTEvent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import java.awt.Toolkit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import java.awt.Point;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
import java.net.URL;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
import java.io.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
import java.awt.Dimension;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
import java.awt.KeyboardFocusManager;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
import java.security.AccessController;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
import java.security.PrivilegedAction;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
import java.util.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
import java.lang.reflect.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
import javax.sound.sampled.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
import sun.awt.AppContext;
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
    50
import sun.awt.SunToolkit;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
import sun.swing.SwingUtilities2;
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
    53
import sun.swing.icon.SortArrowIcon;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
import javax.swing.LookAndFeel;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
import javax.swing.AbstractAction;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
import javax.swing.Action;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
import javax.swing.ActionMap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
import javax.swing.BorderFactory;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
import javax.swing.JComponent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
import javax.swing.ImageIcon;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
import javax.swing.UIDefaults;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
import javax.swing.UIManager;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
import javax.swing.KeyStroke;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
import javax.swing.JTextField;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
import javax.swing.DefaultListCellRenderer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
import javax.swing.FocusManager;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
import javax.swing.LayoutFocusTraversalPolicy;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
import javax.swing.SwingUtilities;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
import javax.swing.MenuSelectionManager;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
import javax.swing.MenuElement;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
import javax.swing.border.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
import javax.swing.plaf.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
import javax.swing.text.JTextComponent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
import javax.swing.text.DefaultEditorKit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
import javax.swing.JInternalFrame;
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
    77
import static javax.swing.UIDefaults.LazyValue;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
import java.beans.PropertyVetoException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
import java.awt.Window;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
import java.beans.PropertyChangeListener;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
import java.beans.PropertyChangeEvent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
 * A base class to use in creating a look and feel for Swing.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
 * Each of the {@code ComponentUI}s provided by {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
 * BasicLookAndFeel} derives its behavior from the defaults
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
 * table. Unless otherwise noted each of the {@code ComponentUI}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
 * implementations in this package document the set of defaults they
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
 * use. Unless otherwise noted the defaults are installed at the time
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
 * {@code installUI} is invoked, and follow the recommendations
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
 * outlined in {@code LookAndFeel} for installing defaults.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
 * <strong>Warning:</strong>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
 * Serialized objects of this class will not be compatible with
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
 * future Swing releases. The current serialization support is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
 * appropriate for short term storage or RMI between applications running
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
 * 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: 15637
diff changeset
   100
 * of all JavaBeans&trade;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
 * has been added to the <code>java.beans</code> package.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
 * Please see {@link java.beans.XMLEncoder}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
 * @author unattributed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
 */
22574
7f8ce0c8c20a 8032627: Add @SuppressWarnings("serial") to appropriate javax.swing classes
darcy
parents: 21278
diff changeset
   106
@SuppressWarnings("serial") // Same-version serialization only
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
public abstract class BasicLookAndFeel extends LookAndFeel implements Serializable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     * Whether or not the developer has created a JPopupMenu.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    static boolean needsEventHelper;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * Lock used when manipulating clipPlaying.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    private transient Object audioLock = new Object();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * The Clip that is currently playing (set in AudioAction).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    private Clip clipPlaying;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    AWTEventHelper invocator = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * Listen for our AppContext being disposed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    private PropertyChangeListener disposer = null;
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 the look and feel defaults. The returned {@code UIDefaults}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * is populated by invoking, in order, {@code initClassDefaults},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * {@code initSystemColorDefaults} and {@code initComponentDefaults}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * While this method is public, it should only be invoked by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * {@code UIManager} when the look and feel is set as the current
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * look and feel and after {@code initialize} has been invoked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * @return the look and feel defaults
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * @see #initClassDefaults
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * @see #initSystemColorDefaults
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * @see #initComponentDefaults
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    public UIDefaults getDefaults() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        UIDefaults table = new UIDefaults(610, 0.75f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        initClassDefaults(table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        initSystemColorDefaults(table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
        initComponentDefaults(table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        return table;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    public void initialize() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
        if (needsEventHelper) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
            installAWTEventListener();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    void installAWTEventListener() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        if (invocator == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
            invocator = new AWTEventHelper();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
            needsEventHelper = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
            // Add a PropertyChangeListener to our AppContext so we're alerted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
            // when the AppContext is disposed(), at which time this laf should
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
            // be uninitialize()d.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
            disposer = new PropertyChangeListener() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
                public void propertyChange(PropertyChangeEvent prpChg) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
                    uninitialize();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
            };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
            AppContext.getAppContext().addPropertyChangeListener(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
                                                        AppContext.GUI_DISPOSED,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
                                                        disposer);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    public void uninitialize() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
        AppContext context = AppContext.getAppContext();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        synchronized (BasicPopupMenuUI.MOUSE_GRABBER_KEY) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
            Object grabber = context.get(BasicPopupMenuUI.MOUSE_GRABBER_KEY);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
            if (grabber != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
                ((BasicPopupMenuUI.MouseGrabber)grabber).uninstall();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        synchronized (BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
            Object helper =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
                    context.get(BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
            if (helper != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
                ((BasicPopupMenuUI.MenuKeyboardHelper)helper).uninstall();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
        if(invocator != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
            AccessController.doPrivileged(invocator);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
            invocator = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
        if (disposer != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
            // Note that we're likely calling removePropertyChangeListener()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
            // during the course of AppContext.firePropertyChange().
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
            // However, EventListenerAggreggate has code to safely modify
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
            // the list under such circumstances.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
            context.removePropertyChangeListener(AppContext.GUI_DISPOSED,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
                                                 disposer);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
            disposer = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     * Populates {@code table} with mappings from {@code uiClassID} to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     * fully qualified name of the ui class. The value for a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     * particular {@code uiClassID} is {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * "javax.swing.plaf.basic.Basic + uiClassID"}. For example, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     * value for the {@code uiClassID} {@code TreeUI} is {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * "javax.swing.plaf.basic.BasicTreeUI"}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     * @param table the {@code UIDefaults} instance the entries are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     *        added to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
     * @throws NullPointerException if {@code table} is {@code null}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     * @see javax.swing.LookAndFeel
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     * @see #getDefaults
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    protected void initClassDefaults(UIDefaults table)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
        final String basicPackageName = "javax.swing.plaf.basic.";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
        Object[] uiDefaults = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
                   "ButtonUI", basicPackageName + "BasicButtonUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
                 "CheckBoxUI", basicPackageName + "BasicCheckBoxUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
             "ColorChooserUI", basicPackageName + "BasicColorChooserUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
       "FormattedTextFieldUI", basicPackageName + "BasicFormattedTextFieldUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
                  "MenuBarUI", basicPackageName + "BasicMenuBarUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
                     "MenuUI", basicPackageName + "BasicMenuUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
                 "MenuItemUI", basicPackageName + "BasicMenuItemUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
         "CheckBoxMenuItemUI", basicPackageName + "BasicCheckBoxMenuItemUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
      "RadioButtonMenuItemUI", basicPackageName + "BasicRadioButtonMenuItemUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
              "RadioButtonUI", basicPackageName + "BasicRadioButtonUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
             "ToggleButtonUI", basicPackageName + "BasicToggleButtonUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
                "PopupMenuUI", basicPackageName + "BasicPopupMenuUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
              "ProgressBarUI", basicPackageName + "BasicProgressBarUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
                "ScrollBarUI", basicPackageName + "BasicScrollBarUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
               "ScrollPaneUI", basicPackageName + "BasicScrollPaneUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
                "SplitPaneUI", basicPackageName + "BasicSplitPaneUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
                   "SliderUI", basicPackageName + "BasicSliderUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
                "SeparatorUI", basicPackageName + "BasicSeparatorUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
                  "SpinnerUI", basicPackageName + "BasicSpinnerUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
         "ToolBarSeparatorUI", basicPackageName + "BasicToolBarSeparatorUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
       "PopupMenuSeparatorUI", basicPackageName + "BasicPopupMenuSeparatorUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
               "TabbedPaneUI", basicPackageName + "BasicTabbedPaneUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
                 "TextAreaUI", basicPackageName + "BasicTextAreaUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
                "TextFieldUI", basicPackageName + "BasicTextFieldUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
            "PasswordFieldUI", basicPackageName + "BasicPasswordFieldUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
                 "TextPaneUI", basicPackageName + "BasicTextPaneUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
               "EditorPaneUI", basicPackageName + "BasicEditorPaneUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
                     "TreeUI", basicPackageName + "BasicTreeUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
                    "LabelUI", basicPackageName + "BasicLabelUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
                     "ListUI", basicPackageName + "BasicListUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
                  "ToolBarUI", basicPackageName + "BasicToolBarUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
                  "ToolTipUI", basicPackageName + "BasicToolTipUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
                 "ComboBoxUI", basicPackageName + "BasicComboBoxUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
                    "TableUI", basicPackageName + "BasicTableUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
              "TableHeaderUI", basicPackageName + "BasicTableHeaderUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
            "InternalFrameUI", basicPackageName + "BasicInternalFrameUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
              "DesktopPaneUI", basicPackageName + "BasicDesktopPaneUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
              "DesktopIconUI", basicPackageName + "BasicDesktopIconUI",
6837
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents: 5506
diff changeset
   275
              "FileChooserUI", basicPackageName + "BasicFileChooserUI",
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
               "OptionPaneUI", basicPackageName + "BasicOptionPaneUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
                    "PanelUI", basicPackageName + "BasicPanelUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
                 "ViewportUI", basicPackageName + "BasicViewportUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
                 "RootPaneUI", basicPackageName + "BasicRootPaneUI",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
        };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
        table.putDefaults(uiDefaults);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     * Populates {@code table} with system colors. This creates an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
     * array of {@code name-color} pairs and invokes {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     * loadSystemColors}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     * The name is a {@code String} that corresponds to the name of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     * one of the static {@code SystemColor} fields in the {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     * SystemColor} class.  A name-color pair is created for every
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     * such {@code SystemColor} field.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     * The {@code color} corresponds to a hex {@code String} as
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
     * understood by {@code Color.decode}. For example, one of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     * {@code name-color} pairs is {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
     * "desktop"-"#005C5C"}. This corresponds to the {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     * SystemColor} field {@code desktop}, with a color value of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     * {@code new Color(0x005C5C)}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     * The following shows two of the {@code name-color} pairs:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     * <pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
     *   String[] nameColorPairs = new String[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     *          "desktop", "#005C5C",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     *    "activeCaption", "#000080" };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     *   loadSystemColors(table, nameColorPairs, isNativeLookAndFeel());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     * </pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
     * As previously stated, this invokes {@code loadSystemColors}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
     * with the supplied {@code table} and {@code name-color} pair
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     * array. The last argument to {@code loadSystemColors} indicates
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     * whether the value of the field in {@code SystemColor} should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     * used. This method passes the value of {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
     * isNativeLookAndFeel()} as the last argument to {@code loadSystemColors}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
     * @param table the {@code UIDefaults} object the values are added to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
     * @throws NullPointerException if {@code table} is {@code null}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
     * @see java.awt.SystemColor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
     * @see #getDefaults
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
     * @see #loadSystemColors
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
    protected void initSystemColorDefaults(UIDefaults table)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
        String[] defaultSystemColors = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
                "desktop", "#005C5C", /* Color of the desktop background */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
          "activeCaption", "#000080", /* Color for captions (title bars) when they are active. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
      "activeCaptionText", "#FFFFFF", /* Text color for text in captions (title bars). */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
    "activeCaptionBorder", "#C0C0C0", /* Border color for caption (title bar) window borders. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
        "inactiveCaption", "#808080", /* Color for captions (title bars) when not active. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
    "inactiveCaptionText", "#C0C0C0", /* Text color for text in inactive captions (title bars). */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
  "inactiveCaptionBorder", "#C0C0C0", /* Border color for inactive caption (title bar) window borders. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
                 "window", "#FFFFFF", /* Default color for the interior of windows */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
           "windowBorder", "#000000", /* ??? */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
             "windowText", "#000000", /* ??? */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
                   "menu", "#C0C0C0", /* Background color for menus */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
               "menuText", "#000000", /* Text color for menus  */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
                   "text", "#C0C0C0", /* Text background color */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
               "textText", "#000000", /* Text foreground color */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
          "textHighlight", "#000080", /* Text background color when selected */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
      "textHighlightText", "#FFFFFF", /* Text color when selected */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
       "textInactiveText", "#808080", /* Text color when disabled */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
                "control", "#C0C0C0", /* Default color for controls (buttons, sliders, etc) */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
            "controlText", "#000000", /* Default color for text in controls */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
       "controlHighlight", "#C0C0C0", /* Specular highlight (opposite of the shadow) */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
     "controlLtHighlight", "#FFFFFF", /* Highlight color for controls */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
          "controlShadow", "#808080", /* Shadow color for controls */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
        "controlDkShadow", "#000000", /* Dark shadow color for controls */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
              "scrollbar", "#E0E0E0", /* Scrollbar background (usually the "track") */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
                   "info", "#FFFFE1", /* ??? */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
               "infoText", "#000000"  /* ??? */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
        };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
        loadSystemColors(table, defaultSystemColors, isNativeLookAndFeel());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
     * Populates {@code table} with the {@code name-color} pairs in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
     * {@code systemColors}. Refer to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
     * {@link #initSystemColorDefaults(UIDefaults)} for details on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     * the format of {@code systemColors}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     * An entry is added to {@code table} for each of the {@code name-color}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     * pairs in {@code systemColors}. The entry key is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     * the {@code name} of the {@code name-color} pair.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     * The value of the entry corresponds to the {@code color} of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
     * {@code name-color} pair.  The value of the entry is calculated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
     * in one of two ways. With either approach the value is always a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
     * {@code ColorUIResource}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
     * If {@code useNative} is {@code false}, the {@code color} is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     * created by using {@code Color.decode} to convert the {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     * String} into a {@code Color}. If {@code decode} can not convert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     * the {@code String} into a {@code Color} ({@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     * NumberFormatException} is thrown) then a {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
     * ColorUIResource} of black is used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
     * If {@code useNative} is {@code true}, the {@code color} is the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
     * value of the field in {@code SystemColor} with the same name as
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
     * the {@code name} of the {@code name-color} pair. If the field
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
     * is not valid, a {@code ColorUIResource} of black is used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
     * @param table the {@code UIDefaults} object the values are added to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
     * @param systemColors array of {@code name-color} pairs as described
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
     *        in {@link #initSystemColorDefaults(UIDefaults)}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
     * @param useNative whether the color is obtained from {@code SystemColor}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
     *        or {@code Color.decode}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
     * @throws NullPointerException if {@code systemColors} is {@code null}; or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
     *         {@code systemColors} is not empty, and {@code table} is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
     *         {@code null}; or one of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     *         names of the {@code name-color} pairs is {@code null}; or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     *         {@code useNative} is {@code false} and one of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
     *         {@code colors} of the {@code name-color} pairs is {@code null}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
     * @throws ArrayIndexOutOfBoundsException if {@code useNative} is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
     *         {@code false} and {@code systemColors.length} is odd
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
     * @see #initSystemColorDefaults(javax.swing.UIDefaults)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     * @see java.awt.SystemColor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
     * @see java.awt.Color#decode(String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
    protected void loadSystemColors(UIDefaults table, String[] systemColors, boolean useNative)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
        /* PENDING(hmuller) We don't load the system colors below because
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
         * they're not reliable.  Hopefully we'll be able to do better in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
         * a future version of AWT.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
        if (useNative) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
            for(int i = 0; i < systemColors.length; i += 2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
                Color color = Color.black;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
                try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
                    String name = systemColors[i];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
                    color = (Color)(SystemColor.class.getField(name).get(null));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
                } catch (Exception e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
                table.put(systemColors[i], new ColorUIResource(color));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
            for(int i = 0; i < systemColors.length; i += 2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
                Color color = Color.black;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
                try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
                    color = Color.decode(systemColors[i + 1]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
                catch(NumberFormatException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
                    e.printStackTrace();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
                table.put(systemColors[i], new ColorUIResource(color));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     * Initialize the defaults table with the name of the ResourceBundle
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     * used for getting localized defaults.  Also initialize the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
     * locale used when no locale is passed into UIDefaults.get().  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
     * default locale should generally not be relied upon. It is here for
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 20458
diff changeset
   438
     * compatibility with releases prior to 1.4.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
    private void initResourceBundle(UIDefaults table) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
        table.setDefaultLocale( Locale.getDefault() );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
        table.addResourceBundle( "com.sun.swing.internal.plaf.basic.resources.basic" );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
     * Populates {@code table} with the defaults for the basic look and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
     * feel.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
     * @param table the {@code UIDefaults} to add the values to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
     * @throws NullPointerException if {@code table} is {@code null}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
    protected void initComponentDefaults(UIDefaults table)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
        initResourceBundle(table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
        // *** Shared Integers
25777
bb88947b6766 8049893: Replace uses of 'new Integer()' with appropriate alternative across client classes
prr
parents: 25565
diff changeset
   458
        Integer fiveHundred = 500;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
        // *** Shared Longs
25186
63e1a2ec30f5 8048267: Replace uses of 'new Long()' with appropriate alternative across core classes
prappo
parents: 23612
diff changeset
   461
        Long oneThousand = 1000L;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   463
        LazyValue dialogPlain12 = t ->
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   464
            new FontUIResource(Font.DIALOG, Font.PLAIN, 12);
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   465
        LazyValue serifPlain12 = t ->
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   466
            new FontUIResource(Font.SERIF, Font.PLAIN, 12);
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   467
        LazyValue sansSerifPlain12 =  t ->
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   468
            new FontUIResource(Font.SANS_SERIF, Font.PLAIN, 12);
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   469
        LazyValue monospacedPlain12 = t ->
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   470
            new FontUIResource(Font.MONOSPACED, Font.PLAIN, 12);
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   471
        LazyValue dialogBold12 = t ->
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   472
            new FontUIResource(Font.DIALOG, Font.BOLD, 12);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
        // *** Shared Colors
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
        ColorUIResource red = new ColorUIResource(Color.red);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
        ColorUIResource black = new ColorUIResource(Color.black);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
        ColorUIResource white = new ColorUIResource(Color.white);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
        ColorUIResource yellow = new ColorUIResource(Color.yellow);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
        ColorUIResource gray = new ColorUIResource(Color.gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
        ColorUIResource lightGray = new ColorUIResource(Color.lightGray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
        ColorUIResource darkGray = new ColorUIResource(Color.darkGray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
        ColorUIResource scrollBarTrack = new ColorUIResource(224, 224, 224);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
        Color control = table.getColor("control");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
        Color controlDkShadow = table.getColor("controlDkShadow");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
        Color controlHighlight = table.getColor("controlHighlight");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
        Color controlLtHighlight = table.getColor("controlLtHighlight");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
        Color controlShadow = table.getColor("controlShadow");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
        Color controlText = table.getColor("controlText");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
        Color menu = table.getColor("menu");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
        Color menuText = table.getColor("menuText");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
        Color textHighlight = table.getColor("textHighlight");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
        Color textHighlightText = table.getColor("textHighlightText");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
        Color textInactiveText = table.getColor("textInactiveText");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
        Color textText = table.getColor("textText");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
        Color window = table.getColor("window");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
        // *** Shared Insets
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
        InsetsUIResource zeroInsets = new InsetsUIResource(0,0,0,0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
        InsetsUIResource twoInsets = new InsetsUIResource(2,2,2,2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
        InsetsUIResource threeInsets = new InsetsUIResource(3,3,3,3);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
        // *** Shared Borders
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   505
        LazyValue marginBorder = t -> new BasicBorders.MarginBorder();
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   506
        LazyValue etchedBorder = t ->
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   507
            BorderUIResource.getEtchedBorderUIResource();
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   508
        LazyValue loweredBevelBorder = t ->
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   509
            BorderUIResource.getLoweredBevelBorderUIResource();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   511
        LazyValue popupMenuBorder = t -> BasicBorders.getInternalFrameBorder();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   513
        LazyValue blackLineBorder = t ->
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   514
            BorderUIResource.getBlackLineBorderUIResource();
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   515
        LazyValue focusCellHighlightBorder = t ->
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   516
            new BorderUIResource.LineBorderUIResource(yellow);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
        Object noFocusBorder = new BorderUIResource.EmptyBorderUIResource(1,1,1,1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   520
        LazyValue tableHeaderBorder = t ->
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   521
            new BorderUIResource.BevelBorderUIResource(
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   522
                    BevelBorder.RAISED,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
                                         controlLtHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
                                         control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
                                         controlDkShadow,
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   526
                    controlShadow);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
        // *** Button value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   531
        LazyValue buttonBorder =
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   532
            t -> BasicBorders.getButtonBorder();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   534
        LazyValue buttonToggleBorder =
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   535
            t -> BasicBorders.getToggleButtonBorder();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   537
        LazyValue radioButtonBorder =
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   538
            t -> BasicBorders.getRadioButtonBorder();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
        // *** FileChooser / FileView value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
        Object newFolderIcon = SwingUtilities2.makeIcon(getClass(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
                                                        BasicLookAndFeel.class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
                                                        "icons/NewFolder.gif");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
        Object upFolderIcon = SwingUtilities2.makeIcon(getClass(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
                                                       BasicLookAndFeel.class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
                                                       "icons/UpFolder.gif");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
        Object homeFolderIcon = SwingUtilities2.makeIcon(getClass(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
                                                         BasicLookAndFeel.class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
                                                         "icons/HomeFolder.gif");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
        Object detailsViewIcon = SwingUtilities2.makeIcon(getClass(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
                                                          BasicLookAndFeel.class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
                                                          "icons/DetailsView.gif");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
        Object listViewIcon = SwingUtilities2.makeIcon(getClass(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
                                                       BasicLookAndFeel.class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
                                                       "icons/ListView.gif");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
        Object directoryIcon = SwingUtilities2.makeIcon(getClass(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
                                                        BasicLookAndFeel.class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
                                                        "icons/Directory.gif");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
        Object fileIcon = SwingUtilities2.makeIcon(getClass(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
                                                   BasicLookAndFeel.class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
                                                   "icons/File.gif");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
        Object computerIcon = SwingUtilities2.makeIcon(getClass(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
                                                       BasicLookAndFeel.class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
                                                       "icons/Computer.gif");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
        Object hardDriveIcon = SwingUtilities2.makeIcon(getClass(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
                                                        BasicLookAndFeel.class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
                                                        "icons/HardDrive.gif");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
        Object floppyDriveIcon = SwingUtilities2.makeIcon(getClass(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
                                                          BasicLookAndFeel.class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
                                                          "icons/FloppyDrive.gif");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
        // *** InternalFrame value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   576
        LazyValue internalFrameBorder = t ->
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   577
            BasicBorders.getInternalFrameBorder();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
        // *** List value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
        Object listCellRendererActiveValue = new UIDefaults.ActiveValue() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
            public Object createValue(UIDefaults table) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
                return new DefaultListCellRenderer.UIResource();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
        };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
        // *** Menus value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   590
        LazyValue menuBarBorder =
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   591
            t -> BasicBorders.getMenuBarBorder();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   593
        LazyValue menuItemCheckIcon =
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   594
            t -> BasicIconFactory.getMenuItemCheckIcon();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   596
        LazyValue menuItemArrowIcon =
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   597
            t -> BasicIconFactory.getMenuItemArrowIcon();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   600
        LazyValue menuArrowIcon =
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   601
            t -> BasicIconFactory.getMenuArrowIcon();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   603
        LazyValue checkBoxIcon =
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   604
            t -> BasicIconFactory.getCheckBoxIcon();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   606
        LazyValue radioButtonIcon =
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   607
            t -> BasicIconFactory.getRadioButtonIcon();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   609
        LazyValue checkBoxMenuItemIcon =
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   610
            t -> BasicIconFactory.getCheckBoxMenuItemIcon();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   612
        LazyValue radioButtonMenuItemIcon =
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   613
            t -> BasicIconFactory.getRadioButtonMenuItemIcon();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
438
2ae294e4518c 6613529: Avoid duplicate object creation within JDK packages
dav
parents: 2
diff changeset
   615
        Object menuItemAcceleratorDelimiter = "+";
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
        // *** OptionPane value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
        Object optionPaneMinimumSize = new DimensionUIResource(262, 90);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   621
        int zero =  0;
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   622
        LazyValue zeroBorder = t ->
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   623
            new BorderUIResource.EmptyBorderUIResource(zero, zero, zero, zero);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   625
        int ten = 10;
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   626
        LazyValue optionPaneBorder = t ->
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   627
            new BorderUIResource.EmptyBorderUIResource(ten, ten, 12, ten);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   629
        LazyValue optionPaneButtonAreaBorder = t ->
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   630
            new BorderUIResource.EmptyBorderUIResource(6, zero, zero, zero);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
        // *** ProgessBar value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   635
        LazyValue progressBarBorder =
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   636
            t -> BasicBorders.getProgressBarBorder();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
        // ** ScrollBar value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
        Object minimumThumbSize = new DimensionUIResource(8,8);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
        Object maximumThumbSize = new DimensionUIResource(4096,4096);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
        // ** Slider value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
        Object sliderFocusInsets = twoInsets;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
        Object toolBarSeparatorSize = new DimensionUIResource( 10, 10 );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
        // *** SplitPane value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   652
        LazyValue splitPaneBorder =
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   653
            t -> BasicBorders.getSplitPaneBorder();
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   654
        LazyValue splitPaneDividerBorder =
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   655
            t -> BasicBorders.getSplitPaneDividerBorder();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
        // ** TabbedBane value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
        Object tabbedPaneTabInsets = new InsetsUIResource(0, 4, 1, 4);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
        Object tabbedPaneTabPadInsets = new InsetsUIResource(2, 2, 2, 1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
        Object tabbedPaneTabAreaInsets = new InsetsUIResource(3, 2, 0, 2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
        Object tabbedPaneContentBorderInsets = new InsetsUIResource(2, 2, 3, 3);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
        // *** Text value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   670
        LazyValue textFieldBorder =
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   671
            t -> BasicBorders.getTextFieldBorder();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
        Object editorMargin = threeInsets;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
        Object caretBlinkRate = fiveHundred;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
        Object[] allAuditoryCues = new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   678
                "CheckBoxMenuItem.commandSound",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
                "InternalFrame.closeSound",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
                "InternalFrame.maximizeSound",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
                "InternalFrame.minimizeSound",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
                "InternalFrame.restoreDownSound",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
                "InternalFrame.restoreUpSound",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
                "MenuItem.commandSound",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
                "OptionPane.errorSound",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
                "OptionPane.informationSound",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
                "OptionPane.questionSound",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
                "OptionPane.warningSound",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
                "PopupMenu.popupSound",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
                "RadioButtonMenuItem.commandSound"};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
        Object[] noAuditoryCues = new Object[] {"mute"};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
        // *** Component Defaults
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
        Object[] defaults = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
            // *** Auditory Feedback
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
            "AuditoryCues.cueList", allAuditoryCues,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   699
            "AuditoryCues.allAuditoryCues", allAuditoryCues,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   700
            "AuditoryCues.noAuditoryCues", noAuditoryCues,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
            // this key defines which of the various cues to render.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   702
            // L&Fs that want auditory feedback NEED to override playList.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
            "AuditoryCues.playList", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   704
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
            // *** Buttons
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
            "Button.defaultButtonFollowsFocus", Boolean.TRUE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   707
            "Button.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
            "Button.background", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
            "Button.foreground", controlText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
            "Button.shadow", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
            "Button.darkShadow", controlDkShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   712
            "Button.light", controlHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
            "Button.highlight", controlLtHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
            "Button.border", buttonBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
            "Button.margin", new InsetsUIResource(2, 14, 2, 14),
25777
bb88947b6766 8049893: Replace uses of 'new Integer()' with appropriate alternative across client classes
prr
parents: 25565
diff changeset
   716
            "Button.textIconGap", 4,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
            "Button.textShiftOffset", zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   718
            "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
                         "SPACE", "pressed",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
                "released SPACE", "released",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   721
                         "ENTER", "pressed",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   722
                "released ENTER", "released"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   723
              }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
90ce3da70b43 Initial load
duke
parents:
diff changeset
   725
            "ToggleButton.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   726
            "ToggleButton.background", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   727
            "ToggleButton.foreground", controlText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   728
            "ToggleButton.shadow", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   729
            "ToggleButton.darkShadow", controlDkShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   730
            "ToggleButton.light", controlHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   731
            "ToggleButton.highlight", controlLtHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   732
            "ToggleButton.border", buttonToggleBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   733
            "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14),
25777
bb88947b6766 8049893: Replace uses of 'new Integer()' with appropriate alternative across client classes
prr
parents: 25565
diff changeset
   734
            "ToggleButton.textIconGap", 4,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   735
            "ToggleButton.textShiftOffset", zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   736
            "ToggleButton.focusInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   737
              new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   738
                            "SPACE", "pressed",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   739
                   "released SPACE", "released"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   740
                }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   741
90ce3da70b43 Initial load
duke
parents:
diff changeset
   742
            "RadioButton.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   743
            "RadioButton.background", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   744
            "RadioButton.foreground", controlText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   745
            "RadioButton.shadow", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   746
            "RadioButton.darkShadow", controlDkShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   747
            "RadioButton.light", controlHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   748
            "RadioButton.highlight", controlLtHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   749
            "RadioButton.border", radioButtonBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   750
            "RadioButton.margin", twoInsets,
25777
bb88947b6766 8049893: Replace uses of 'new Integer()' with appropriate alternative across client classes
prr
parents: 25565
diff changeset
   751
            "RadioButton.textIconGap", 4,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   752
            "RadioButton.textShiftOffset", zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   753
            "RadioButton.icon", radioButtonIcon,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   754
            "RadioButton.focusInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   755
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   756
                          "SPACE", "pressed",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   757
                 "released SPACE", "released",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   758
                         "RETURN", "pressed"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   759
              }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   760
90ce3da70b43 Initial load
duke
parents:
diff changeset
   761
            "CheckBox.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   762
            "CheckBox.background", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   763
            "CheckBox.foreground", controlText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   764
            "CheckBox.border", radioButtonBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   765
            "CheckBox.margin", twoInsets,
25777
bb88947b6766 8049893: Replace uses of 'new Integer()' with appropriate alternative across client classes
prr
parents: 25565
diff changeset
   766
            "CheckBox.textIconGap", 4,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   767
            "CheckBox.textShiftOffset", zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   768
            "CheckBox.icon", checkBoxIcon,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   769
            "CheckBox.focusInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   770
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   771
                            "SPACE", "pressed",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   772
                   "released SPACE", "released"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   773
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   774
            "FileChooser.useSystemExtensionHiding", Boolean.FALSE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   775
90ce3da70b43 Initial load
duke
parents:
diff changeset
   776
            // *** ColorChooser
90ce3da70b43 Initial load
duke
parents:
diff changeset
   777
            "ColorChooser.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   778
            "ColorChooser.background", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   779
            "ColorChooser.foreground", controlText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   780
90ce3da70b43 Initial load
duke
parents:
diff changeset
   781
            "ColorChooser.swatchesSwatchSize", new Dimension(10, 10),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   782
            "ColorChooser.swatchesRecentSwatchSize", new Dimension(10, 10),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   783
            "ColorChooser.swatchesDefaultRecentColor", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   784
90ce3da70b43 Initial load
duke
parents:
diff changeset
   785
            // *** ComboBox
90ce3da70b43 Initial load
duke
parents:
diff changeset
   786
            "ComboBox.font", sansSerifPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   787
            "ComboBox.background", window,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   788
            "ComboBox.foreground", textText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   789
            "ComboBox.buttonBackground", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   790
            "ComboBox.buttonShadow", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   791
            "ComboBox.buttonDarkShadow", controlDkShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   792
            "ComboBox.buttonHighlight", controlLtHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   793
            "ComboBox.selectionBackground", textHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   794
            "ComboBox.selectionForeground", textHighlightText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   795
            "ComboBox.disabledBackground", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   796
            "ComboBox.disabledForeground", textInactiveText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   797
            "ComboBox.timeFactor", oneThousand,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   798
            "ComboBox.isEnterSelectablePopup", Boolean.FALSE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   799
            "ComboBox.ancestorInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   800
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   801
                      "ESCAPE", "hidePopup",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   802
                     "PAGE_UP", "pageUpPassThrough",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   803
                   "PAGE_DOWN", "pageDownPassThrough",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   804
                        "HOME", "homePassThrough",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   805
                         "END", "endPassThrough",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   806
                       "ENTER", "enterPressed"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   807
                 }),
15637
2c226ebab6a6 4199622: RFE: JComboBox shouldn't sending ActionEvents for keyboard navigation
vkarnauk
parents: 15316
diff changeset
   808
            "ComboBox.noActionOnKeyNavigation", Boolean.FALSE,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   809
90ce3da70b43 Initial load
duke
parents:
diff changeset
   810
            // *** FileChooser
90ce3da70b43 Initial load
duke
parents:
diff changeset
   811
90ce3da70b43 Initial load
duke
parents:
diff changeset
   812
            "FileChooser.newFolderIcon", newFolderIcon,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   813
            "FileChooser.upFolderIcon", upFolderIcon,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   814
            "FileChooser.homeFolderIcon", homeFolderIcon,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   815
            "FileChooser.detailsViewIcon", detailsViewIcon,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   816
            "FileChooser.listViewIcon", listViewIcon,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   817
            "FileChooser.readOnly", Boolean.FALSE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   818
            "FileChooser.usesSingleFilePane", Boolean.FALSE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   819
            "FileChooser.ancestorInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   820
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   821
                     "ESCAPE", "cancelSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   822
                     "F5", "refresh",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   823
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   824
90ce3da70b43 Initial load
duke
parents:
diff changeset
   825
            "FileView.directoryIcon", directoryIcon,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   826
            "FileView.fileIcon", fileIcon,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   827
            "FileView.computerIcon", computerIcon,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   828
            "FileView.hardDriveIcon", hardDriveIcon,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   829
            "FileView.floppyDriveIcon", floppyDriveIcon,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   830
90ce3da70b43 Initial load
duke
parents:
diff changeset
   831
            // *** InternalFrame
90ce3da70b43 Initial load
duke
parents:
diff changeset
   832
            "InternalFrame.titleFont", dialogBold12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   833
            "InternalFrame.borderColor", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   834
            "InternalFrame.borderShadow", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   835
            "InternalFrame.borderDarkShadow", controlDkShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   836
            "InternalFrame.borderHighlight", controlLtHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   837
            "InternalFrame.borderLight", controlHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   838
            "InternalFrame.border", internalFrameBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   839
            "InternalFrame.icon",   SwingUtilities2.makeIcon(getClass(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   840
                                                             BasicLookAndFeel.class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   841
                                                             "icons/JavaCup16.png"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   842
90ce3da70b43 Initial load
duke
parents:
diff changeset
   843
            /* Default frame icons are undefined for Basic. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   844
            "InternalFrame.maximizeIcon",
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   845
               (LazyValue) t -> BasicIconFactory.createEmptyFrameIcon(),
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   846
            "InternalFrame.minimizeIcon",
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   847
               (LazyValue) t -> BasicIconFactory.createEmptyFrameIcon(),
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   848
            "InternalFrame.iconifyIcon",
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   849
               (LazyValue) t -> BasicIconFactory.createEmptyFrameIcon(),
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   850
            "InternalFrame.closeIcon",
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
   851
               (LazyValue) t -> BasicIconFactory.createEmptyFrameIcon(),
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   852
            // InternalFrame Auditory Cue Mappings
90ce3da70b43 Initial load
duke
parents:
diff changeset
   853
            "InternalFrame.closeSound", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   854
            "InternalFrame.maximizeSound", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   855
            "InternalFrame.minimizeSound", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   856
            "InternalFrame.restoreDownSound", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   857
            "InternalFrame.restoreUpSound", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   858
90ce3da70b43 Initial load
duke
parents:
diff changeset
   859
            "InternalFrame.activeTitleBackground", table.get("activeCaption"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   860
            "InternalFrame.activeTitleForeground", table.get("activeCaptionText"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   861
            "InternalFrame.inactiveTitleBackground", table.get("inactiveCaption"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   862
            "InternalFrame.inactiveTitleForeground", table.get("inactiveCaptionText"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   863
            "InternalFrame.windowBindings", new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   864
              "shift ESCAPE", "showSystemMenu",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   865
                "ctrl SPACE", "showSystemMenu",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   866
                    "ESCAPE", "hideSystemMenu"},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   867
90ce3da70b43 Initial load
duke
parents:
diff changeset
   868
            "InternalFrameTitlePane.iconifyButtonOpacity", Boolean.TRUE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   869
            "InternalFrameTitlePane.maximizeButtonOpacity", Boolean.TRUE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   870
            "InternalFrameTitlePane.closeButtonOpacity", Boolean.TRUE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   871
90ce3da70b43 Initial load
duke
parents:
diff changeset
   872
        "DesktopIcon.border", internalFrameBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   873
90ce3da70b43 Initial load
duke
parents:
diff changeset
   874
            "Desktop.minOnScreenInsets", threeInsets,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   875
            "Desktop.background", table.get("desktop"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   876
            "Desktop.ancestorInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   877
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   878
                 "ctrl F5", "restore",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   879
                 "ctrl F4", "close",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   880
                 "ctrl F7", "move",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   881
                 "ctrl F8", "resize",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   882
                   "RIGHT", "right",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   883
                "KP_RIGHT", "right",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   884
             "shift RIGHT", "shrinkRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   885
          "shift KP_RIGHT", "shrinkRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   886
                    "LEFT", "left",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   887
                 "KP_LEFT", "left",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   888
              "shift LEFT", "shrinkLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   889
           "shift KP_LEFT", "shrinkLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   890
                      "UP", "up",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   891
                   "KP_UP", "up",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   892
                "shift UP", "shrinkUp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   893
             "shift KP_UP", "shrinkUp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   894
                    "DOWN", "down",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   895
                 "KP_DOWN", "down",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   896
              "shift DOWN", "shrinkDown",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   897
           "shift KP_DOWN", "shrinkDown",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   898
                  "ESCAPE", "escape",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   899
                 "ctrl F9", "minimize",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   900
                "ctrl F10", "maximize",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   901
                 "ctrl F6", "selectNextFrame",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   902
                "ctrl TAB", "selectNextFrame",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   903
             "ctrl alt F6", "selectNextFrame",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   904
       "shift ctrl alt F6", "selectPreviousFrame",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   905
                "ctrl F12", "navigateNext",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   906
          "shift ctrl F12", "navigatePrevious"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   907
              }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   908
90ce3da70b43 Initial load
duke
parents:
diff changeset
   909
            // *** Label
90ce3da70b43 Initial load
duke
parents:
diff changeset
   910
            "Label.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   911
            "Label.background", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   912
            "Label.foreground", controlText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   913
            "Label.disabledForeground", white,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   914
            "Label.disabledShadow", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   915
            "Label.border", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   916
90ce3da70b43 Initial load
duke
parents:
diff changeset
   917
            // *** List
90ce3da70b43 Initial load
duke
parents:
diff changeset
   918
            "List.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   919
            "List.background", window,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   920
            "List.foreground", textText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   921
            "List.selectionBackground", textHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   922
            "List.selectionForeground", textHighlightText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   923
            "List.noFocusBorder", noFocusBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   924
            "List.focusCellHighlightBorder", focusCellHighlightBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   925
            "List.dropLineColor", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   926
            "List.border", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   927
            "List.cellRenderer", listCellRendererActiveValue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   928
            "List.timeFactor", oneThousand,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   929
            "List.focusInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   930
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   931
                           "ctrl C", "copy",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   932
                           "ctrl V", "paste",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   933
                           "ctrl X", "cut",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   934
                             "COPY", "copy",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   935
                            "PASTE", "paste",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   936
                              "CUT", "cut",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   937
                   "control INSERT", "copy",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   938
                     "shift INSERT", "paste",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   939
                     "shift DELETE", "cut",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   940
                               "UP", "selectPreviousRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   941
                            "KP_UP", "selectPreviousRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   942
                         "shift UP", "selectPreviousRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   943
                      "shift KP_UP", "selectPreviousRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   944
                    "ctrl shift UP", "selectPreviousRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   945
                 "ctrl shift KP_UP", "selectPreviousRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   946
                          "ctrl UP", "selectPreviousRowChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   947
                       "ctrl KP_UP", "selectPreviousRowChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   948
                             "DOWN", "selectNextRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   949
                          "KP_DOWN", "selectNextRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   950
                       "shift DOWN", "selectNextRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   951
                    "shift KP_DOWN", "selectNextRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   952
                  "ctrl shift DOWN", "selectNextRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   953
               "ctrl shift KP_DOWN", "selectNextRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   954
                        "ctrl DOWN", "selectNextRowChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   955
                     "ctrl KP_DOWN", "selectNextRowChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   956
                             "LEFT", "selectPreviousColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   957
                          "KP_LEFT", "selectPreviousColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   958
                       "shift LEFT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   959
                    "shift KP_LEFT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   960
                  "ctrl shift LEFT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   961
               "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   962
                        "ctrl LEFT", "selectPreviousColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   963
                     "ctrl KP_LEFT", "selectPreviousColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   964
                            "RIGHT", "selectNextColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   965
                         "KP_RIGHT", "selectNextColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   966
                      "shift RIGHT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   967
                   "shift KP_RIGHT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   968
                 "ctrl shift RIGHT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   969
              "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   970
                       "ctrl RIGHT", "selectNextColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   971
                    "ctrl KP_RIGHT", "selectNextColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   972
                             "HOME", "selectFirstRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   973
                       "shift HOME", "selectFirstRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   974
                  "ctrl shift HOME", "selectFirstRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   975
                        "ctrl HOME", "selectFirstRowChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   976
                              "END", "selectLastRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   977
                        "shift END", "selectLastRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   978
                   "ctrl shift END", "selectLastRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   979
                         "ctrl END", "selectLastRowChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   980
                          "PAGE_UP", "scrollUp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   981
                    "shift PAGE_UP", "scrollUpExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   982
               "ctrl shift PAGE_UP", "scrollUpExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   983
                     "ctrl PAGE_UP", "scrollUpChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   984
                        "PAGE_DOWN", "scrollDown",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   985
                  "shift PAGE_DOWN", "scrollDownExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   986
             "ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   987
                   "ctrl PAGE_DOWN", "scrollDownChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   988
                           "ctrl A", "selectAll",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   989
                       "ctrl SLASH", "selectAll",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   990
                  "ctrl BACK_SLASH", "clearSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   991
                            "SPACE", "addToSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   992
                       "ctrl SPACE", "toggleAndAnchor",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   993
                      "shift SPACE", "extendTo",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   994
                 "ctrl shift SPACE", "moveSelectionTo"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   995
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   996
            "List.focusInputMap.RightToLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   997
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   998
                             "LEFT", "selectNextColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   999
                          "KP_LEFT", "selectNextColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1000
                       "shift LEFT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1001
                    "shift KP_LEFT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1002
                  "ctrl shift LEFT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1003
               "ctrl shift KP_LEFT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1004
                        "ctrl LEFT", "selectNextColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1005
                     "ctrl KP_LEFT", "selectNextColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1006
                            "RIGHT", "selectPreviousColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1007
                         "KP_RIGHT", "selectPreviousColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1008
                      "shift RIGHT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1009
                   "shift KP_RIGHT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1010
                 "ctrl shift RIGHT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1011
              "ctrl shift KP_RIGHT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1012
                       "ctrl RIGHT", "selectPreviousColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1013
                    "ctrl KP_RIGHT", "selectPreviousColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1014
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1015
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1016
            // *** Menus
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1017
            "MenuBar.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1018
            "MenuBar.background", menu,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1019
            "MenuBar.foreground", menuText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1020
            "MenuBar.shadow", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1021
            "MenuBar.highlight", controlLtHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1022
            "MenuBar.border", menuBarBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1023
            "MenuBar.windowBindings", new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1024
                "F10", "takeFocus" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1025
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1026
            "MenuItem.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1027
            "MenuItem.acceleratorFont", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1028
            "MenuItem.background", menu,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1029
            "MenuItem.foreground", menuText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1030
            "MenuItem.selectionForeground", textHighlightText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1031
            "MenuItem.selectionBackground", textHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1032
            "MenuItem.disabledForeground", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1033
            "MenuItem.acceleratorForeground", menuText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1034
            "MenuItem.acceleratorSelectionForeground", textHighlightText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1035
            "MenuItem.acceleratorDelimiter", menuItemAcceleratorDelimiter,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1036
            "MenuItem.border", marginBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1037
            "MenuItem.borderPainted", Boolean.FALSE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1038
            "MenuItem.margin", twoInsets,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1039
            "MenuItem.checkIcon", menuItemCheckIcon,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1040
            "MenuItem.arrowIcon", menuItemArrowIcon,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1041
            "MenuItem.commandSound", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1042
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1043
            "RadioButtonMenuItem.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1044
            "RadioButtonMenuItem.acceleratorFont", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1045
            "RadioButtonMenuItem.background", menu,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1046
            "RadioButtonMenuItem.foreground", menuText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1047
            "RadioButtonMenuItem.selectionForeground", textHighlightText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1048
            "RadioButtonMenuItem.selectionBackground", textHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1049
            "RadioButtonMenuItem.disabledForeground", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1050
            "RadioButtonMenuItem.acceleratorForeground", menuText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1051
            "RadioButtonMenuItem.acceleratorSelectionForeground", textHighlightText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1052
            "RadioButtonMenuItem.border", marginBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1053
            "RadioButtonMenuItem.borderPainted", Boolean.FALSE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1054
            "RadioButtonMenuItem.margin", twoInsets,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1055
            "RadioButtonMenuItem.checkIcon", radioButtonMenuItemIcon,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1056
            "RadioButtonMenuItem.arrowIcon", menuItemArrowIcon,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1057
            "RadioButtonMenuItem.commandSound", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1058
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1059
            "CheckBoxMenuItem.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1060
            "CheckBoxMenuItem.acceleratorFont", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1061
            "CheckBoxMenuItem.background", menu,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1062
            "CheckBoxMenuItem.foreground", menuText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1063
            "CheckBoxMenuItem.selectionForeground", textHighlightText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1064
            "CheckBoxMenuItem.selectionBackground", textHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1065
            "CheckBoxMenuItem.disabledForeground", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1066
            "CheckBoxMenuItem.acceleratorForeground", menuText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1067
            "CheckBoxMenuItem.acceleratorSelectionForeground", textHighlightText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1068
            "CheckBoxMenuItem.border", marginBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1069
            "CheckBoxMenuItem.borderPainted", Boolean.FALSE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1070
            "CheckBoxMenuItem.margin", twoInsets,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1071
            "CheckBoxMenuItem.checkIcon", checkBoxMenuItemIcon,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1072
            "CheckBoxMenuItem.arrowIcon", menuItemArrowIcon,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1073
            "CheckBoxMenuItem.commandSound", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1074
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1075
            "Menu.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1076
            "Menu.acceleratorFont", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1077
            "Menu.background", menu,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1078
            "Menu.foreground", menuText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1079
            "Menu.selectionForeground", textHighlightText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1080
            "Menu.selectionBackground", textHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1081
            "Menu.disabledForeground", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1082
            "Menu.acceleratorForeground", menuText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1083
            "Menu.acceleratorSelectionForeground", textHighlightText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1084
            "Menu.border", marginBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1085
            "Menu.borderPainted", Boolean.FALSE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1086
            "Menu.margin", twoInsets,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1087
            "Menu.checkIcon", menuItemCheckIcon,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1088
            "Menu.arrowIcon", menuArrowIcon,
25777
bb88947b6766 8049893: Replace uses of 'new Integer()' with appropriate alternative across client classes
prr
parents: 25565
diff changeset
  1089
            "Menu.menuPopupOffsetX", 0,
bb88947b6766 8049893: Replace uses of 'new Integer()' with appropriate alternative across client classes
prr
parents: 25565
diff changeset
  1090
            "Menu.menuPopupOffsetY", 0,
bb88947b6766 8049893: Replace uses of 'new Integer()' with appropriate alternative across client classes
prr
parents: 25565
diff changeset
  1091
            "Menu.submenuPopupOffsetX", 0,
bb88947b6766 8049893: Replace uses of 'new Integer()' with appropriate alternative across client classes
prr
parents: 25565
diff changeset
  1092
            "Menu.submenuPopupOffsetY", 0,
15316
0dcb6f02678d 8003978: closed/javax/swing/JRootPane/bug4670486.java fails since jdk7u12b01 on macosx
alexsch
parents: 12047
diff changeset
  1093
            "Menu.shortcutKeys", new int[]{
0dcb6f02678d 8003978: closed/javax/swing/JRootPane/bug4670486.java fails since jdk7u12b01 on macosx
alexsch
parents: 12047
diff changeset
  1094
                SwingUtilities2.getSystemMnemonicKeyMask()
0dcb6f02678d 8003978: closed/javax/swing/JRootPane/bug4670486.java fails since jdk7u12b01 on macosx
alexsch
parents: 12047
diff changeset
  1095
            },
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1096
            "Menu.crossMenuMnemonic", Boolean.TRUE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1097
            // Menu.cancelMode affects the cancel menu action behaviour;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1098
            // currently supports:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1099
            // "hideLastSubmenu" (default)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1100
            //     hides the last open submenu,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1101
            //     and move selection one step back
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1102
            // "hideMenuTree"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1103
            //     resets selection and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1104
            //     hide the entire structure of open menu and its submenus
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1105
            "Menu.cancelMode", "hideLastSubmenu",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1106
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1107
             // Menu.preserveTopLevelSelection affects
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1108
             // the cancel menu action behaviour
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1109
             // if set to true then top level menu selection
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1110
             // will be preserved when the last popup was cancelled;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1111
             // the menu itself will be unselect with the next cancel action
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1112
             "Menu.preserveTopLevelSelection", Boolean.FALSE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1113
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1114
            // PopupMenu
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1115
            "PopupMenu.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1116
            "PopupMenu.background", menu,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1117
            "PopupMenu.foreground", menuText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1118
            "PopupMenu.border", popupMenuBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1119
                 // Internal Frame Auditory Cue Mappings
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1120
            "PopupMenu.popupSound", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1121
            // These window InputMap bindings are used when the Menu is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1122
            // selected.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1123
            "PopupMenu.selectedWindowInputMapBindings", new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1124
                  "ESCAPE", "cancel",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1125
                    "DOWN", "selectNext",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1126
                 "KP_DOWN", "selectNext",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1127
                      "UP", "selectPrevious",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1128
                   "KP_UP", "selectPrevious",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1129
                    "LEFT", "selectParent",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1130
                 "KP_LEFT", "selectParent",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1131
                   "RIGHT", "selectChild",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1132
                "KP_RIGHT", "selectChild",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1133
                   "ENTER", "return",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1134
              "ctrl ENTER", "return",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1135
                   "SPACE", "return"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1136
            },
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1137
            "PopupMenu.selectedWindowInputMapBindings.RightToLeft", new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1138
                    "LEFT", "selectChild",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1139
                 "KP_LEFT", "selectChild",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1140
                   "RIGHT", "selectParent",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1141
                "KP_RIGHT", "selectParent",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1142
            },
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1143
            "PopupMenu.consumeEventOnClose", Boolean.FALSE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1144
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1145
            // *** OptionPane
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1146
            // You can additionaly define OptionPane.messageFont which will
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1147
            // dictate the fonts used for the message, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1148
            // OptionPane.buttonFont, which defines the font for the buttons.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1149
            "OptionPane.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1150
            "OptionPane.background", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1151
            "OptionPane.foreground", controlText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1152
            "OptionPane.messageForeground", controlText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1153
            "OptionPane.border", optionPaneBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1154
            "OptionPane.messageAreaBorder", zeroBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1155
            "OptionPane.buttonAreaBorder", optionPaneButtonAreaBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1156
            "OptionPane.minimumSize", optionPaneMinimumSize,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1157
            "OptionPane.errorIcon", SwingUtilities2.makeIcon(getClass(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1158
                                                             BasicLookAndFeel.class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1159
                                                             "icons/Error.gif"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1160
            "OptionPane.informationIcon", SwingUtilities2.makeIcon(getClass(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1161
                                                                   BasicLookAndFeel.class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1162
                                                                   "icons/Inform.gif"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1163
            "OptionPane.warningIcon", SwingUtilities2.makeIcon(getClass(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1164
                                                               BasicLookAndFeel.class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1165
                                                               "icons/Warn.gif"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1166
            "OptionPane.questionIcon", SwingUtilities2.makeIcon(getClass(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1167
                                                                BasicLookAndFeel.class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1168
                                                                "icons/Question.gif"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1169
            "OptionPane.windowBindings", new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1170
                "ESCAPE", "close" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1171
                 // OptionPane Auditory Cue Mappings
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1172
            "OptionPane.errorSound", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1173
            "OptionPane.informationSound", null, // Info and Plain
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1174
            "OptionPane.questionSound", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1175
            "OptionPane.warningSound", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1176
            "OptionPane.buttonClickThreshhold", fiveHundred,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1177
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1178
            // *** Panel
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1179
            "Panel.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1180
            "Panel.background", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1181
            "Panel.foreground", textText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1182
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1183
            // *** ProgressBar
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1184
            "ProgressBar.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1185
            "ProgressBar.foreground",  textHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1186
            "ProgressBar.background", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1187
            "ProgressBar.selectionForeground", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1188
            "ProgressBar.selectionBackground", textHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1189
            "ProgressBar.border", progressBarBorder,
25777
bb88947b6766 8049893: Replace uses of 'new Integer()' with appropriate alternative across client classes
prr
parents: 25565
diff changeset
  1190
            "ProgressBar.cellLength", 1,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1191
            "ProgressBar.cellSpacing", zero,
25777
bb88947b6766 8049893: Replace uses of 'new Integer()' with appropriate alternative across client classes
prr
parents: 25565
diff changeset
  1192
            "ProgressBar.repaintInterval", 50,
bb88947b6766 8049893: Replace uses of 'new Integer()' with appropriate alternative across client classes
prr
parents: 25565
diff changeset
  1193
            "ProgressBar.cycleTime", 3000,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1194
            "ProgressBar.horizontalSize", new DimensionUIResource(146, 12),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1195
            "ProgressBar.verticalSize", new DimensionUIResource(12, 146),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1196
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1197
           // *** Separator
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1198
            "Separator.shadow", controlShadow,          // DEPRECATED - DO NOT USE!
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1199
            "Separator.highlight", controlLtHighlight,  // DEPRECATED - DO NOT USE!
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1200
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1201
            "Separator.background", controlLtHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1202
            "Separator.foreground", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1203
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1204
            // *** ScrollBar/ScrollPane/Viewport
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1205
            "ScrollBar.background", scrollBarTrack,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1206
            "ScrollBar.foreground", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1207
            "ScrollBar.track", table.get("scrollbar"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1208
            "ScrollBar.trackHighlight", controlDkShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1209
            "ScrollBar.thumb", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1210
            "ScrollBar.thumbHighlight", controlLtHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1211
            "ScrollBar.thumbDarkShadow", controlDkShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1212
            "ScrollBar.thumbShadow", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1213
            "ScrollBar.border", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1214
            "ScrollBar.minimumThumbSize", minimumThumbSize,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1215
            "ScrollBar.maximumThumbSize", maximumThumbSize,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1216
            "ScrollBar.ancestorInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1217
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1218
                       "RIGHT", "positiveUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1219
                    "KP_RIGHT", "positiveUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1220
                        "DOWN", "positiveUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1221
                     "KP_DOWN", "positiveUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1222
                   "PAGE_DOWN", "positiveBlockIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1223
                        "LEFT", "negativeUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1224
                     "KP_LEFT", "negativeUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1225
                          "UP", "negativeUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1226
                       "KP_UP", "negativeUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1227
                     "PAGE_UP", "negativeBlockIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1228
                        "HOME", "minScroll",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1229
                         "END", "maxScroll"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1230
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1231
            "ScrollBar.ancestorInputMap.RightToLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1232
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1233
                       "RIGHT", "negativeUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1234
                    "KP_RIGHT", "negativeUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1235
                        "LEFT", "positiveUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1236
                     "KP_LEFT", "positiveUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1237
                 }),
25777
bb88947b6766 8049893: Replace uses of 'new Integer()' with appropriate alternative across client classes
prr
parents: 25565
diff changeset
  1238
            "ScrollBar.width", 16,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1239
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1240
            "ScrollPane.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1241
            "ScrollPane.background", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1242
            "ScrollPane.foreground", controlText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1243
            "ScrollPane.border", textFieldBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1244
            "ScrollPane.viewportBorder", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1245
            "ScrollPane.ancestorInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1246
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1247
                           "RIGHT", "unitScrollRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1248
                        "KP_RIGHT", "unitScrollRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1249
                            "DOWN", "unitScrollDown",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1250
                         "KP_DOWN", "unitScrollDown",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1251
                            "LEFT", "unitScrollLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1252
                         "KP_LEFT", "unitScrollLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1253
                              "UP", "unitScrollUp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1254
                           "KP_UP", "unitScrollUp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1255
                         "PAGE_UP", "scrollUp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1256
                       "PAGE_DOWN", "scrollDown",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1257
                    "ctrl PAGE_UP", "scrollLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1258
                  "ctrl PAGE_DOWN", "scrollRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1259
                       "ctrl HOME", "scrollHome",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1260
                        "ctrl END", "scrollEnd"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1261
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1262
            "ScrollPane.ancestorInputMap.RightToLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1263
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1264
                    "ctrl PAGE_UP", "scrollRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1265
                  "ctrl PAGE_DOWN", "scrollLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1266
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1267
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1268
            "Viewport.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1269
            "Viewport.background", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1270
            "Viewport.foreground", textText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1271
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1272
            // *** Slider
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1273
            "Slider.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1274
            "Slider.foreground", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1275
            "Slider.background", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1276
            "Slider.highlight", controlLtHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1277
            "Slider.tickColor", Color.black,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1278
            "Slider.shadow", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1279
            "Slider.focus", controlDkShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1280
            "Slider.border", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1281
            "Slider.horizontalSize", new Dimension(200, 21),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1282
            "Slider.verticalSize", new Dimension(21, 200),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1283
            "Slider.minimumHorizontalSize", new Dimension(36, 21),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1284
            "Slider.minimumVerticalSize", new Dimension(21, 36),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1285
            "Slider.focusInsets", sliderFocusInsets,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1286
            "Slider.focusInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1287
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1288
                       "RIGHT", "positiveUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1289
                    "KP_RIGHT", "positiveUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1290
                        "DOWN", "negativeUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1291
                     "KP_DOWN", "negativeUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1292
                   "PAGE_DOWN", "negativeBlockIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1293
                        "LEFT", "negativeUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1294
                     "KP_LEFT", "negativeUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1295
                          "UP", "positiveUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1296
                       "KP_UP", "positiveUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1297
                     "PAGE_UP", "positiveBlockIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1298
                        "HOME", "minScroll",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1299
                         "END", "maxScroll"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1300
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1301
            "Slider.focusInputMap.RightToLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1302
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1303
                       "RIGHT", "negativeUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1304
                    "KP_RIGHT", "negativeUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1305
                        "LEFT", "positiveUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1306
                     "KP_LEFT", "positiveUnitIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1307
                 }),
456
8ded0dbe4aaa 6614972: JSlider value should not change on right-click
rupashka
parents: 2
diff changeset
  1308
            "Slider.onlyLeftMouseButtonDrag", Boolean.TRUE,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1309
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1310
            // *** Spinner
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1311
            "Spinner.font", monospacedPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1312
            "Spinner.background", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1313
            "Spinner.foreground", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1314
            "Spinner.border", textFieldBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1315
            "Spinner.arrowButtonBorder", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1316
            "Spinner.arrowButtonInsets", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1317
            "Spinner.arrowButtonSize", new Dimension(16, 5),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1318
            "Spinner.ancestorInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1319
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1320
                               "UP", "increment",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1321
                            "KP_UP", "increment",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1322
                             "DOWN", "decrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1323
                          "KP_DOWN", "decrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1324
               }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1325
            "Spinner.editorBorderPainted", Boolean.FALSE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1326
            "Spinner.editorAlignment", JTextField.TRAILING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1327
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1328
            // *** SplitPane
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1329
            "SplitPane.background", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1330
            "SplitPane.highlight", controlLtHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1331
            "SplitPane.shadow", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1332
            "SplitPane.darkShadow", controlDkShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1333
            "SplitPane.border", splitPaneBorder,
25777
bb88947b6766 8049893: Replace uses of 'new Integer()' with appropriate alternative across client classes
prr
parents: 25565
diff changeset
  1334
            "SplitPane.dividerSize", 7,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1335
            "SplitPaneDivider.border", splitPaneDividerBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1336
            "SplitPaneDivider.draggingColor", darkGray,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1337
            "SplitPane.ancestorInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1338
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1339
                        "UP", "negativeIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1340
                      "DOWN", "positiveIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1341
                      "LEFT", "negativeIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1342
                     "RIGHT", "positiveIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1343
                     "KP_UP", "negativeIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1344
                   "KP_DOWN", "positiveIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1345
                   "KP_LEFT", "negativeIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1346
                  "KP_RIGHT", "positiveIncrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1347
                      "HOME", "selectMin",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1348
                       "END", "selectMax",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1349
                        "F8", "startResize",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1350
                        "F6", "toggleFocus",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1351
                  "ctrl TAB", "focusOutForward",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1352
            "ctrl shift TAB", "focusOutBackward"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1353
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1354
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1355
            // *** TabbedPane
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1356
            "TabbedPane.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1357
            "TabbedPane.background", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1358
            "TabbedPane.foreground", controlText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1359
            "TabbedPane.highlight", controlLtHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1360
            "TabbedPane.light", controlHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1361
            "TabbedPane.shadow", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1362
            "TabbedPane.darkShadow", controlDkShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1363
            "TabbedPane.selected", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1364
            "TabbedPane.focus", controlText,
25777
bb88947b6766 8049893: Replace uses of 'new Integer()' with appropriate alternative across client classes
prr
parents: 25565
diff changeset
  1365
            "TabbedPane.textIconGap", 4,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1366
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1367
            // Causes tabs to be painted on top of the content area border.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1368
            // The amount of overlap is then controlled by tabAreaInsets.bottom,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1369
            // which is zero by default
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1370
            "TabbedPane.tabsOverlapBorder", Boolean.FALSE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1371
            "TabbedPane.selectionFollowsFocus", Boolean.TRUE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1372
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1373
            "TabbedPane.labelShift", 1,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1374
            "TabbedPane.selectedLabelShift", -1,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1375
            "TabbedPane.tabInsets", tabbedPaneTabInsets,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1376
            "TabbedPane.selectedTabPadInsets", tabbedPaneTabPadInsets,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1377
            "TabbedPane.tabAreaInsets", tabbedPaneTabAreaInsets,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1378
            "TabbedPane.contentBorderInsets", tabbedPaneContentBorderInsets,
25777
bb88947b6766 8049893: Replace uses of 'new Integer()' with appropriate alternative across client classes
prr
parents: 25565
diff changeset
  1379
            "TabbedPane.tabRunOverlay", 2,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1380
            "TabbedPane.tabsOpaque", Boolean.TRUE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1381
            "TabbedPane.contentOpaque", Boolean.TRUE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1382
            "TabbedPane.focusInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1383
              new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1384
                         "RIGHT", "navigateRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1385
                      "KP_RIGHT", "navigateRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1386
                          "LEFT", "navigateLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1387
                       "KP_LEFT", "navigateLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1388
                            "UP", "navigateUp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1389
                         "KP_UP", "navigateUp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1390
                          "DOWN", "navigateDown",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1391
                       "KP_DOWN", "navigateDown",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1392
                     "ctrl DOWN", "requestFocusForVisibleComponent",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1393
                  "ctrl KP_DOWN", "requestFocusForVisibleComponent",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1394
                }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1395
            "TabbedPane.ancestorInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1396
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1397
                   "ctrl PAGE_DOWN", "navigatePageDown",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1398
                     "ctrl PAGE_UP", "navigatePageUp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1399
                          "ctrl UP", "requestFocus",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1400
                       "ctrl KP_UP", "requestFocus",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1401
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1402
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1403
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1404
            // *** Table
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1405
            "Table.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1406
            "Table.foreground", controlText,  // cell text color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1407
            "Table.background", window,  // cell background color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1408
            "Table.selectionForeground", textHighlightText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1409
            "Table.selectionBackground", textHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1410
            "Table.dropLineColor", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1411
            "Table.dropLineShortColor", black,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1412
            "Table.gridColor", gray,  // grid line color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1413
            "Table.focusCellBackground", window,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1414
            "Table.focusCellForeground", controlText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1415
            "Table.focusCellHighlightBorder", focusCellHighlightBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1416
            "Table.scrollPaneBorder", loweredBevelBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1417
            "Table.ancestorInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1418
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1419
                               "ctrl C", "copy",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1420
                               "ctrl V", "paste",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1421
                               "ctrl X", "cut",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1422
                                 "COPY", "copy",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1423
                                "PASTE", "paste",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1424
                                  "CUT", "cut",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1425
                       "control INSERT", "copy",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1426
                         "shift INSERT", "paste",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1427
                         "shift DELETE", "cut",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1428
                                "RIGHT", "selectNextColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1429
                             "KP_RIGHT", "selectNextColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1430
                          "shift RIGHT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1431
                       "shift KP_RIGHT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1432
                     "ctrl shift RIGHT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1433
                  "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1434
                           "ctrl RIGHT", "selectNextColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1435
                        "ctrl KP_RIGHT", "selectNextColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1436
                                 "LEFT", "selectPreviousColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1437
                              "KP_LEFT", "selectPreviousColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1438
                           "shift LEFT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1439
                        "shift KP_LEFT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1440
                      "ctrl shift LEFT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1441
                   "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1442
                            "ctrl LEFT", "selectPreviousColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1443
                         "ctrl KP_LEFT", "selectPreviousColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1444
                                 "DOWN", "selectNextRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1445
                              "KP_DOWN", "selectNextRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1446
                           "shift DOWN", "selectNextRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1447
                        "shift KP_DOWN", "selectNextRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1448
                      "ctrl shift DOWN", "selectNextRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1449
                   "ctrl shift KP_DOWN", "selectNextRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1450
                            "ctrl DOWN", "selectNextRowChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1451
                         "ctrl KP_DOWN", "selectNextRowChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1452
                                   "UP", "selectPreviousRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1453
                                "KP_UP", "selectPreviousRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1454
                             "shift UP", "selectPreviousRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1455
                          "shift KP_UP", "selectPreviousRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1456
                        "ctrl shift UP", "selectPreviousRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1457
                     "ctrl shift KP_UP", "selectPreviousRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1458
                              "ctrl UP", "selectPreviousRowChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1459
                           "ctrl KP_UP", "selectPreviousRowChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1460
                                 "HOME", "selectFirstColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1461
                           "shift HOME", "selectFirstColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1462
                      "ctrl shift HOME", "selectFirstRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1463
                            "ctrl HOME", "selectFirstRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1464
                                  "END", "selectLastColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1465
                            "shift END", "selectLastColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1466
                       "ctrl shift END", "selectLastRowExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1467
                             "ctrl END", "selectLastRow",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1468
                              "PAGE_UP", "scrollUpChangeSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1469
                        "shift PAGE_UP", "scrollUpExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1470
                   "ctrl shift PAGE_UP", "scrollLeftExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1471
                         "ctrl PAGE_UP", "scrollLeftChangeSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1472
                            "PAGE_DOWN", "scrollDownChangeSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1473
                      "shift PAGE_DOWN", "scrollDownExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1474
                 "ctrl shift PAGE_DOWN", "scrollRightExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1475
                       "ctrl PAGE_DOWN", "scrollRightChangeSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1476
                                  "TAB", "selectNextColumnCell",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1477
                            "shift TAB", "selectPreviousColumnCell",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1478
                                "ENTER", "selectNextRowCell",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1479
                          "shift ENTER", "selectPreviousRowCell",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1480
                               "ctrl A", "selectAll",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1481
                           "ctrl SLASH", "selectAll",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1482
                      "ctrl BACK_SLASH", "clearSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1483
                               "ESCAPE", "cancel",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1484
                                   "F2", "startEditing",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1485
                                "SPACE", "addToSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1486
                           "ctrl SPACE", "toggleAndAnchor",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1487
                          "shift SPACE", "extendTo",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1488
                     "ctrl shift SPACE", "moveSelectionTo",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1489
                                   "F8", "focusHeader"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1490
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1491
            "Table.ancestorInputMap.RightToLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1492
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1493
                                "RIGHT", "selectPreviousColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1494
                             "KP_RIGHT", "selectPreviousColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1495
                          "shift RIGHT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1496
                       "shift KP_RIGHT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1497
                     "ctrl shift RIGHT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1498
                  "ctrl shift KP_RIGHT", "selectPreviousColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1499
                           "ctrl RIGHT", "selectPreviousColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1500
                        "ctrl KP_RIGHT", "selectPreviousColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1501
                                 "LEFT", "selectNextColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1502
                              "KP_LEFT", "selectNextColumn",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1503
                           "shift LEFT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1504
                        "shift KP_LEFT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1505
                      "ctrl shift LEFT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1506
                   "ctrl shift KP_LEFT", "selectNextColumnExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1507
                            "ctrl LEFT", "selectNextColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1508
                         "ctrl KP_LEFT", "selectNextColumnChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1509
                         "ctrl PAGE_UP", "scrollRightChangeSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1510
                       "ctrl PAGE_DOWN", "scrollLeftChangeSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1511
                   "ctrl shift PAGE_UP", "scrollRightExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1512
                 "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1513
                 }),
23612
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
  1514
            "Table.ascendingSortIcon", (LazyValue) t ->
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
  1515
                    new SortArrowIcon(true, "Table.sortIconColor"),
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
  1516
            "Table.descendingSortIcon", (LazyValue) t ->
bac7b20c12f4 8035313: Change SwingLazyValue usage to lambda
alexsch
parents: 22574
diff changeset
  1517
                    new SortArrowIcon(false, "Table.sortIconColor"),
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1518
            "Table.sortIconColor", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1519
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1520
            "TableHeader.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1521
            "TableHeader.foreground", controlText, // header text color
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1522
            "TableHeader.background", control, // header background
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1523
            "TableHeader.cellBorder", tableHeaderBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1524
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1525
            // Support for changing the background/border of the currently
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1526
            // selected header column when the header has the keyboard focus.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1527
            "TableHeader.focusCellBackground", table.getColor("text"), // like text component bg
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1528
            "TableHeader.focusCellForeground", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1529
            "TableHeader.focusCellBorder", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1530
            "TableHeader.ancestorInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1531
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1532
                                "SPACE", "toggleSortOrder",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1533
                                 "LEFT", "selectColumnToLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1534
                              "KP_LEFT", "selectColumnToLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1535
                                "RIGHT", "selectColumnToRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1536
                             "KP_RIGHT", "selectColumnToRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1537
                             "alt LEFT", "moveColumnLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1538
                          "alt KP_LEFT", "moveColumnLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1539
                            "alt RIGHT", "moveColumnRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1540
                         "alt KP_RIGHT", "moveColumnRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1541
                       "alt shift LEFT", "resizeLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1542
                    "alt shift KP_LEFT", "resizeLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1543
                      "alt shift RIGHT", "resizeRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1544
                   "alt shift KP_RIGHT", "resizeRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1545
                               "ESCAPE", "focusTable",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1546
               }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1547
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1548
            // *** Text
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1549
            "TextField.font", sansSerifPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1550
            "TextField.background", window,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1551
            "TextField.foreground", textText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1552
            "TextField.shadow", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1553
            "TextField.darkShadow", controlDkShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1554
            "TextField.light", controlHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1555
            "TextField.highlight", controlLtHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1556
            "TextField.inactiveForeground", textInactiveText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1557
            "TextField.inactiveBackground", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1558
            "TextField.selectionBackground", textHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1559
            "TextField.selectionForeground", textHighlightText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1560
            "TextField.caretForeground", textText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1561
            "TextField.caretBlinkRate", caretBlinkRate,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1562
            "TextField.border", textFieldBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1563
            "TextField.margin", zeroInsets,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1564
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1565
            "FormattedTextField.font", sansSerifPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1566
            "FormattedTextField.background", window,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1567
            "FormattedTextField.foreground", textText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1568
            "FormattedTextField.inactiveForeground", textInactiveText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1569
            "FormattedTextField.inactiveBackground", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1570
            "FormattedTextField.selectionBackground", textHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1571
            "FormattedTextField.selectionForeground", textHighlightText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1572
            "FormattedTextField.caretForeground", textText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1573
            "FormattedTextField.caretBlinkRate", caretBlinkRate,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1574
            "FormattedTextField.border", textFieldBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1575
            "FormattedTextField.margin", zeroInsets,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1576
            "FormattedTextField.focusInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1577
              new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1578
                           "ctrl C", DefaultEditorKit.copyAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1579
                           "ctrl V", DefaultEditorKit.pasteAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1580
                           "ctrl X", DefaultEditorKit.cutAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1581
                             "COPY", DefaultEditorKit.copyAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1582
                            "PASTE", DefaultEditorKit.pasteAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1583
                              "CUT", DefaultEditorKit.cutAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1584
                   "control INSERT", DefaultEditorKit.copyAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1585
                     "shift INSERT", DefaultEditorKit.pasteAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1586
                     "shift DELETE", DefaultEditorKit.cutAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1587
                       "shift LEFT", DefaultEditorKit.selectionBackwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1588
                    "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1589
                      "shift RIGHT", DefaultEditorKit.selectionForwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1590
                   "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1591
                        "ctrl LEFT", DefaultEditorKit.previousWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1592
                     "ctrl KP_LEFT", DefaultEditorKit.previousWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1593
                       "ctrl RIGHT", DefaultEditorKit.nextWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1594
                    "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1595
                  "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1596
               "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1597
                 "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1598
              "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1599
                           "ctrl A", DefaultEditorKit.selectAllAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1600
                             "HOME", DefaultEditorKit.beginLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1601
                              "END", DefaultEditorKit.endLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1602
                       "shift HOME", DefaultEditorKit.selectionBeginLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1603
                        "shift END", DefaultEditorKit.selectionEndLineAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1604
                       "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1605
                 "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1606
                           "ctrl H", DefaultEditorKit.deletePrevCharAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1607
                           "DELETE", DefaultEditorKit.deleteNextCharAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1608
                      "ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1609
                  "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1610
                            "RIGHT", DefaultEditorKit.forwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1611
                             "LEFT", DefaultEditorKit.backwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1612
                         "KP_RIGHT", DefaultEditorKit.forwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1613
                          "KP_LEFT", DefaultEditorKit.backwardAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1614
                            "ENTER", JTextField.notifyAction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1615
                  "ctrl BACK_SLASH", "unselect",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1616
                  "control shift O", "toggle-componentOrientation",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1617
                           "ESCAPE", "reset-field-edit",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1618
                               "UP", "increment",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1619
                            "KP_UP", "increment",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1620
                             "DOWN", "decrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1621
                          "KP_DOWN", "decrement",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1622
              }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1623
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1624
            "PasswordField.font", monospacedPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1625
            "PasswordField.background", window,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1626
            "PasswordField.foreground", textText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1627
            "PasswordField.inactiveForeground", textInactiveText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1628
            "PasswordField.inactiveBackground", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1629
            "PasswordField.selectionBackground", textHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1630
            "PasswordField.selectionForeground", textHighlightText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1631
            "PasswordField.caretForeground", textText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1632
            "PasswordField.caretBlinkRate", caretBlinkRate,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1633
            "PasswordField.border", textFieldBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1634
            "PasswordField.margin", zeroInsets,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1635
            "PasswordField.echoChar", '*',
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1636
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1637
            "TextArea.font", monospacedPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1638
            "TextArea.background", window,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1639
            "TextArea.foreground", textText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1640
            "TextArea.inactiveForeground", textInactiveText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1641
            "TextArea.selectionBackground", textHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1642
            "TextArea.selectionForeground", textHighlightText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1643
            "TextArea.caretForeground", textText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1644
            "TextArea.caretBlinkRate", caretBlinkRate,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1645
            "TextArea.border", marginBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1646
            "TextArea.margin", zeroInsets,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1647
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1648
            "TextPane.font", serifPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1649
            "TextPane.background", white,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1650
            "TextPane.foreground", textText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1651
            "TextPane.selectionBackground", textHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1652
            "TextPane.selectionForeground", textHighlightText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1653
            "TextPane.caretForeground", textText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1654
            "TextPane.caretBlinkRate", caretBlinkRate,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1655
            "TextPane.inactiveForeground", textInactiveText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1656
            "TextPane.border", marginBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1657
            "TextPane.margin", editorMargin,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1658
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1659
            "EditorPane.font", serifPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1660
            "EditorPane.background", white,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1661
            "EditorPane.foreground", textText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1662
            "EditorPane.selectionBackground", textHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1663
            "EditorPane.selectionForeground", textHighlightText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1664
            "EditorPane.caretForeground", textText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1665
            "EditorPane.caretBlinkRate", caretBlinkRate,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1666
            "EditorPane.inactiveForeground", textInactiveText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1667
            "EditorPane.border", marginBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1668
            "EditorPane.margin", editorMargin,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1669
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1670
            "html.pendingImage", SwingUtilities2.makeIcon(getClass(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1671
                                    BasicLookAndFeel.class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1672
                                    "icons/image-delayed.png"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1673
            "html.missingImage", SwingUtilities2.makeIcon(getClass(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1674
                                    BasicLookAndFeel.class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1675
                                    "icons/image-failed.png"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1676
            // *** TitledBorder
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1677
            "TitledBorder.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1678
            "TitledBorder.titleColor", controlText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1679
            "TitledBorder.border", etchedBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1680
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1681
            // *** ToolBar
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1682
            "ToolBar.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1683
            "ToolBar.background", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1684
            "ToolBar.foreground", controlText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1685
            "ToolBar.shadow", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1686
            "ToolBar.darkShadow", controlDkShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1687
            "ToolBar.light", controlHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1688
            "ToolBar.highlight", controlLtHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1689
            "ToolBar.dockingBackground", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1690
            "ToolBar.dockingForeground", red,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1691
            "ToolBar.floatingBackground", control,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1692
            "ToolBar.floatingForeground", darkGray,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1693
            "ToolBar.border", etchedBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1694
            "ToolBar.separatorSize", toolBarSeparatorSize,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1695
            "ToolBar.ancestorInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1696
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1697
                        "UP", "navigateUp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1698
                     "KP_UP", "navigateUp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1699
                      "DOWN", "navigateDown",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1700
                   "KP_DOWN", "navigateDown",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1701
                      "LEFT", "navigateLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1702
                   "KP_LEFT", "navigateLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1703
                     "RIGHT", "navigateRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1704
                  "KP_RIGHT", "navigateRight"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1705
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1706
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1707
            // *** ToolTips
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1708
            "ToolTip.font", sansSerifPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1709
            "ToolTip.background", table.get("info"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1710
            "ToolTip.foreground", table.get("infoText"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1711
            "ToolTip.border", blackLineBorder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1712
            // ToolTips also support backgroundInactive, borderInactive,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1713
            // and foregroundInactive
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1714
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1715
        // *** ToolTipManager
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1716
            // ToolTipManager.enableToolTipMode currently supports:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1717
            // "allWindows" (default):
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1718
            //     enables tool tips for all windows of all java applications,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1719
            //     whether the windows are active or inactive
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1720
            // "activeApplication"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1721
            //     enables tool tips for windows of an application only when
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1722
            //     the application has an active window
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1723
            "ToolTipManager.enableToolTipMode", "allWindows",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1724
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1725
        // *** Tree
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1726
            "Tree.paintLines", Boolean.TRUE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1727
            "Tree.lineTypeDashed", Boolean.FALSE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1728
            "Tree.font", dialogPlain12,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1729
            "Tree.background", window,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1730
            "Tree.foreground", textText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1731
            "Tree.hash", gray,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1732
            "Tree.textForeground", textText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1733
            "Tree.textBackground", table.get("text"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1734
            "Tree.selectionForeground", textHighlightText,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1735
            "Tree.selectionBackground", textHighlight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1736
            "Tree.selectionBorderColor", black,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1737
            "Tree.dropLineColor", controlShadow,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1738
            "Tree.editorBorder", blackLineBorder,
25777
bb88947b6766 8049893: Replace uses of 'new Integer()' with appropriate alternative across client classes
prr
parents: 25565
diff changeset
  1739
            "Tree.leftChildIndent", 7,
bb88947b6766 8049893: Replace uses of 'new Integer()' with appropriate alternative across client classes
prr
parents: 25565
diff changeset
  1740
            "Tree.rightChildIndent", 13,
bb88947b6766 8049893: Replace uses of 'new Integer()' with appropriate alternative across client classes
prr
parents: 25565
diff changeset
  1741
            "Tree.rowHeight", 16,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1742
            "Tree.scrollsOnExpand", Boolean.TRUE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1743
            "Tree.openIcon", SwingUtilities2.makeIcon(getClass(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1744
                                                      BasicLookAndFeel.class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1745
                                                      "icons/TreeOpen.gif"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1746
            "Tree.closedIcon", SwingUtilities2.makeIcon(getClass(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1747
                                                        BasicLookAndFeel.class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1748
                                                        "icons/TreeClosed.gif"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1749
            "Tree.leafIcon", SwingUtilities2.makeIcon(getClass(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1750
                                                      BasicLookAndFeel.class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1751
                                                      "icons/TreeLeaf.gif"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1752
            "Tree.expandedIcon", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1753
            "Tree.collapsedIcon", null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1754
            "Tree.changeSelectionWithFocus", Boolean.TRUE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1755
            "Tree.drawsFocusBorderAroundIcon", Boolean.FALSE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1756
            "Tree.timeFactor", oneThousand,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1757
            "Tree.focusInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1758
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1759
                                 "ctrl C", "copy",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1760
                                 "ctrl V", "paste",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1761
                                 "ctrl X", "cut",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1762
                                   "COPY", "copy",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1763
                                  "PASTE", "paste",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1764
                                    "CUT", "cut",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1765
                         "control INSERT", "copy",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1766
                           "shift INSERT", "paste",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1767
                           "shift DELETE", "cut",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1768
                                     "UP", "selectPrevious",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1769
                                  "KP_UP", "selectPrevious",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1770
                               "shift UP", "selectPreviousExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1771
                            "shift KP_UP", "selectPreviousExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1772
                          "ctrl shift UP", "selectPreviousExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1773
                       "ctrl shift KP_UP", "selectPreviousExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1774
                                "ctrl UP", "selectPreviousChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1775
                             "ctrl KP_UP", "selectPreviousChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1776
                                   "DOWN", "selectNext",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1777
                                "KP_DOWN", "selectNext",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1778
                             "shift DOWN", "selectNextExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1779
                          "shift KP_DOWN", "selectNextExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1780
                        "ctrl shift DOWN", "selectNextExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1781
                     "ctrl shift KP_DOWN", "selectNextExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1782
                              "ctrl DOWN", "selectNextChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1783
                           "ctrl KP_DOWN", "selectNextChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1784
                                  "RIGHT", "selectChild",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1785
                               "KP_RIGHT", "selectChild",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1786
                                   "LEFT", "selectParent",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1787
                                "KP_LEFT", "selectParent",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1788
                                "PAGE_UP", "scrollUpChangeSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1789
                          "shift PAGE_UP", "scrollUpExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1790
                     "ctrl shift PAGE_UP", "scrollUpExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1791
                           "ctrl PAGE_UP", "scrollUpChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1792
                              "PAGE_DOWN", "scrollDownChangeSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1793
                        "shift PAGE_DOWN", "scrollDownExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1794
                   "ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1795
                         "ctrl PAGE_DOWN", "scrollDownChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1796
                                   "HOME", "selectFirst",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1797
                             "shift HOME", "selectFirstExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1798
                        "ctrl shift HOME", "selectFirstExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1799
                              "ctrl HOME", "selectFirstChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1800
                                    "END", "selectLast",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1801
                              "shift END", "selectLastExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1802
                         "ctrl shift END", "selectLastExtendSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1803
                               "ctrl END", "selectLastChangeLead",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1804
                                     "F2", "startEditing",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1805
                                 "ctrl A", "selectAll",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1806
                             "ctrl SLASH", "selectAll",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1807
                        "ctrl BACK_SLASH", "clearSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1808
                              "ctrl LEFT", "scrollLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1809
                           "ctrl KP_LEFT", "scrollLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1810
                             "ctrl RIGHT", "scrollRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1811
                          "ctrl KP_RIGHT", "scrollRight",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1812
                                  "SPACE", "addToSelection",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1813
                             "ctrl SPACE", "toggleAndAnchor",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1814
                            "shift SPACE", "extendTo",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1815
                       "ctrl shift SPACE", "moveSelectionTo"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1816
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1817
            "Tree.focusInputMap.RightToLeft",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1818
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1819
                                  "RIGHT", "selectParent",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1820
                               "KP_RIGHT", "selectParent",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1821
                                   "LEFT", "selectChild",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1822
                                "KP_LEFT", "selectChild",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1823
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1824
            "Tree.ancestorInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1825
               new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1826
                     "ESCAPE", "cancel"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1827
                 }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1828
            // Bind specific keys that can invoke popup on currently
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1829
            // focused JComponent
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1830
            "RootPane.ancestorInputMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1831
                new UIDefaults.LazyInputMap(new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1832
                     "shift F10", "postPopup",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1833
                  "CONTEXT_MENU", "postPopup"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1834
                  }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1835
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1836
            // These bindings are only enabled when there is a default
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1837
            // button set on the rootpane.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1838
            "RootPane.defaultButtonWindowKeyBindings", new Object[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1839
                             "ENTER", "press",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1840
                    "released ENTER", "release",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1841
                        "ctrl ENTER", "press",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1842
               "ctrl released ENTER", "release"
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1843
              },
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1844
        };
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1845
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1846
        table.putDefaults(defaults);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1847
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1848
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
  1849
    static int getFocusAcceleratorKeyMask() {
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
  1850
        Toolkit tk = Toolkit.getDefaultToolkit();
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
  1851
        if (tk instanceof SunToolkit) {
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
  1852
            return ((SunToolkit)tk).getFocusAcceleratorKeyMask();
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
  1853
        }
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
  1854
        return ActionEvent.ALT_MASK;
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
  1855
    }
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
  1856
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
  1857
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1858
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1859
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1860
     * Returns the ui that is of type <code>klass</code>, or null if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1861
     * one can not be found.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1862
     */
25565
ce603b34c98d 8043548: Fix raw and unchecked lint warnings in javax.swing.plaf.*
darcy
parents: 25186
diff changeset
  1863
    static Object getUIOfType(ComponentUI ui, Class<?> klass) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1864
        if (klass.isInstance(ui)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1865
            return ui;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1866
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1867
        return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1868
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1869
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1870
    // ********* Auditory Cue support methods and objects *********
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1871
    // also see the "AuditoryCues" section of the defaults table
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1872
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1873
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1874
     * Returns an <code>ActionMap</code> containing the audio actions
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1875
     * for this look and feel.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1876
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1877
     * The returned <code>ActionMap</code> contains <code>Actions</code> that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1878
     * embody the ability to render an auditory cue. These auditory
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1879
     * cues map onto user and system activities that may be useful
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1880
     * for an end user to know about (such as a dialog box appearing).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1881
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1882
     * At the appropriate time,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1883
     * the {@code ComponentUI} is responsible for obtaining an
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1884
     * <code>Action</code> out of the <code>ActionMap</code> and passing
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1885
     * it to <code>playSound</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1886
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1887
     * This method first looks up the {@code ActionMap} from the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1888
     * defaults using the key {@code "AuditoryCues.actionMap"}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1889
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1890
     * If the value is {@code non-null}, it is returned. If the value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1891
     * of the default {@code "AuditoryCues.actionMap"} is {@code null}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1892
     * and the value of the default {@code "AuditoryCues.cueList"} is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1893
     * {@code non-null}, an {@code ActionMapUIResource} is created and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1894
     * populated. Population is done by iterating over each of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1895
     * elements of the {@code "AuditoryCues.cueList"} array, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1896
     * invoking {@code createAudioAction()} to create an {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1897
     * Action} for each element.  The resulting {@code Action} is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1898
     * placed in the {@code ActionMapUIResource}, using the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1899
     * element as the key.  For example, if the {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1900
     * "AuditoryCues.cueList"} array contains a single-element, {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1901
     * "audioKey"}, the {@code ActionMapUIResource} is created, then
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1902
     * populated by way of {@code actionMap.put(cueList[0],
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1903
     * createAudioAction(cueList[0]))}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1904
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1905
     * If the value of the default {@code "AuditoryCues.actionMap"} is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1906
     * {@code null} and the value of the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1907
     * {@code "AuditoryCues.cueList"} is {@code null}, an empty
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1908
     * {@code ActionMapUIResource} is created.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1909
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1910
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1911
     * @return      an ActionMap containing {@code Actions}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1912
     *              responsible for playing auditory cues
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1913
     * @throws ClassCastException if the value of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1914
     *         default {@code "AuditoryCues.actionMap"} is not an
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1915
     *         {@code ActionMap}, or the value of the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1916
     *         {@code "AuditoryCues.cueList"} is not an {@code Object[]}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1917
     * @see #createAudioAction
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1918
     * @see #playSound(Action)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1919
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1920
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1921
    protected ActionMap getAudioActionMap() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1922
        ActionMap audioActionMap = (ActionMap)UIManager.get(
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1923
                                              "AuditoryCues.actionMap");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1924
        if (audioActionMap == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1925
            Object[] acList = (Object[])UIManager.get("AuditoryCues.cueList");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1926
            if (acList != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1927
                audioActionMap = new ActionMapUIResource();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1928
                for(int counter = acList.length-1; counter >= 0; counter--) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1929
                    audioActionMap.put(acList[counter],
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1930
                                       createAudioAction(acList[counter]));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1931
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1932
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1933
            UIManager.getLookAndFeelDefaults().put("AuditoryCues.actionMap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1934
                                                   audioActionMap);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1935
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1936
        return audioActionMap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1937
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1938
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1939
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1940
     * Creates and returns an {@code Action} used to play a sound.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1941
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1942
     * If {@code key} is {@code non-null}, an {@code Action} is created
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1943
     * using the value from the defaults with key {@code key}. The value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1944
     * identifies the sound resource to load when
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1945
     * {@code actionPerformed} is invoked on the {@code Action}. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1946
     * sound resource is loaded into a {@code byte[]} by way of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1947
     * {@code getClass().getResourceAsStream()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1948
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1949
     * @param key the key identifying the audio action
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1950
     * @return      an {@code Action} used to play the source, or {@code null}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1951
     *              if {@code key} is {@code null}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1952
     * @see #playSound(Action)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1953
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1954
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1955
    protected Action createAudioAction(Object key) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1956
        if (key != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1957
            String audioKey = (String)key;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1958
            String audioValue = (String)UIManager.get(key);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1959
            return new AudioAction(audioKey, audioValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1960
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1961
            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1962
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1963
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1964
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1965
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1966
     * Pass the name String to the super constructor. This is used
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1967
     * later to identify the Action and decide whether to play it or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1968
     * not. Store the resource String. I is used to get the audio
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1969
     * resource. In this case, the resource is an audio file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1970
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1971
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1972
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1973
    private class AudioAction extends AbstractAction implements LineListener {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1974
        // We strive to only play one sound at a time (other platforms
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1975
        // appear to do this). This is done by maintaining the field
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1976
        // clipPlaying. Every time a sound is to be played,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1977
        // cancelCurrentSound is invoked to cancel any sound that may be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1978
        // playing.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1979
        private String audioResource;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1980
        private byte[] audioBuffer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1981
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1982
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1983
         * The String is the name of the Action and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1984
         * points to the audio resource.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1985
         * The byte[] is a buffer of the audio bits.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1986
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1987
        public AudioAction(String name, String resource) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1988
            super(name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1989
            audioResource = resource;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1990
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1991
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1992
        public void actionPerformed(ActionEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1993
            if (audioBuffer == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1994
                audioBuffer = loadAudioData(audioResource);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1995
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1996
            if (audioBuffer != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1997
                cancelCurrentSound(null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1998
                try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1999
                    AudioInputStream soundStream =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2000
                        AudioSystem.getAudioInputStream(
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2001
                            new ByteArrayInputStream(audioBuffer));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2002
                    DataLine.Info info =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2003
                        new DataLine.Info(Clip.class, soundStream.getFormat());
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2004
                    Clip clip = (Clip) AudioSystem.getLine(info);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2005
                    clip.open(soundStream);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2006
                    clip.addLineListener(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2007
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2008
                    synchronized(audioLock) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2009
                        clipPlaying = clip;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2010
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2011
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2012
                    clip.start();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2013
                } catch (Exception ex) {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2014
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2015
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2016
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2017
        public void update(LineEvent event) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2018
            if (event.getType() == LineEvent.Type.STOP) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2019
                cancelCurrentSound((Clip)event.getLine());
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2020
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2021
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2022
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2023
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2024
         * If the parameter is null, or equal to the currently
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2025
         * playing sound, then cancel the currently playing sound.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2026
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2027
        private void cancelCurrentSound(Clip clip) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2028
            Clip lastClip = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2029
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2030
            synchronized(audioLock) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2031
                if (clip == null || clip == clipPlaying) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2032
                    lastClip = clipPlaying;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2033
                    clipPlaying = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2034
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2035
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2036
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2037
            if (lastClip != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2038
                lastClip.removeLineListener(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2039
                lastClip.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2040
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2041
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2042
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2043
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2044
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2045
     * Utility method that loads audio bits for the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2046
     * <code>soundFile</code> filename. If this method is unable to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2047
     * build a viable path name from the <code>baseClass</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2048
     * <code>soundFile</code> passed into this method, it will
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2049
     * return <code>null</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2050
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2051
     * @param soundFile    the name of the audio file to be retrieved
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2052
     *                     from disk
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2053
     * @return             A byte[] with audio data or null
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2054
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2055
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2056
    private byte[] loadAudioData(final String soundFile){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2057
        if (soundFile == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2058
            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2059
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2060
        /* Copy resource into a byte array.  This is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2061
         * necessary because several browsers consider
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2062
         * Class.getResource a security risk since it
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2063
         * can be used to load additional classes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2064
         * Class.getResourceAsStream just returns raw
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2065
         * bytes, which we can convert to a sound.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2066
         */
1290
da8902cd496c 6727661: Code improvement and warnings removing from the swing/plaf packages
rupashka
parents: 467
diff changeset
  2067
        byte[] buffer = AccessController.doPrivileged(
da8902cd496c 6727661: Code improvement and warnings removing from the swing/plaf packages
rupashka
parents: 467
diff changeset
  2068
                                                 new PrivilegedAction<byte[]>() {
da8902cd496c 6727661: Code improvement and warnings removing from the swing/plaf packages
rupashka
parents: 467
diff changeset
  2069
                public byte[] run() {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2070
                    try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2071
                        InputStream resource = BasicLookAndFeel.this.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2072
                            getClass().getResourceAsStream(soundFile);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2073
                        if (resource == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2074
                            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2075
                        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2076
                        BufferedInputStream in =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2077
                            new BufferedInputStream(resource);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2078
                        ByteArrayOutputStream out =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2079
                            new ByteArrayOutputStream(1024);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2080
                        byte[] buffer = new byte[1024];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2081
                        int n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2082
                        while ((n = in.read(buffer)) > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2083
                            out.write(buffer, 0, n);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2084
                        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2085
                        in.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2086
                        out.flush();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2087
                        buffer = out.toByteArray();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2088
                        return buffer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2089
                    } catch (IOException ioe) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2090
                        System.err.println(ioe.toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2091
                        return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2092
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2093
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2094
            });
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2095
        if (buffer == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2096
            System.err.println(getClass().getName() + "/" +
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2097
                               soundFile + " not found.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2098
            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2099
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2100
        if (buffer.length == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2101
            System.err.println("warning: " + soundFile +
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2102
                               " is zero-length");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2103
            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2104
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2105
        return buffer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2106
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2107
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2108
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2109
     * If necessary, invokes {@code actionPerformed} on
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2110
     * {@code audioAction} to play a sound.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2111
     * The {@code actionPerformed} method is invoked if the value of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2112
     * the {@code "AuditoryCues.playList"} default is a {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2113
     * non-null} {@code Object[]} containing a {@code String} entry
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2114
     * equal to the name of the {@code audioAction}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2115
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2116
     * @param audioAction an Action that knows how to render the audio
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2117
     *                    associated with the system or user activity
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2118
     *                    that is occurring; a value of {@code null}, is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2119
     *                    ignored
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2120
     * @throws ClassCastException if {@code audioAction} is {@code non-null}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2121
     *         and the value of the default {@code "AuditoryCues.playList"}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2122
     *         is not an {@code Object[]}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2123
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2124
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2125
    protected void playSound(Action audioAction) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2126
        if (audioAction != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2127
            Object[] audioStrings = (Object[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2128
                                    UIManager.get("AuditoryCues.playList");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2129
            if (audioStrings != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2130
                // create a HashSet to help us decide to play or not
1290
da8902cd496c 6727661: Code improvement and warnings removing from the swing/plaf packages
rupashka
parents: 467
diff changeset
  2131
                HashSet<Object> audioCues = new HashSet<Object>();
da8902cd496c 6727661: Code improvement and warnings removing from the swing/plaf packages
rupashka
parents: 467
diff changeset
  2132
                for (Object audioString : audioStrings) {
da8902cd496c 6727661: Code improvement and warnings removing from the swing/plaf packages
rupashka
parents: 467
diff changeset
  2133
                    audioCues.add(audioString);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2134
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2135
                // get the name of the Action
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2136
                String actionName = (String)audioAction.getValue(Action.NAME);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2137
                // if the actionName is in the audioCues HashSet, play it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2138
                if (audioCues.contains(actionName)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2139
                    audioAction.actionPerformed(new
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2140
                        ActionEvent(this, ActionEvent.ACTION_PERFORMED,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2141
                                    actionName));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2142
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2143
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2144
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2145
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2146
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2147
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2148
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2149
     * Sets the parent of the passed in ActionMap to be the audio action
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2150
     * map.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2151
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2152
    static void installAudioActionMap(ActionMap map) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2153
        LookAndFeel laf = UIManager.getLookAndFeel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2154
        if (laf instanceof BasicLookAndFeel) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2155
            map.setParent(((BasicLookAndFeel)laf).getAudioActionMap());
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2156
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2157
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2158
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2159
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2160
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2161
     * Helper method to play a named sound.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2162
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2163
     * @param c JComponent to play the sound for.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2164
     * @param actionKey Key for the sound.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2165
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2166
    static void playSound(JComponent c, Object actionKey) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2167
        LookAndFeel laf = UIManager.getLookAndFeel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2168
        if (laf instanceof BasicLookAndFeel) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2169
            ActionMap map = c.getActionMap();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2170
            if (map != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2171
                Action audioAction = map.get(actionKey);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2172
                if (audioAction != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2173
                    // pass off firing the Action to a utility method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2174
                    ((BasicLookAndFeel)laf).playSound(audioAction);
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
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2179
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2180
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2181
     * This class contains listener that watches for all the mouse
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2182
     * events that can possibly invoke popup on the component
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2183
     */
1290
da8902cd496c 6727661: Code improvement and warnings removing from the swing/plaf packages
rupashka
parents: 467
diff changeset
  2184
    class AWTEventHelper implements AWTEventListener,PrivilegedAction<Object> {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2185
        AWTEventHelper() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2186
            super();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2187
            AccessController.doPrivileged(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2188
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2189
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2190
        public Object run() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2191
            Toolkit tk = Toolkit.getDefaultToolkit();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2192
            if(invocator == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2193
                tk.addAWTEventListener(this, AWTEvent.MOUSE_EVENT_MASK);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2194
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2195
                tk.removeAWTEventListener(invocator);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2196
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2197
            // Return value not used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2198
            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2199
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2200
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2201
        public void eventDispatched(AWTEvent ev) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2202
            int eventID = ev.getID();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2203
            if((eventID & AWTEvent.MOUSE_EVENT_MASK) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2204
                MouseEvent me = (MouseEvent) ev;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2205
                if(me.isPopupTrigger()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2206
                    MenuElement[] elems = MenuSelectionManager
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2207
                            .defaultManager()
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2208
                            .getSelectedPath();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2209
                    if(elems != null && elems.length != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2210
                        return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2211
                        // We shall not interfere with already opened menu
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2212
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2213
                    Object c = me.getSource();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2214
                    JComponent src = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2215
                    if(c instanceof JComponent) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2216
                        src = (JComponent) c;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2217
                    } else if(c instanceof BasicSplitPaneDivider) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2218
                        // Special case - if user clicks on divider we must
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2219
                        // invoke popup from the SplitPane
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2220
                        src = (JComponent)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2221
                            ((BasicSplitPaneDivider)c).getParent();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2222
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2223
                    if(src != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2224
                        if(src.getComponentPopupMenu() != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2225
                            Point pt = src.getPopupLocation(me);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2226
                            if(pt == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2227
                                pt = me.getPoint();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2228
                                pt = SwingUtilities.convertPoint((Component)c,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2229
                                                                  pt, src);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2230
                            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2231
                            src.getComponentPopupMenu().show(src, pt.x, pt.y);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2232
                            me.consume();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2233
                        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2234
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2235
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2236
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2237
            /* Activate a JInternalFrame if necessary. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2238
            if (eventID == MouseEvent.MOUSE_PRESSED) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2239
                Object object = ev.getSource();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2240
                if (!(object instanceof Component)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2241
                    return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2242
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2243
                Component component = (Component)object;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2244
                if (component != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2245
                    Component parent = component;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2246
                    while (parent != null && !(parent instanceof Window)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2247
                        if (parent instanceof JInternalFrame) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2248
                            // Activate the frame.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2249
                            try { ((JInternalFrame)parent).setSelected(true); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2250
                            catch (PropertyVetoException e1) { }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2251
                        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2252
                        parent = parent.getParent();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2253
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2254
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2255
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2256
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2257
    }
25565
ce603b34c98d 8043548: Fix raw and unchecked lint warnings in javax.swing.plaf.*
darcy
parents: 25186
diff changeset
  2258
}