2 * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
\r
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
\r
5 * This code is free software; you can redistribute it and/or modify it
\r
6 * under the terms of the GNU General Public License version 2 only, as
\r
7 * published by the Free Software Foundation. Oracle designates this
\r
8 * particular file as subject to the "Classpath" exception as provided
\r
9 * by Oracle in the LICENSE file that accompanied this code.
\r
11 * This code is distributed in the hope that it will be useful, but WITHOUT
\r
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
\r
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
\r
14 * version 2 for more details (a copy is included in the LICENSE file that
\r
15 * accompanied this code).
\r
17 * You should have received a copy of the GNU General Public License version
\r
18 * 2 along with this work; if not, write to the Free Software Foundation,
\r
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
\r
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
\r
22 * or visit www.oracle.com if you need additional information or have any
\r
26 package swingjs.plaf;
\r
28 //import jsjava.awt.AWTEvent;
\r
29 import jsjava.awt.Color;
\r
30 import jsjava.awt.Dimension;
\r
31 import jsjava.awt.Font;
\r
32 import jsjavax.swing.DefaultListCellRenderer;
\r
33 import jsjavax.swing.JTextField;
\r
34 //import jsjava.awt.Component;
\r
35 //import jsjava.awt.Dimension;
\r
36 //import jsjava.awt.Font;
\r
37 //import jsjava.awt.Point;
\r
38 //import jsjava.awt.Toolkit;
\r
39 //import jsjava.awt.Window;
\r
40 //import jsjava.awt.event.AWTEventListener;
\r
41 //import jsjava.awt.event.ActionEvent;
\r
42 //import jsjava.awt.event.KeyEvent;
\r
43 //import jsjava.awt.event.MouseEvent;
\r
44 //import jsjava.beans.PropertyChangeEvent;
\r
45 //import jsjava.beans.PropertyChangeListener;
\r
46 //import jsjava.beans.PropertyVetoException;
\r
47 //import java.io.BufferedInputStream;
\r
48 //import java.io.ByteArrayInputStream;
\r
49 //import java.io.ByteArrayOutputStream;
\r
50 //import java.io.IOException;
\r
51 //import java.io.InputStream;
\r
52 ////import java.io.Serializable;
\r
53 //import jsjava.security.AccessController;
\r
54 //import jsjava.security.PrivilegedAction;
\r
55 //import java.util.HashSet;
\r
56 //import jsjava.util.Locale;
\r
58 ////import jsjavax.sound.sampled.AudioInputStream;
\r
59 ////import jsjavax.sound.sampled.AudioSystem;
\r
60 ////import jsjavax.sound.sampled.Clip;
\r
61 ////import jsjavax.sound.sampled.DataLine;
\r
62 ////import jsjavax.sound.sampled.LineEvent;
\r
63 ////import jsjavax.sound.sampled.LineListener;
\r
64 //import jsjavax.swing.AbstractAction;
\r
65 //import jsjavax.swing.Action;
\r
66 //import jsjavax.swing.ActionMap;
\r
67 //import jsjavax.swing.DefaultListCellRenderer;
\r
68 //import jsjavax.swing.JComponent;
\r
69 ////import jsjavax.swing.JInternalFrame;
\r
70 //import jsjavax.swing.JTextField;
\r
71 //import jsjavax.swing.LookAndFeel;
\r
72 //import jsjavax.swing.MenuElement;
\r
73 //import jsjavax.swing.MenuSelectionManager;
\r
74 //import jsjavax.swing.SwingUtilities;
\r
75 import jsjavax.swing.LookAndFeel;
\r
76 import jsjavax.swing.UIDefaults;
\r
77 //import jsjavax.swing.UIManager;
\r
78 //import jsjavax.swing.border.BevelBorder;
\r
79 //import jsjavax.swing.plaf.ActionMapUIResource;
\r
80 //import jsjavax.swing.plaf.BorderUIResource;
\r
81 import jsjavax.swing.plaf.ColorUIResource;
\r
82 import jsjavax.swing.plaf.FontUIResource;
\r
83 //import jsjavax.swing.plaf.ComponentUI;
\r
84 import jsjavax.swing.plaf.DimensionUIResource;
\r
85 //import jsjavax.swing.plaf.DimensionUIResource;
\r
86 //import jsjavax.swing.plaf.InsetsUIResource;
\r
87 ////import jsjavax.swing.plaf.basic.popupMenuUI;
\r
88 ////import jsjavax.swing.plaf.basic.BasicSplitPaneDivider;
\r
89 //import jsjavax.swing.text.DefaultEditorKit;
\r
91 //import jssun.awt.AppContext;
\r
92 //import jssun.swing.SwingUtilities2;
\r
93 ////import jssun.swing.SwingLazyValue;
\r
95 import jsjavax.swing.plaf.InsetsUIResource;
\r
96 import jssun.swing.SwingLazyValue;
\r
99 * A base class to use in creating a look and feel for Swing.
\r
101 * Each of the {@code ComponentUI}s provided by {@code BasicLookAndFeel} derives
\r
102 * its behavior from the defaults table. Unless otherwise noted each of the
\r
103 * {@code ComponentUI} implementations in this package document the set of
\r
104 * defaults they use. Unless otherwise noted the defaults are installed at the
\r
105 * time {@code installUI} is invoked, and follow the recommendations outlined in
\r
106 * {@code LookAndFeel} for installing defaults.
\r
108 * <strong>Warning:</strong> Serialized objects of this class will not be
\r
109 * compatible with future Swing releases. The current serialization support is
\r
110 * appropriate for short term storage or RMI between applications running the
\r
111 * same version of Swing. As of 1.4, support for long term storage of all
\r
112 * JavaBeans<sup><font size="-2">TM</font></sup> has been added to the
\r
113 * <code>java.beans</code> package. Please see {@link java.beans.XMLEncoder}.
\r
115 * @author unattributed
\r
117 public class HTML5LookAndFeel extends LookAndFeel {
\r
119 // * Whether or not the developer has created a JPopupMenu.
\r
121 // static boolean needsEventHelper;
\r
124 // * Lock used when manipulating clipPlaying.
\r
126 // private transient Object audioLock = new Object();
\r
128 // * The Clip that is currently playing (set in AudioAction).
\r
130 // private Clip clipPlaying;
\r
132 // AWTEventHelper invocator = null;
\r
135 // * Listen for our AppContext being disposed
\r
137 // private PropertyChangeListener disposer = null;
\r
140 * Returns the look and feel defaults. The returned {@code UIDefaults} is
\r
141 * populated by invoking, in order, {@code initClassDefaults},
\r
142 * {@code initSystemColorDefaults} and {@code initComponentDefaults}.
\r
144 * While this method is public, it should only be invoked by the
\r
145 * {@code UIManager} when the look and feel is set as the current look and
\r
146 * feel and after {@code initialize} has been invoked.
\r
148 * @return the look and feel defaults
\r
150 * @see #initClassDefaults
\r
151 * @see #initSystemColorDefaults
\r
152 * @see #initComponentDefaults
\r
154 public UIDefaults getDefaults() {
\r
155 UIDefaults table = new UIDefaults(610, 0.75f);
\r
157 initClassDefaults(table);
\r
158 initSystemColorDefaults(table);
\r
159 initComponentDefaults(table);
\r
167 public void initialize() {
\r
168 // if (needsEventHelper) {
\r
169 // installAWTEventListener();
\r
173 void installAWTEventListener() {
\r
174 // if (invocator == null) {
\r
175 // invocator = new AWTEventHelper();
\r
176 // needsEventHelper = true;
\r
178 // // Add a PropertyChangeListener to our AppContext so we're alerted
\r
179 // // when the AppContext is disposed(), at which time this laf should
\r
180 // // be uninitialize()d.
\r
181 // disposer = new PropertyChangeListener() {
\r
182 // public void propertyChange(PropertyChangeEvent prpChg) {
\r
186 // AppContext.getAppContext().addPropertyChangeListener(
\r
187 // AppContext.GUI_DISPOSED,
\r
195 public void uninitialize() {
\r
196 // AppContext context = AppContext.getAppContext();
\r
197 // synchronized (popupMenuUI.MOUSE_GRABBER_KEY) {
\r
198 // Object grabber = context.get(popupMenuUI.MOUSE_GRABBER_KEY);
\r
199 // if (grabber != null) {
\r
200 // ((popupMenuUI.MouseGrabber)grabber).uninstall();
\r
203 // synchronized (popupMenuUI.MENU_KEYBOARD_HELPER_KEY) {
\r
205 // context.get(popupMenuUI.MENU_KEYBOARD_HELPER_KEY);
\r
206 // if (helper != null) {
\r
207 // ((popupMenuUI.MenuKeyboardHelper)helper).uninstall();
\r
211 // if(invocator != null) {
\r
212 // AccessController.doPrivileged(invocator);
\r
213 // invocator = null;
\r
216 // if (disposer != null) {
\r
217 // // Note that we're likely calling removePropertyChangeListener()
\r
218 // // during the course of AppContext.firePropertyChange().
\r
219 // // However, EventListenerAggreggate has code to safely modify
\r
220 // // the list under such circumstances.
\r
221 // context.removePropertyChangeListener(AppContext.GUI_DISPOSED,
\r
223 // disposer = null;
\r
228 * Populates {@code table} with mappings from {@code uiClassID} to the fully
\r
229 * qualified name of the ui class. The value for a particular
\r
230 * {@code uiClassID} is {@code "jsjavax.swing.plaf.basic.Basic + uiClassID"}.
\r
231 * For example, the value for the {@code uiClassID} {@code TreeUI} is
\r
232 * {@code "jsjavax.swing.plaf.basic.BasicTreeUI"}.
\r
235 * the {@code UIDefaults} instance the entries are added to
\r
236 * @throws NullPointerException
\r
237 * if {@code table} is {@code null}
\r
239 * @see jsjavax.swing.LookAndFeel
\r
240 * @see #getDefaults
\r
242 protected void initClassDefaults(UIDefaults table) {
\r
243 final String packageName = "swingjs.plaf.";
\r
244 Object[] uiDefaults = {
\r
245 /**/ "ButtonUI", packageName + "JSButtonUI",
\r
246 /**/ "CheckBoxUI", packageName + "JSCheckBoxUI",
\r
247 "ColorChooserUI", packageName + "JSColorChooserUI",
\r
248 /**/ "FormattedTextFieldUI", packageName + "JSFormattedTextFieldUI",
\r
249 /**/ "MenuBarUI", packageName + "JSMenuBarUI",
\r
250 /**/ "MenuUI", packageName + "JSMenuUI",
\r
251 /**/ "MenuItemUI", packageName + "JSMenuItemUI",
\r
252 /**/ "CheckBoxMenuItemUI", packageName + "JSCheckBoxMenuItemUI",
\r
253 /**/ "RadioButtonMenuItemUI", packageName + "JSRadioButtonMenuItemUI",
\r
254 /**/ "RadioButtonUI", packageName + "JSRadioButtonUI",
\r
255 /**/ "ToggleButtonUI", packageName + "JSToggleButtonUI",
\r
256 /**/ "PopupMenuUI", packageName + "JSPopupMenuUI",
\r
257 "ProgressBarUI", packageName + "JSProgressBarUI",
\r
258 /**/ "ScrollBarUI", packageName + "JSScrollBarUI",
\r
259 /**/ "ScrollPaneUI", packageName + "JSScrollPaneUI",
\r
260 "SplitPaneUI", packageName + "JSSplitPaneUI",
\r
261 /**/ "SliderUI", packageName + "JSSliderUI",
\r
262 /**/ "SeparatorUI", packageName + "JSSeparatorUI",
\r
263 "SpinnerUI", packageName + "JSSpinnerUI",
\r
264 /**/ "ToolBarSeparatorUI", packageName + "JSToolBarSeparatorUI",
\r
265 /**/ "PopupMenuSeparatorUI", packageName + "JSPopupMenuSeparatorUI",
\r
266 "TabbedPaneUI", packageName + "JSTabbedPaneUI",
\r
267 /**/ "TextAreaUI", packageName + "JSTextAreaUI",
\r
268 /**/ "TextFieldUI", packageName + "JSTextFieldUI",
\r
269 /**/ "PasswordFieldUI", packageName + "JSPasswordFieldUI",
\r
270 "TextPaneUI", packageName + "JSTextPaneUI",
\r
271 "EditorPaneUI", packageName + "JSEditorPaneUI",
\r
272 "TreeUI", packageName + "JSTreeUI",
\r
273 /**/ "LabelUI", packageName + "JSLabelUI",
\r
274 "ListUI", packageName + "JSListUI",
\r
275 "ToolBarUI", packageName + "JSToolBarUI",
\r
276 "ToolTipUI", packageName + "JSToolTipUI",
\r
277 /**/ "ComboBoxUI", packageName + "JSComboBoxUI",
\r
278 "TableUI", packageName + "JSTableUI",
\r
279 "TableHeaderUI", packageName + "JSTableHeaderUI",
\r
280 "InternalFrameUI", packageName + "JSInternalFrameUI",
\r
281 "DesktopPaneUI", packageName + "JSDesktopPaneUI",
\r
282 "DesktopIconUI", packageName + "JSDesktopIconUI",
\r
283 "OptionPaneUI", packageName + "JSOptionPaneUI",
\r
284 /**/ "PanelUI", packageName + "JSPanelUI",
\r
285 /**/ "ViewportUI", packageName + "JSViewportUI",
\r
286 /**/ "RootPaneUI", packageName + "JSRootPaneUI"
\r
289 table.putDefaults(uiDefaults);
\r
293 * Populates {@code table} with system colors. This creates an array of
\r
294 * {@code name-color} pairs and invokes {@code loadSystemColors}.
\r
296 * The name is a {@code String} that corresponds to the name of one of the
\r
297 * static {@code SystemColor} fields in the {@code SystemColor} class. A
\r
298 * name-color pair is created for every such {@code SystemColor} field.
\r
300 * The {@code color} corresponds to a hex {@code String} as understood by
\r
301 * {@code Color.decode}. For example, one of the {@code name-color} pairs is
\r
302 * {@code "desktop"-"#005C5C"}. This corresponds to the {@code SystemColor}
\r
303 * field {@code desktop}, with a color value of {@code new Color(0x005C5C)}.
\r
305 * The following shows two of the {@code name-color} pairs:
\r
308 * String[] nameColorPairs = new String[] { "desktop", "#005C5C", "activeCaption",
\r
309 * "#000080" };
\r
310 * loadSystemColors(table, nameColorPairs, isNativeLookAndFeel());
\r
313 * As previously stated, this invokes {@code loadSystemColors} with the
\r
314 * supplied {@code table} and {@code name-color} pair array. The last argument
\r
315 * to {@code loadSystemColors} indicates whether the value of the field in
\r
316 * {@code SystemColor} should be used. This method passes the value of
\r
317 * {@code isNativeLookAndFeel()} as the last argument to
\r
318 * {@code loadSystemColors}.
\r
321 * the {@code UIDefaults} object the values are added to
\r
322 * @throws NullPointerException
\r
323 * if {@code table} is {@code null}
\r
325 * @see jsjava.awt.SystemColor
\r
326 * @see #getDefaults
\r
327 * @see #loadSystemColors
\r
329 protected void initSystemColorDefaults(UIDefaults table) {
\r
330 String[] defaultSystemColors = {
\r
333 // "desktop", "#005C5C", /*
\r
338 // "activeCaption", "#000080", /*
\r
339 // * Color for captions (title bars) when they are
\r
342 // "activeCaptionText", "#FFFFFF", /*
\r
343 // * Text color for text in captions (title
\r
346 // "activeCaptionBorder", "#C0C0C0", /*
\r
347 // * Border color for caption (title bar)
\r
348 // * window borders.
\r
350 // "inactiveCaption", "#808080", /*
\r
351 // * Color for captions (title bars) when not
\r
354 // "inactiveCaptionText", "#C0C0C0", /*
\r
355 // * Text color for text in inactive
\r
356 // * captions (title bars).
\r
358 // "inactiveCaptionBorder", "#C0C0C0", /*
\r
359 // * Border color for inactive caption
\r
360 // * (title bar) window borders.
\r
362 // plaf.metal.OceanTheme
\r
363 "window", "#FFFFFF", /* Default color for the interior of windows */
\r
364 // "windowBorder", "#000000", /* ??? */
\r
365 "windowText", "#333333", /* ??? */
\r
366 "menu", "#C0C0C0", /* Background color for menus */
\r
367 "menuText", "#333333", /* Text color for menus */
\r
368 "text", "#C0C0C0", /* Text background color */
\r
369 "textText", "#333333", /* Text foreground color */
\r
370 // "textHighlight", "#000080", /* Text background color when selected */
\r
371 // "textHighlightText", "#FFFFFF", /* Text color when selected */
\r
372 // "textInactiveText", "#808080", /* Text color when disabled */
\r
373 "control", "#EEEEEE", // SECONDARY3 Default color for controls (buttons, sliders, etc)
\r
374 "controlText", "#333333", // Default color for text in controls
\r
375 // "controlHighlight", "#C0C0C0", /*
\r
376 // * Specular highlight (opposite of the
\r
379 // "controlLtHighlight", "#FFFFFF", /* Highlight color for controls */
\r
380 // "controlShadow", "#808080", /* Shadow color for controls */
\r
381 // "controlDkShadow", "#000000", /* Dark shadow color for controls */
\r
382 "scrollbar", "#E0E0E0", /* Scrollbar background (usually the "track") */
\r
383 "info", "#FFFFE1", /* ??? */
\r
384 "infoText", "#000000" /* ??? */
\r
387 loadSystemColors(table, defaultSystemColors, isNativeLookAndFeel());
\r
391 * Populates {@code table} with the {@code name-color} pairs in
\r
392 * {@code systemColors}. Refer to {@link #initSystemColorDefaults(UIDefaults)}
\r
393 * for details on the format of {@code systemColors}.
\r
395 * An entry is added to {@code table} for each of the {@code name-color} pairs
\r
396 * in {@code systemColors}. The entry key is the {@code name} of the
\r
397 * {@code name-color} pair.
\r
399 * The value of the entry corresponds to the {@code color} of the
\r
400 * {@code name-color} pair. The value of the entry is calculated in one of two
\r
401 * ways. With either approach the value is always a {@code ColorUIResource}.
\r
403 * If {@code useNative} is {@code false}, the {@code color} is created by
\r
404 * using {@code Color.decode} to convert the {@code String} into a
\r
405 * {@code Color}. If {@code decode} can not convert the {@code String} into a
\r
406 * {@code Color} ({@code NumberFormatException} is thrown) then a
\r
407 * {@code ColorUIResource} of black is used.
\r
409 * If {@code useNative} is {@code true}, the {@code color} is the value of the
\r
410 * field in {@code SystemColor} with the same name as the {@code name} of the
\r
411 * {@code name-color} pair. If the field is not valid, a
\r
412 * {@code ColorUIResource} of black is used.
\r
415 * the {@code UIDefaults} object the values are added to
\r
416 * @param systemColors
\r
417 * array of {@code name-color} pairs as described in
\r
418 * {@link #initSystemColorDefaults(UIDefaults)}
\r
420 * whether the color is obtained from {@code SystemColor} or
\r
421 * {@code Color.decode}
\r
422 * @throws NullPointerException
\r
423 * if {@code systemColors} is {@code null}; or {@code systemColors}
\r
424 * is not empty, and {@code table} is {@code null}; or one of the
\r
425 * names of the {@code name-color} pairs is {@code null}; or
\r
426 * {@code useNative} is {@code false} and one of the {@code colors}
\r
427 * of the {@code name-color} pairs is {@code null}
\r
428 * @throws ArrayIndexOutOfBoundsException
\r
429 * if {@code useNative} is {@code false} and
\r
430 * {@code systemColors.length} is odd
\r
432 * @see #initSystemColorDefaults(jsjavax.swing.UIDefaults)
\r
433 * @see jsjava.awt.SystemColor
\r
434 * @see jsjava.awt.Color#decode(String)
\r
436 protected void loadSystemColors(UIDefaults table, String[] systemColors,
\r
437 boolean useNative) {
\r
439 * PENDING(hmuller) We don't load the system colors below because they're
\r
440 * not reliable. Hopefully we'll be able to do better in a future version of
\r
443 // if (useNative) {
\r
444 // for (int i = 0; i < systemColors.length; i += 2) {
\r
445 // Color color = Color.black;
\r
447 // // String name = systemColors[i];
\r
448 // // color = (Color)(SystemColor.class.getField(name).get(null));
\r
449 // // } catch (Exception e) {
\r
451 // table.put(systemColors[i], new ColorUIResource(color));
\r
454 for (int i = 0; i < systemColors.length; i += 2) {
\r
455 Color color = Color.black;
\r
457 color = Color.decode(systemColors[i + 1]);
\r
458 } catch (NumberFormatException e) {
\r
459 e.printStackTrace();
\r
461 table.put(systemColors[i], new ColorUIResource(color));
\r
467 * Initialize the defaults table with the name of the ResourceBundle used for
\r
468 * getting localized defaults. Also initialize the default locale used when no
\r
469 * locale is passed into UIDefaults.get(). The default locale should generally
\r
470 * not be relied upon. It is here for compatability with releases prior to
\r
473 private void initResourceBundle(UIDefaults table) {
\r
474 // table.setDefaultLocale( Locale.getDefault() );
\r
475 // table.addResourceBundle(
\r
476 // "com.sun.swing.internal.plaf.basic.resources.basic" );
\r
480 * Populates {@code table} with the defaults for the basic look and feel.
\r
483 * the {@code UIDefaults} to add the values to
\r
484 * @throws NullPointerException
\r
485 * if {@code table} is {@code null}
\r
487 protected void initComponentDefaults(UIDefaults table) {
\r
489 initResourceBundle(table);
\r
491 // // *** Shared Integers
\r
492 // Integer fiveHundred = new Integer(500);
\r
494 // *** Shared Longs
\r
495 Long oneThousand = new Long(1000);
\r
497 // *** Shared Fonts
\r
498 Integer twelve = new Integer(12);
\r
499 Integer fontPlain = new Integer(Font.PLAIN);
\r
500 // Integer fontBold = new Integer(Font.BOLD);
\r
501 // Object dialogPlain12 = new SwingLazyValue(
\r
502 // "jsjavax.swing.plaf.FontUIResource",
\r
504 // new Object[] {Font.DIALOG, fontPlain, twelve});
\r
505 Object serifPlain12 = new FontUIResource(Font.SERIF, Font.PLAIN, 12);
\r
506 Object sansSerifPlain12 = new FontUIResource(Font.SANS_SERIF, Font.PLAIN,
\r
508 Object dialogPlain12 = new FontUIResource(Font.DIALOG, Font.PLAIN, 12);
\r
509 Object monospacedPlain12 = new FontUIResource(Font.MONOSPACED, Font.PLAIN, 12);
\r
510 // Object dialogBold12 = new SwingLazyValue(
\r
511 // "jsjavax.swing.plaf.FontUIResource",
\r
513 // new Object[] {Font.DIALOG, fontBold, twelve});
\r
516 // *** Shared Colors
\r
517 // ColorUIResource red = new ColorUIResource(Color.red);
\r
518 ColorUIResource black = new ColorUIResource(Color.black);
\r
519 ColorUIResource white = new ColorUIResource(Color.white);
\r
520 // ColorUIResource yellow = new ColorUIResource(Color.yellow);
\r
521 ColorUIResource gray = new ColorUIResource(Color.gray);
\r
522 // ColorUIResource lightGray = new ColorUIResource(Color.lightGray);
\r
523 ColorUIResource darkGray = new ColorUIResource(Color.darkGray);
\r
524 // ColorUIResource scrollBarTrack = new ColorUIResource(224, 224, 224);
\r
526 Color control = table.getColor("control");
\r
527 // Color controlDkShadow = table.getColor("controlDkShadow");
\r
528 // Color controlHighlight = table.getColor("controlHighlight");
\r
529 // Color controlLtHighlight = table.getColor("controlLtHighlight");
\r
530 // Color controlShadow = table.getColor("controlShadow");
\r
531 Color controlText = table.getColor("controlText");
\r
532 Color menu = table.getColor("menu");
\r
533 Color menuText = table.getColor("menuText");
\r
534 // Color textHighlight = table.getColor("textHighlight");
\r
535 // Color textHighlightText = table.getColor("textHighlightText");
\r
536 // Color textInactiveText = table.getColor("textInactiveText");
\r
537 Color textText = table.getColor("textText");
\r
538 Color window = table.getColor("window");
\r
540 // *** Shared Insets
\r
541 InsetsUIResource zeroInsets = new InsetsUIResource(0, 0, 0, 0);
\r
542 InsetsUIResource twoInsets = new InsetsUIResource(2, 2, 2, 2);
\r
543 InsetsUIResource threeInsets = new InsetsUIResource(3, 3, 3, 3);
\r
545 // // *** Shared Borders
\r
546 // Object marginBorder = new SwingLazyValue(
\r
547 // "jsjavax.swing.plaf.basic.BasicBorders$MarginBorder");
\r
548 // Object etchedBorder = new SwingLazyValue(
\r
549 // "jsjavax.swing.plaf.BorderUIResource",
\r
550 // "getEtchedBorderUIResource");
\r
551 // Object loweredBevelBorder = new SwingLazyValue(
\r
552 // "jsjavax.swing.plaf.BorderUIResource",
\r
553 // "getLoweredBevelBorderUIResource");
\r
555 // Object popupMenuBorder = new SwingLazyValue(
\r
556 // "jsjavax.swing.plaf.basic.BasicBorders",
\r
557 // "getInternalFrameBorder");
\r
559 // Object blackLineBorder = new SwingLazyValue(
\r
560 // "jsjavax.swing.plaf.BorderUIResource",
\r
561 // "getBlackLineBorderUIResource");
\r
562 // Object focusCellHighlightBorder = new SwingLazyValue(
\r
563 // "jsjavax.swing.plaf.BorderUIResource$LineBorderUIResource",
\r
565 // new Object[] {yellow});
\r
567 // Object noFocusBorder = new
\r
568 // BorderUIResource.EmptyBorderUIResource(1,1,1,1);
\r
570 // Object tableHeaderBorder = new SwingLazyValue(
\r
571 // "jsjavax.swing.plaf.BorderUIResource$BevelBorderUIResource",
\r
573 // new Object[] { new Integer(BevelBorder.RAISED),
\r
574 // controlLtHighlight,
\r
576 // controlDkShadow,
\r
577 // controlShadow });
\r
580 // // *** Button value objects
\r
582 // Object buttonBorder =
\r
583 // new SwingLazyValue(
\r
584 // "jsjavax.swing.plaf.basic.BasicBorders",
\r
585 // "getButtonBorder");
\r
587 // Object buttonToggleBorder =
\r
588 // new SwingLazyValue(
\r
589 // "jsjavax.swing.plaf.basic.BasicBorders",
\r
590 // "getToggleButtonBorder");
\r
592 // Object radioButtonBorder =
\r
593 // new SwingLazyValue(
\r
594 // "jsjavax.swing.plaf.basic.BasicBorders",
\r
595 // "getRadioButtonBorder");
\r
597 // // *** FileChooser / FileView value objects
\r
599 // Object newFolderIcon = SwingUtilities2.makeIcon(getClass(),
\r
600 // BasicLookAndFeel.class,
\r
601 // "icons/NewFolder.gif");
\r
602 // Object upFolderIcon = SwingUtilities2.makeIcon(getClass(),
\r
603 // BasicLookAndFeel.class,
\r
604 // "icons/UpFolder.gif");
\r
605 // Object homeFolderIcon = SwingUtilities2.makeIcon(getClass(),
\r
606 // BasicLookAndFeel.class,
\r
607 // "icons/HomeFolder.gif");
\r
608 // Object detailsViewIcon = SwingUtilities2.makeIcon(getClass(),
\r
609 // BasicLookAndFeel.class,
\r
610 // "icons/DetailsView.gif");
\r
611 // Object listViewIcon = SwingUtilities2.makeIcon(getClass(),
\r
612 // BasicLookAndFeel.class,
\r
613 // "icons/ListView.gif");
\r
614 // Object directoryIcon = SwingUtilities2.makeIcon(getClass(),
\r
615 // BasicLookAndFeel.class,
\r
616 // "icons/Directory.gif");
\r
617 // Object fileIcon = SwingUtilities2.makeIcon(getClass(),
\r
618 // BasicLookAndFeel.class,
\r
619 // "icons/File.gif");
\r
620 // Object computerIcon = SwingUtilities2.makeIcon(getClass(),
\r
621 // BasicLookAndFeel.class,
\r
622 // "icons/Computer.gif");
\r
623 // Object hardDriveIcon = SwingUtilities2.makeIcon(getClass(),
\r
624 // BasicLookAndFeel.class,
\r
625 // "icons/HardDrive.gif");
\r
626 // Object floppyDriveIcon = SwingUtilities2.makeIcon(getClass(),
\r
627 // BasicLookAndFeel.class,
\r
628 // "icons/FloppyDrive.gif");
\r
631 // // *** InternalFrame value objects
\r
633 // Object internalFrameBorder = new SwingLazyValue(
\r
634 // "jsjavax.swing.plaf.basic.BasicBorders",
\r
635 // "getInternalFrameBorder");
\r
637 // // *** List value objects
\r
639 Object listCellRendererActiveValue = new UIDefaults.ActiveValue() {
\r
640 public Object createValue(UIDefaults table) {
\r
641 return new DefaultListCellRenderer.UIResource();
\r
646 // // *** Menus value objects
\r
648 // Object menuBarBorder =
\r
649 // new SwingLazyValue(
\r
650 // "jsjavax.swing.plaf.basic.BasicBorders",
\r
651 // "getMenuBarBorder");
\r
653 // Object menuItemCheckIcon =
\r
654 // new SwingLazyValue(
\r
655 // "jsjavax.swing.plaf.basic.BasicIconFactory",
\r
656 // "getMenuItemCheckIcon");
\r
658 // Object menuItemArrowIcon =
\r
659 // new SwingLazyValue(
\r
660 // "jsjavax.swing.plaf.basic.BasicIconFactory",
\r
661 // "getMenuItemArrowIcon");
\r
664 // Object menuArrowIcon =
\r
665 // new SwingLazyValue(
\r
666 // "jsjavax.swing.plaf.basic.BasicIconFactory",
\r
667 // "getMenuArrowIcon");
\r
669 // Object checkBoxIcon =
\r
670 // new SwingLazyValue(
\r
671 // "jsjavax.swing.plaf.basic.BasicIconFactory",
\r
672 // "getCheckBoxIcon");
\r
674 // Object radioButtonIcon =
\r
675 // new SwingLazyValue(
\r
676 // "jsjavax.swing.plaf.basic.BasicIconFactory",
\r
677 // "getRadioButtonIcon");
\r
679 // Object checkBoxMenuItemIcon =
\r
680 // new SwingLazyValue(
\r
681 // "jsjavax.swing.plaf.basic.BasicIconFactory",
\r
682 // "getCheckBoxMenuItemIcon");
\r
684 // Object radioButtonMenuItemIcon =
\r
685 // new SwingLazyValue(
\r
686 // "jsjavax.swing.plaf.basic.BasicIconFactory",
\r
687 // "getRadioButtonMenuItemIcon");
\r
689 // Object menuItemAcceleratorDelimiter = new String("+");
\r
691 // // *** OptionPane value objects
\r
693 // Object optionPaneMinimumSize = new DimensionUIResource(262, 90);
\r
695 Integer zero = new Integer(0);
\r
696 // Object zeroBorder = new SwingLazyValue(
\r
697 // "jsjavax.swing.plaf.BorderUIResource$EmptyBorderUIResource",
\r
698 // new Object[] {zero, zero, zero, zero});
\r
700 // Integer ten = new Integer(10);
\r
701 // Object optionPaneBorder = new SwingLazyValue(
\r
702 // "jsjavax.swing.plaf.BorderUIResource$EmptyBorderUIResource",
\r
703 // new Object[] {ten, ten, twelve, ten});
\r
705 // Object optionPaneButtonAreaBorder = new SwingLazyValue(
\r
706 // "jsjavax.swing.plaf.BorderUIResource$EmptyBorderUIResource",
\r
707 // new Object[] {new Integer(6), zero, zero, zero});
\r
710 // // *** ProgessBar value objects
\r
712 // Object progressBarBorder =
\r
713 // new SwingLazyValue(
\r
714 // "jsjavax.swing.plaf.basic.BasicBorders",
\r
715 // "getProgressBarBorder");
\r
717 // // ** ScrollBar value objects
\r
719 // Object minimumThumbSize = new DimensionUIResource(8,8);
\r
720 // Object maximumThumbSize = new DimensionUIResource(4096,4096);
\r
722 // // ** Slider value objects
\r
724 // Object sliderFocusInsets = twoInsets;
\r
726 // Object toolBarSeparatorSize = new DimensionUIResource( 10, 10 );
\r
729 // // *** SplitPane value objects
\r
731 // Object splitPaneBorder =
\r
732 // new SwingLazyValue(
\r
733 // "jsjavax.swing.plaf.basic.BasicBorders",
\r
734 // "getSplitPaneBorder");
\r
735 // Object splitPaneDividerBorder =
\r
736 // new SwingLazyValue(
\r
737 // "jsjavax.swing.plaf.basic.BasicBorders",
\r
738 // "getSplitPaneDividerBorder");
\r
740 // ** TabbedBane value objects
\r
742 Object tabbedPaneTabInsets = new InsetsUIResource(0, 4, 1, 4);
\r
744 Object tabbedPaneTabPadInsets = new InsetsUIResource(2, 2, 2, 1);
\r
746 Object tabbedPaneTabAreaInsets = new InsetsUIResource(3, 2, 0, 2);
\r
748 Object tabbedPaneContentBorderInsets = new InsetsUIResource(2, 2, 3, 3);
\r
750 // *** Text value objects
\r
752 // Object textFieldBorder =
\r
753 // new SwingLazyValue(
\r
754 // "jsjavax.swing.plaf.basic.BasicBorders",
\r
755 // "getTextFieldBorder");
\r
757 Object editorMargin = threeInsets;
\r
759 // Object caretBlinkRate = fiveHundred;
\r
760 Integer four = new Integer(4);
\r
762 // Object[] allAuditoryCues = new Object[] {
\r
763 // "CheckBoxMenuItem.commandSound",
\r
764 // "InternalFrame.closeSound",
\r
765 // "InternalFrame.maximizeSound",
\r
766 // "InternalFrame.minimizeSound",
\r
767 // "InternalFrame.restoreDownSound",
\r
768 // "InternalFrame.restoreUpSound",
\r
769 // "MenuItem.commandSound",
\r
770 // "OptionPane.errorSound",
\r
771 // "OptionPane.informationSound",
\r
772 // "OptionPane.questionSound",
\r
773 // "OptionPane.warningSound",
\r
774 // "PopupMenu.popupSound",
\r
775 // "RadioButtonMenuItem.commandSound"};
\r
777 // Object[] noAuditoryCues = new Object[] {"mute"};
\r
779 // // *** Component Defaults
\r
781 Object[] defaults = {
\r
788 // *** Auditory Feedback
\r
789 // "AuditoryCues.cueList", allAuditoryCues,
\r
790 // "AuditoryCues.allAuditoryCues", allAuditoryCues,
\r
791 // "AuditoryCues.noAuditoryCues", noAuditoryCues,
\r
792 // // this key defines which of the various cues to render.
\r
793 // // L&Fs that want auditory feedback NEED to override playList.
\r
794 // "AuditoryCues.playList", null,
\r
797 // "Button.defaultButtonFollowsFocus", Boolean.TRUE,
\r
798 // "Button.font", dialogPlain12,
\r
799 // "Button.background", control,
\r
800 // "Button.foreground", controlText,
\r
801 // "Button.shadow", controlShadow,
\r
802 // "Button.darkShadow", controlDkShadow,
\r
803 // "Button.light", controlHighlight,
\r
804 // "Button.highlight", controlLtHighlight,
\r
805 // "Button.border", buttonBorder,
\r
807 new InsetsUIResource(2, 14, 2, 14),
\r
808 // "Button.textIconGap", four,
\r
809 // "Button.textShiftOffset", zero,
\r
810 // "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
\r
811 // "SPACE", "pressed",
\r
812 // "released SPACE", "released",
\r
813 // "ENTER", "pressed",
\r
814 // "released ENTER", "released"
\r
817 // "ToggleButton.font", dialogPlain12,
\r
818 // "ToggleButton.background", control,
\r
819 // "ToggleButton.foreground", controlText,
\r
820 // "ToggleButton.shadow", controlShadow,
\r
821 // "ToggleButton.darkShadow", controlDkShadow,
\r
822 // "ToggleButton.light", controlHighlight,
\r
823 // "ToggleButton.highlight", controlLtHighlight,
\r
824 // "ToggleButton.border", buttonToggleBorder,
\r
825 "ToggleButton.margin",
\r
826 new InsetsUIResource(2, 14, 2, 14),
\r
827 "ToggleButton.textIconGap",
\r
829 "ToggleButton.textShiftOffset",
\r
831 // "ToggleButton.focusInputMap",
\r
832 // new UIDefaults.LazyInputMap(new Object[] {
\r
833 // "SPACE", "pressed",
\r
834 // "released SPACE", "released"
\r
837 // "RadioButton.font", dialogPlain12,
\r
838 // "RadioButton.background", control,
\r
839 // "RadioButton.foreground", controlText,
\r
840 // "RadioButton.shadow", controlShadow,
\r
841 // "RadioButton.darkShadow", controlDkShadow,
\r
842 // "RadioButton.light", controlHighlight,
\r
843 // "RadioButton.highlight", controlLtHighlight,
\r
844 // "RadioButton.border", radioButtonBorder,
\r
845 "RadioButton.margin",
\r
847 "RadioButton.textIconGap",
\r
849 "RadioButton.textShiftOffset",
\r
851 // "RadioButton.icon", radioButtonIcon,
\r
852 // "RadioButton.focusInputMap",
\r
853 // new UIDefaults.LazyInputMap(new Object[] {
\r
854 // "SPACE", "pressed",
\r
855 // "released SPACE", "released",
\r
856 // "RETURN", "pressed"
\r
859 // "CheckBox.font", dialogPlain12,
\r
860 // "CheckBox.background", control,
\r
861 // "CheckBox.foreground", controlText,
\r
862 // "CheckBox.border", radioButtonBorder,
\r
865 "CheckBox.textIconGap",
\r
867 "CheckBox.textShiftOffset",
\r
869 // "CheckBox.icon", checkBoxIcon,
\r
870 // "CheckBox.focusInputMap",
\r
871 // new UIDefaults.LazyInputMap(new Object[] {
\r
872 // "SPACE", "pressed",
\r
873 // "released SPACE", "released"
\r
875 // "FileChooser.useSystemExtensionHiding", Boolean.FALSE,
\r
877 // *** ColorChooser
\r
878 // "ColorChooser.font", dialogPlain12,
\r
879 // "ColorChooser.background", control,
\r
880 // "ColorChooser.foreground", controlText,
\r
882 "ColorChooser.swatchesSwatchSize",
\r
883 new Dimension(10, 10),
\r
884 "ColorChooser.swatchesRecentSwatchSize",
\r
885 new Dimension(10, 10),
\r
886 "ColorChooser.swatchesDefaultRecentColor",
\r
892 "ComboBox.background",
\r
894 "ComboBox.foreground",
\r
896 // "ComboBox.buttonBackground", control,
\r
897 // "ComboBox.buttonShadow", controlShadow,
\r
898 // "ComboBox.buttonDarkShadow", controlDkShadow,
\r
899 // "ComboBox.buttonHighlight", controlLtHighlight,
\r
900 // "ComboBox.selectionBackground", textHighlight,
\r
901 // "ComboBox.selectionForeground", textHighlightText,
\r
902 // "ComboBox.disabledBackground", control,
\r
903 // "ComboBox.disabledForeground", textInactiveText,
\r
904 "ComboBox.timeFactor",
\r
906 "ComboBox.isEnterSelectablePopup",
\r
908 // "ComboBox.ancestorInputMap",
\r
909 // new UIDefaults.LazyInputMap(new Object[] {
\r
910 // "ESCAPE", "hidePopup",
\r
911 // "PAGE_UP", "pageUpPassThrough",
\r
912 // "PAGE_DOWN", "pageDownPassThrough",
\r
913 // "HOME", "homePassThrough",
\r
914 // "END", "endPassThrough",
\r
915 // "ENTER", "enterPressed"
\r
920 // "FileChooser.newFolderIcon", newFolderIcon,
\r
921 // "FileChooser.upFolderIcon", upFolderIcon,
\r
922 // "FileChooser.homeFolderIcon", homeFolderIcon,
\r
923 // "FileChooser.detailsViewIcon", detailsViewIcon,
\r
924 // "FileChooser.listViewIcon", listViewIcon,
\r
925 "FileChooser.readOnly",
\r
927 // "FileChooser.usesSingleFilePane", Boolean.FALSE,
\r
928 // "FileChooser.ancestorInputMap",
\r
929 // new UIDefaults.LazyInputMap(new Object[] {
\r
930 // "ESCAPE", "cancelSelection",
\r
931 // "F5", "refresh",
\r
934 // "FileView.directoryIcon", directoryIcon,
\r
935 // "FileView.fileIcon", fileIcon,
\r
936 // "FileView.computerIcon", computerIcon,
\r
937 // "FileView.hardDriveIcon", hardDriveIcon,
\r
938 // "FileView.floppyDriveIcon", floppyDriveIcon,
\r
940 // *** InternalFrame
\r
941 // "InternalFrame.titleFont", dialogBold12,
\r
942 // "InternalFrame.borderColor", control,
\r
943 // "InternalFrame.borderShadow", controlShadow,
\r
944 // "InternalFrame.borderDarkShadow", controlDkShadow,
\r
945 // "InternalFrame.borderHighlight", controlLtHighlight,
\r
946 // "InternalFrame.borderLight", controlHighlight,
\r
947 // "InternalFrame.border", internalFrameBorder,
\r
948 // "InternalFrame.icon", SwingUtilities2.makeIcon(getClass(),
\r
949 // BasicLookAndFeel.class,
\r
950 // "icons/JavaCup16.png"),
\r
952 // /* Default frame icons are undefined for Basic. */
\r
953 // "InternalFrame.maximizeIcon",
\r
954 // new SwingLazyValue(
\r
955 // "jsjavax.swing.plaf.basic.BasicIconFactory",
\r
956 // "createEmptyFrameIcon"),
\r
957 // "InternalFrame.minimizeIcon",
\r
958 // new SwingLazyValue(
\r
959 // "jsjavax.swing.plaf.basic.BasicIconFactory",
\r
960 // "createEmptyFrameIcon"),
\r
961 // "InternalFrame.iconifyIcon",
\r
962 // new SwingLazyValue(
\r
963 // "jsjavax.swing.plaf.basic.BasicIconFactory",
\r
964 // "createEmptyFrameIcon"),
\r
965 // "InternalFrame.closeIcon",
\r
966 // new SwingLazyValue(
\r
967 // "jsjavax.swing.plaf.basic.BasicIconFactory",
\r
968 // "createEmptyFrameIcon"),
\r
969 // // InternalFrame Auditory Cue Mappings
\r
970 // "InternalFrame.closeSound", null,
\r
971 // "InternalFrame.maximizeSound", null,
\r
972 // "InternalFrame.minimizeSound", null,
\r
973 // "InternalFrame.restoreDownSound", null,
\r
974 // "InternalFrame.restoreUpSound", null,
\r
976 // "InternalFrame.activeTitleBackground", table.get("activeCaption"),
\r
977 // "InternalFrame.activeTitleForeground",
\r
978 // table.get("activeCaptionText"),
\r
979 // "InternalFrame.inactiveTitleBackground",
\r
980 // table.get("inactiveCaption"),
\r
981 // "InternalFrame.inactiveTitleForeground",
\r
982 // table.get("inactiveCaptionText"),
\r
983 // "InternalFrame.windowBindings", new Object[] {
\r
984 // "shift ESCAPE", "showSystemMenu",
\r
985 // "ctrl SPACE", "showSystemMenu",
\r
986 // "ESCAPE", "hideSystemMenu"},
\r
988 // "InternalFrameTitlePane.iconifyButtonOpacity", Boolean.TRUE,
\r
989 // "InternalFrameTitlePane.maximizeButtonOpacity", Boolean.TRUE,
\r
990 // "InternalFrameTitlePane.closeButtonOpacity", Boolean.TRUE,
\r
992 // "DesktopIcon.border", internalFrameBorder,
\r
994 // "Desktop.minOnScreenInsets", threeInsets,
\r
995 // "Desktop.background", table.get("desktop"),
\r
996 // "Desktop.ancestorInputMap",
\r
997 // new UIDefaults.LazyInputMap(new Object[] {
\r
998 // "ctrl F5", "restore",
\r
999 // "ctrl F4", "close",
\r
1000 // "ctrl F7", "move",
\r
1001 // "ctrl F8", "resize",
\r
1002 // "RIGHT", "right",
\r
1003 // "KP_RIGHT", "right",
\r
1004 // "shift RIGHT", "shrinkRight",
\r
1005 // "shift KP_RIGHT", "shrinkRight",
\r
1006 // "LEFT", "left",
\r
1007 // "KP_LEFT", "left",
\r
1008 // "shift LEFT", "shrinkLeft",
\r
1009 // "shift KP_LEFT", "shrinkLeft",
\r
1012 // "shift UP", "shrinkUp",
\r
1013 // "shift KP_UP", "shrinkUp",
\r
1014 // "DOWN", "down",
\r
1015 // "KP_DOWN", "down",
\r
1016 // "shift DOWN", "shrinkDown",
\r
1017 // "shift KP_DOWN", "shrinkDown",
\r
1018 // "ESCAPE", "escape",
\r
1019 // "ctrl F9", "minimize",
\r
1020 // "ctrl F10", "maximize",
\r
1021 // "ctrl F6", "selectNextFrame",
\r
1022 // "ctrl TAB", "selectNextFrame",
\r
1023 // "ctrl alt F6", "selectNextFrame",
\r
1024 // "shift ctrl alt F6", "selectPreviousFrame",
\r
1025 // "ctrl F12", "navigateNext",
\r
1026 // "shift ctrl F12", "navigatePrevious"
\r
1030 // "Label.font", dialogPlain12,
\r
1031 // "Label.background", control,
\r
1032 // "Label.foreground", controlText,
\r
1033 // "Label.disabledForeground", white,
\r
1034 // "Label.disabledShadow", controlShadow,
\r
1039 // "List.font", dialogPlain12,
\r
1040 "List.background",
\r
1042 "List.foreground",
\r
1044 // "List.selectionBackground", textHighlight,
\r
1045 // "List.selectionForeground", textHighlightText,
\r
1046 // "List.noFocusBorder", noFocusBorder,
\r
1047 // "List.focusCellHighlightBorder", focusCellHighlightBorder,
\r
1048 // "List.dropLineColor", controlShadow,
\r
1049 // "List.border", null,
\r
1050 "List.cellRenderer",
\r
1051 listCellRendererActiveValue,
\r
1052 "List.timeFactor",
\r
1054 // "List.focusInputMap",
\r
1055 // new UIDefaults.LazyInputMap(new Object[] {
\r
1056 // "ctrl C", "copy",
\r
1057 // "ctrl V", "paste",
\r
1058 // "ctrl X", "cut",
\r
1059 // "COPY", "copy",
\r
1060 // "PASTE", "paste",
\r
1062 // "control INSERT", "copy",
\r
1063 // "shift INSERT", "paste",
\r
1064 // "shift DELETE", "cut",
\r
1065 // "UP", "selectPreviousRow",
\r
1066 // "KP_UP", "selectPreviousRow",
\r
1067 // "shift UP", "selectPreviousRowExtendSelection",
\r
1068 // "shift KP_UP", "selectPreviousRowExtendSelection",
\r
1069 // "ctrl shift UP", "selectPreviousRowExtendSelection",
\r
1070 // "ctrl shift KP_UP", "selectPreviousRowExtendSelection",
\r
1071 // "ctrl UP", "selectPreviousRowChangeLead",
\r
1072 // "ctrl KP_UP", "selectPreviousRowChangeLead",
\r
1073 // "DOWN", "selectNextRow",
\r
1074 // "KP_DOWN", "selectNextRow",
\r
1075 // "shift DOWN", "selectNextRowExtendSelection",
\r
1076 // "shift KP_DOWN", "selectNextRowExtendSelection",
\r
1077 // "ctrl shift DOWN", "selectNextRowExtendSelection",
\r
1078 // "ctrl shift KP_DOWN", "selectNextRowExtendSelection",
\r
1079 // "ctrl DOWN", "selectNextRowChangeLead",
\r
1080 // "ctrl KP_DOWN", "selectNextRowChangeLead",
\r
1081 // "LEFT", "selectPreviousColumn",
\r
1082 // "KP_LEFT", "selectPreviousColumn",
\r
1083 // "shift LEFT", "selectPreviousColumnExtendSelection",
\r
1084 // "shift KP_LEFT", "selectPreviousColumnExtendSelection",
\r
1085 // "ctrl shift LEFT", "selectPreviousColumnExtendSelection",
\r
1086 // "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
\r
1087 // "ctrl LEFT", "selectPreviousColumnChangeLead",
\r
1088 // "ctrl KP_LEFT", "selectPreviousColumnChangeLead",
\r
1089 // "RIGHT", "selectNextColumn",
\r
1090 // "KP_RIGHT", "selectNextColumn",
\r
1091 // "shift RIGHT", "selectNextColumnExtendSelection",
\r
1092 // "shift KP_RIGHT", "selectNextColumnExtendSelection",
\r
1093 // "ctrl shift RIGHT", "selectNextColumnExtendSelection",
\r
1094 // "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
\r
1095 // "ctrl RIGHT", "selectNextColumnChangeLead",
\r
1096 // "ctrl KP_RIGHT", "selectNextColumnChangeLead",
\r
1097 // "HOME", "selectFirstRow",
\r
1098 // "shift HOME", "selectFirstRowExtendSelection",
\r
1099 // "ctrl shift HOME", "selectFirstRowExtendSelection",
\r
1100 // "ctrl HOME", "selectFirstRowChangeLead",
\r
1101 // "END", "selectLastRow",
\r
1102 // "shift END", "selectLastRowExtendSelection",
\r
1103 // "ctrl shift END", "selectLastRowExtendSelection",
\r
1104 // "ctrl END", "selectLastRowChangeLead",
\r
1105 // "PAGE_UP", "scrollUp",
\r
1106 // "shift PAGE_UP", "scrollUpExtendSelection",
\r
1107 // "ctrl shift PAGE_UP", "scrollUpExtendSelection",
\r
1108 // "ctrl PAGE_UP", "scrollUpChangeLead",
\r
1109 // "PAGE_DOWN", "scrollDown",
\r
1110 // "shift PAGE_DOWN", "scrollDownExtendSelection",
\r
1111 // "ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
\r
1112 // "ctrl PAGE_DOWN", "scrollDownChangeLead",
\r
1113 // "ctrl A", "selectAll",
\r
1114 // "ctrl SLASH", "selectAll",
\r
1115 // "ctrl BACK_SLASH", "clearSelection",
\r
1116 // "SPACE", "addToSelection",
\r
1117 // "ctrl SPACE", "toggleAndAnchor",
\r
1118 // "shift SPACE", "extendTo",
\r
1119 // "ctrl shift SPACE", "moveSelectionTo"
\r
1121 // "List.focusInputMap.RightToLeft",
\r
1122 // new UIDefaults.LazyInputMap(new Object[] {
\r
1123 // "LEFT", "selectNextColumn",
\r
1124 // "KP_LEFT", "selectNextColumn",
\r
1125 // "shift LEFT", "selectNextColumnExtendSelection",
\r
1126 // "shift KP_LEFT", "selectNextColumnExtendSelection",
\r
1127 // "ctrl shift LEFT", "selectNextColumnExtendSelection",
\r
1128 // "ctrl shift KP_LEFT", "selectNextColumnExtendSelection",
\r
1129 // "ctrl LEFT", "selectNextColumnChangeLead",
\r
1130 // "ctrl KP_LEFT", "selectNextColumnChangeLead",
\r
1131 // "RIGHT", "selectPreviousColumn",
\r
1132 // "KP_RIGHT", "selectPreviousColumn",
\r
1133 // "shift RIGHT", "selectPreviousColumnExtendSelection",
\r
1134 // "shift KP_RIGHT", "selectPreviousColumnExtendSelection",
\r
1135 // "ctrl shift RIGHT", "selectPreviousColumnExtendSelection",
\r
1136 // "ctrl shift KP_RIGHT", "selectPreviousColumnExtendSelection",
\r
1137 // "ctrl RIGHT", "selectPreviousColumnChangeLead",
\r
1138 // "ctrl KP_RIGHT", "selectPreviousColumnChangeLead",
\r
1144 "MenuBar.background",
\r
1146 "MenuBar.foreground",
\r
1148 // "MenuBar.shadow", controlShadow,
\r
1149 // "MenuBar.highlight", controlLtHighlight,
\r
1150 // "MenuBar.border", menuBarBorder,
\r
1151 // "MenuBar.windowBindings", new Object[] {
\r
1152 // "F10", "takeFocus" },
\r
1154 "MenuItem.font", dialogPlain12,
\r
1155 //"MenuItem.acceleratorFont", dialogPlain12,
\r
1156 "MenuItem.background",
\r
1158 "MenuItem.foreground",
\r
1160 // "MenuItem.selectionForeground", textHighlightText,
\r
1161 // "MenuItem.selectionBackground", textHighlight,
\r
1162 // "MenuItem.disabledForeground", null,
\r
1163 // "MenuItem.acceleratorForeground", menuText,
\r
1164 // "MenuItem.acceleratorSelectionForeground", textHighlightText,
\r
1165 // "MenuItem.acceleratorDelimiter", menuItemAcceleratorDelimiter,
\r
1166 // "MenuItem.border", marginBorder,
\r
1167 // "MenuItem.borderPainted", Boolean.FALSE,
\r
1168 "MenuItem.margin",
\r
1170 // "MenuItem.checkIcon", menuItemCheckIcon,
\r
1171 // "MenuItem.arrowIcon", menuItemArrowIcon,
\r
1172 // "MenuItem.commandSound", null,
\r
1174 "RadioButtonMenuItem.font", dialogPlain12,
\r
1175 // "RadioButtonMenuItem.acceleratorFont", dialogPlain12,
\r
1176 "RadioButtonMenuItem.background",
\r
1178 "RadioButtonMenuItem.foreground",
\r
1180 // "RadioButtonMenuItem.selectionForeground", textHighlightText,
\r
1181 // "RadioButtonMenuItem.selectionBackground", textHighlight,
\r
1182 // "RadioButtonMenuItem.disabledForeground", null,
\r
1183 // "RadioButtonMenuItem.acceleratorForeground", menuText,
\r
1184 // "RadioButtonMenuItem.acceleratorSelectionForeground",
\r
1185 // textHighlightText,
\r
1186 // "RadioButtonMenuItem.border", marginBorder,
\r
1187 // "RadioButtonMenuItem.borderPainted", Boolean.FALSE,
\r
1188 "RadioButtonMenuItem.margin",
\r
1190 // "RadioButtonMenuItem.checkIcon", radioButtonMenuItemIcon,
\r
1191 // "RadioButtonMenuItem.arrowIcon", menuItemArrowIcon,
\r
1192 // "RadioButtonMenuItem.commandSound", null,
\r
1194 "CheckBoxMenuItem.font", dialogPlain12,
\r
1195 // "CheckBoxMenuItem.acceleratorFont", dialogPlain12,
\r
1196 "CheckBoxMenuItem.background",
\r
1198 "CheckBoxMenuItem.foreground",
\r
1200 // "CheckBoxMenuItem.selectionForeground", textHighlightText,
\r
1201 // "CheckBoxMenuItem.selectionBackground", textHighlight,
\r
1202 // "CheckBoxMenuItem.disabledForeground", null,
\r
1203 // "CheckBoxMenuItem.acceleratorForeground", menuText,
\r
1204 // "CheckBoxMenuItem.acceleratorSelectionForeground", textHighlightText,
\r
1205 // "CheckBoxMenuItem.border", marginBorder,
\r
1206 // "CheckBoxMenuItem.borderPainted", Boolean.FALSE,
\r
1207 "CheckBoxMenuItem.margin",
\r
1209 // "CheckBoxMenuItem.checkIcon", checkBoxMenuItemIcon,
\r
1210 // "CheckBoxMenuItem.arrowIcon", menuItemArrowIcon,
\r
1211 // "CheckBoxMenuItem.commandSound", null,
\r
1213 // "Menu.font", dialogPlain12,
\r
1214 // "Menu.acceleratorFont", dialogPlain12,
\r
1215 "Menu.background",
\r
1217 "Menu.foreground",
\r
1219 // "Menu.selectionForeground", textHighlightText,
\r
1220 // "Menu.selectionBackground", textHighlight,
\r
1221 // "Menu.disabledForeground", null,
\r
1222 // "Menu.acceleratorForeground", menuText,
\r
1223 // "Menu.acceleratorSelectionForeground", textHighlightText,
\r
1224 // "Menu.border", marginBorder,
\r
1225 // "Menu.borderPainted", Boolean.FALSE,
\r
1228 // "Menu.checkIcon", menuItemCheckIcon,
\r
1229 // "Menu.arrowIcon", menuArrowIcon,
\r
1230 // "Menu.menuPopupOffsetX", new Integer(0),
\r
1231 // "Menu.menuPopupOffsetY", new Integer(0),
\r
1232 // "Menu.submenuPopupOffsetX", new Integer(0),
\r
1233 // "Menu.submenuPopupOffsetY", new Integer(0),
\r
1234 // "Menu.shortcutKeys", new int[] {KeyEvent.ALT_MASK},
\r
1235 // "Menu.crossMenuMnemonic", Boolean.TRUE,
\r
1236 // Menu.cancelMode affects the cancel menu action behaviour;
\r
1237 // currently supports:
\r
1238 // "hideLastSubmenu" (default)
\r
1239 // hides the last open submenu,
\r
1240 // and move selection one step back
\r
1242 // resets selection and
\r
1243 // hide the entire structure of open menu and its submenus
\r
1244 // "Menu.cancelMode", "hideLastSubmenu",
\r
1246 // Menu.preserveTopLevelSelection affects
\r
1247 // the cancel menu action behaviour
\r
1248 // if set to true then top level menu selection
\r
1249 // will be preserved when the last popup was cancelled;
\r
1250 // the menu itself will be unselect with the next cancel action
\r
1251 // "Menu.preserveTopLevelSelection", Boolean.FALSE,
\r
1254 // "PopupMenu.font", dialogPlain12,
\r
1255 "PopupMenu.background",
\r
1257 "PopupMenu.foreground",
\r
1259 // "PopupMenu.border", popupMenuBorder,
\r
1260 // Internal Frame Auditory Cue Mappings
\r
1261 // "PopupMenu.popupSound", null,
\r
1262 // // These window InputMap bindings are used when the Menu is
\r
1264 // "PopupMenu.selectedWindowInputMapBindings", new Object[] {
\r
1265 // "ESCAPE", "cancel",
\r
1266 // "DOWN", "selectNext",
\r
1267 // "KP_DOWN", "selectNext",
\r
1268 // "UP", "selectPrevious",
\r
1269 // "KP_UP", "selectPrevious",
\r
1270 // "LEFT", "selectParent",
\r
1271 // "KP_LEFT", "selectParent",
\r
1272 // "RIGHT", "selectChild",
\r
1273 // "KP_RIGHT", "selectChild",
\r
1274 // "ENTER", "return",
\r
1275 // "ctrl ENTER", "return",
\r
1276 // "SPACE", "return"
\r
1278 // "PopupMenu.selectedWindowInputMapBindings.RightToLeft", new Object[]
\r
1280 // "LEFT", "selectChild",
\r
1281 // "KP_LEFT", "selectChild",
\r
1282 // "RIGHT", "selectParent",
\r
1283 // "KP_RIGHT", "selectParent",
\r
1285 "PopupMenu.consumeEventOnClose",
\r
1289 // You can additionaly define OptionPane.messageFont which will
\r
1290 // dictate the fonts used for the message, and
\r
1291 // OptionPane.buttonFont, which defines the font for the buttons.
\r
1292 // "OptionPane.font", dialogPlain12,
\r
1293 // "OptionPane.background", control,
\r
1294 // "OptionPane.foreground", controlText,
\r
1295 "OptionPane.messageForeground",
\r
1297 // "OptionPane.border", optionPaneBorder,
\r
1298 // "OptionPane.messageAreaBorder", zeroBorder,
\r
1299 // "OptionPane.buttonAreaBorder", optionPaneButtonAreaBorder,
\r
1300 // "OptionPane.minimumSize", optionPaneMinimumSize,
\r
1301 // "OptionPane.errorIcon", SwingUtilities2.makeIcon(getClass(),
\r
1302 // BasicLookAndFeel.class,
\r
1303 // "icons/Error.gif"),
\r
1304 // "OptionPane.informationIcon", SwingUtilities2.makeIcon(getClass(),
\r
1305 // BasicLookAndFeel.class,
\r
1306 // "icons/Inform.gif"),
\r
1307 // "OptionPane.warningIcon", SwingUtilities2.makeIcon(getClass(),
\r
1308 // BasicLookAndFeel.class,
\r
1309 // "icons/Warn.gif"),
\r
1310 // "OptionPane.questionIcon", SwingUtilities2.makeIcon(getClass(),
\r
1311 // BasicLookAndFeel.class,
\r
1312 // "icons/Question.gif"),
\r
1313 // "OptionPane.windowBindings", new Object[] {
\r
1314 // "ESCAPE", "close" },
\r
1315 // // OptionPane Auditory Cue Mappings
\r
1316 // "OptionPane.errorSound", null,
\r
1317 // "OptionPane.informationSound", null, // Info and Plain
\r
1318 // "OptionPane.questionSound", null,
\r
1319 // "OptionPane.warningSound", null,
\r
1320 // "OptionPane.buttonClickThreshhold", fiveHundred,
\r
1325 "Panel.background",
\r
1327 "Panel.foreground",
\r
1330 // *** ProgressBar
\r
1331 // "ProgressBar.font", dialogPlain12,
\r
1332 // "ProgressBar.foreground", textHighlight,
\r
1333 // "ProgressBar.background", control,
\r
1334 // "ProgressBar.selectionForeground", control,
\r
1335 // "ProgressBar.selectionBackground", textHighlight,
\r
1336 // "ProgressBar.border", progressBarBorder,
\r
1337 "ProgressBar.cellLength",
\r
1339 "ProgressBar.cellSpacing",
\r
1341 "ProgressBar.repaintInterval",
\r
1343 "ProgressBar.cycleTime",
\r
1344 new Integer(3000),
\r
1345 "ProgressBar.horizontalSize",
\r
1346 new DimensionUIResource(146, 12),
\r
1347 "ProgressBar.verticalSize",
\r
1348 new DimensionUIResource(12, 146),
\r
1351 // "Separator.shadow", controlShadow, // DEPRECATED - DO NOT USE!
\r
1352 // "Separator.highlight", controlLtHighlight, // DEPRECATED - DO NOT
\r
1355 // "Separator.background", controlLtHighlight,
\r
1356 // "Separator.foreground", controlShadow,
\r
1358 // *** ScrollBar/ScrollPane/Viewport
\r
1359 // "ScrollBar.background", scrollBarTrack,
\r
1360 "ScrollBar.foreground",
\r
1362 // "ScrollBar.track", table.get("scrollbar"),
\r
1363 // "ScrollBar.trackHighlight", controlDkShadow,
\r
1364 // "ScrollBar.thumb", control,
\r
1365 // "ScrollBar.thumbHighlight", controlLtHighlight,
\r
1366 // "ScrollBar.thumbDarkShadow", controlDkShadow,
\r
1367 // "ScrollBar.thumbShadow", controlShadow,
\r
1368 // "ScrollBar.border", null,
\r
1369 // "ScrollBar.minimumThumbSize", minimumThumbSize,
\r
1370 // "ScrollBar.maximumThumbSize", maximumThumbSize,
\r
1371 // "ScrollBar.ancestorInputMap",
\r
1372 // new UIDefaults.LazyInputMap(new Object[] {
\r
1373 // "RIGHT", "positiveUnitIncrement",
\r
1374 // "KP_RIGHT", "positiveUnitIncrement",
\r
1375 // "DOWN", "positiveUnitIncrement",
\r
1376 // "KP_DOWN", "positiveUnitIncrement",
\r
1377 // "PAGE_DOWN", "positiveBlockIncrement",
\r
1378 // "LEFT", "negativeUnitIncrement",
\r
1379 // "KP_LEFT", "negativeUnitIncrement",
\r
1380 // "UP", "negativeUnitIncrement",
\r
1381 // "KP_UP", "negativeUnitIncrement",
\r
1382 // "PAGE_UP", "negativeBlockIncrement",
\r
1383 // "HOME", "minScroll",
\r
1384 // "END", "maxScroll"
\r
1386 // "ScrollBar.ancestorInputMap.RightToLeft",
\r
1387 // new UIDefaults.LazyInputMap(new Object[] {
\r
1388 // "RIGHT", "negativeUnitIncrement",
\r
1389 // "KP_RIGHT", "negativeUnitIncrement",
\r
1390 // "LEFT", "positiveUnitIncrement",
\r
1391 // "KP_LEFT", "positiveUnitIncrement",
\r
1393 "ScrollBar.width",
\r
1396 // "ScrollPane.font", dialogPlain12,
\r
1397 // "ScrollPane.background", control,
\r
1398 // "ScrollPane.foreground", controlText,
\r
1399 // "ScrollPane.border", textFieldBorder,
\r
1400 // "ScrollPane.viewportBorder", null,
\r
1401 // "ScrollPane.ancestorInputMap",
\r
1402 // new UIDefaults.LazyInputMap(new Object[] {
\r
1403 // "RIGHT", "unitScrollRight",
\r
1404 // "KP_RIGHT", "unitScrollRight",
\r
1405 // "DOWN", "unitScrollDown",
\r
1406 // "KP_DOWN", "unitScrollDown",
\r
1407 // "LEFT", "unitScrollLeft",
\r
1408 // "KP_LEFT", "unitScrollLeft",
\r
1409 // "UP", "unitScrollUp",
\r
1410 // "KP_UP", "unitScrollUp",
\r
1411 // "PAGE_UP", "scrollUp",
\r
1412 // "PAGE_DOWN", "scrollDown",
\r
1413 // "ctrl PAGE_UP", "scrollLeft",
\r
1414 // "ctrl PAGE_DOWN", "scrollRight",
\r
1415 // "ctrl HOME", "scrollHome",
\r
1416 // "ctrl END", "scrollEnd"
\r
1418 // "ScrollPane.ancestorInputMap.RightToLeft",
\r
1419 // new UIDefaults.LazyInputMap(new Object[] {
\r
1420 // "ctrl PAGE_UP", "scrollRight",
\r
1421 // "ctrl PAGE_DOWN", "scrollLeft",
\r
1424 // "Viewport.font", dialogPlain12,
\r
1425 // "Viewport.background", control,
\r
1426 "Viewport.foreground",
\r
1430 // "Slider.font", dialogPlain12,
\r
1431 // "Slider.foreground", control,
\r
1432 // "Slider.background", control,
\r
1433 // "Slider.highlight", controlLtHighlight,
\r
1434 // "Slider.tickColor", Color.black,
\r
1435 // "Slider.shadow", controlShadow,
\r
1436 // "Slider.focus", controlDkShadow,
\r
1437 // "Slider.border", null,
\r
1438 "Slider.horizontalSize",
\r
1439 new Dimension(200, 21),
\r
1440 "Slider.verticalSize",
\r
1441 new Dimension(21, 200),
\r
1442 "Slider.minimumHorizontalSize",
\r
1443 new Dimension(36, 21),
\r
1444 "Slider.minimumVerticalSize",
\r
1445 new Dimension(21, 36),
\r
1446 // "Slider.focusInsets", sliderFocusInsets,
\r
1447 // "Slider.focusInputMap",
\r
1448 // new UIDefaults.LazyInputMap(new Object[] {
\r
1449 // "RIGHT", "positiveUnitIncrement",
\r
1450 // "KP_RIGHT", "positiveUnitIncrement",
\r
1451 // "DOWN", "negativeUnitIncrement",
\r
1452 // "KP_DOWN", "negativeUnitIncrement",
\r
1453 // "PAGE_DOWN", "negativeBlockIncrement",
\r
1454 // "LEFT", "negativeUnitIncrement",
\r
1455 // "KP_LEFT", "negativeUnitIncrement",
\r
1456 // "UP", "positiveUnitIncrement",
\r
1457 // "KP_UP", "positiveUnitIncrement",
\r
1458 // "PAGE_UP", "positiveBlockIncrement",
\r
1459 // "HOME", "minScroll",
\r
1460 // "END", "maxScroll"
\r
1462 // "Slider.focusInputMap.RightToLeft",
\r
1463 // new UIDefaults.LazyInputMap(new Object[] {
\r
1464 // "RIGHT", "negativeUnitIncrement",
\r
1465 // "KP_RIGHT", "negativeUnitIncrement",
\r
1466 // "LEFT", "positiveUnitIncrement",
\r
1467 // "KP_LEFT", "positiveUnitIncrement",
\r
1472 monospacedPlain12,
\r
1473 // "Spinner.background", control,
\r
1474 // "Spinner.foreground", control,
\r
1475 // "Spinner.border", textFieldBorder,
\r
1476 // "Spinner.arrowButtonBorder", null,
\r
1477 // "Spinner.arrowButtonInsets", null,
\r
1478 "Spinner.arrowButtonSize",
\r
1479 new Dimension(16, 5),
\r
1480 // "Spinner.ancestorInputMap",
\r
1481 // new UIDefaults.LazyInputMap(new Object[] {
\r
1482 // "UP", "increment",
\r
1483 // "KP_UP", "increment",
\r
1484 // "DOWN", "decrement",
\r
1485 // "KP_DOWN", "decrement",
\r
1487 // "Spinner.editorBorderPainted", Boolean.FALSE,
\r
1488 "Spinner.editorAlignment",
\r
1489 JTextField.TRAILING,
\r
1492 "SplitPane.background",
\r
1494 // "SplitPane.highlight", controlLtHighlight,
\r
1495 // "SplitPane.shadow", controlShadow,
\r
1496 // "SplitPane.darkShadow", controlDkShadow,
\r
1497 // "SplitPane.border", splitPaneBorder,
\r
1498 "SplitPane.dividerSize",
\r
1500 // "SplitPaneDivider.border", splitPaneDividerBorder,
\r
1501 "SplitPaneDivider.draggingColor",
\r
1503 // "SplitPane.ancestorInputMap",
\r
1504 // new UIDefaults.LazyInputMap(new Object[] {
\r
1505 // "UP", "negativeIncrement",
\r
1506 // "DOWN", "positiveIncrement",
\r
1507 // "LEFT", "negativeIncrement",
\r
1508 // "RIGHT", "positiveIncrement",
\r
1509 // "KP_UP", "negativeIncrement",
\r
1510 // "KP_DOWN", "positiveIncrement",
\r
1511 // "KP_LEFT", "negativeIncrement",
\r
1512 // "KP_RIGHT", "positiveIncrement",
\r
1513 // "HOME", "selectMin",
\r
1514 // "END", "selectMax",
\r
1515 // "F8", "startResize",
\r
1516 // "F6", "toggleFocus",
\r
1517 // "ctrl TAB", "focusOutForward",
\r
1518 // "ctrl shift TAB", "focusOutBackward"
\r
1522 // "TabbedPane.font", dialogPlain12,
\r
1523 // "TabbedPane.background", control,
\r
1524 // "TabbedPane.foreground", controlText,
\r
1525 // "TabbedPane.highlight", controlLtHighlight,
\r
1526 // "TabbedPane.light", controlHighlight,
\r
1527 // "TabbedPane.shadow", controlShadow,
\r
1528 // "TabbedPane.darkShadow", controlDkShadow,
\r
1529 "TabbedPane.selected",
\r
1531 // "TabbedPane.focus", controlText,
\r
1532 "TabbedPane.textIconGap",
\r
1535 // Causes tabs to be painted on top of the content area border.
\r
1536 // The amount of overlap is then controlled by tabAreaInsets.bottom,
\r
1537 // which is zero by default
\r
1538 "TabbedPane.tabsOverlapBorder",
\r
1540 // "TabbedPane.selectionFollowsFocus", Boolean.TRUE,
\r
1542 "TabbedPane.labelShift",
\r
1544 "TabbedPane.selectedLabelShift",
\r
1546 "TabbedPane.tabInsets",
\r
1547 tabbedPaneTabInsets,
\r
1548 "TabbedPane.selectedTabPadInsets",
\r
1549 tabbedPaneTabPadInsets,
\r
1550 "TabbedPane.tabAreaInsets",
\r
1551 tabbedPaneTabAreaInsets,
\r
1552 "TabbedPane.contentBorderInsets",
\r
1553 tabbedPaneContentBorderInsets,
\r
1554 "TabbedPane.tabRunOverlay",
\r
1556 // "TabbedPane.tabsOpaque", Boolean.TRUE,
\r
1557 // "TabbedPane.contentOpaque", Boolean.TRUE,
\r
1558 // "TabbedPane.focusInputMap",
\r
1559 // new UIDefaults.LazyInputMap(new Object[] {
\r
1560 // "RIGHT", "navigateRight",
\r
1561 // "KP_RIGHT", "navigateRight",
\r
1562 // "LEFT", "navigateLeft",
\r
1563 // "KP_LEFT", "navigateLeft",
\r
1564 // "UP", "navigateUp",
\r
1565 // "KP_UP", "navigateUp",
\r
1566 // "DOWN", "navigateDown",
\r
1567 // "KP_DOWN", "navigateDown",
\r
1568 // "ctrl DOWN", "requestFocusForVisibleComponent",
\r
1569 // "ctrl KP_DOWN", "requestFocusForVisibleComponent",
\r
1571 // "TabbedPane.ancestorInputMap",
\r
1572 // new UIDefaults.LazyInputMap(new Object[] {
\r
1573 // "ctrl PAGE_DOWN", "navigatePageDown",
\r
1574 // "ctrl PAGE_UP", "navigatePageUp",
\r
1575 // "ctrl UP", "requestFocus",
\r
1576 // "ctrl KP_UP", "requestFocus",
\r
1581 // "Table.font", dialogPlain12,
\r
1582 // "Table.foreground", controlText, // cell text color
\r
1583 "Table.background",
\r
1584 window, // cell background color
\r
1585 // "Table.selectionForeground", textHighlightText,
\r
1586 // "Table.selectionBackground", textHighlight,
\r
1587 // "Table.dropLineColor", controlShadow,
\r
1588 "Table.dropLineShortColor",
\r
1590 "Table.gridColor",
\r
1591 gray, // grid line color
\r
1592 "Table.focusCellBackground",
\r
1594 "Table.focusCellForeground",
\r
1596 // "Table.focusCellHighlightBorder", focusCellHighlightBorder,
\r
1597 // "Table.scrollPaneBorder", loweredBevelBorder,
\r
1598 // "Table.ancestorInputMap",
\r
1599 // new UIDefaults.LazyInputMap(new Object[] {
\r
1600 // "ctrl C", "copy",
\r
1601 // "ctrl V", "paste",
\r
1602 // "ctrl X", "cut",
\r
1603 // "COPY", "copy",
\r
1604 // "PASTE", "paste",
\r
1606 // "control INSERT", "copy",
\r
1607 // "shift INSERT", "paste",
\r
1608 // "shift DELETE", "cut",
\r
1609 // "RIGHT", "selectNextColumn",
\r
1610 // "KP_RIGHT", "selectNextColumn",
\r
1611 // "shift RIGHT", "selectNextColumnExtendSelection",
\r
1612 // "shift KP_RIGHT", "selectNextColumnExtendSelection",
\r
1613 // "ctrl shift RIGHT", "selectNextColumnExtendSelection",
\r
1614 // "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
\r
1615 // "ctrl RIGHT", "selectNextColumnChangeLead",
\r
1616 // "ctrl KP_RIGHT", "selectNextColumnChangeLead",
\r
1617 // "LEFT", "selectPreviousColumn",
\r
1618 // "KP_LEFT", "selectPreviousColumn",
\r
1619 // "shift LEFT", "selectPreviousColumnExtendSelection",
\r
1620 // "shift KP_LEFT", "selectPreviousColumnExtendSelection",
\r
1621 // "ctrl shift LEFT", "selectPreviousColumnExtendSelection",
\r
1622 // "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
\r
1623 // "ctrl LEFT", "selectPreviousColumnChangeLead",
\r
1624 // "ctrl KP_LEFT", "selectPreviousColumnChangeLead",
\r
1625 // "DOWN", "selectNextRow",
\r
1626 // "KP_DOWN", "selectNextRow",
\r
1627 // "shift DOWN", "selectNextRowExtendSelection",
\r
1628 // "shift KP_DOWN", "selectNextRowExtendSelection",
\r
1629 // "ctrl shift DOWN", "selectNextRowExtendSelection",
\r
1630 // "ctrl shift KP_DOWN", "selectNextRowExtendSelection",
\r
1631 // "ctrl DOWN", "selectNextRowChangeLead",
\r
1632 // "ctrl KP_DOWN", "selectNextRowChangeLead",
\r
1633 // "UP", "selectPreviousRow",
\r
1634 // "KP_UP", "selectPreviousRow",
\r
1635 // "shift UP", "selectPreviousRowExtendSelection",
\r
1636 // "shift KP_UP", "selectPreviousRowExtendSelection",
\r
1637 // "ctrl shift UP", "selectPreviousRowExtendSelection",
\r
1638 // "ctrl shift KP_UP", "selectPreviousRowExtendSelection",
\r
1639 // "ctrl UP", "selectPreviousRowChangeLead",
\r
1640 // "ctrl KP_UP", "selectPreviousRowChangeLead",
\r
1641 // "HOME", "selectFirstColumn",
\r
1642 // "shift HOME", "selectFirstColumnExtendSelection",
\r
1643 // "ctrl shift HOME", "selectFirstRowExtendSelection",
\r
1644 // "ctrl HOME", "selectFirstRow",
\r
1645 // "END", "selectLastColumn",
\r
1646 // "shift END", "selectLastColumnExtendSelection",
\r
1647 // "ctrl shift END", "selectLastRowExtendSelection",
\r
1648 // "ctrl END", "selectLastRow",
\r
1649 // "PAGE_UP", "scrollUpChangeSelection",
\r
1650 // "shift PAGE_UP", "scrollUpExtendSelection",
\r
1651 // "ctrl shift PAGE_UP", "scrollLeftExtendSelection",
\r
1652 // "ctrl PAGE_UP", "scrollLeftChangeSelection",
\r
1653 // "PAGE_DOWN", "scrollDownChangeSelection",
\r
1654 // "shift PAGE_DOWN", "scrollDownExtendSelection",
\r
1655 // "ctrl shift PAGE_DOWN", "scrollRightExtendSelection",
\r
1656 // "ctrl PAGE_DOWN", "scrollRightChangeSelection",
\r
1657 // "TAB", "selectNextColumnCell",
\r
1658 // "shift TAB", "selectPreviousColumnCell",
\r
1659 // "ENTER", "selectNextRowCell",
\r
1660 // "shift ENTER", "selectPreviousRowCell",
\r
1661 // "ctrl A", "selectAll",
\r
1662 // "ctrl SLASH", "selectAll",
\r
1663 // "ctrl BACK_SLASH", "clearSelection",
\r
1664 // "ESCAPE", "cancel",
\r
1665 // "F2", "startEditing",
\r
1666 // "SPACE", "addToSelection",
\r
1667 // "ctrl SPACE", "toggleAndAnchor",
\r
1668 // "shift SPACE", "extendTo",
\r
1669 // "ctrl shift SPACE", "moveSelectionTo",
\r
1670 // "F8", "focusHeader"
\r
1672 // "Table.ancestorInputMap.RightToLeft",
\r
1673 // new UIDefaults.LazyInputMap(new Object[] {
\r
1674 // "RIGHT", "selectPreviousColumn",
\r
1675 // "KP_RIGHT", "selectPreviousColumn",
\r
1676 // "shift RIGHT", "selectPreviousColumnExtendSelection",
\r
1677 // "shift KP_RIGHT", "selectPreviousColumnExtendSelection",
\r
1678 // "ctrl shift RIGHT", "selectPreviousColumnExtendSelection",
\r
1679 // "ctrl shift KP_RIGHT", "selectPreviousColumnExtendSelection",
\r
1680 // "ctrl RIGHT", "selectPreviousColumnChangeLead",
\r
1681 // "ctrl KP_RIGHT", "selectPreviousColumnChangeLead",
\r
1682 // "LEFT", "selectNextColumn",
\r
1683 // "KP_LEFT", "selectNextColumn",
\r
1684 // "shift LEFT", "selectNextColumnExtendSelection",
\r
1685 // "shift KP_LEFT", "selectNextColumnExtendSelection",
\r
1686 // "ctrl shift LEFT", "selectNextColumnExtendSelection",
\r
1687 // "ctrl shift KP_LEFT", "selectNextColumnExtendSelection",
\r
1688 // "ctrl LEFT", "selectNextColumnChangeLead",
\r
1689 // "ctrl KP_LEFT", "selectNextColumnChangeLead",
\r
1690 // "ctrl PAGE_UP", "scrollRightChangeSelection",
\r
1691 // "ctrl PAGE_DOWN", "scrollLeftChangeSelection",
\r
1692 // "ctrl shift PAGE_UP", "scrollRightExtendSelection",
\r
1693 // "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection",
\r
1695 // "Table.ascendingSortIcon", new SwingLazyValue(
\r
1696 // "sun.swing.icon.SortArrowIcon",
\r
1697 // null, new Object[] { Boolean.TRUE,
\r
1698 // "Table.sortIconColor" }),
\r
1699 // "Table.descendingSortIcon", new SwingLazyValue(
\r
1700 // "sun.swing.icon.SortArrowIcon",
\r
1701 // null, new Object[] { Boolean.FALSE,
\r
1702 // "Table.sortIconColor" }),
\r
1703 // "Table.sortIconColor", controlShadow,
\r
1705 // "TableHeader.font", dialogPlain12,
\r
1706 // "TableHeader.foreground", controlText, // header text color
\r
1707 // "TableHeader.background", control, // header background
\r
1708 // "TableHeader.cellBorder", tableHeaderBorder,
\r
1710 // Support for changing the background/border of the currently
\r
1711 // selected header column when the header has the keyboard focus.
\r
1712 // "TableHeader.focusCellBackground", table.getColor("text"), // like
\r
1713 // text component bg
\r
1714 // "TableHeader.focusCellForeground", null,
\r
1715 // "TableHeader.focusCellBorder", null,
\r
1716 // "TableHeader.ancestorInputMap",
\r
1717 // new UIDefaults.LazyInputMap(new Object[] {
\r
1718 // "SPACE", "toggleSortOrder",
\r
1719 // "LEFT", "selectColumnToLeft",
\r
1720 // "KP_LEFT", "selectColumnToLeft",
\r
1721 // "RIGHT", "selectColumnToRight",
\r
1722 // "KP_RIGHT", "selectColumnToRight",
\r
1723 // "alt LEFT", "moveColumnLeft",
\r
1724 // "alt KP_LEFT", "moveColumnLeft",
\r
1725 // "alt RIGHT", "moveColumnRight",
\r
1726 // "alt KP_RIGHT", "moveColumnRight",
\r
1727 // "alt shift LEFT", "resizeLeft",
\r
1728 // "alt shift KP_LEFT", "resizeLeft",
\r
1729 // "alt shift RIGHT", "resizeRight",
\r
1730 // "alt shift KP_RIGHT", "resizeRight",
\r
1731 // "ESCAPE", "focusTable",
\r
1737 "TextField.background",
\r
1739 "TextField.foreground",
\r
1741 // "TextField.shadow", controlShadow,
\r
1742 // "TextField.darkShadow", controlDkShadow,
\r
1743 // "TextField.light", controlHighlight,
\r
1744 // "TextField.highlight", controlLtHighlight,
\r
1745 // "TextField.inactiveForeground", textInactiveText,
\r
1746 // "TextField.inactiveBackground", control,
\r
1747 // "TextField.selectionBackground", textHighlight,
\r
1748 // "TextField.selectionForeground", textHighlightText,
\r
1749 // "TextField.caretForeground", textText,
\r
1750 // "TextField.caretBlinkRate", caretBlinkRate,
\r
1751 // "TextField.border", textFieldBorder,
\r
1752 "TextField.margin",
\r
1755 "FormattedTextField.font",
\r
1757 "FormattedTextField.background",
\r
1759 "FormattedTextField.foreground",
\r
1761 // "FormattedTextField.inactiveForeground", textInactiveText,
\r
1762 // "FormattedTextField.inactiveBackground", control,
\r
1763 // "FormattedTextField.selectionBackground", textHighlight,
\r
1764 // "FormattedTextField.selectionForeground", textHighlightText,
\r
1765 "FormattedTextField.caretForeground",
\r
1767 // "FormattedTextField.caretBlinkRate", caretBlinkRate,
\r
1768 // "FormattedTextField.border", textFieldBorder,
\r
1769 "FormattedTextField.margin",
\r
1771 // "FormattedTextField.focusInputMap",
\r
1772 // new UIDefaults.LazyInputMap(new Object[] {
\r
1773 // "ctrl C", DefaultEditorKit.copyAction,
\r
1774 // "ctrl V", DefaultEditorKit.pasteAction,
\r
1775 // "ctrl X", DefaultEditorKit.cutAction,
\r
1776 // "COPY", DefaultEditorKit.copyAction,
\r
1777 // "PASTE", DefaultEditorKit.pasteAction,
\r
1778 // "CUT", DefaultEditorKit.cutAction,
\r
1779 // "control INSERT", DefaultEditorKit.copyAction,
\r
1780 // "shift INSERT", DefaultEditorKit.pasteAction,
\r
1781 // "shift DELETE", DefaultEditorKit.cutAction,
\r
1782 // "shift LEFT", DefaultEditorKit.selectionBackwardAction,
\r
1783 // "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction,
\r
1784 // "shift RIGHT", DefaultEditorKit.selectionForwardAction,
\r
1785 // "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction,
\r
1786 // "ctrl LEFT", DefaultEditorKit.previousWordAction,
\r
1787 // "ctrl KP_LEFT", DefaultEditorKit.previousWordAction,
\r
1788 // "ctrl RIGHT", DefaultEditorKit.nextWordAction,
\r
1789 // "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction,
\r
1790 // "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
\r
1791 // "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction,
\r
1792 // "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction,
\r
1793 // "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction,
\r
1794 // "ctrl A", DefaultEditorKit.selectAllAction,
\r
1795 // "HOME", DefaultEditorKit.beginLineAction,
\r
1796 // "END", DefaultEditorKit.endLineAction,
\r
1797 // "shift HOME", DefaultEditorKit.selectionBeginLineAction,
\r
1798 // "shift END", DefaultEditorKit.selectionEndLineAction,
\r
1799 // "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
\r
1800 // "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
\r
1801 // "ctrl H", DefaultEditorKit.deletePrevCharAction,
\r
1802 // "DELETE", DefaultEditorKit.deleteNextCharAction,
\r
1803 // "ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
\r
1804 // "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
\r
1805 // "RIGHT", DefaultEditorKit.forwardAction,
\r
1806 // "LEFT", DefaultEditorKit.backwardAction,
\r
1807 // "KP_RIGHT", DefaultEditorKit.forwardAction,
\r
1808 // "KP_LEFT", DefaultEditorKit.backwardAction,
\r
1809 // "ENTER", JTextField.notifyAction,
\r
1810 // "ctrl BACK_SLASH", "unselect",
\r
1811 // "control shift O", "toggle-componentOrientation",
\r
1812 // "ESCAPE", "reset-field-edit",
\r
1813 // "UP", "increment",
\r
1814 // "KP_UP", "increment",
\r
1815 // "DOWN", "decrement",
\r
1816 // "KP_DOWN", "decrement",
\r
1819 "PasswordField.font",
\r
1820 monospacedPlain12,
\r
1821 "PasswordField.background",
\r
1823 "PasswordField.foreground",
\r
1825 // "PasswordField.inactiveForeground", textInactiveText,
\r
1826 // "PasswordField.inactiveBackground", control,
\r
1827 // "PasswordField.selectionBackground", textHighlight,
\r
1828 // "PasswordField.selectionForeground", textHighlightText,
\r
1829 // "PasswordField.caretForeground", textText,
\r
1830 // "PasswordField.caretBlinkRate", caretBlinkRate,
\r
1831 // "PasswordField.border", textFieldBorder,
\r
1832 "PasswordField.margin",
\r
1834 "PasswordField.echoChar",
\r
1838 monospacedPlain12,
\r
1839 "TextArea.background",
\r
1841 "TextArea.foreground",
\r
1843 // "TextArea.inactiveForeground", textInactiveText,
\r
1844 // "TextArea.selectionBackground", textHighlight,
\r
1845 // "TextArea.selectionForeground", textHighlightText,
\r
1846 // "TextArea.caretForeground", textText,
\r
1847 // "TextArea.caretBlinkRate", caretBlinkRate,
\r
1848 // "TextArea.border", marginBorder,
\r
1849 "TextArea.margin",
\r
1854 "TextPane.background",
\r
1856 "TextPane.foreground",
\r
1858 // "TextPane.selectionBackground", textHighlight,
\r
1859 // "TextPane.selectionForeground", textHighlightText,
\r
1860 // "TextPane.caretForeground", textText,
\r
1861 // "TextPane.caretBlinkRate", caretBlinkRate,
\r
1862 // "TextPane.inactiveForeground", textInactiveText,
\r
1863 // "TextPane.border", marginBorder,
\r
1864 "TextPane.margin",
\r
1867 "EditorPane.font",
\r
1869 "EditorPane.background",
\r
1871 "EditorPane.foreground",
\r
1873 // "EditorPane.selectionBackground", textHighlight,
\r
1874 // "EditorPane.selectionForeground", textHighlightText,
\r
1875 // "EditorPane.caretForeground", textText,
\r
1876 // "EditorPane.caretBlinkRate", caretBlinkRate,
\r
1877 // "EditorPane.inactiveForeground", textInactiveText,
\r
1878 // "EditorPane.border", marginBorder,
\r
1879 "EditorPane.margin",
\r
1882 // "html.pendingImage", SwingUtilities2.makeIcon(getClass(),
\r
1883 // BasicLookAndFeel.class,
\r
1884 // "icons/image-delayed.png"),
\r
1885 // "html.missingImage", SwingUtilities2.makeIcon(getClass(),
\r
1886 // BasicLookAndFeel.class,
\r
1887 // "icons/image-failed.png"),
\r
1888 // *** TitledBorder
\r
1889 // "TitledBorder.font", dialogPlain12,
\r
1890 "TitledBorder.titleColor",
\r
1892 // "TitledBorder.border", etchedBorder,
\r
1895 // "ToolBar.font", dialogPlain12,
\r
1896 // "ToolBar.background", control,
\r
1897 // "ToolBar.foreground", controlText,
\r
1898 // "ToolBar.shadow", controlShadow,
\r
1899 // "ToolBar.darkShadow", controlDkShadow,
\r
1900 // "ToolBar.light", controlHighlight,
\r
1901 // "ToolBar.highlight", controlLtHighlight,
\r
1902 // "ToolBar.dockingBackground", control,
\r
1903 // "ToolBar.dockingForeground", red,
\r
1904 // "ToolBar.floatingBackground", control,
\r
1905 // "ToolBar.floatingForeground", darkGray,
\r
1906 // "ToolBar.border", etchedBorder,
\r
1907 // "ToolBar.separatorSize", toolBarSeparatorSize,
\r
1908 // "ToolBar.ancestorInputMap",
\r
1909 // new UIDefaults.LazyInputMap(new Object[] {
\r
1910 // "UP", "navigateUp",
\r
1911 // "KP_UP", "navigateUp",
\r
1912 // "DOWN", "navigateDown",
\r
1913 // "KP_DOWN", "navigateDown",
\r
1914 // "LEFT", "navigateLeft",
\r
1915 // "KP_LEFT", "navigateLeft",
\r
1916 // "RIGHT", "navigateRight",
\r
1917 // "KP_RIGHT", "navigateRight"
\r
1921 // "ToolTip.font", sansSerifPlain12,
\r
1922 // "ToolTip.background", table.get("info"),
\r
1923 // "ToolTip.foreground", table.get("infoText"),
\r
1924 // "ToolTip.border", blackLineBorder,
\r
1925 // ToolTips also support backgroundInactive, borderInactive,
\r
1926 // and foregroundInactive
\r
1928 // *** ToolTipManager
\r
1929 // ToolTipManager.enableToolTipMode currently supports:
\r
1930 // "allWindows" (default):
\r
1931 // enables tool tips for all windows of all java applications,
\r
1932 // whether the windows are active or inactive
\r
1933 // "activeApplication"
\r
1934 // enables tool tips for windows of an application only when
\r
1935 // the application has an active window
\r
1936 // "ToolTipManager.enableToolTipMode", "allWindows",
\r
1939 "Tree.paintLines",
\r
1941 "Tree.lineTypeDashed",
\r
1943 // "Tree.font", dialogPlain12,
\r
1944 "Tree.background",
\r
1946 "Tree.foreground",
\r
1950 "Tree.textForeground",
\r
1952 "Tree.textBackground",
\r
1953 table.get("text"),
\r
1954 // "Tree.selectionForeground", textHighlightText,
\r
1955 // "Tree.selectionBackground", textHighlight,
\r
1956 // "Tree.selectionBorderColor", black,
\r
1957 // "Tree.dropLineColor", controlShadow,
\r
1958 // "Tree.editorBorder", blackLineBorder,
\r
1959 "Tree.leftChildIndent", new Integer(7), "Tree.rightChildIndent",
\r
1960 new Integer(13), "Tree.rowHeight", new Integer(16),
\r
1961 "Tree.scrollsOnExpand", Boolean.TRUE,
\r
1962 // "Tree.openIcon", SwingUtilities2.makeIcon(getClass(),
\r
1963 // BasicLookAndFeel.class,
\r
1964 // "icons/TreeOpen.gif"),
\r
1965 // "Tree.closedIcon", SwingUtilities2.makeIcon(getClass(),
\r
1966 // BasicLookAndFeel.class,
\r
1967 // "icons/TreeClosed.gif"),
\r
1968 // "Tree.leafIcon", SwingUtilities2.makeIcon(getClass(),
\r
1969 // BasicLookAndFeel.class,
\r
1970 // "icons/TreeLeaf.gif"),
\r
1971 // "Tree.expandedIcon", null,
\r
1972 // "Tree.collapsedIcon", null,
\r
1973 // "Tree.changeSelectionWithFocus", Boolean.TRUE,
\r
1974 // "Tree.drawsFocusBorderAroundIcon", Boolean.FALSE,
\r
1975 "Tree.timeFactor", oneThousand,
\r
1976 // "Tree.focusInputMap",
\r
1977 // new UIDefaults.LazyInputMap(new Object[] {
\r
1978 // "ctrl C", "copy",
\r
1979 // "ctrl V", "paste",
\r
1980 // "ctrl X", "cut",
\r
1981 // "COPY", "copy",
\r
1982 // "PASTE", "paste",
\r
1984 // "control INSERT", "copy",
\r
1985 // "shift INSERT", "paste",
\r
1986 // "shift DELETE", "cut",
\r
1987 // "UP", "selectPrevious",
\r
1988 // "KP_UP", "selectPrevious",
\r
1989 // "shift UP", "selectPreviousExtendSelection",
\r
1990 // "shift KP_UP", "selectPreviousExtendSelection",
\r
1991 // "ctrl shift UP", "selectPreviousExtendSelection",
\r
1992 // "ctrl shift KP_UP", "selectPreviousExtendSelection",
\r
1993 // "ctrl UP", "selectPreviousChangeLead",
\r
1994 // "ctrl KP_UP", "selectPreviousChangeLead",
\r
1995 // "DOWN", "selectNext",
\r
1996 // "KP_DOWN", "selectNext",
\r
1997 // "shift DOWN", "selectNextExtendSelection",
\r
1998 // "shift KP_DOWN", "selectNextExtendSelection",
\r
1999 // "ctrl shift DOWN", "selectNextExtendSelection",
\r
2000 // "ctrl shift KP_DOWN", "selectNextExtendSelection",
\r
2001 // "ctrl DOWN", "selectNextChangeLead",
\r
2002 // "ctrl KP_DOWN", "selectNextChangeLead",
\r
2003 // "RIGHT", "selectChild",
\r
2004 // "KP_RIGHT", "selectChild",
\r
2005 // "LEFT", "selectParent",
\r
2006 // "KP_LEFT", "selectParent",
\r
2007 // "PAGE_UP", "scrollUpChangeSelection",
\r
2008 // "shift PAGE_UP", "scrollUpExtendSelection",
\r
2009 // "ctrl shift PAGE_UP", "scrollUpExtendSelection",
\r
2010 // "ctrl PAGE_UP", "scrollUpChangeLead",
\r
2011 // "PAGE_DOWN", "scrollDownChangeSelection",
\r
2012 // "shift PAGE_DOWN", "scrollDownExtendSelection",
\r
2013 // "ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
\r
2014 // "ctrl PAGE_DOWN", "scrollDownChangeLead",
\r
2015 // "HOME", "selectFirst",
\r
2016 // "shift HOME", "selectFirstExtendSelection",
\r
2017 // "ctrl shift HOME", "selectFirstExtendSelection",
\r
2018 // "ctrl HOME", "selectFirstChangeLead",
\r
2019 // "END", "selectLast",
\r
2020 // "shift END", "selectLastExtendSelection",
\r
2021 // "ctrl shift END", "selectLastExtendSelection",
\r
2022 // "ctrl END", "selectLastChangeLead",
\r
2023 // "F2", "startEditing",
\r
2024 // "ctrl A", "selectAll",
\r
2025 // "ctrl SLASH", "selectAll",
\r
2026 // "ctrl BACK_SLASH", "clearSelection",
\r
2027 // "ctrl LEFT", "scrollLeft",
\r
2028 // "ctrl KP_LEFT", "scrollLeft",
\r
2029 // "ctrl RIGHT", "scrollRight",
\r
2030 // "ctrl KP_RIGHT", "scrollRight",
\r
2031 // "SPACE", "addToSelection",
\r
2032 // "ctrl SPACE", "toggleAndAnchor",
\r
2033 // "shift SPACE", "extendTo",
\r
2034 // "ctrl shift SPACE", "moveSelectionTo"
\r
2036 // "Tree.focusInputMap.RightToLeft",
\r
2037 // new UIDefaults.LazyInputMap(new Object[] {
\r
2038 // "RIGHT", "selectParent",
\r
2039 // "KP_RIGHT", "selectParent",
\r
2040 // "LEFT", "selectChild",
\r
2041 // "KP_LEFT", "selectChild",
\r
2043 // "Tree.ancestorInputMap",
\r
2044 // new UIDefaults.LazyInputMap(new Object[] {
\r
2045 // "ESCAPE", "cancel"
\r
2047 // // Bind specific keys that can invoke popup on currently
\r
2048 // // focused JComponent
\r
2049 // "RootPane.ancestorInputMap",
\r
2050 // new UIDefaults.LazyInputMap(new Object[] {
\r
2051 // "shift F10", "postPopup",
\r
2052 // "CONTEXT_MENU", "postPopup"
\r
2055 // // These bindings are only enabled when there is a default
\r
2056 // // button set on the rootpane.
\r
2057 // "RootPane.defaultButtonWindowKeyBindings", new Object[] {
\r
2058 // "ENTER", "press",
\r
2059 // "released ENTER", "release",
\r
2060 // "ctrl ENTER", "press",
\r
2061 // "ctrl released ENTER", "release"
\r
2065 table.putDefaults(defaults);
\r
2069 // * Returns the ui that is of type <code>klass</code>, or null if
\r
2070 // * one can not be found.
\r
2072 // static Object getUIOfType(ComponentUI ui, Class klass) {
\r
2073 // if (klass.isInstance(ui)) {
\r
2079 // // ********* Auditory Cue support methods and objects *********
\r
2080 // // also see the "AuditoryCues" section of the defaults table
\r
2083 // * Returns an <code>ActionMap</code> containing the audio actions
\r
2084 // * for this look and feel.
\r
2086 // * The returned <code>ActionMap</code> contains <code>Actions</code> that
\r
2087 // * embody the ability to render an auditory cue. These auditory
\r
2088 // * cues map onto user and system activities that may be useful
\r
2089 // * for an end user to know about (such as a dialog box appearing).
\r
2091 // * At the appropriate time,
\r
2092 // * the {@code ComponentUI} is responsible for obtaining an
\r
2093 // * <code>Action</code> out of the <code>ActionMap</code> and passing
\r
2094 // * it to <code>playSound</code>.
\r
2096 // * This method first looks up the {@code ActionMap} from the
\r
2097 // * defaults using the key {@code "AuditoryCues.actionMap"}.
\r
2099 // * If the value is {@code non-null}, it is returned. If the value
\r
2100 // * of the default {@code "AuditoryCues.actionMap"} is {@code null}
\r
2101 // * and the value of the default {@code "AuditoryCues.cueList"} is
\r
2102 // * {@code non-null}, an {@code ActionMapUIResource} is created and
\r
2103 // * populated. Population is done by iterating over each of the
\r
2104 // * elements of the {@code "AuditoryCues.cueList"} array, and
\r
2105 // * invoking {@code createAudioAction()} to create an {@code
\r
2106 // * Action} for each element. The resulting {@code Action} is
\r
2107 // * placed in the {@code ActionMapUIResource}, using the array
\r
2108 // * element as the key. For example, if the {@code
\r
2109 // * "AuditoryCues.cueList"} array contains a single-element, {@code
\r
2110 // * "audioKey"}, the {@code ActionMapUIResource} is created, then
\r
2111 // * populated by way of {@code actionMap.put(cueList[0],
\r
2112 // * createAudioAction(cueList[0]))}.
\r
2114 // * If the value of the default {@code "AuditoryCues.actionMap"} is
\r
2115 // * {@code null} and the value of the default
\r
2116 // * {@code "AuditoryCues.cueList"} is {@code null}, an empty
\r
2117 // * {@code ActionMapUIResource} is created.
\r
2120 // * @return an ActionMap containing {@code Actions}
\r
2121 // * responsible for playing auditory cues
\r
2122 // * @throws ClassCastException if the value of the
\r
2123 // * default {@code "AuditoryCues.actionMap"} is not an
\r
2124 // * {@code ActionMap}, or the value of the default
\r
2125 // * {@code "AuditoryCues.cueList"} is not an {@code Object[]}
\r
2126 // * @see #createAudioAction
\r
2127 // * @see #playSound(Action)
\r
2130 // protected ActionMap getAudioActionMap() {
\r
2131 // ActionMap audioActionMap = (ActionMap)UIManager.get(
\r
2132 // "AuditoryCues.actionMap");
\r
2133 // if (audioActionMap == null) {
\r
2134 // Object[] acList = (Object[])UIManager.get("AuditoryCues.cueList");
\r
2135 // if (acList != null) {
\r
2136 // audioActionMap = new ActionMapUIResource();
\r
2137 // for(int counter = acList.length-1; counter >= 0; counter--) {
\r
2138 // audioActionMap.put(acList[counter],
\r
2139 // createAudioAction(acList[counter]));
\r
2142 // UIManager.getLookAndFeelDefaults().put("AuditoryCues.actionMap",
\r
2143 // audioActionMap);
\r
2145 // return audioActionMap;
\r
2149 // * Creates and returns an {@code Action} used to play a sound.
\r
2151 // * If {@code key} is {@code non-null}, an {@code Action} is created
\r
2152 // * using the value from the defaults with key {@code key}. The value
\r
2153 // * identifies the sound resource to load when
\r
2154 // * {@code actionPerformed} is invoked on the {@code Action}. The
\r
2155 // * sound resource is loaded into a {@code byte[]} by way of
\r
2156 // * {@code getClass().getResourceAsStream()}.
\r
2158 // * @param key the key identifying the audio action
\r
2159 // * @return an {@code Action} used to play the source, or {@code null}
\r
2160 // * if {@code key} is {@code null}
\r
2161 // * @see #playSound(Action)
\r
2164 // protected Action createAudioAction(Object key) {
\r
2165 // if (key != null) {
\r
2166 // String audioKey = (String)key;
\r
2167 // String audioValue = (String)UIManager.get(key);
\r
2168 // return new AudioAction(audioKey, audioValue);
\r
2175 // * Pass the name String to the super constructor. This is used
\r
2176 // * later to identify the Action and decide whether to play it or
\r
2177 // * not. Store the resource String. I is used to get the audio
\r
2178 // * resource. In this case, the resource is an audio file.
\r
2182 // private class AudioAction extends AbstractAction implements LineListener {
\r
2183 // // We strive to only play one sound at a time (other platforms
\r
2184 // // appear to do this). This is done by maintaining the field
\r
2185 // // clipPlaying. Every time a sound is to be played,
\r
2186 // // cancelCurrentSound is invoked to cancel any sound that may be
\r
2188 // private String audioResource;
\r
2189 // private byte[] audioBuffer;
\r
2192 // * The String is the name of the Action and
\r
2193 // * points to the audio resource.
\r
2194 // * The byte[] is a buffer of the audio bits.
\r
2196 // public AudioAction(String name, String resource) {
\r
2198 // audioResource = resource;
\r
2201 // public void actionPerformed(ActionEvent e) {
\r
2202 // if (audioBuffer == null) {
\r
2203 // audioBuffer = loadAudioData(audioResource);
\r
2205 // if (audioBuffer != null) {
\r
2206 // cancelCurrentSound(null);
\r
2208 // AudioInputStream soundStream =
\r
2209 // AudioSystem.getAudioInputStream(
\r
2210 // new ByteArrayInputStream(audioBuffer));
\r
2211 // DataLine.Info info =
\r
2212 // new DataLine.Info(Clip.class, soundStream.getFormat());
\r
2213 // Clip clip = (Clip) AudioSystem.getLine(info);
\r
2214 // clip.open(soundStream);
\r
2215 // clip.addLineListener(this);
\r
2217 // synchronized(audioLock) {
\r
2218 // clipPlaying = clip;
\r
2222 // } catch (Exception ex) {}
\r
2226 // public void update(LineEvent event) {
\r
2227 // if (event.getType() == LineEvent.Type.STOP) {
\r
2228 // cancelCurrentSound((Clip)event.getLine());
\r
2233 // * If the parameter is null, or equal to the currently
\r
2234 // * playing sound, then cancel the currently playing sound.
\r
2236 // private void cancelCurrentSound(Clip clip) {
\r
2237 // Clip lastClip = null;
\r
2239 // synchronized(audioLock) {
\r
2240 // if (clip == null || clip == clipPlaying) {
\r
2241 // lastClip = clipPlaying;
\r
2242 // clipPlaying = null;
\r
2246 // if (lastClip != null) {
\r
2247 // lastClip.removeLineListener(this);
\r
2248 // lastClip.close();
\r
2254 // * Utility method that loads audio bits for the specified
\r
2255 // * <code>soundFile</code> filename. If this method is unable to
\r
2256 // * build a viable path name from the <code>baseClass</code> and
\r
2257 // * <code>soundFile</code> passed into this method, it will
\r
2258 // * return <code>null</code>.
\r
2260 // * @param baseClass used as the root class/location to get the
\r
2261 // * soundFile from
\r
2262 // * @param soundFile the name of the audio file to be retrieved
\r
2264 // * @return A byte[] with audio data or null
\r
2267 // private byte[] loadAudioData(final String soundFile){
\r
2268 // if (soundFile == null) {
\r
2271 // /* Copy resource into a byte array. This is
\r
2272 // * necessary because several browsers consider
\r
2273 // * Class.getResource a security risk since it
\r
2274 // * can be used to load additional classes.
\r
2275 // * Class.getResourceAsStream just returns raw
\r
2276 // * bytes, which we can convert to a sound.
\r
2278 // byte[] buffer = (byte[])AccessController.doPrivileged(
\r
2279 // new PrivilegedAction() {
\r
2280 // public Object run() {
\r
2282 // InputStream resource = BasicLookAndFeel.this.
\r
2283 // getClass().getResourceAsStream(soundFile);
\r
2284 // if (resource == null) {
\r
2287 // BufferedInputStream in =
\r
2288 // new BufferedInputStream(resource);
\r
2289 // ByteArrayOutputStream out =
\r
2290 // new ByteArrayOutputStream(1024);
\r
2291 // byte[] buffer = new byte[1024];
\r
2293 // while ((n = in.read(buffer)) > 0) {
\r
2294 // out.write(buffer, 0, n);
\r
2298 // buffer = out.toByteArray();
\r
2300 // } catch (IOException ioe) {
\r
2301 // System.err.println(ioe.toString());
\r
2306 // if (buffer == null) {
\r
2307 // System.err.println(getClass().getName() + "/" +
\r
2308 // soundFile + " not found.");
\r
2311 // if (buffer.length == 0) {
\r
2312 // System.err.println("warning: " + soundFile +
\r
2313 // " is zero-length");
\r
2320 // * If necessary, invokes {@code actionPerformed} on
\r
2321 // * {@code audioAction} to play a sound.
\r
2322 // * The {@code actionPerformed} method is invoked if the value of
\r
2323 // * the {@code "AuditoryCues.playList"} default is a {@code
\r
2324 // * non-null} {@code Object[]} containing a {@code String} entry
\r
2325 // * equal to the name of the {@code audioAction}.
\r
2327 // * @param audioAction an Action that knows how to render the audio
\r
2328 // * associated with the system or user activity
\r
2329 // * that is occurring; a value of {@code null}, is
\r
2331 // * @throws ClassCastException if {@code audioAction} is {@code non-null}
\r
2332 // * and the value of the default {@code "AuditoryCues.playList"}
\r
2333 // * is not an {@code Object[]}
\r
2336 // protected void playSound(Action audioAction) {
\r
2337 // if (audioAction != null) {
\r
2338 // Object[] audioStrings = (Object[])
\r
2339 // UIManager.get("AuditoryCues.playList");
\r
2340 // if (audioStrings != null) {
\r
2341 // // create a HashSet to help us decide to play or not
\r
2342 // HashSet audioCues = new HashSet();
\r
2343 // for (int i = 0; i < audioStrings.length; i++) {
\r
2344 // audioCues.add(audioStrings[i]);
\r
2346 // // get the name of the Action
\r
2347 // String actionName = (String)audioAction.getValue(Action.NAME);
\r
2348 // // if the actionName is in the audioCues HashSet, play it.
\r
2349 // if (audioCues.contains(actionName)) {
\r
2350 // audioAction.actionPerformed(new
\r
2351 // ActionEvent(this, ActionEvent.ACTION_PERFORMED,
\r
2360 // * Sets the parent of the passed in ActionMap to be the audio action
\r
2363 // static void installAudioActionMap(ActionMap map) {
\r
2364 // LookAndFeel laf = UIManager.getLookAndFeel();
\r
2365 // if (laf instanceof BasicLookAndFeel) {
\r
2366 // map.setParent(((BasicLookAndFeel)laf).getAudioActionMap());
\r
2372 // * Helper method to play a named sound.
\r
2374 // * @param c JComponent to play the sound for.
\r
2375 // * @param actionKey Key for the sound.
\r
2377 // static void playSound(JComponent c, Object actionKey) {
\r
2378 // LookAndFeel laf = UIManager.getLookAndFeel();
\r
2379 // if (laf instanceof BasicLookAndFeel) {
\r
2380 // ActionMap map = c.getActionMap();
\r
2381 // if (map != null) {
\r
2382 // Action audioAction = map.get(actionKey);
\r
2383 // if (audioAction != null) {
\r
2384 // // pass off firing the Action to a utility method
\r
2385 // ((BasicLookAndFeel)laf).playSound(audioAction);
\r
2392 // * This class contains listener that watches for all the mouse
\r
2393 // * events that can possibly invoke popup on the component
\r
2395 // class AWTEventHelper implements AWTEventListener,PrivilegedAction {
\r
2396 // AWTEventHelper() {
\r
2398 // AccessController.doPrivileged(this);
\r
2401 // public Object run() {
\r
2402 // Toolkit tk = Toolkit.getDefaultToolkit();
\r
2403 // if(invocator == null) {
\r
2404 // tk.addAWTEventListener(this, AWTEvent.MOUSE_EVENT_MASK);
\r
2406 // tk.removeAWTEventListener(invocator);
\r
2408 // // Return value not used.
\r
2412 // public void eventDispatched(AWTEvent ev) {
\r
2413 // int eventID = ev.getID();
\r
2414 // if((eventID & AWTEvent.MOUSE_EVENT_MASK) != 0) {
\r
2415 // MouseEvent me = (MouseEvent) ev;
\r
2416 // if(me.isPopupTrigger()) {
\r
2417 // MenuElement[] elems = MenuSelectionManager
\r
2418 // .defaultManager()
\r
2419 // .getSelectedPath();
\r
2420 // if(elems != null && elems.length != 0) {
\r
2422 // // We shall not interfere with already opened menu
\r
2424 // Object c = me.getSource();
\r
2425 // JComponent src = null;
\r
2426 // if(c instanceof JComponent) {
\r
2427 // src = (JComponent) c;
\r
2428 // } else if(c instanceof BasicSplitPaneDivider) {
\r
2429 // // Special case - if user clicks on divider we must
\r
2430 // // invoke popup from the SplitPane
\r
2431 // src = (JComponent)
\r
2432 // ((BasicSplitPaneDivider)c).getParent();
\r
2434 // if(src != null) {
\r
2435 // if(src.getComponentPopupMenu() != null) {
\r
2436 // Point pt = src.getPopupLocation(me);
\r
2437 // if(pt == null) {
\r
2438 // pt = me.getPoint();
\r
2439 // pt = SwingUtilities.convertPoint((Component)c,
\r
2442 // src.getComponentPopupMenu().show(src, pt.x, pt.y);
\r
2448 // /* Activate a JInternalFrame if necessary. */
\r
2449 // if (eventID == MouseEvent.MOUSE_PRESSED) {
\r
2450 // Object object = ev.getSource();
\r
2451 // if (!(object instanceof Component)) {
\r
2454 // Component component = (Component)object;
\r
2455 // if (component != null) {
\r
2456 // Component parent = component;
\r
2457 // while (parent != null && !(parent instanceof Window)) {
\r
2458 // if (parent instanceof JInternalFrame) {
\r
2459 // // Activate the frame.
\r
2460 // try { ((JInternalFrame)parent).setSelected(true); }
\r
2461 // catch (PropertyVetoException e1) { }
\r
2463 // parent = parent.getParent();
\r
2471 public String getName() {
\r
2476 public String getID() {
\r
2481 public String getDescription() {
\r
2482 return "SwingJS L&F";
\r
2486 public boolean isNativeLookAndFeel() {
\r
2491 public boolean isSupportedLookAndFeel() {
\r