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