KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > java > swing > plaf > motif > MotifLookAndFeel


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

7
8 package com.sun.java.swing.plaf.motif;
9
10 import java.awt.Toolkit JavaDoc;
11 import java.awt.Color JavaDoc;
12 import java.awt.Font JavaDoc;
13 import java.awt.Insets JavaDoc;
14 import java.awt.event.KeyEvent JavaDoc;
15 import java.awt.event.InputEvent JavaDoc;
16 import java.util.*;
17
18 import java.lang.reflect.*;
19
20 import javax.swing.*;
21 import javax.swing.plaf.*;
22 import javax.swing.border.*;
23 import javax.swing.text.JTextComponent JavaDoc;
24 import javax.swing.text.DefaultEditorKit JavaDoc;
25
26 import javax.swing.plaf.basic.BasicLookAndFeel JavaDoc;
27 import javax.swing.plaf.basic.BasicBorders JavaDoc;
28 import javax.swing.plaf.basic.BasicComboBoxRenderer JavaDoc;
29 import javax.swing.plaf.basic.BasicComboBoxEditor JavaDoc;
30
31 import com.sun.java.swing.SwingUtilities2;
32
33 /**
34  * Implements the Motif Look and Feel.
35  * UI classes not implemented specifically for Motif will
36  * default to those implemented in Basic.
37  * <p>
38  * <strong>Warning:</strong>
39  * Serialized objects of this class will not be compatible with
40  * future Swing releases. The current serialization support is appropriate
41  * for short term storage or RMI between applications running the same
42  * version of Swing. A future release of Swing will provide support for
43  * long term persistence.
44  *
45  * @version 1.171 02/08/05
46  * @author unattributed
47  */

48 public class MotifLookAndFeel extends BasicLookAndFeel JavaDoc
49 {
50     public String JavaDoc getName() {
51         return "CDE/Motif";
52     }
53
54     public String JavaDoc getID() {
55         return "Motif";
56     }
57
58     public String JavaDoc getDescription() {
59         return "The CDE/Motif Look and Feel";
60     }
61
62
63     public boolean isNativeLookAndFeel() {
64         String JavaDoc osName = System.getProperty("os.name");
65         return (osName != null) &&
66            (osName.indexOf("SunOS") != -1 || osName.indexOf("Solaris") != -1);
67     }
68
69
70     public boolean isSupportedLookAndFeel() {
71         return true;
72     }
73
74
75     /**
76      * Load the SystemColors into the defaults table. The keys
77      * for SystemColor defaults are the same as the names of
78      * the public fields in SystemColor. If the table is being
79      * created on a native Motif platform we use the SystemColor
80      * values, otherwise we create color objects whose values match
81      * the default CDE/Motif colors.
82      */

83     protected void initSystemColorDefaults(UIDefaults table)
84     {
85         String JavaDoc[] defaultSystemColors = {
86                   "desktop", "#005C5C", /* Color of the desktop background */
87             "activeCaption", "#000080", /* Color for captions (title bars) when they are active. */
88         "activeCaptionText", "#FFFFFF", /* Text color for text in captions (title bars). */
89       "activeCaptionBorder", "#B24D7A", /* Border color for caption (title bar) window borders. */
90           "inactiveCaption", "#AEB2C3", /* Color for captions (title bars) when not active. */
91       "inactiveCaptionText", "#000000", /* Text color for text in inactive captions (title bars). */
92     "inactiveCaptionBorder", "#AEB2C3", /* Border color for inactive caption (title bar) window borders. */
93                    "window", "#AEB2C3", /* Default color for the interior of windows */
94              "windowBorder", "#AEB2C3", /* ??? */
95                "windowText", "#000000", /* ??? */
96                      "menu", "#AEB2C3", /* ??? */
97                  "menuText", "#000000", /* ??? */
98                      "text", "#FFF7E9", /* Text background color */
99                  "textText", "#000000", /* Text foreground color */
100             "textHighlight", "#000000", /* Text background color when selected */
101         "textHighlightText", "#FFF7E9", /* Text color when selected */
102          "textInactiveText", "#808080", /* Text color when disabled */
103                   "control", "#AEB2C3", /* Default color for controls (buttons, sliders, etc) */
104               "controlText", "#000000", /* Default color for text in controls */
105          "controlHighlight", "#DCDEE5", /* Highlight color for controls */
106        "controlLtHighlight", "#DCDEE5", /* Light highlight color for controls */
107             "controlShadow", "#63656F", /* Shadow color for controls */
108        "controlLightShadow", "#9397A5", /* Shadow color for controls */
109           "controlDkShadow", "#000000", /* Dark shadow color for controls */
110                 "scrollbar", "#AEB2C3", /* Scrollbar ??? color. PENDING(jeff) foreground? background? ?*/
111                      "info", "#FFF7E9", /* ??? */
112                  "infoText", "#000000" /* ??? */
113         };
114
115         // AWT SystemColors only for for CDE on JDK1.2
116
loadSystemColors(table, defaultSystemColors, false/*is1dot2*/);
117     }
118
119
120     protected void initClassDefaults(UIDefaults table)
121     {
122         super.initClassDefaults(table);
123         String JavaDoc motifPackageName = "com.sun.java.swing.plaf.motif.";
124
125         Object JavaDoc[] uiDefaults = {
126                    "ButtonUI", motifPackageName + "MotifButtonUI",
127                  "CheckBoxUI", motifPackageName + "MotifCheckBoxUI",
128             "DirectoryPaneUI", motifPackageName + "MotifDirectoryPaneUI",
129               "FileChooserUI", motifPackageName + "MotifFileChooserUI",
130                     "LabelUI", motifPackageName + "MotifLabelUI",
131                   "MenuBarUI", motifPackageName + "MotifMenuBarUI",
132                      "MenuUI", motifPackageName + "MotifMenuUI",
133                  "MenuItemUI", motifPackageName + "MotifMenuItemUI",
134          "CheckBoxMenuItemUI", motifPackageName + "MotifCheckBoxMenuItemUI",
135       "RadioButtonMenuItemUI", motifPackageName + "MotifRadioButtonMenuItemUI",
136               "RadioButtonUI", motifPackageName + "MotifRadioButtonUI",
137              "ToggleButtonUI", motifPackageName + "MotifToggleButtonUI",
138                 "PopupMenuUI", motifPackageName + "MotifPopupMenuUI",
139               "ProgressBarUI", motifPackageName + "MotifProgressBarUI",
140                 "ScrollBarUI", motifPackageName + "MotifScrollBarUI",
141                "ScrollPaneUI", motifPackageName + "MotifScrollPaneUI",
142                    "SliderUI", motifPackageName + "MotifSliderUI",
143                 "SplitPaneUI", motifPackageName + "MotifSplitPaneUI",
144                "TabbedPaneUI", motifPackageName + "MotifTabbedPaneUI",
145                  "TextAreaUI", motifPackageName + "MotifTextAreaUI",
146                 "TextFieldUI", motifPackageName + "MotifTextFieldUI",
147             "PasswordFieldUI", motifPackageName + "MotifPasswordFieldUI",
148                  "TextPaneUI", motifPackageName + "MotifTextPaneUI",
149                "EditorPaneUI", motifPackageName + "MotifEditorPaneUI",
150                      "TreeUI", motifPackageName + "MotifTreeUI",
151             "InternalFrameUI", motifPackageName + "MotifInternalFrameUI",
152               "DesktopPaneUI", motifPackageName + "MotifDesktopPaneUI",
153                 "SeparatorUI", motifPackageName + "MotifSeparatorUI",
154        "PopupMenuSeparatorUI", motifPackageName + "MotifPopupMenuSeparatorUI",
155                "OptionPaneUI", motifPackageName + "MotifOptionPaneUI",
156                  "ComboBoxUI", motifPackageName + "MotifComboBoxUI",
157               "DesktopIconUI", motifPackageName + "MotifDesktopIconUI"
158         };
159
160         table.putDefaults(uiDefaults);
161     }
162
163
164     /**
165      * Initialize the defaults table with the name of the ResourceBundle
166      * used for getting localized defaults.
167      */

168     private void initResourceBundle(UIDefaults table) {
169         table.addResourceBundle( "com.sun.java.swing.plaf.motif.resources.motif" );
170     }
171
172
173     protected void initComponentDefaults(UIDefaults table)
174     {
175         super.initComponentDefaults(table);
176
177         initResourceBundle(table);
178
179         FontUIResource dialogPlain12 = new FontUIResource("Dialog",
180                                                           Font.PLAIN, 12);
181         FontUIResource serifPlain12 = new FontUIResource("Serif",
182                                                           Font.PLAIN, 12);
183         FontUIResource sansSerifPlain12 = new FontUIResource("SansSerif",
184                                                           Font.PLAIN, 12);
185         FontUIResource monospacedPlain12 = new FontUIResource("Monospaced",
186                                                           Font.PLAIN, 12);
187         ColorUIResource red = new ColorUIResource(Color.red);
188         ColorUIResource black = new ColorUIResource(Color.black);
189         ColorUIResource white = new ColorUIResource(Color.white);
190         ColorUIResource lightGray = new ColorUIResource(Color.lightGray);
191         ColorUIResource controlDarker = new ColorUIResource(147, 151, 165); // slate blue
192
ColorUIResource scrollBarTrack = controlDarker;
193         ColorUIResource menuItemPressedBackground = new ColorUIResource(165,165,165);
194         ColorUIResource menuItemPressedForeground = new ColorUIResource(0,0,0);
195
196
197         Border loweredBevelBorder = new MotifBorders.BevelBorder(false,
198                                            table.getColor("controlShadow"),
199                                            table.getColor("controlLtHighlight"));
200
201         Border raisedBevelBorder = new MotifBorders.BevelBorder(true, table.getColor("controlShadow"),
202                                            table.getColor("controlLtHighlight"));
203
204         Border marginBorder = new BasicBorders.MarginBorder JavaDoc();
205
206         Border focusBorder = new MotifBorders.FocusBorder(
207                                            table.getColor("control"),
208                                            table.getColor("activeCaptionBorder"));
209
210
211         Border focusBevelBorder = new BorderUIResource.CompoundBorderUIResource(
212                                           focusBorder,
213                                           loweredBevelBorder);
214
215         Border comboBoxBorder = new BorderUIResource.CompoundBorderUIResource(
216                                           focusBorder,
217                                           raisedBevelBorder);
218
219
220         Border buttonBorder = new BorderUIResource.CompoundBorderUIResource(
221                                       new MotifBorders.ButtonBorder(
222                                           table.getColor("Button.shadow"),
223                                           table.getColor("Button.highlight"),
224                                           table.getColor("Button.darkShadow"),
225                                           table.getColor("activeCaptionBorder")),
226                                       marginBorder);
227
228         Border toggleButtonBorder = new BorderUIResource.CompoundBorderUIResource(
229                                       new MotifBorders.ToggleButtonBorder(
230                                           table.getColor("ToggleButton.shadow"),
231                                           table.getColor("ToggleButton.highlight"),
232                                           table.getColor("ToggleButton.darkShadow"),
233                                           table.getColor("activeCaptionBorder")), marginBorder);
234
235         Border textFieldBorder = new BorderUIResource.CompoundBorderUIResource(
236                                       focusBevelBorder,
237                                       marginBorder);
238
239     Border popupMenuBorder = new BorderUIResource.CompoundBorderUIResource(
240                       raisedBevelBorder,
241                       new MotifBorders.MotifPopupMenuBorder(
242                                         table.getFont("PopupMenu.font"),
243                                         table.getColor("PopupMenu.background"),
244                                         table.getColor("PopupMenu.foreground"),
245                                         table.getColor("controlShadow"),
246                                         table.getColor("controlLtHighlight")
247                     ));
248
249         Object JavaDoc menuItemCheckIcon = new UIDefaults.LazyValue() {
250             public Object JavaDoc createValue(UIDefaults table) {
251                 return MotifIconFactory.getMenuItemCheckIcon();
252             }
253         };
254
255         Object JavaDoc menuItemArrowIcon = new UIDefaults.LazyValue() {
256             public Object JavaDoc createValue(UIDefaults table) {
257                 return MotifIconFactory.getMenuItemArrowIcon();
258             }
259         };
260
261         Object JavaDoc menuArrowIcon = new UIDefaults.LazyValue() {
262             public Object JavaDoc createValue(UIDefaults table) {
263                 return MotifIconFactory.getMenuArrowIcon();
264             }
265         };
266
267         Object JavaDoc checkBoxIcon = new UIDefaults.LazyValue() {
268             public Object JavaDoc createValue(UIDefaults table) {
269                 return MotifIconFactory.getCheckBoxIcon();
270             }
271         };
272
273         Object JavaDoc radioButtonIcon = new UIDefaults.LazyValue() {
274             public Object JavaDoc createValue(UIDefaults table) {
275                 return MotifIconFactory.getRadioButtonIcon();
276             }
277         };
278
279         Object JavaDoc unselectedTabBackground = new UIDefaults.LazyValue() {
280             public Object JavaDoc createValue(UIDefaults table) {
281                 Color JavaDoc c = (Color JavaDoc)table.getColor("control");
282                 return new ColorUIResource(Math.max((int)(c.getRed()*.85),0),
283                                            Math.max((int)(c.getGreen()*.85),0),
284                                            Math.max((int)(c.getBlue()*.85),0));
285             }
286         };
287
288         Object JavaDoc unselectedTabForeground = new UIDefaults.LazyValue() {
289             public Object JavaDoc createValue(UIDefaults table) {
290                 Color JavaDoc c = (Color JavaDoc)table.getColor("controlText");
291                 return new ColorUIResource(Math.max((int)(c.getRed()*.85),0),
292                                            Math.max((int)(c.getGreen()*.85),0),
293                                            Math.max((int)(c.getBlue()*.85),0));
294             }
295         };
296
297         Object JavaDoc unselectedTabShadow = new UIDefaults.LazyValue() {
298             public Object JavaDoc createValue(UIDefaults table) {
299                 Color JavaDoc c = (Color JavaDoc)table.getColor("control");
300                 Color JavaDoc base = new Color JavaDoc(Math.max((int)(c.getRed()*.85),0),
301                                        Math.max((int)(c.getGreen()*.85),0),
302                                        Math.max((int)(c.getBlue()*.85),0));
303                 return new ColorUIResource(base.darker());
304             }
305         };
306
307         Object JavaDoc unselectedTabHighlight = new UIDefaults.LazyValue() {
308             public Object JavaDoc createValue(UIDefaults table) {
309                 Color JavaDoc c = (Color JavaDoc)table.getColor("control");
310                 Color JavaDoc base = new Color JavaDoc(Math.max((int)(c.getRed()*.85),0),
311                                        Math.max((int)(c.getGreen()*.85),0),
312                                        Math.max((int)(c.getBlue()*.85),0));
313                 return new ColorUIResource(base.brighter());
314             }
315         };
316
317     // *** Text
318

319     Object JavaDoc fieldInputMap = new UIDefaults.LazyInputMap(new Object JavaDoc[] {
320                "COPY", DefaultEditorKit.copyAction,
321               "PASTE", DefaultEditorKit.pasteAction,
322                 "CUT", DefaultEditorKit.cutAction,
323              "control INSERT", DefaultEditorKit.copyAction,
324                "shift INSERT", DefaultEditorKit.pasteAction,
325                "shift DELETE", DefaultEditorKit.cutAction,
326                   "control F", DefaultEditorKit.forwardAction,
327                   "control B", DefaultEditorKit.backwardAction,
328                   "control D", DefaultEditorKit.deleteNextCharAction,
329                      "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
330                          "ctrl H", DefaultEditorKit.deletePrevCharAction,
331                          "DELETE", DefaultEditorKit.deleteNextCharAction,
332                           "RIGHT", DefaultEditorKit.forwardAction,
333                            "LEFT", DefaultEditorKit.backwardAction,
334                        "KP_RIGHT", DefaultEditorKit.forwardAction,
335                         "KP_LEFT", DefaultEditorKit.backwardAction,
336                  "shift LEFT", DefaultEditorKit.selectionBackwardAction,
337                 "shift RIGHT", DefaultEditorKit.selectionForwardAction,
338                "control LEFT", DefaultEditorKit.previousWordAction,
339               "control RIGHT", DefaultEditorKit.nextWordAction,
340          "control shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
341         "control shift RIGHT", DefaultEditorKit.selectionNextWordAction,
342               "control SLASH", DefaultEditorKit.selectAllAction,
343                        "HOME", DefaultEditorKit.beginLineAction,
344                         "END", DefaultEditorKit.endLineAction,
345                  "shift HOME", DefaultEditorKit.selectionBeginLineAction,
346                   "shift END", DefaultEditorKit.selectionEndLineAction,
347          "control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
348                       "ENTER", JTextField.notifyAction,
349                 "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
350     });
351
352         Object JavaDoc passwordInputMap = new UIDefaults.LazyInputMap(new Object JavaDoc[] {
353                            "COPY", DefaultEditorKit.copyAction,
354                           "PASTE", DefaultEditorKit.pasteAction,
355                             "CUT", DefaultEditorKit.cutAction,
356                  "control INSERT", DefaultEditorKit.copyAction,
357                    "shift INSERT", DefaultEditorKit.pasteAction,
358                    "shift DELETE", DefaultEditorKit.cutAction,
359                       "control F", DefaultEditorKit.forwardAction,
360                       "control B", DefaultEditorKit.backwardAction,
361                       "control D", DefaultEditorKit.deleteNextCharAction,
362                      "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
363                          "ctrl H", DefaultEditorKit.deletePrevCharAction,
364                          "DELETE", DefaultEditorKit.deleteNextCharAction,
365                           "RIGHT", DefaultEditorKit.forwardAction,
366                            "LEFT", DefaultEditorKit.backwardAction,
367                        "KP_RIGHT", DefaultEditorKit.forwardAction,
368                         "KP_LEFT", DefaultEditorKit.backwardAction,
369                      "shift LEFT", DefaultEditorKit.selectionBackwardAction,
370                     "shift RIGHT", DefaultEditorKit.selectionForwardAction,
371                    "control LEFT", DefaultEditorKit.beginLineAction,
372                   "control RIGHT", DefaultEditorKit.endLineAction,
373              "control shift LEFT", DefaultEditorKit.selectionBeginLineAction,
374             "control shift RIGHT", DefaultEditorKit.selectionEndLineAction,
375                   "control SLASH", DefaultEditorKit.selectAllAction,
376                            "HOME", DefaultEditorKit.beginLineAction,
377                             "END", DefaultEditorKit.endLineAction,
378                      "shift HOME", DefaultEditorKit.selectionBeginLineAction,
379                       "shift END", DefaultEditorKit.selectionEndLineAction,
380              "control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
381                           "ENTER", JTextField.notifyAction,
382                 "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
383         });
384
385     Object JavaDoc multilineInputMap = new UIDefaults.LazyInputMap(new Object JavaDoc[] {
386                "COPY", DefaultEditorKit.copyAction,
387               "PASTE", DefaultEditorKit.pasteAction,
388                 "CUT", DefaultEditorKit.cutAction,
389              "control INSERT", DefaultEditorKit.copyAction,
390                "shift INSERT", DefaultEditorKit.pasteAction,
391                "shift DELETE", DefaultEditorKit.cutAction,
392                   "control F", DefaultEditorKit.forwardAction,
393                   "control B", DefaultEditorKit.backwardAction,
394                   "control D", DefaultEditorKit.deleteNextCharAction,
395                      "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
396                          "ctrl H", DefaultEditorKit.deletePrevCharAction,
397                          "DELETE", DefaultEditorKit.deleteNextCharAction,
398                           "RIGHT", DefaultEditorKit.forwardAction,
399                            "LEFT", DefaultEditorKit.backwardAction,
400                        "KP_RIGHT", DefaultEditorKit.forwardAction,
401                         "KP_LEFT", DefaultEditorKit.backwardAction,
402                  "shift LEFT", DefaultEditorKit.selectionBackwardAction,
403                 "shift RIGHT", DefaultEditorKit.selectionForwardAction,
404                "control LEFT", DefaultEditorKit.previousWordAction,
405               "control RIGHT", DefaultEditorKit.nextWordAction,
406          "control shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
407         "control shift RIGHT", DefaultEditorKit.selectionNextWordAction,
408               "control SLASH", DefaultEditorKit.selectAllAction,
409                        "HOME", DefaultEditorKit.beginLineAction,
410                         "END", DefaultEditorKit.endLineAction,
411                  "shift HOME", DefaultEditorKit.selectionBeginLineAction,
412                   "shift END", DefaultEditorKit.selectionEndLineAction,
413
414               "control N", DefaultEditorKit.downAction,
415               "control P", DefaultEditorKit.upAction,
416                  "UP", DefaultEditorKit.upAction,
417                "DOWN", DefaultEditorKit.downAction,
418             "PAGE_UP", DefaultEditorKit.pageUpAction,
419               "PAGE_DOWN", DefaultEditorKit.pageDownAction,
420           "shift PAGE_UP", "selection-page-up",
421             "shift PAGE_DOWN", "selection-page-down",
422          "ctrl shift PAGE_UP", "selection-page-left",
423        "ctrl shift PAGE_DOWN", "selection-page-right",
424                "shift UP", DefaultEditorKit.selectionUpAction,
425              "shift DOWN", DefaultEditorKit.selectionDownAction,
426               "ENTER", DefaultEditorKit.insertBreakAction,
427                 "TAB", DefaultEditorKit.insertTabAction,
428          "control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
429            "control HOME", DefaultEditorKit.beginAction,
430             "control END", DefaultEditorKit.endAction,
431          "control shift HOME", DefaultEditorKit.selectionBeginAction,
432           "control shift END", DefaultEditorKit.selectionEndAction,
433                       "control T", "next-link-action",
434                 "control shift T", "previous-link-action",
435                   "control SPACE", "activate-link-action",
436                 "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
437     });
438
439         // *** Tree
440

441         Object JavaDoc treeOpenIcon = SwingUtilities2.makeIcon(getClass(),
442                                                        MotifLookAndFeel.class,
443                                                        "icons/TreeOpen.gif");
444
445         Object JavaDoc treeClosedIcon = SwingUtilities2.makeIcon(getClass(),
446                                                          MotifLookAndFeel.class,
447                                                          "icons/TreeClosed.gif");
448
449         Object JavaDoc treeLeafIcon = new UIDefaults.LazyValue() {
450             public Object JavaDoc createValue(UIDefaults table) {
451                 return MotifTreeCellRenderer.loadLeafIcon();
452             }
453         };
454
455         Object JavaDoc treeExpandedIcon = new UIDefaults.LazyValue() {
456             public Object JavaDoc createValue(UIDefaults table) {
457                 return MotifTreeUI.MotifExpandedIcon.createExpandedIcon();
458             }
459         };
460
461         Object JavaDoc treeCollapsedIcon = new UIDefaults.LazyValue() {
462             public Object JavaDoc createValue(UIDefaults table) {
463                 return MotifTreeUI.MotifCollapsedIcon.createCollapsedIcon();
464             }
465         };
466
467         Border menuBarBorder = new MotifBorders.MenuBarBorder(
468                                           table.getColor("MenuBar.shadow"),
469                                           table.getColor("MenuBar.highlight"),
470                                           table.getColor("MenuBar.darkShadow"),
471                                           table.getColor("activeCaptionBorder"));
472
473
474         Border menuMarginBorder = new BorderUIResource.CompoundBorderUIResource(
475                                           loweredBevelBorder,
476                                           marginBorder);
477
478
479         Border focusCellHighlightBorder = new BorderUIResource.LineBorderUIResource(
480                                                 table.getColor("activeCaptionBorder"));
481
482     Object JavaDoc sliderFocusInsets = new InsetsUIResource( 0, 0, 0, 0 );
483
484     // ** for tabbedpane
485

486         Object JavaDoc tabbedPaneTabInsets = new InsetsUIResource(3, 4, 3, 4);
487
488         Object JavaDoc tabbedPaneTabPadInsets = new InsetsUIResource(3, 0, 1, 0);
489      
490     Object JavaDoc tabbedPaneTabAreaInsets = new InsetsUIResource(4, 2, 0, 8);
491
492         Object JavaDoc tabbedPaneContentBorderInsets = new InsetsUIResource(2, 2, 2, 2);
493
494
495         // ** for optionpane
496

497         Object JavaDoc optionPaneBorder = new BorderUIResource.EmptyBorderUIResource(10,0,0,0);
498
499         Object JavaDoc optionPaneButtonAreaBorder = new BorderUIResource.EmptyBorderUIResource(10,10,10,10);
500
501         Object JavaDoc optionPaneMessageAreaBorder = new BorderUIResource.EmptyBorderUIResource(10,10,12,10);
502
503
504         Object JavaDoc[] defaults = {
505
506             "Desktop.background", table.get("desktop"),
507         "Desktop.ancestorInputMap",
508            new UIDefaults.LazyInputMap(new Object JavaDoc[] {
509          "ctrl F5", "restore",
510          "ctrl F4", "close",
511          "ctrl F7", "move",
512          "ctrl F8", "resize",
513            "RIGHT", "right",
514         "KP_RIGHT", "right",
515              "shift RIGHT", "shrinkRight",
516           "shift KP_RIGHT", "shrinkRight",
517             "LEFT", "left",
518          "KP_LEFT", "left",
519               "shift LEFT", "shrinkLeft",
520            "shift KP_LEFT", "shrinkLeft",
521               "UP", "up",
522            "KP_UP", "up",
523                 "shift UP", "shrinkUp",
524              "shift KP_UP", "shrinkUp",
525             "DOWN", "down",
526          "KP_DOWN", "down",
527               "shift DOWN", "shrinkDown",
528            "shift KP_DOWN", "shrinkDown",
529           "ESCAPE", "escape",
530          "ctrl F9", "minimize",
531         "ctrl F10", "maximize",
532          "ctrl F6", "selectNextFrame",
533         "ctrl TAB", "selectNextFrame",
534          "ctrl alt F6", "selectNextFrame",
535        "shift ctrl alt F6", "selectPreviousFrame",
536                 "ctrl F12", "navigateNext",
537           "shift ctrl F12", "navigatePrevious"
538           }),
539
540             "Panel.background", table.get("control"),
541             "Panel.foreground", table.get("textText"),
542             "Panel.font", dialogPlain12,
543
544             "ProgressBar.font", dialogPlain12,
545             "ProgressBar.foreground", controlDarker,
546             "ProgressBar.background", table.get("control"),
547         "ProgressBar.selectionForeground", table.get("control"),
548         "ProgressBar.selectionBackground", table.get("controlText"),
549         "ProgressBar.border", loweredBevelBorder,
550             "ProgressBar.cellLength", new Integer JavaDoc(6),
551             "ProgressBar.cellSpacing", new Integer JavaDoc(0),
552
553         // Buttons
554
"Button.margin", new InsetsUIResource(2, 4, 2, 4),
555             "Button.border", buttonBorder,
556             "Button.background", table.get("control"),
557             "Button.foreground", table.get("controlText"),
558             "Button.select", table.get("controlLightShadow"),
559             "Button.font", dialogPlain12,
560             "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object JavaDoc[] {
561                           "SPACE", "pressed",
562                  "released SPACE", "released"
563               }),
564
565         "CheckBox.textIconGap", new Integer JavaDoc(8),
566         "CheckBox.margin", new InsetsUIResource(4, 2, 4, 2),
567             "CheckBox.icon", checkBoxIcon,
568             "CheckBox.focus", table.get("activeCaptionBorder"),
569         "CheckBox.focusInputMap",
570            new UIDefaults.LazyInputMap(new Object JavaDoc[] {
571                     "SPACE", "pressed",
572                    "released SPACE", "released"
573          }),
574
575         "RadioButton.margin", new InsetsUIResource(4, 2, 4, 2),
576         "RadioButton.textIconGap", new Integer JavaDoc(8),
577             "RadioButton.background", table.get("control"),
578             "RadioButton.foreground", table.get("controlText"),
579             "RadioButton.icon", radioButtonIcon,
580             "RadioButton.focus", table.get("activeCaptionBorder"),
581             "RadioButton.icon", radioButtonIcon,
582         "RadioButton.focusInputMap",
583            new UIDefaults.LazyInputMap(new Object JavaDoc[] {
584                           "SPACE", "pressed",
585                  "released SPACE", "released"
586           }),
587
588             "ToggleButton.border", toggleButtonBorder,
589             "ToggleButton.background", table.get("control"),
590             "ToggleButton.foreground", table.get("controlText"),
591             "ToggleButton.focus", table.get("controlText"),
592             "ToggleButton.select", table.get("controlLightShadow"),
593         "ToggleButton.focusInputMap",
594           new UIDefaults.LazyInputMap(new Object JavaDoc[] {
595                     "SPACE", "pressed",
596                    "released SPACE", "released"
597             }),
598
599         // Menus
600
"Menu.border", menuMarginBorder,
601             "Menu.font", dialogPlain12,
602             "Menu.acceleratorFont", dialogPlain12,
603             "Menu.foreground", table.get("menuText"),
604             "Menu.background", table.get("menu"),
605             "Menu.selectionForeground", menuItemPressedForeground,
606             "Menu.selectionBackground", menuItemPressedBackground,
607             "Menu.checkIcon", menuItemCheckIcon,
608             "Menu.arrowIcon", menuArrowIcon,
609         "Menu.menuPopupOffsetX", new Integer JavaDoc(0),
610         "Menu.menuPopupOffsetY", new Integer JavaDoc(0),
611         "Menu.submenuPopupOffsetX", new Integer JavaDoc(-2),
612         "Menu.submenuPopupOffsetY", new Integer JavaDoc(3),
613             "Menu.shortcutKeys", new int[] {KeyEvent.ALT_MASK,
614                                             KeyEvent.META_MASK},
615
616             "MenuBar.border", menuBarBorder,
617             "MenuBar.background", table.get("menu"),
618             "MenuBar.foreground", table.get("menuText"),
619             "MenuBar.font", dialogPlain12,
620         "MenuBar.windowBindings", new Object JavaDoc[] {
621         "F10", "takeFocus" },
622
623             "MenuItem.border", menuMarginBorder,
624             "MenuItem.font", dialogPlain12,
625             "MenuItem.acceleratorFont", dialogPlain12,
626             "MenuItem.foreground", table.get("menuText"),
627             "MenuItem.background", table.get("menu"),
628             "MenuItem.selectionForeground", menuItemPressedForeground,
629             "MenuItem.selectionBackground", menuItemPressedBackground,
630             "MenuItem.checkIcon", menuItemCheckIcon,
631             "MenuItem.arrowIcon", menuItemArrowIcon,
632
633             "RadioButtonMenuItem.border", menuMarginBorder,
634             "RadioButtonMenuItem.font", dialogPlain12,
635             "RadioButtonMenuItem.acceleratorFont", dialogPlain12,
636             "RadioButtonMenuItem.foreground", table.get("menuText"),
637             "RadioButtonMenuItem.background", table.get("menu"),
638             "RadioButtonMenuItem.selectionForeground", menuItemPressedForeground,
639             "RadioButtonMenuItem.selectionBackground", menuItemPressedBackground,
640             "RadioButtonMenuItem.checkIcon", radioButtonIcon,
641             "RadioButtonMenuItem.arrowIcon", menuItemArrowIcon,
642
643             "CheckBoxMenuItem.border", menuMarginBorder,
644             "CheckBoxMenuItem.font", dialogPlain12,
645             "CheckBoxMenuItem.acceleratorFont", dialogPlain12,
646             "CheckBoxMenuItem.foreground", table.get("menuText"),
647             "CheckBoxMenuItem.background", table.get("menu"),
648             "CheckBoxMenuItem.selectionForeground", menuItemPressedForeground,
649             "CheckBoxMenuItem.selectionBackground", menuItemPressedBackground,
650             "CheckBoxMenuItem.checkIcon", checkBoxIcon,
651             "CheckBoxMenuItem.arrowIcon", menuItemArrowIcon,
652
653             "PopupMenu.background", table.get("menu"),
654             "PopupMenu.border", popupMenuBorder,
655             "PopupMenu.foreground", table.get("menuText"),
656             "PopupMenu.font", dialogPlain12,
657             "PopupMenu.consumeEventOnClose", Boolean.TRUE,
658
659             "Label.font", dialogPlain12,
660             "Label.background", table.get("control"),
661             "Label.foreground", table.get("controlText"),
662
663             "Separator.shadow", table.get("controlShadow"), // DEPRECATED - DO NOT USE!
664
"Separator.highlight", table.get("controlLtHighlight"), // DEPRECATED - DO NOT USE!
665

666             "Separator.background", table.get("controlLtHighlight"),
667             "Separator.foreground", table.get("controlShadow"),
668
669             "List.focusCellHighlightBorder", focusCellHighlightBorder,
670         "List.focusInputMap",
671            new UIDefaults.LazyInputMap(new Object JavaDoc[] {
672                  "COPY", "copy",
673                 "PASTE", "paste",
674                   "CUT", "cut",
675                "control INSERT", "copy",
676                  "shift INSERT", "paste",
677                  "shift DELETE", "cut",
678                        "UP", "selectPreviousRow",
679                     "KP_UP", "selectPreviousRow",
680                  "shift UP", "selectPreviousRowExtendSelection",
681               "shift KP_UP", "selectPreviousRowExtendSelection",
682                     "ctrl shift UP", "selectPreviousRowExtendSelection",
683                  "ctrl shift KP_UP", "selectPreviousRowExtendSelection",
684                           "ctrl UP", "selectPreviousRowChangeLead",
685                        "ctrl KP_UP", "selectPreviousRowChangeLead",
686                      "DOWN", "selectNextRow",
687                   "KP_DOWN", "selectNextRow",
688                "shift DOWN", "selectNextRowExtendSelection",
689             "shift KP_DOWN", "selectNextRowExtendSelection",
690                   "ctrl shift DOWN", "selectNextRowExtendSelection",
691                "ctrl shift KP_DOWN", "selectNextRowExtendSelection",
692                         "ctrl DOWN", "selectNextRowChangeLead",
693                      "ctrl KP_DOWN", "selectNextRowChangeLead",
694                      "LEFT", "selectPreviousColumn",
695                   "KP_LEFT", "selectPreviousColumn",
696                "shift LEFT", "selectPreviousColumnExtendSelection",
697             "shift KP_LEFT", "selectPreviousColumnExtendSelection",
698                   "ctrl shift LEFT", "selectPreviousColumnExtendSelection",
699                "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
700                         "ctrl LEFT", "selectPreviousColumnChangeLead",
701                      "ctrl KP_LEFT", "selectPreviousColumnChangeLead",
702                     "RIGHT", "selectNextColumn",
703                  "KP_RIGHT", "selectNextColumn",
704               "shift RIGHT", "selectNextColumnExtendSelection",
705            "shift KP_RIGHT", "selectNextColumnExtendSelection",
706                  "ctrl shift RIGHT", "selectNextColumnExtendSelection",
707               "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
708                        "ctrl RIGHT", "selectNextColumnChangeLead",
709                     "ctrl KP_RIGHT", "selectNextColumnChangeLead",
710                      "HOME", "selectFirstRow",
711                "shift HOME", "selectFirstRowExtendSelection",
712                   "ctrl shift HOME", "selectFirstRowExtendSelection",
713                         "ctrl HOME", "selectFirstRowChangeLead",
714                       "END", "selectLastRow",
715                 "shift END", "selectLastRowExtendSelection",
716                    "ctrl shift END", "selectLastRowExtendSelection",
717                          "ctrl END", "selectLastRowChangeLead",
718                   "PAGE_UP", "scrollUp",
719             "shift PAGE_UP", "scrollUpExtendSelection",
720                "ctrl shift PAGE_UP", "scrollUpExtendSelection",
721                      "ctrl PAGE_UP", "scrollUpChangeLead",
722                 "PAGE_DOWN", "scrollDown",
723           "shift PAGE_DOWN", "scrollDownExtendSelection",
724              "ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
725                    "ctrl PAGE_DOWN", "scrollDownChangeLead",
726                    "ctrl A", "selectAll",
727                "ctrl SLASH", "selectAll",
728           "ctrl BACK_SLASH", "clearSelection",
729                             "SPACE", "addToSelection",
730                        "ctrl SPACE", "toggleAndAnchor",
731                       "shift SPACE", "extendTo",
732                  "ctrl shift SPACE", "moveSelectionTo"
733          }),
734
735             "DesktopIcon.icon", SwingUtilities2.makeIcon(getClass(),
736                                                          MotifLookAndFeel.class,
737                                                          "icons/DesktopIcon.gif"),
738         "DesktopIcon.border", null,
739         // These are a little odd, MotifInternalFrameUI isntalls em!
740
"DesktopIcon.windowBindings", new Object JavaDoc[]
741           { "ESCAPE", "hideSystemMenu" },
742
743         "InternalFrame.activeTitleBackground", table.get("activeCaptionBorder"),
744         "InternalFrame.inactiveTitleBackground", table.get("inactiveCaptionBorder"),
745         "InternalFrame.windowBindings", new Object JavaDoc[] {
746         "shift ESCAPE", "showSystemMenu",
747           "ctrl SPACE", "showSystemMenu",
748                   "ESCAPE", "hideSystemMenu"
749         },
750
751             "ScrollBar.background", scrollBarTrack,
752             "ScrollBar.foreground", table.get("control"),
753             "ScrollBar.track", scrollBarTrack,
754             "ScrollBar.trackHighlight", table.get("controlDkShadow"),
755             "ScrollBar.thumb", table.get("control"),
756             "ScrollBar.thumbHighlight", table.get("controlHighlight"),
757             "ScrollBar.thumbDarkShadow", table.get("controlDkShadow"),
758             "ScrollBar.thumbShadow", table.get("controlShadow"),
759             "ScrollBar.border", loweredBevelBorder,
760         "ScrollBar.allowsAbsolutePositioning", Boolean.TRUE,
761         "ScrollBar.ancestorInputMap",
762            new UIDefaults.LazyInputMap(new Object JavaDoc[] {
763                "RIGHT", "positiveUnitIncrement",
764             "KP_RIGHT", "positiveUnitIncrement",
765                 "DOWN", "positiveUnitIncrement",
766              "KP_DOWN", "positiveUnitIncrement",
767            "PAGE_DOWN", "positiveBlockIncrement",
768           "ctrl PAGE_DOWN", "positiveBlockIncrement",
769                 "LEFT", "negativeUnitIncrement",
770              "KP_LEFT", "negativeUnitIncrement",
771                   "UP", "negativeUnitIncrement",
772                "KP_UP", "negativeUnitIncrement",
773              "PAGE_UP", "negativeBlockIncrement",
774             "ctrl PAGE_UP", "negativeBlockIncrement",
775                 "HOME", "minScroll",
776                  "END", "maxScroll"
777          }),
778  
779             "ScrollPane.font", dialogPlain12,
780             "ScrollPane.background", table.get("control"),
781             "ScrollPane.foreground", table.get("controlText"),
782             "ScrollPane.border", null,
783             "ScrollPane.viewportBorder", loweredBevelBorder,
784         "ScrollPane.ancestorInputMap",
785            new UIDefaults.LazyInputMap(new Object JavaDoc[] {
786                    "RIGHT", "unitScrollRight",
787                 "KP_RIGHT", "unitScrollRight",
788                     "DOWN", "unitScrollDown",
789                  "KP_DOWN", "unitScrollDown",
790                     "LEFT", "unitScrollLeft",
791                  "KP_LEFT", "unitScrollLeft",
792                       "UP", "unitScrollUp",
793                    "KP_UP", "unitScrollUp",
794                  "PAGE_UP", "scrollUp",
795                "PAGE_DOWN", "scrollDown",
796             "ctrl PAGE_UP", "scrollLeft",
797           "ctrl PAGE_DOWN", "scrollRight",
798                "ctrl HOME", "scrollHome",
799                 "ctrl END", "scrollEnd"
800          }),
801
802             "Slider.border", focusBevelBorder,
803             "Slider.foreground", table.get("control"),
804             "Slider.background", controlDarker,
805             "Slider.highlight", table.get("controlHighlight"),
806             "Slider.shadow", table.get("controlShadow"),
807             "Slider.focus", table.get("controlDkShadow"),
808         "Slider.focusInsets", sliderFocusInsets,
809         "Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object JavaDoc[] {
810                  "RIGHT", "positiveUnitIncrement",
811               "KP_RIGHT", "positiveUnitIncrement",
812                   "DOWN", "negativeUnitIncrement",
813                "KP_DOWN", "negativeUnitIncrement",
814         "ctrl PAGE_DOWN", "negativeBlockIncrement",
815                   "LEFT", "negativeUnitIncrement",
816                "KP_LEFT", "negativeUnitIncrement",
817                     "UP", "positiveUnitIncrement",
818                  "KP_UP", "positiveUnitIncrement",
819           "ctrl PAGE_UP", "positiveBlockIncrement",
820                   "HOME", "minScroll",
821                    "END", "maxScroll"
822         }),
823
824             // Spinner
825
"Spinner.ancestorInputMap",
826            new UIDefaults.LazyInputMap(new Object JavaDoc[] {
827                                "UP", "increment",
828                             "KP_UP", "increment",
829                              "DOWN", "decrement",
830                           "KP_DOWN", "decrement",
831                }),
832         "Spinner.border", textFieldBorder,
833
834             "SplitPane.background", table.get("control"),
835             "SplitPane.highlight", table.get("controlHighlight"),
836             "SplitPane.shadow", table.get("controlShadow"),
837             "SplitPane.dividerSize", new Integer JavaDoc(20),
838             "SplitPane.activeThumb", table.get("activeCaptionBorder"),
839         "SplitPane.ancestorInputMap",
840            new UIDefaults.LazyInputMap(new Object JavaDoc[] {
841                 "UP", "negativeIncrement",
842               "DOWN", "positiveIncrement",
843               "LEFT", "negativeIncrement",
844              "RIGHT", "positiveIncrement",
845              "KP_UP", "negativeIncrement",
846            "KP_DOWN", "positiveIncrement",
847            "KP_LEFT", "negativeIncrement",
848           "KP_RIGHT", "positiveIncrement",
849               "HOME", "selectMin",
850                "END", "selectMax",
851                 "F8", "startResize",
852                 "F6", "toggleFocus",
853           "ctrl TAB", "focusOutForward",
854         "ctrl shift TAB", "focusOutBackward"
855            }),
856
857             "TabbedPane.font", dialogPlain12,
858             "TabbedPane.background", table.get("control"),
859             "TabbedPane.foreground", table.get("controlText"),
860             "TabbedPane.light", table.get("controlHighlight"),
861             "TabbedPane.highlight", table.get("controlLtHighlight"),
862             "TabbedPane.shadow", table.get("controlShadow"),
863             "TabbedPane.darkShadow", table.get("controlShadow"),
864             "TabbedPane.unselectedTabBackground", unselectedTabBackground,
865             "TabbedPane.unselectedTabForeground", unselectedTabForeground,
866             "TabbedPane.unselectedTabHighlight", unselectedTabHighlight,
867             "TabbedPane.unselectedTabShadow", unselectedTabShadow,
868             "TabbedPane.focus", table.get("activeCaptionBorder"),
869             "TabbedPane.tabInsets", tabbedPaneTabInsets,
870             "TabbedPane.selectedTabPadInsets", tabbedPaneTabPadInsets,
871             "TabbedPane.tabAreaInsets", tabbedPaneTabAreaInsets,
872             "TabbedPane.contentBorderInsets", tabbedPaneContentBorderInsets,
873         "TabbedPane.focusInputMap",
874           new UIDefaults.LazyInputMap(new Object JavaDoc[] {
875                  "RIGHT", "navigateRight",
876                   "KP_RIGHT", "navigateRight",
877                       "LEFT", "navigateLeft",
878                    "KP_LEFT", "navigateLeft",
879                         "UP", "navigateUp",
880                      "KP_UP", "navigateUp",
881                       "DOWN", "navigateDown",
882                    "KP_DOWN", "navigateDown",
883                  "ctrl DOWN", "requestFocusForVisibleComponent",
884               "ctrl KP_DOWN", "requestFocusForVisibleComponent",
885         }),
886         "TabbedPane.ancestorInputMap",
887            new UIDefaults.LazyInputMap(new Object JavaDoc[] {
888            "ctrl PAGE_DOWN", "navigatePageDown",
889                  "ctrl PAGE_UP", "navigatePageUp",
890                       "ctrl UP", "requestFocus",
891                    "ctrl KP_UP", "requestFocus",
892          }),
893
894
895             "Tree.background", controlDarker, // default: dark slate blue
896
"Tree.hash", table.get("controlDkShadow"), // default: black
897
"Tree.iconShadow", table.get("controlShadow"),
898             "Tree.iconHighlight", table.get("controlHighlight"),
899             "Tree.iconBackground", table.get("control"),
900             "Tree.iconForeground", table.get("controlShadow"), // default: black
901
"Tree.textBackground", controlDarker, // default: dark slate blue
902
"Tree.textForeground", table.get("textText"), // default: black
903
"Tree.selectionBackground", table.get("text"), // default: white
904
"Tree.selectionForeground", table.get("textText"), // default: black
905
"Tree.selectionBorderColor", table.get("activeCaptionBorder"), // default: maroon
906
"Tree.openIcon", treeOpenIcon,
907             "Tree.closedIcon", treeClosedIcon,
908             "Tree.leafIcon", treeLeafIcon,
909             "Tree.expandedIcon", treeExpandedIcon,
910             "Tree.collapsedIcon", treeCollapsedIcon,
911         "Tree.editorBorder", focusBorder,
912         "Tree.editorBorderSelectionColor", table.get("activeCaptionBorder"),
913         "Tree.rowHeight", new Integer JavaDoc(18),
914         "Tree.drawsFocusBorderAroundIcon", Boolean.TRUE,
915         "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object JavaDoc[] {
916                     "COPY", "copy",
917                    "PASTE", "paste",
918                      "CUT", "cut",
919                   "control INSERT", "copy",
920                     "shift INSERT", "paste",
921                     "shift DELETE", "cut",
922                                   "UP", "selectPrevious",
923                                "KP_UP", "selectPrevious",
924                             "shift UP", "selectPreviousExtendSelection",
925                          "shift KP_UP", "selectPreviousExtendSelection",
926                        "ctrl shift UP", "selectPreviousExtendSelection",
927                     "ctrl shift KP_UP", "selectPreviousExtendSelection",
928                              "ctrl UP", "selectPreviousChangeLead",
929                           "ctrl KP_UP", "selectPreviousChangeLead",
930                                 "DOWN", "selectNext",
931                              "KP_DOWN", "selectNext",
932                           "shift DOWN", "selectNextExtendSelection",
933                        "shift KP_DOWN", "selectNextExtendSelection",
934                      "ctrl shift DOWN", "selectNextExtendSelection",
935                   "ctrl shift KP_DOWN", "selectNextExtendSelection",
936                            "ctrl DOWN", "selectNextChangeLead",
937                         "ctrl KP_DOWN", "selectNextChangeLead",
938                                "RIGHT", "selectChild",
939                             "KP_RIGHT", "selectChild",
940                                 "LEFT", "selectParent",
941                              "KP_LEFT", "selectParent",
942                              "PAGE_UP", "scrollUpChangeSelection",
943                        "shift PAGE_UP", "scrollUpExtendSelection",
944                   "ctrl shift PAGE_UP", "scrollUpExtendSelection",
945                         "ctrl PAGE_UP", "scrollUpChangeLead",
946                            "PAGE_DOWN", "scrollDownChangeSelection",
947                      "shift PAGE_DOWN", "scrollDownExtendSelection",
948                 "ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
949                       "ctrl PAGE_DOWN", "scrollDownChangeLead",
950                                 "HOME", "selectFirst",
951                           "shift HOME", "selectFirstExtendSelection",
952                      "ctrl shift HOME", "selectFirstExtendSelection",
953                            "ctrl HOME", "selectFirstChangeLead",
954                                  "END", "selectLast",
955                            "shift END", "selectLastExtendSelection",
956                       "ctrl shift END", "selectLastExtendSelection",
957                             "ctrl END", "selectLastChangeLead",
958                                   "F2", "startEditing",
959                               "ctrl A", "selectAll",
960                           "ctrl SLASH", "selectAll",
961                      "ctrl BACK_SLASH", "clearSelection",
962                            "ctrl LEFT", "scrollLeft",
963                         "ctrl KP_LEFT", "scrollLeft",
964                           "ctrl RIGHT", "scrollRight",
965                        "ctrl KP_RIGHT", "scrollRight",
966                                "SPACE", "addToSelection",
967                           "ctrl SPACE", "toggleAndAnchor",
968                          "shift SPACE", "extendTo",
969                     "ctrl shift SPACE", "moveSelectionTo"
970           }),
971         "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object JavaDoc[] {
972         "ESCAPE", "cancel" }),
973
974             "Table.focusCellHighlightBorder", focusCellHighlightBorder,
975             "Table.scrollPaneBorder", null,
976
977             // "Table.background", white, // cell background color
978
"Table.ancestorInputMap",
979            new UIDefaults.LazyInputMap(new Object JavaDoc[] {
980                      "COPY", "copy",
981                     "PASTE", "paste",
982                       "CUT", "cut",
983                    "control INSERT", "copy",
984                      "shift INSERT", "paste",
985                      "shift DELETE", "cut",
986                                 "RIGHT", "selectNextColumn",
987                              "KP_RIGHT", "selectNextColumn",
988                           "shift RIGHT", "selectNextColumnExtendSelection",
989                        "shift KP_RIGHT", "selectNextColumnExtendSelection",
990                      "ctrl shift RIGHT", "selectNextColumnExtendSelection",
991                   "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
992                            "ctrl RIGHT", "selectNextColumnChangeLead",
993                         "ctrl KP_RIGHT", "selectNextColumnChangeLead",
994                                  "LEFT", "selectPreviousColumn",
995                               "KP_LEFT", "selectPreviousColumn",
996                            "shift LEFT", "selectPreviousColumnExtendSelection",
997                         "shift KP_LEFT", "selectPreviousColumnExtendSelection",
998                       "ctrl shift LEFT", "selectPreviousColumnExtendSelection",
999                    "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
1000                            "ctrl LEFT", "selectPreviousColumnChangeLead",
1001                         "ctrl KP_LEFT", "selectPreviousColumnChangeLead",
1002                                 "DOWN", "selectNextRow",
1003                              "KP_DOWN", "selectNextRow",
1004                           "shift DOWN", "selectNextRowExtendSelection",
1005                        "shift KP_DOWN", "selectNextRowExtendSelection",
1006                      "ctrl shift DOWN", "selectNextRowExtendSelection",
1007                   "ctrl shift KP_DOWN", "selectNextRowExtendSelection",
1008                            "ctrl DOWN", "selectNextRowChangeLead",
1009                         "ctrl KP_DOWN", "selectNextRowChangeLead",
1010                                   "UP", "selectPreviousRow",
1011                                "KP_UP", "selectPreviousRow",
1012                             "shift UP", "selectPreviousRowExtendSelection",
1013                          "shift KP_UP", "selectPreviousRowExtendSelection",
1014                        "ctrl shift UP", "selectPreviousRowExtendSelection",
1015                     "ctrl shift KP_UP", "selectPreviousRowExtendSelection",
1016                              "ctrl UP", "selectPreviousRowChangeLead",
1017                           "ctrl KP_UP", "selectPreviousRowChangeLead",
1018                                 "HOME", "selectFirstColumn",
1019                           "shift HOME", "selectFirstColumnExtendSelection",
1020                      "ctrl shift HOME", "selectFirstRowExtendSelection",
1021                            "ctrl HOME", "selectFirstRow",
1022                                  "END", "selectLastColumn",
1023                            "shift END", "selectLastColumnExtendSelection",
1024                       "ctrl shift END", "selectLastRowExtendSelection",
1025                             "ctrl END", "selectLastRow",
1026                              "PAGE_UP", "scrollUpChangeSelection",
1027                        "shift PAGE_UP", "scrollUpExtendSelection",
1028                   "ctrl shift PAGE_UP", "scrollLeftExtendSelection",
1029                         "ctrl PAGE_UP", "scrollLeftChangeSelection",
1030                            "PAGE_DOWN", "scrollDownChangeSelection",
1031                      "shift PAGE_DOWN", "scrollDownExtendSelection",
1032                 "ctrl shift PAGE_DOWN", "scrollRightExtendSelection",
1033                       "ctrl PAGE_DOWN", "scrollRightChangeSelection",
1034                                  "TAB", "selectNextColumnCell",
1035                            "shift TAB", "selectPreviousColumnCell",
1036                                "ENTER", "selectNextRowCell",
1037                          "shift ENTER", "selectPreviousRowCell",
1038                               "ctrl A", "selectAll",
1039                           "ctrl SLASH", "selectAll",
1040                      "ctrl BACK_SLASH", "clearSelection",
1041                               "ESCAPE", "cancel",
1042                                   "F2", "startEditing",
1043                                "SPACE", "addToSelection",
1044                           "ctrl SPACE", "toggleAndAnchor",
1045                          "shift SPACE", "extendTo",
1046                     "ctrl shift SPACE", "moveSelectionTo"
1047         }),
1048
1049
1050            "FormattedTextField.focusInputMap",
1051              new UIDefaults.LazyInputMap(new Object JavaDoc[] {
1052               "ctrl C", DefaultEditorKit.copyAction,
1053               "ctrl V", DefaultEditorKit.pasteAction,
1054               "ctrl X", DefaultEditorKit.cutAction,
1055                 "COPY", DefaultEditorKit.copyAction,
1056                "PASTE", DefaultEditorKit.pasteAction,
1057                  "CUT", DefaultEditorKit.cutAction,
1058               "shift LEFT", DefaultEditorKit.selectionBackwardAction,
1059                    "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction,
1060              "shift RIGHT", DefaultEditorKit.selectionForwardAction,
1061           "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction,
1062            "ctrl LEFT", DefaultEditorKit.previousWordAction,
1063             "ctrl KP_LEFT", DefaultEditorKit.previousWordAction,
1064               "ctrl RIGHT", DefaultEditorKit.nextWordAction,
1065            "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction,
1066          "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
1067           "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction,
1068         "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction,
1069          "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction,
1070               "ctrl A", DefaultEditorKit.selectAllAction,
1071                 "HOME", DefaultEditorKit.beginLineAction,
1072                  "END", DefaultEditorKit.endLineAction,
1073               "shift HOME", DefaultEditorKit.selectionBeginLineAction,
1074                "shift END", DefaultEditorKit.selectionEndLineAction,
1075                       "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
1076                           "ctrl H", DefaultEditorKit.deletePrevCharAction,
1077                           "DELETE", DefaultEditorKit.deleteNextCharAction,
1078                            "RIGHT", DefaultEditorKit.forwardAction,
1079                             "LEFT", DefaultEditorKit.backwardAction,
1080                         "KP_RIGHT", DefaultEditorKit.forwardAction,
1081                          "KP_LEFT", DefaultEditorKit.backwardAction,
1082                "ENTER", JTextField.notifyAction,
1083          "ctrl BACK_SLASH", "unselect",
1084                   "control shift O", "toggle-componentOrientation",
1085                           "ESCAPE", "reset-field-edit",
1086                               "UP", "increment",
1087                            "KP_UP", "increment",
1088                             "DOWN", "decrement",
1089                          "KP_DOWN", "decrement",
1090              }),
1091
1092        // ToolBar.
1093
"ToolBar.ancestorInputMap",
1094           new UIDefaults.LazyInputMap(new Object JavaDoc[] {
1095                "UP", "navigateUp",
1096             "KP_UP", "navigateUp",
1097              "DOWN", "navigateDown",
1098           "KP_DOWN", "navigateDown",
1099              "LEFT", "navigateLeft",
1100           "KP_LEFT", "navigateLeft",
1101             "RIGHT", "navigateRight",
1102          "KP_RIGHT", "navigateRight"
1103         }),
1104
1105
1106
1107            "ComboBox.control", table.get("control"),
1108            "ComboBox.controlForeground", black,
1109            "ComboBox.background", table.get("window"),
1110            "ComboBox.foreground", black,
1111            "ComboBox.border", comboBoxBorder,
1112            "ComboBox.selectionBackground", black,
1113            "ComboBox.selectionForeground", table.get("text"),
1114            "ComboBox.disabledBackground", table.get("control"),
1115            "ComboBox.disabledForeground", table.get("textInactiveText"),
1116            "ComboBox.font", dialogPlain12,
1117        "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object JavaDoc[] {
1118           "ESCAPE", "hidePopup",
1119          "PAGE_UP", "pageUpPassThrough",
1120        "PAGE_DOWN", "pageDownPassThrough",
1121             "HOME", "homePassThrough",
1122              "END", "endPassThrough",
1123             "DOWN", "selectNext",
1124          "KP_DOWN", "selectNext",
1125               "UP", "selectPrevious",
1126            "KP_UP", "selectPrevious",
1127                    "SPACE", "spacePopup",
1128                    "ENTER", "enterPressed"
1129          }),
1130
1131            "TextField.caretForeground", black,
1132            "TextField.caretBlinkRate", new Integer JavaDoc(500),
1133            "TextField.inactiveForeground", table.get("textInactiveText"),
1134            "TextField.selectionBackground", table.get("textHighlight"),
1135            "TextField.selectionForeground", table.get("textHighlightText"),
1136            "TextField.background", table.get("window"),
1137            "TextField.foreground", table.get("textText"),
1138            "TextField.font", sansSerifPlain12,
1139            "TextField.border", textFieldBorder,
1140        "TextField.focusInputMap", fieldInputMap,
1141            
1142            "PasswordField.caretForeground", black,
1143            "PasswordField.caretBlinkRate", new Integer JavaDoc(500),
1144            "PasswordField.inactiveForeground", table.get("textInactiveText"),
1145            "PasswordField.selectionBackground", table.get("textHighlight"),
1146            "PasswordField.selectionForeground", table.get("textHighlightText"),
1147            "PasswordField.background", table.get("window"),
1148            "PasswordField.foreground", table.get("textText"),
1149            "PasswordField.font", monospacedPlain12,
1150            "PasswordField.border", textFieldBorder,
1151        "PasswordField.focusInputMap", passwordInputMap,
1152            
1153            "TextArea.caretForeground", black,
1154            "TextArea.caretBlinkRate", new Integer JavaDoc(500),
1155            "TextArea.inactiveForeground", table.get("textInactiveText"),
1156            "TextArea.selectionBackground", table.get("textHighlight"),
1157            "TextArea.selectionForeground", table.get("textHighlightText"),
1158            "TextArea.background", table.get("window"),
1159            "TextArea.foreground", table.get("textText"),
1160            "TextArea.font", monospacedPlain12,
1161            "TextArea.border", marginBorder,
1162        "TextArea.focusInputMap", multilineInputMap,
1163            
1164            "TextPane.caretForeground", black,
1165            "TextPane.caretBlinkRate", new Integer JavaDoc(500),
1166            "TextPane.inactiveForeground", table.get("textInactiveText"),
1167            "TextPane.selectionBackground", lightGray,
1168            "TextPane.selectionForeground", table.get("textHighlightText"),
1169            "TextPane.background", white,
1170            "TextPane.foreground", table.get("textText"),
1171            "TextPane.font", serifPlain12,
1172            "TextPane.border", marginBorder,
1173        "TextPane.focusInputMap", multilineInputMap,
1174            
1175            "EditorPane.caretForeground", red,
1176            "EditorPane.caretBlinkRate", new Integer JavaDoc(500),
1177            "EditorPane.inactiveForeground", table.get("textInactiveText"),
1178            "EditorPane.selectionBackground", lightGray,
1179            "EditorPane.selectionForeground", table.get("textHighlightText"),
1180            "EditorPane.background", white,
1181            "EditorPane.foreground", table.get("textText"),
1182            "EditorPane.font", serifPlain12,
1183            "EditorPane.border", marginBorder,
1184        "EditorPane.focusInputMap", multilineInputMap,
1185
1186
1187        "FileChooser.pathLabelMnemonic", new Integer JavaDoc(KeyEvent.VK_P), // 'p'
1188
"FileChooser.filterLabelMnemonic", new Integer JavaDoc (KeyEvent.VK_R), // 'r'
1189
"FileChooser.foldersLabelMnemonic", new Integer JavaDoc (KeyEvent.VK_L), // 'l'
1190
"FileChooser.filesLabelMnemonic", new Integer JavaDoc (KeyEvent.VK_I), // 'i'
1191
"FileChooser.enterFileNameLabelMnemonic", new Integer JavaDoc (KeyEvent.VK_N), // 'n'
1192
"FileChooser.ancestorInputMap",
1193           new UIDefaults.LazyInputMap(new Object JavaDoc[] {
1194                     "ESCAPE", "cancelSelection",
1195                     "ENTER", "approveSelection"
1196         }),
1197
1198
1199            "ToolTip.border", raisedBevelBorder,
1200            "ToolTip.background", table.get("info"),
1201            "ToolTip.foreground", table.get("infoText"),
1202
1203        // These window InputMap bindings are used when the Menu is
1204
// selected.
1205
"PopupMenu.selectedWindowInputMapBindings", new Object JavaDoc[] {
1206          "ESCAPE", "cancel",
1207             "TAB", "cancel",
1208           "shift TAB", "cancel",
1209                    "DOWN", "selectNext",
1210         "KP_DOWN", "selectNext",
1211              "UP", "selectPrevious",
1212           "KP_UP", "selectPrevious",
1213            "LEFT", "selectParent",
1214         "KP_LEFT", "selectParent",
1215           "RIGHT", "selectChild",
1216        "KP_RIGHT", "selectChild",
1217           "ENTER", "return",
1218           "SPACE", "return"
1219        },
1220
1221
1222            "OptionPane.border", optionPaneBorder,
1223            "OptionPane.messageAreaBorder", optionPaneMessageAreaBorder,
1224            "OptionPane.buttonAreaBorder", optionPaneButtonAreaBorder,
1225            "OptionPane.errorIcon", SwingUtilities2.makeIcon(getClass(),
1226                                                             MotifLookAndFeel.class,
1227                                                             "icons/Error.gif"),
1228            "OptionPane.informationIcon", SwingUtilities2.makeIcon(getClass(),
1229                                                                   MotifLookAndFeel.class,
1230                                                                   "icons/Inform.gif"),
1231            "OptionPane.warningIcon", SwingUtilities2.makeIcon(getClass(),
1232                                                               MotifLookAndFeel.class,
1233                                                               "icons/Warn.gif"),
1234            "OptionPane.questionIcon", SwingUtilities2.makeIcon(getClass(),
1235                                                                MotifLookAndFeel.class,
1236                                                                "icons/Question.gif"),
1237        "OptionPane.windowBindings", new Object JavaDoc[] {
1238        "ESCAPE", "close" },
1239
1240        // These bindings are only enabled when there is a default
1241
// button set on the rootpane.
1242
"RootPane.defaultButtonWindowKeyBindings", new Object JavaDoc[] {
1243                     "ENTER", "press",
1244            "released ENTER", "release",
1245                "ctrl ENTER", "press",
1246           "ctrl released ENTER", "release"
1247          },
1248        };
1249
1250        table.putDefaults(defaults);
1251    }
1252
1253    /*
1254     * Returns whether this is being run on a JDK 1.2 or later VM.
1255     * This is a system-wide, rather than AppContext-wide, state.
1256     */

1257    /*package-private*/ static boolean is1dot2 = true;
1258
1259    static {
1260        try {
1261            // Test if method introduced in 1.2 is available.
1262
Method m = Toolkit JavaDoc.class.getMethod("getMaximumCursorColors", null);
1263            is1dot2 = (m != null);
1264        } catch (NoSuchMethodException JavaDoc e) {
1265            is1dot2 = false;
1266        }
1267    }
1268
1269}
1270
1271
Popular Tags