KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > swing > plaf > basic > BasicLookAndFeel


1 /*
2  * @(#)BasicLookAndFeel.java 1.242 06/08/16
3  *
4  * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.swing.plaf.basic;
9
10 import java.awt.Font JavaDoc;
11 import java.awt.Color JavaDoc;
12 import java.awt.SystemColor JavaDoc;
13 import java.awt.event.*;
14 import java.awt.Insets JavaDoc;
15 import java.awt.Component JavaDoc;
16 import java.awt.Container JavaDoc;
17 import java.awt.FocusTraversalPolicy JavaDoc;
18 import java.awt.AWTEvent JavaDoc;
19 import java.awt.Toolkit JavaDoc;
20 import java.awt.Point JavaDoc;
21 import java.net.URL JavaDoc;
22 import java.io.*;
23 import java.awt.Dimension JavaDoc;
24 import java.awt.KeyboardFocusManager JavaDoc;
25 import java.security.AccessController JavaDoc;
26 import java.security.PrivilegedAction JavaDoc;
27 import java.util.*;
28 import java.lang.reflect.*;
29 import javax.sound.sampled.*;
30
31 import sun.awt.AppContext;
32
33 import sun.swing.SwingLazyValue;
34 import com.sun.java.swing.SwingUtilities2;
35
36 import javax.swing.LookAndFeel JavaDoc;
37 import javax.swing.AbstractAction JavaDoc;
38 import javax.swing.Action JavaDoc;
39 import javax.swing.ActionMap JavaDoc;
40 import javax.swing.BorderFactory JavaDoc;
41 import javax.swing.JComponent JavaDoc;
42 import javax.swing.ImageIcon JavaDoc;
43 import javax.swing.UIDefaults JavaDoc;
44 import javax.swing.UIManager JavaDoc;
45 import javax.swing.KeyStroke JavaDoc;
46 import javax.swing.JTextField JavaDoc;
47 import javax.swing.DefaultListCellRenderer JavaDoc;
48 import javax.swing.FocusManager JavaDoc;
49 import javax.swing.LayoutFocusTraversalPolicy JavaDoc;
50 import javax.swing.SwingUtilities JavaDoc;
51 import javax.swing.MenuSelectionManager JavaDoc;
52 import javax.swing.MenuElement JavaDoc;
53 import javax.swing.border.*;
54 import javax.swing.plaf.*;
55 import javax.swing.text.JTextComponent JavaDoc;
56 import javax.swing.text.DefaultEditorKit JavaDoc;
57 import java.beans.PropertyChangeListener JavaDoc;
58 import java.beans.PropertyChangeEvent JavaDoc;
59
60
61 /**
62  * Implements the a standard base LookAndFeel class from which
63  * standard desktop LookAndFeel classes (JLF, Mac, Windows, etc.)
64  * can be derived. This class cannot be instantiated directly,
65  * however the UI classes "Basic" defines can be.
66  * <p>
67  * <strong>Warning:</strong>
68  * Serialized objects of this class will not be compatible with
69  * future Swing releases. The current serialization support is
70  * appropriate for short term storage or RMI between applications running
71  * the same version of Swing. As of 1.4, support for long term storage
72  * of all JavaBeans<sup><font size="-2">TM</font></sup>
73  * has been added to the <code>java.beans</code> package.
74  * Please see {@link java.beans.XMLEncoder}.
75  *
76  * @version 1.242 08/16/06
77  * @author unattributed
78  */

79 public abstract class BasicLookAndFeel extends LookAndFeel JavaDoc implements Serializable
80 {
81     /**
82      * Whether or not the developer has created a JPopupMenu.
83      */

84     static boolean hasPopups;
85
86     /**
87      * Lock used when manipulating clipPlaying.
88      */

89     private Object JavaDoc audioLock = new Object JavaDoc();
90     /**
91      * The Clip that is currently playing (set in AudioAction).
92      */

93     private Clip clipPlaying;
94
95     PopupInvocationHelper invocator = null;
96
97     /*
98      * Listen for our AppContext being disposed
99      */

100     private PropertyChangeListener JavaDoc disposer = null;
101
102     public UIDefaults JavaDoc getDefaults() {
103     UIDefaults JavaDoc table = new UIDefaults JavaDoc();
104
105     initClassDefaults(table);
106     initSystemColorDefaults(table);
107     initComponentDefaults(table);
108
109     return table;
110     }
111
112     /**
113      * UIManager.setLookAndFeel calls this method before the first call
114      * (and typically the only call) to getDefaults().
115      */

116     public void initialize() {
117         if (hasPopups) {
118             createdPopup();
119         }
120     }
121
122     /**
123      * UIManager.setLookAndFeel calls this method just
124      * before we're replaced by a new default look and feel.
125      */

126     public void uninitialize() {
127         Toolkit JavaDoc tk = Toolkit.getDefaultToolkit();
128         if(invocator != null) {
129             AccessController.doPrivileged(invocator);
130             invocator = null;
131         }
132
133         if (disposer != null) {
134             // Note that we're likely calling removePropertyChangeListener()
135
// during the course of AppContext.firePropertyChange().
136
// However, EventListenerAggreggate has code to safely modify
137
// the list under such circumstances.
138
AppContext.getAppContext().removePropertyChangeListener(
139                                                         AppContext.GUI_DISPOSED,
140                                                         disposer);
141             disposer = null;
142         }
143     }
144
145     /**
146      * Initialize the uiClassID to BasicComponentUI mapping.
147      * The JComponent classes define their own uiClassID constants
148      * (see AbstractComponent.getUIClassID). This table must
149      * map those constants to a BasicComponentUI class of the
150      * appropriate type.
151      *
152      * @see #getDefaults
153      */

154     protected void initClassDefaults(UIDefaults JavaDoc table)
155     {
156     final String JavaDoc basicPackageName = "javax.swing.plaf.basic.";
157     Object JavaDoc[] uiDefaults = {
158            "ButtonUI", basicPackageName + "BasicButtonUI",
159          "CheckBoxUI", basicPackageName + "BasicCheckBoxUI",
160              "ColorChooserUI", basicPackageName + "BasicColorChooserUI",
161        "FormattedTextFieldUI", basicPackageName + "BasicFormattedTextFieldUI",
162           "MenuBarUI", basicPackageName + "BasicMenuBarUI",
163              "MenuUI", basicPackageName + "BasicMenuUI",
164          "MenuItemUI", basicPackageName + "BasicMenuItemUI",
165      "CheckBoxMenuItemUI", basicPackageName + "BasicCheckBoxMenuItemUI",
166       "RadioButtonMenuItemUI", basicPackageName + "BasicRadioButtonMenuItemUI",
167           "RadioButtonUI", basicPackageName + "BasicRadioButtonUI",
168          "ToggleButtonUI", basicPackageName + "BasicToggleButtonUI",
169         "PopupMenuUI", basicPackageName + "BasicPopupMenuUI",
170           "ProgressBarUI", basicPackageName + "BasicProgressBarUI",
171         "ScrollBarUI", basicPackageName + "BasicScrollBarUI",
172            "ScrollPaneUI", basicPackageName + "BasicScrollPaneUI",
173         "SplitPaneUI", basicPackageName + "BasicSplitPaneUI",
174            "SliderUI", basicPackageName + "BasicSliderUI",
175         "SeparatorUI", basicPackageName + "BasicSeparatorUI",
176           "SpinnerUI", basicPackageName + "BasicSpinnerUI",
177      "ToolBarSeparatorUI", basicPackageName + "BasicToolBarSeparatorUI",
178        "PopupMenuSeparatorUI", basicPackageName + "BasicPopupMenuSeparatorUI",
179            "TabbedPaneUI", basicPackageName + "BasicTabbedPaneUI",
180          "TextAreaUI", basicPackageName + "BasicTextAreaUI",
181         "TextFieldUI", basicPackageName + "BasicTextFieldUI",
182         "PasswordFieldUI", basicPackageName + "BasicPasswordFieldUI",
183          "TextPaneUI", basicPackageName + "BasicTextPaneUI",
184                "EditorPaneUI", basicPackageName + "BasicEditorPaneUI",
185              "TreeUI", basicPackageName + "BasicTreeUI",
186             "LabelUI", basicPackageName + "BasicLabelUI",
187              "ListUI", basicPackageName + "BasicListUI",
188           "ToolBarUI", basicPackageName + "BasicToolBarUI",
189           "ToolTipUI", basicPackageName + "BasicToolTipUI",
190          "ComboBoxUI", basicPackageName + "BasicComboBoxUI",
191             "TableUI", basicPackageName + "BasicTableUI",
192           "TableHeaderUI", basicPackageName + "BasicTableHeaderUI",
193         "InternalFrameUI", basicPackageName + "BasicInternalFrameUI",
194           "DesktopPaneUI", basicPackageName + "BasicDesktopPaneUI",
195           "DesktopIconUI", basicPackageName + "BasicDesktopIconUI",
196            "OptionPaneUI", basicPackageName + "BasicOptionPaneUI",
197                 "PanelUI", basicPackageName + "BasicPanelUI",
198          "ViewportUI", basicPackageName + "BasicViewportUI",
199          "RootPaneUI", basicPackageName + "BasicRootPaneUI",
200     };
201
202     table.putDefaults(uiDefaults);
203     }
204
205     /**
206      * Load the SystemColors into the defaults table. The keys
207      * for SystemColor defaults are the same as the names of
208      * the public fields in SystemColor. If the table is being
209      * created on a native Windows platform we use the SystemColor
210      * values, otherwise we create color objects whose values match
211      * the defaults Windows95 colors.
212      */

213     protected void initSystemColorDefaults(UIDefaults JavaDoc table)
214     {
215     String JavaDoc[] defaultSystemColors = {
216             "desktop", "#005C5C", /* Color of the desktop background */
217       "activeCaption", "#000080", /* Color for captions (title bars) when they are active. */
218       "activeCaptionText", "#FFFFFF", /* Text color for text in captions (title bars). */
219     "activeCaptionBorder", "#C0C0C0", /* Border color for caption (title bar) window borders. */
220         "inactiveCaption", "#808080", /* Color for captions (title bars) when not active. */
221     "inactiveCaptionText", "#C0C0C0", /* Text color for text in inactive captions (title bars). */
222   "inactiveCaptionBorder", "#C0C0C0", /* Border color for inactive caption (title bar) window borders. */
223              "window", "#FFFFFF", /* Default color for the interior of windows */
224        "windowBorder", "#000000", /* ??? */
225          "windowText", "#000000", /* ??? */
226            "menu", "#C0C0C0", /* Background color for menus */
227            "menuText", "#000000", /* Text color for menus */
228            "text", "#C0C0C0", /* Text background color */
229            "textText", "#000000", /* Text foreground color */
230       "textHighlight", "#000080", /* Text background color when selected */
231       "textHighlightText", "#FFFFFF", /* Text color when selected */
232        "textInactiveText", "#808080", /* Text color when disabled */
233             "control", "#C0C0C0", /* Default color for controls (buttons, sliders, etc) */
234         "controlText", "#000000", /* Default color for text in controls */
235        "controlHighlight", "#C0C0C0", /* Specular highlight (opposite of the shadow) */
236      "controlLtHighlight", "#FFFFFF", /* Highlight color for controls */
237       "controlShadow", "#808080", /* Shadow color for controls */
238         "controlDkShadow", "#000000", /* Dark shadow color for controls */
239           "scrollbar", "#E0E0E0", /* Scrollbar background (usually the "track") */
240            "info", "#FFFFE1", /* ??? */
241            "infoText", "#000000" /* ??? */
242     };
243
244     loadSystemColors(table, defaultSystemColors, isNativeLookAndFeel());
245     }
246
247
248     /**
249      * If this is the native look and feel the initial values for the
250      * system color properties are the same as the SystemColor constants.
251      * If not we use the integer color values in the <code>systemColors</code>
252      * argument.
253      */

254     protected void loadSystemColors(UIDefaults JavaDoc table, String JavaDoc[] systemColors, boolean useNative)
255     {
256     /* PENDING(hmuller) We don't load the system colors below because
257      * they're not reliable. Hopefully we'll be able to do better in
258      * a future version of AWT.
259      */

260     if (useNative) {
261         for(int i = 0; i < systemColors.length; i += 2) {
262         Color JavaDoc color = Color.black;
263         try {
264             String JavaDoc name = systemColors[i];
265             color = (Color JavaDoc)(SystemColor JavaDoc.class.getField(name).get(null));
266         } catch (Exception JavaDoc e) {
267         }
268         table.put(systemColors[i], new ColorUIResource(color));
269         }
270     } else {
271         for(int i = 0; i < systemColors.length; i += 2) {
272         Color JavaDoc color = Color.black;
273         try {
274             color = Color.decode(systemColors[i + 1]);
275         }
276         catch(NumberFormatException JavaDoc e) {
277             e.printStackTrace();
278         }
279         table.put(systemColors[i], new ColorUIResource(color));
280         }
281     }
282     }
283     /**
284      * Initialize the defaults table with the name of the ResourceBundle
285      * used for getting localized defaults. Also initialize the default
286      * locale used when no locale is passed into UIDefaults.get(). The
287      * default locale should generally not be relied upon. It is here for
288      * compatability with releases prior to 1.4.
289      */

290     private void initResourceBundle(UIDefaults JavaDoc table) {
291         table.setDefaultLocale( Locale.getDefault() );
292         table.addResourceBundle( "com.sun.swing.internal.plaf.basic.resources.basic" );
293     }
294
295     protected void initComponentDefaults(UIDefaults JavaDoc table)
296     {
297
298         initResourceBundle(table);
299
300     // *** Shared Integers
301
Integer JavaDoc fiveHundred = new Integer JavaDoc(500);
302
303     // *** Shared Longs
304
Long JavaDoc oneThousand = new Long JavaDoc(1000);
305
306     // *** Shared Fonts
307
Integer JavaDoc twelve = new Integer JavaDoc(12);
308     Integer JavaDoc fontPlain = new Integer JavaDoc(Font.PLAIN);
309     Integer JavaDoc fontBold = new Integer JavaDoc(Font.BOLD);
310     Object JavaDoc dialogPlain12 = new SwingLazyValue(
311               "javax.swing.plaf.FontUIResource",
312               null,
313               new Object JavaDoc[] {"Dialog", fontPlain, twelve});
314     Object JavaDoc serifPlain12 = new SwingLazyValue(
315               "javax.swing.plaf.FontUIResource",
316               null,
317               new Object JavaDoc[] {"Serif", fontPlain, twelve});
318     Object JavaDoc sansSerifPlain12 = new SwingLazyValue(
319               "javax.swing.plaf.FontUIResource",
320               null,
321               new Object JavaDoc[] {"SansSerif", fontPlain, twelve});
322     Object JavaDoc monospacedPlain12 = new SwingLazyValue(
323               "javax.swing.plaf.FontUIResource",
324               null,
325               new Object JavaDoc[] {"MonoSpaced", fontPlain, twelve});
326     Object JavaDoc dialogBold12 = new SwingLazyValue(
327               "javax.swing.plaf.FontUIResource",
328               null,
329               new Object JavaDoc[] {"Dialog", fontBold, twelve});
330
331
332     // *** Shared Colors
333
ColorUIResource red = new ColorUIResource(Color.red);
334     ColorUIResource black = new ColorUIResource(Color.black);
335         ColorUIResource white = new ColorUIResource(Color.white);
336     ColorUIResource yellow = new ColorUIResource(Color.yellow);
337         ColorUIResource gray = new ColorUIResource(Color.gray);
338     ColorUIResource lightGray = new ColorUIResource(Color.lightGray);
339     ColorUIResource darkGray = new ColorUIResource(Color.darkGray);
340     ColorUIResource scrollBarTrack = new ColorUIResource(224, 224, 224);
341
342         Color JavaDoc control = table.getColor("control");
343         Color JavaDoc controlDkShadow = table.getColor("controlDkShadow");
344         Color JavaDoc controlHighlight = table.getColor("controlHighlight");
345         Color JavaDoc controlLtHighlight = table.getColor("controlLtHighlight");
346         Color JavaDoc controlShadow = table.getColor("controlShadow");
347         Color JavaDoc controlText = table.getColor("controlText");
348         Color JavaDoc menu = table.getColor("menu");
349         Color JavaDoc menuText = table.getColor("menuText");
350         Color JavaDoc textHighlight = table.getColor("textHighlight");
351         Color JavaDoc textHighlightText = table.getColor("textHighlightText");
352         Color JavaDoc textInactiveText = table.getColor("textInactiveText");
353         Color JavaDoc textText = table.getColor("textText");
354         Color JavaDoc window = table.getColor("window");
355
356         // *** Shared Insets
357
InsetsUIResource zeroInsets = new InsetsUIResource(0,0,0,0);
358         InsetsUIResource twoInsets = new InsetsUIResource(2, 2, 2, 2);
359
360         // *** Shared Borders
361
Object JavaDoc marginBorder = new SwingLazyValue(
362               "javax.swing.plaf.basic.BasicBorders$MarginBorder");
363     Object JavaDoc etchedBorder = new SwingLazyValue(
364               "javax.swing.plaf.BorderUIResource",
365               "getEtchedBorderUIResource");
366         Object JavaDoc loweredBevelBorder = new SwingLazyValue(
367               "javax.swing.plaf.BorderUIResource",
368               "getLoweredBevelBorderUIResource");
369     
370     Object JavaDoc popupMenuBorder = new SwingLazyValue(
371               "javax.swing.plaf.basic.BasicBorders",
372               "getInternalFrameBorder");
373
374         Object JavaDoc blackLineBorder = new SwingLazyValue(
375               "javax.swing.plaf.BorderUIResource",
376               "getBlackLineBorderUIResource");
377     Object JavaDoc focusCellHighlightBorder = new SwingLazyValue(
378               "javax.swing.plaf.BorderUIResource$LineBorderUIResource",
379               null,
380               new Object JavaDoc[] {yellow});
381
382
383     Object JavaDoc tableHeaderBorder = new SwingLazyValue(
384               "javax.swing.plaf.BorderUIResource$BevelBorderUIResource",
385               null,
386               new Object JavaDoc[] { new Integer JavaDoc(BevelBorder.RAISED),
387                      controlLtHighlight,
388                                          control,
389                      controlDkShadow,
390                      controlShadow });
391
392
393     // *** Button value objects
394

395     Object JavaDoc buttonBorder =
396         new SwingLazyValue(
397                 "javax.swing.plaf.basic.BasicBorders",
398                 "getButtonBorder");
399
400     Object JavaDoc buttonToggleBorder =
401         new SwingLazyValue(
402                 "javax.swing.plaf.basic.BasicBorders",
403                 "getToggleButtonBorder");
404
405     Object JavaDoc radioButtonBorder =
406         new SwingLazyValue(
407                 "javax.swing.plaf.basic.BasicBorders",
408                 "getRadioButtonBorder");
409
410     // *** FileChooser / FileView value objects
411

412         Object JavaDoc newFolderIcon = SwingUtilities2.makeIcon(getClass(),
413                                                         BasicLookAndFeel JavaDoc.class,
414                                                         "icons/NewFolder.gif");
415         Object JavaDoc upFolderIcon = SwingUtilities2.makeIcon(getClass(),
416                                                        BasicLookAndFeel JavaDoc.class,
417                                                        "icons/UpFolder.gif");
418         Object JavaDoc homeFolderIcon = SwingUtilities2.makeIcon(getClass(),
419                                                          BasicLookAndFeel JavaDoc.class,
420                                                          "icons/HomeFolder.gif");
421         Object JavaDoc detailsViewIcon = SwingUtilities2.makeIcon(getClass(),
422                                                           BasicLookAndFeel JavaDoc.class,
423                                                           "icons/DetailsView.gif");
424         Object JavaDoc listViewIcon = SwingUtilities2.makeIcon(getClass(),
425                                                        BasicLookAndFeel JavaDoc.class,
426                                                        "icons/ListView.gif");
427         Object JavaDoc directoryIcon = SwingUtilities2.makeIcon(getClass(),
428                                                         BasicLookAndFeel JavaDoc.class,
429                                                         "icons/Directory.gif");
430         Object JavaDoc fileIcon = SwingUtilities2.makeIcon(getClass(),
431                                                    BasicLookAndFeel JavaDoc.class,
432                                                    "icons/File.gif");
433         Object JavaDoc computerIcon = SwingUtilities2.makeIcon(getClass(),
434                                                        BasicLookAndFeel JavaDoc.class,
435                                                        "icons/Computer.gif");
436         Object JavaDoc hardDriveIcon = SwingUtilities2.makeIcon(getClass(),
437                                                         BasicLookAndFeel JavaDoc.class,
438                                                         "icons/HardDrive.gif");
439         Object JavaDoc floppyDriveIcon = SwingUtilities2.makeIcon(getClass(),
440                                                           BasicLookAndFeel JavaDoc.class,
441                                                           "icons/FloppyDrive.gif");
442
443
444     // *** InternalFrame value objects
445

446     Object JavaDoc internalFrameBorder = new SwingLazyValue(
447                 "javax.swing.plaf.basic.BasicBorders",
448         "getInternalFrameBorder");
449
450     // *** List value objects
451

452     Object JavaDoc listCellRendererActiveValue = new UIDefaults.ActiveValue JavaDoc() {
453         public Object JavaDoc createValue(UIDefaults JavaDoc table) {
454         return new DefaultListCellRenderer.UIResource JavaDoc();
455         }
456     };
457
458
459     // *** Menus value objects
460

461     Object JavaDoc menuBarBorder =
462         new SwingLazyValue(
463                 "javax.swing.plaf.basic.BasicBorders",
464         "getMenuBarBorder");
465
466     Object JavaDoc menuItemCheckIcon =
467         new SwingLazyValue(
468         "javax.swing.plaf.basic.BasicIconFactory",
469         "getMenuItemCheckIcon");
470
471     Object JavaDoc menuItemArrowIcon =
472         new SwingLazyValue(
473         "javax.swing.plaf.basic.BasicIconFactory",
474         "getMenuItemArrowIcon");
475
476
477     Object JavaDoc menuArrowIcon =
478         new SwingLazyValue(
479         "javax.swing.plaf.basic.BasicIconFactory",
480         "getMenuArrowIcon");
481
482     Object JavaDoc checkBoxIcon =
483         new SwingLazyValue(
484         "javax.swing.plaf.basic.BasicIconFactory",
485         "getCheckBoxIcon");
486
487     Object JavaDoc radioButtonIcon =
488         new SwingLazyValue(
489         "javax.swing.plaf.basic.BasicIconFactory",
490         "getRadioButtonIcon");
491
492     Object JavaDoc checkBoxMenuItemIcon =
493         new SwingLazyValue(
494         "javax.swing.plaf.basic.BasicIconFactory",
495         "getCheckBoxMenuItemIcon");
496
497     Object JavaDoc radioButtonMenuItemIcon =
498         new SwingLazyValue(
499         "javax.swing.plaf.basic.BasicIconFactory",
500         "getRadioButtonMenuItemIcon");
501
502     Object JavaDoc menuItemAcceleratorDelimiter = new String JavaDoc("+");
503
504     // *** OptionPane value objects
505

506         Object JavaDoc optionPaneMinimumSize = new DimensionUIResource(262, 90);
507
508     Integer JavaDoc zero = new Integer JavaDoc(0);
509         Object JavaDoc zeroBorder = new SwingLazyValue(
510                "javax.swing.plaf.BorderUIResource$EmptyBorderUIResource",
511                new Object JavaDoc[] {zero, zero, zero, zero});
512
513     Integer JavaDoc ten = new Integer JavaDoc(10);
514         Object JavaDoc optionPaneBorder = new SwingLazyValue(
515                "javax.swing.plaf.BorderUIResource$EmptyBorderUIResource",
516                new Object JavaDoc[] {ten, ten, twelve, ten});
517     
518         Object JavaDoc optionPaneButtonAreaBorder = new SwingLazyValue(
519                "javax.swing.plaf.BorderUIResource$EmptyBorderUIResource",
520                new Object JavaDoc[] {new Integer JavaDoc(6), zero, zero, zero});
521
522
523     // *** ProgessBar value objects
524

525     Object JavaDoc progressBarBorder =
526         new SwingLazyValue(
527                 "javax.swing.plaf.basic.BasicBorders",
528                 "getProgressBarBorder");
529
530     // ** ScrollBar value objects
531

532     Object JavaDoc minimumThumbSize = new DimensionUIResource(8,8);
533     Object JavaDoc maximumThumbSize = new DimensionUIResource(4096,4096);
534
535     // ** Slider value objects
536

537     Object JavaDoc sliderFocusInsets = twoInsets;
538
539     Object JavaDoc toolBarSeparatorSize = new DimensionUIResource( 10, 10 );
540
541
542     // *** SplitPane value objects
543

544     Object JavaDoc splitPaneBorder =
545         new SwingLazyValue(
546                 "javax.swing.plaf.basic.BasicBorders",
547                 "getSplitPaneBorder");
548     Object JavaDoc splitPaneDividerBorder =
549         new SwingLazyValue(
550                 "javax.swing.plaf.basic.BasicBorders",
551                 "getSplitPaneDividerBorder");
552
553     // ** TabbedBane value objects
554

555         Object JavaDoc tabbedPaneTabInsets = new InsetsUIResource(0, 4, 1, 4);
556
557         Object JavaDoc tabbedPaneTabPadInsets = new InsetsUIResource(2, 2, 2, 1);
558
559         Object JavaDoc tabbedPaneTabAreaInsets = new InsetsUIResource(3, 2, 0, 2);
560
561         Object JavaDoc tabbedPaneContentBorderInsets = new InsetsUIResource(2, 2, 3, 3);
562
563
564     // *** Text value objects
565

566     Object JavaDoc textFieldBorder =
567         new SwingLazyValue(
568                 "javax.swing.plaf.basic.BasicBorders",
569                 "getTextFieldBorder");
570
571         Object JavaDoc editorMargin = new InsetsUIResource(3,3,3,3);
572
573     Object JavaDoc caretBlinkRate = fiveHundred;
574     Integer JavaDoc four = new Integer JavaDoc(4);
575
576     Object JavaDoc[] allAuditoryCues = new Object JavaDoc[] {
577         "CheckBoxMenuItem.commandSound",
578         "InternalFrame.closeSound",
579         "InternalFrame.maximizeSound",
580         "InternalFrame.minimizeSound",
581         "InternalFrame.restoreDownSound",
582         "InternalFrame.restoreUpSound",
583         "MenuItem.commandSound",
584         "OptionPane.errorSound",
585         "OptionPane.informationSound",
586         "OptionPane.questionSound",
587         "OptionPane.warningSound",
588         "PopupMenu.popupSound",
589         "RadioButtonMenuItem.commandSound"};
590
591     Object JavaDoc[] noAuditoryCues = new Object JavaDoc[] {"mute"};
592
593         // *** Component Defaults
594

595     Object JavaDoc[] defaults = {
596         // *** Auditory Feedback
597
"AuditoryCues.cueList", allAuditoryCues,
598         "AuditoryCues.allAuditoryCues", allAuditoryCues,
599         "AuditoryCues.noAuditoryCues", noAuditoryCues,
600         // this key defines which of the various cues to render.
601
// L&Fs that want auditory feedback NEED to override playList.
602
"AuditoryCues.playList", null,
603
604         // *** Buttons
605
"Button.defaultButtonFollowsFocus", Boolean.TRUE,
606         "Button.font", dialogPlain12,
607         "Button.background", control,
608         "Button.foreground", controlText,
609         "Button.shadow", controlShadow,
610             "Button.darkShadow", controlDkShadow,
611             "Button.light", controlHighlight,
612             "Button.highlight", controlLtHighlight,
613         "Button.border", buttonBorder,
614         "Button.margin", new InsetsUIResource(2, 14, 2, 14),
615         "Button.textIconGap", four,
616         "Button.textShiftOffset", zero,
617         "Button.focusInputMap", new UIDefaults.LazyInputMap JavaDoc(new Object JavaDoc[] {
618                          "SPACE", "pressed",
619                 "released SPACE", "released",
620                          "ENTER", "pressed",
621                 "released ENTER", "released"
622               }),
623
624         "ToggleButton.font", dialogPlain12,
625         "ToggleButton.background", control,
626         "ToggleButton.foreground", controlText,
627         "ToggleButton.shadow", controlShadow,
628             "ToggleButton.darkShadow", controlDkShadow,
629             "ToggleButton.light", controlHighlight,
630             "ToggleButton.highlight", controlLtHighlight,
631         "ToggleButton.border", buttonToggleBorder,
632         "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14),
633         "ToggleButton.textIconGap", four,
634         "ToggleButton.textShiftOffset", zero,
635         "ToggleButton.focusInputMap",
636           new UIDefaults.LazyInputMap JavaDoc(new Object JavaDoc[] {
637                     "SPACE", "pressed",
638                    "released SPACE", "released"
639             }),
640
641         "RadioButton.font", dialogPlain12,
642         "RadioButton.background", control,
643         "RadioButton.foreground", controlText,
644         "RadioButton.shadow", controlShadow,
645             "RadioButton.darkShadow", controlDkShadow,
646             "RadioButton.light", controlHighlight,
647             "RadioButton.highlight", controlLtHighlight,
648         "RadioButton.border", radioButtonBorder,
649         "RadioButton.margin", twoInsets,
650         "RadioButton.textIconGap", four,
651         "RadioButton.textShiftOffset", zero,
652         "RadioButton.icon", radioButtonIcon,
653         "RadioButton.focusInputMap",
654            new UIDefaults.LazyInputMap JavaDoc(new Object JavaDoc[] {
655                           "SPACE", "pressed",
656