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