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