1 /*
   2  * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.java.swing.plaf.motif;
  27 
  28 import java.awt.Color;
  29 import java.awt.Font;
  30 import java.awt.Insets;
  31 import java.awt.event.KeyEvent;
  32 import java.awt.event.InputEvent;
  33 import java.util.*;
  34 
  35 import javax.swing.*;
  36 import javax.swing.plaf.*;
  37 import javax.swing.border.*;
  38 import javax.swing.text.JTextComponent;
  39 import javax.swing.text.DefaultEditorKit;
  40 
  41 import javax.swing.plaf.basic.BasicLookAndFeel;
  42 import javax.swing.plaf.basic.BasicBorders;
  43 import javax.swing.plaf.basic.BasicComboBoxRenderer;
  44 import javax.swing.plaf.basic.BasicComboBoxEditor;
  45 
  46 import sun.swing.SwingUtilities2;
  47 import sun.awt.OSInfo;
  48 
  49 /**
  50  * Implements the Motif Look and Feel.
  51  * UI classes not implemented specifically for Motif will
  52  * default to those implemented in Basic.
  53  * <p>
  54  * <strong>Warning:</strong>
  55  * Serialized objects of this class will not be compatible with
  56  * future Swing releases.  The current serialization support is appropriate
  57  * for short term storage or RMI between applications running the same
  58  * version of Swing.  A future release of Swing will provide support for
  59  * long term persistence.
  60  *
  61  * @author unattributed
  62  */
  63 public class MotifLookAndFeel extends BasicLookAndFeel
  64 {
  65     public String getName() {
  66         return "CDE/Motif";
  67     }
  68 
  69     public String getID() {
  70         return "Motif";
  71     }
  72 
  73     public String getDescription() {
  74         return "The CDE/Motif Look and Feel";
  75     }
  76 
  77 
  78     public boolean isNativeLookAndFeel() {
  79         return OSInfo.getOSType() == OSInfo.OSType.SOLARIS;
  80     }
  81 
  82 
  83     public boolean isSupportedLookAndFeel() {
  84         return true;
  85     }
  86 
  87 
  88     /**
  89      * Load the SystemColors into the defaults table.  The keys
  90      * for SystemColor defaults are the same as the names of
  91      * the public fields in SystemColor.  If the table is being
  92      * created on a native Motif platform we use the SystemColor
  93      * values, otherwise we create color objects whose values match
  94      * the default CDE/Motif colors.
  95      */
  96     protected void initSystemColorDefaults(UIDefaults table)
  97     {
  98         String[] defaultSystemColors = {
  99                   "desktop", "#005C5C", /* Color of the desktop background */
 100             "activeCaption", "#000080", /* Color for captions (title bars) when they are active. */
 101         "activeCaptionText", "#FFFFFF", /* Text color for text in captions (title bars). */
 102       "activeCaptionBorder", "#B24D7A", /* Border color for caption (title bar) window borders. */
 103           "inactiveCaption", "#AEB2C3", /* Color for captions (title bars) when not active. */
 104       "inactiveCaptionText", "#000000", /* Text color for text in inactive captions (title bars). */
 105     "inactiveCaptionBorder", "#AEB2C3", /* Border color for inactive caption (title bar) window borders. */
 106                    "window", "#AEB2C3", /* Default color for the interior of windows */
 107              "windowBorder", "#AEB2C3", /* ??? */
 108                "windowText", "#000000", /* ??? */
 109                      "menu", "#AEB2C3", /* ??? */
 110                  "menuText", "#000000", /* ??? */
 111                      "text", "#FFF7E9", /* Text background color */
 112                  "textText", "#000000", /* Text foreground color */
 113             "textHighlight", "#000000", /* Text background color when selected */
 114         "textHighlightText", "#FFF7E9", /* Text color when selected */
 115          "textInactiveText", "#808080", /* Text color when disabled */
 116                   "control", "#AEB2C3", /* Default color for controls (buttons, sliders, etc) */
 117               "controlText", "#000000", /* Default color for text in controls */
 118          "controlHighlight", "#DCDEE5", /* Highlight color for controls */
 119        "controlLtHighlight", "#DCDEE5", /* Light highlight color for controls */
 120             "controlShadow", "#63656F", /* Shadow color for controls */
 121        "controlLightShadow", "#9397A5", /* Shadow color for controls */
 122           "controlDkShadow", "#000000", /* Dark shadow color for controls */
 123                 "scrollbar", "#AEB2C3", /* Scrollbar ??? color. PENDING(jeff) foreground? background? ?*/
 124                      "info", "#FFF7E9", /* ??? */
 125                  "infoText", "#000000"  /* ??? */
 126         };
 127 
 128         loadSystemColors(table, defaultSystemColors, false);
 129     }
 130 
 131 
 132     protected void initClassDefaults(UIDefaults table)
 133     {
 134         super.initClassDefaults(table);
 135         String motifPackageName = "com.sun.java.swing.plaf.motif.";
 136 
 137         Object[] uiDefaults = {
 138                    "ButtonUI", motifPackageName + "MotifButtonUI",
 139                  "CheckBoxUI", motifPackageName + "MotifCheckBoxUI",
 140             "DirectoryPaneUI", motifPackageName + "MotifDirectoryPaneUI",
 141               "FileChooserUI", motifPackageName + "MotifFileChooserUI",
 142                     "LabelUI", motifPackageName + "MotifLabelUI",
 143                   "MenuBarUI", motifPackageName + "MotifMenuBarUI",
 144                      "MenuUI", motifPackageName + "MotifMenuUI",
 145                  "MenuItemUI", motifPackageName + "MotifMenuItemUI",
 146          "CheckBoxMenuItemUI", motifPackageName + "MotifCheckBoxMenuItemUI",
 147       "RadioButtonMenuItemUI", motifPackageName + "MotifRadioButtonMenuItemUI",
 148               "RadioButtonUI", motifPackageName + "MotifRadioButtonUI",
 149              "ToggleButtonUI", motifPackageName + "MotifToggleButtonUI",
 150                 "PopupMenuUI", motifPackageName + "MotifPopupMenuUI",
 151               "ProgressBarUI", motifPackageName + "MotifProgressBarUI",
 152                 "ScrollBarUI", motifPackageName + "MotifScrollBarUI",
 153                "ScrollPaneUI", motifPackageName + "MotifScrollPaneUI",
 154                    "SliderUI", motifPackageName + "MotifSliderUI",
 155                 "SplitPaneUI", motifPackageName + "MotifSplitPaneUI",
 156                "TabbedPaneUI", motifPackageName + "MotifTabbedPaneUI",
 157                  "TextAreaUI", motifPackageName + "MotifTextAreaUI",
 158                 "TextFieldUI", motifPackageName + "MotifTextFieldUI",
 159             "PasswordFieldUI", motifPackageName + "MotifPasswordFieldUI",
 160                  "TextPaneUI", motifPackageName + "MotifTextPaneUI",
 161                "EditorPaneUI", motifPackageName + "MotifEditorPaneUI",
 162                      "TreeUI", motifPackageName + "MotifTreeUI",
 163             "InternalFrameUI", motifPackageName + "MotifInternalFrameUI",
 164               "DesktopPaneUI", motifPackageName + "MotifDesktopPaneUI",
 165                 "SeparatorUI", motifPackageName + "MotifSeparatorUI",
 166        "PopupMenuSeparatorUI", motifPackageName + "MotifPopupMenuSeparatorUI",
 167                "OptionPaneUI", motifPackageName + "MotifOptionPaneUI",
 168                  "ComboBoxUI", motifPackageName + "MotifComboBoxUI",
 169               "DesktopIconUI", motifPackageName + "MotifDesktopIconUI"
 170         };
 171 
 172         table.putDefaults(uiDefaults);
 173     }
 174 
 175 
 176     /**
 177      * Initialize the defaults table with the name of the ResourceBundle
 178      * used for getting localized defaults.
 179      */
 180     private void initResourceBundle(UIDefaults table) {
 181         table.addResourceBundle( "com.sun.java.swing.plaf.motif.resources.motif" );
 182     }
 183 
 184 
 185     protected void initComponentDefaults(UIDefaults table)
 186     {
 187         super.initComponentDefaults(table);
 188 
 189         initResourceBundle(table);
 190 
 191         FontUIResource dialogPlain12 = new FontUIResource(Font.DIALOG,
 192                                                           Font.PLAIN, 12);
 193         FontUIResource serifPlain12 = new FontUIResource(Font.SERIF,
 194                                                           Font.PLAIN, 12);
 195         FontUIResource sansSerifPlain12 = new FontUIResource(Font.SANS_SERIF,
 196                                                           Font.PLAIN, 12);
 197         FontUIResource monospacedPlain12 = new FontUIResource(Font.MONOSPACED,
 198                                                           Font.PLAIN, 12);
 199         ColorUIResource red = new ColorUIResource(Color.red);
 200         ColorUIResource black = new ColorUIResource(Color.black);
 201         ColorUIResource white = new ColorUIResource(Color.white);
 202         ColorUIResource lightGray = new ColorUIResource(Color.lightGray);
 203         ColorUIResource controlDarker = new ColorUIResource(147, 151, 165);  // slate blue
 204         ColorUIResource scrollBarTrack = controlDarker;
 205         ColorUIResource menuItemPressedBackground = new ColorUIResource(165,165,165);
 206         ColorUIResource menuItemPressedForeground = new ColorUIResource(0,0,0);
 207 
 208 
 209         Border loweredBevelBorder = new MotifBorders.BevelBorder(false,
 210                                            table.getColor("controlShadow"),
 211                                            table.getColor("controlLtHighlight"));
 212 
 213         Border raisedBevelBorder = new MotifBorders.BevelBorder(true,                                                                  table.getColor("controlShadow"),
 214                                            table.getColor("controlLtHighlight"));
 215 
 216         Border marginBorder = new BasicBorders.MarginBorder();
 217 
 218         Border focusBorder = new MotifBorders.FocusBorder(
 219                                            table.getColor("control"),
 220                                            table.getColor("activeCaptionBorder"));
 221 
 222 
 223         Border focusBevelBorder = new BorderUIResource.CompoundBorderUIResource(
 224                                           focusBorder,
 225                                           loweredBevelBorder);
 226 
 227         Border comboBoxBorder = new BorderUIResource.CompoundBorderUIResource(
 228                                           focusBorder,
 229                                           raisedBevelBorder);
 230 
 231 
 232         Border buttonBorder = new BorderUIResource.CompoundBorderUIResource(
 233                                       new MotifBorders.ButtonBorder(
 234                                           table.getColor("Button.shadow"),
 235                                           table.getColor("Button.highlight"),
 236                                           table.getColor("Button.darkShadow"),
 237                                           table.getColor("activeCaptionBorder")),
 238                                       marginBorder);
 239 
 240         Border toggleButtonBorder = new BorderUIResource.CompoundBorderUIResource(
 241                                       new MotifBorders.ToggleButtonBorder(
 242                                           table.getColor("ToggleButton.shadow"),
 243                                           table.getColor("ToggleButton.highlight"),
 244                                           table.getColor("ToggleButton.darkShadow"),
 245                                           table.getColor("activeCaptionBorder")),                                                        marginBorder);
 246 
 247         Border textFieldBorder = new BorderUIResource.CompoundBorderUIResource(
 248                                       focusBevelBorder,
 249                                       marginBorder);
 250 
 251         Border popupMenuBorder = new BorderUIResource.CompoundBorderUIResource(
 252                                       raisedBevelBorder,
 253                                       new MotifBorders.MotifPopupMenuBorder(
 254                                         table.getFont("PopupMenu.font"),
 255                                         table.getColor("PopupMenu.background"),
 256                                         table.getColor("PopupMenu.foreground"),
 257                                         table.getColor("controlShadow"),
 258                                         table.getColor("controlLtHighlight")
 259                                         ));
 260 
 261         Object menuItemCheckIcon = new UIDefaults.LazyValue() {
 262             public Object createValue(UIDefaults table) {
 263                 return MotifIconFactory.getMenuItemCheckIcon();
 264             }
 265         };
 266 
 267         Object menuItemArrowIcon = new UIDefaults.LazyValue() {
 268             public Object createValue(UIDefaults table) {
 269                 return MotifIconFactory.getMenuItemArrowIcon();
 270             }
 271         };
 272 
 273         Object menuArrowIcon = new UIDefaults.LazyValue() {
 274             public Object createValue(UIDefaults table) {
 275                 return MotifIconFactory.getMenuArrowIcon();
 276             }
 277         };
 278 
 279         Object checkBoxIcon = new UIDefaults.LazyValue() {
 280             public Object createValue(UIDefaults table) {
 281                 return MotifIconFactory.getCheckBoxIcon();
 282             }
 283         };
 284 
 285         Object radioButtonIcon = new UIDefaults.LazyValue() {
 286             public Object createValue(UIDefaults table) {
 287                 return MotifIconFactory.getRadioButtonIcon();
 288             }
 289         };
 290 
 291         Object unselectedTabBackground = new UIDefaults.LazyValue() {
 292             public Object createValue(UIDefaults table) {
 293                 Color c = table.getColor("control");
 294                 return new ColorUIResource(Math.max((int)(c.getRed()*.85),0),
 295                                            Math.max((int)(c.getGreen()*.85),0),
 296                                            Math.max((int)(c.getBlue()*.85),0));
 297             }
 298         };
 299 
 300         Object unselectedTabForeground = new UIDefaults.LazyValue() {
 301             public Object createValue(UIDefaults table) {
 302                 Color c = table.getColor("controlText");
 303                 return new ColorUIResource(Math.max((int)(c.getRed()*.85),0),
 304                                            Math.max((int)(c.getGreen()*.85),0),
 305                                            Math.max((int)(c.getBlue()*.85),0));
 306             }
 307         };
 308 
 309         Object unselectedTabShadow = new UIDefaults.LazyValue() {
 310             public Object createValue(UIDefaults table) {
 311                 Color c = table.getColor("control");
 312                 Color base = new Color(Math.max((int)(c.getRed()*.85),0),
 313                                        Math.max((int)(c.getGreen()*.85),0),
 314                                        Math.max((int)(c.getBlue()*.85),0));
 315                 return new ColorUIResource(base.darker());
 316             }
 317         };
 318 
 319         Object unselectedTabHighlight = new UIDefaults.LazyValue() {
 320             public Object createValue(UIDefaults table) {
 321                 Color c = table.getColor("control");
 322                 Color base = new Color(Math.max((int)(c.getRed()*.85),0),
 323                                        Math.max((int)(c.getGreen()*.85),0),
 324                                        Math.max((int)(c.getBlue()*.85),0));
 325                 return new ColorUIResource(base.brighter());
 326             }
 327         };
 328 
 329         // *** Text
 330 
 331         Object fieldInputMap = new UIDefaults.LazyInputMap(new Object[] {
 332                            "COPY", DefaultEditorKit.copyAction,
 333                           "PASTE", DefaultEditorKit.pasteAction,
 334                             "CUT", DefaultEditorKit.cutAction,
 335                  "control INSERT", DefaultEditorKit.copyAction,
 336                    "shift INSERT", DefaultEditorKit.pasteAction,
 337                    "shift DELETE", DefaultEditorKit.cutAction,
 338                       "control F", DefaultEditorKit.forwardAction,
 339                       "control B", DefaultEditorKit.backwardAction,
 340                       "control D", DefaultEditorKit.deleteNextCharAction,
 341                      "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
 342                "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
 343                          "ctrl H", DefaultEditorKit.deletePrevCharAction,
 344                          "DELETE", DefaultEditorKit.deleteNextCharAction,
 345                     "ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
 346                 "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
 347                           "RIGHT", DefaultEditorKit.forwardAction,
 348                            "LEFT", DefaultEditorKit.backwardAction,
 349                        "KP_RIGHT", DefaultEditorKit.forwardAction,
 350                         "KP_LEFT", DefaultEditorKit.backwardAction,
 351                      "shift LEFT", DefaultEditorKit.selectionBackwardAction,
 352                     "shift RIGHT", DefaultEditorKit.selectionForwardAction,
 353                    "control LEFT", DefaultEditorKit.previousWordAction,
 354                   "control RIGHT", DefaultEditorKit.nextWordAction,
 355              "control shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
 356             "control shift RIGHT", DefaultEditorKit.selectionNextWordAction,
 357                   "control SLASH", DefaultEditorKit.selectAllAction,
 358                            "HOME", DefaultEditorKit.beginLineAction,
 359                             "END", DefaultEditorKit.endLineAction,
 360                      "shift HOME", DefaultEditorKit.selectionBeginLineAction,
 361                       "shift END", DefaultEditorKit.selectionEndLineAction,
 362              "control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
 363                           "ENTER", JTextField.notifyAction,
 364                 "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
 365         });
 366 
 367         Object passwordInputMap = new UIDefaults.LazyInputMap(new Object[] {
 368                            "COPY", DefaultEditorKit.copyAction,
 369                           "PASTE", DefaultEditorKit.pasteAction,
 370                             "CUT", DefaultEditorKit.cutAction,
 371                  "control INSERT", DefaultEditorKit.copyAction,
 372                    "shift INSERT", DefaultEditorKit.pasteAction,
 373                    "shift DELETE", DefaultEditorKit.cutAction,
 374                       "control F", DefaultEditorKit.forwardAction,
 375                       "control B", DefaultEditorKit.backwardAction,
 376                       "control D", DefaultEditorKit.deleteNextCharAction,
 377                      "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
 378                "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
 379                          "ctrl H", DefaultEditorKit.deletePrevCharAction,
 380                          "DELETE", DefaultEditorKit.deleteNextCharAction,
 381                           "RIGHT", DefaultEditorKit.forwardAction,
 382                            "LEFT", DefaultEditorKit.backwardAction,
 383                        "KP_RIGHT", DefaultEditorKit.forwardAction,
 384                         "KP_LEFT", DefaultEditorKit.backwardAction,
 385                      "shift LEFT", DefaultEditorKit.selectionBackwardAction,
 386                     "shift RIGHT", DefaultEditorKit.selectionForwardAction,
 387                    "control LEFT", DefaultEditorKit.beginLineAction,
 388                   "control RIGHT", DefaultEditorKit.endLineAction,
 389              "control shift LEFT", DefaultEditorKit.selectionBeginLineAction,
 390             "control shift RIGHT", DefaultEditorKit.selectionEndLineAction,
 391                   "control SLASH", DefaultEditorKit.selectAllAction,
 392                            "HOME", DefaultEditorKit.beginLineAction,
 393                             "END", DefaultEditorKit.endLineAction,
 394                      "shift HOME", DefaultEditorKit.selectionBeginLineAction,
 395                       "shift END", DefaultEditorKit.selectionEndLineAction,
 396              "control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
 397                           "ENTER", JTextField.notifyAction,
 398                 "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
 399         });
 400 
 401         Object multilineInputMap = new UIDefaults.LazyInputMap(new Object[] {
 402                            "COPY", DefaultEditorKit.copyAction,
 403                           "PASTE", DefaultEditorKit.pasteAction,
 404                             "CUT", DefaultEditorKit.cutAction,
 405                  "control INSERT", DefaultEditorKit.copyAction,
 406                    "shift INSERT", DefaultEditorKit.pasteAction,
 407                    "shift DELETE", DefaultEditorKit.cutAction,
 408                       "control F", DefaultEditorKit.forwardAction,
 409                       "control B", DefaultEditorKit.backwardAction,
 410                       "control D", DefaultEditorKit.deleteNextCharAction,
 411                      "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
 412                "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
 413                          "ctrl H", DefaultEditorKit.deletePrevCharAction,
 414                          "DELETE", DefaultEditorKit.deleteNextCharAction,
 415                     "ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
 416                 "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
 417                           "RIGHT", DefaultEditorKit.forwardAction,
 418                            "LEFT", DefaultEditorKit.backwardAction,
 419                        "KP_RIGHT", DefaultEditorKit.forwardAction,
 420                         "KP_LEFT", DefaultEditorKit.backwardAction,
 421                      "shift LEFT", DefaultEditorKit.selectionBackwardAction,
 422                     "shift RIGHT", DefaultEditorKit.selectionForwardAction,
 423                    "control LEFT", DefaultEditorKit.previousWordAction,
 424                   "control RIGHT", DefaultEditorKit.nextWordAction,
 425              "control shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
 426             "control shift RIGHT", DefaultEditorKit.selectionNextWordAction,
 427                   "control SLASH", DefaultEditorKit.selectAllAction,
 428                            "HOME", DefaultEditorKit.beginLineAction,
 429                             "END", DefaultEditorKit.endLineAction,
 430                      "shift HOME", DefaultEditorKit.selectionBeginLineAction,
 431                       "shift END", DefaultEditorKit.selectionEndLineAction,
 432 
 433                       "control N", DefaultEditorKit.downAction,
 434                       "control P", DefaultEditorKit.upAction,
 435                              "UP", DefaultEditorKit.upAction,
 436                            "DOWN", DefaultEditorKit.downAction,
 437                         "PAGE_UP", DefaultEditorKit.pageUpAction,
 438                       "PAGE_DOWN", DefaultEditorKit.pageDownAction,
 439                   "shift PAGE_UP", "selection-page-up",
 440                 "shift PAGE_DOWN", "selection-page-down",
 441              "ctrl shift PAGE_UP", "selection-page-left",
 442            "ctrl shift PAGE_DOWN", "selection-page-right",
 443                        "shift UP", DefaultEditorKit.selectionUpAction,
 444                      "shift DOWN", DefaultEditorKit.selectionDownAction,
 445                           "ENTER", DefaultEditorKit.insertBreakAction,
 446                             "TAB", DefaultEditorKit.insertTabAction,
 447              "control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
 448                    "control HOME", DefaultEditorKit.beginAction,
 449                     "control END", DefaultEditorKit.endAction,
 450              "control shift HOME", DefaultEditorKit.selectionBeginAction,
 451               "control shift END", DefaultEditorKit.selectionEndAction,
 452                       "control T", "next-link-action",
 453                 "control shift T", "previous-link-action",
 454                   "control SPACE", "activate-link-action",
 455                 "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
 456         });
 457 
 458         // *** Tree
 459 
 460         Object treeOpenIcon = SwingUtilities2.makeIcon(getClass(),
 461                                                        MotifLookAndFeel.class,
 462                                                        "icons/TreeOpen.gif");
 463 
 464         Object treeClosedIcon = SwingUtilities2.makeIcon(getClass(),
 465                                                          MotifLookAndFeel.class,
 466                                                          "icons/TreeClosed.gif");
 467 
 468         Object treeLeafIcon = new UIDefaults.LazyValue() {
 469             public Object createValue(UIDefaults table) {
 470                 return MotifTreeCellRenderer.loadLeafIcon();
 471             }
 472         };
 473 
 474         Object treeExpandedIcon = new UIDefaults.LazyValue() {
 475             public Object createValue(UIDefaults table) {
 476                 return MotifTreeUI.MotifExpandedIcon.createExpandedIcon();
 477             }
 478         };
 479 
 480         Object treeCollapsedIcon = new UIDefaults.LazyValue() {
 481             public Object createValue(UIDefaults table) {
 482                 return MotifTreeUI.MotifCollapsedIcon.createCollapsedIcon();
 483             }
 484         };
 485 
 486         Border menuBarBorder = new MotifBorders.MenuBarBorder(
 487                                           table.getColor("MenuBar.shadow"),
 488                                           table.getColor("MenuBar.highlight"),
 489                                           table.getColor("MenuBar.darkShadow"),
 490                                           table.getColor("activeCaptionBorder"));
 491 
 492 
 493         Border menuMarginBorder = new BorderUIResource.CompoundBorderUIResource(
 494                                           loweredBevelBorder,
 495                                           marginBorder);
 496 
 497 
 498         Border focusCellHighlightBorder = new BorderUIResource.LineBorderUIResource(
 499                                                 table.getColor("activeCaptionBorder"));
 500 
 501         Object sliderFocusInsets = new InsetsUIResource( 0, 0, 0, 0 );
 502 
 503         // ** for tabbedpane
 504 
 505         Object tabbedPaneTabInsets = new InsetsUIResource(3, 4, 3, 4);
 506 
 507         Object tabbedPaneTabPadInsets = new InsetsUIResource(3, 0, 1, 0);
 508 
 509         Object tabbedPaneTabAreaInsets = new InsetsUIResource(4, 2, 0, 8);
 510 
 511         Object tabbedPaneContentBorderInsets = new InsetsUIResource(2, 2, 2, 2);
 512 
 513 
 514         // ** for optionpane
 515 
 516         Object optionPaneBorder = new BorderUIResource.EmptyBorderUIResource(10,0,0,0);
 517 
 518         Object optionPaneButtonAreaBorder = new BorderUIResource.EmptyBorderUIResource(10,10,10,10);
 519 
 520         Object optionPaneMessageAreaBorder = new BorderUIResource.EmptyBorderUIResource(10,10,12,10);
 521 
 522 
 523         Object[] defaults = {
 524 
 525             "Desktop.background", table.get("desktop"),
 526             "Desktop.ancestorInputMap",
 527                new UIDefaults.LazyInputMap(new Object[] {
 528                  "ctrl F5", "restore",
 529                  "ctrl F4", "close",
 530                  "ctrl F7", "move",
 531                  "ctrl F8", "resize",
 532                    "RIGHT", "right",
 533                 "KP_RIGHT", "right",
 534              "shift RIGHT", "shrinkRight",
 535           "shift KP_RIGHT", "shrinkRight",
 536                     "LEFT", "left",
 537                  "KP_LEFT", "left",
 538               "shift LEFT", "shrinkLeft",
 539            "shift KP_LEFT", "shrinkLeft",
 540                       "UP", "up",
 541                    "KP_UP", "up",
 542                 "shift UP", "shrinkUp",
 543              "shift KP_UP", "shrinkUp",
 544                     "DOWN", "down",
 545                  "KP_DOWN", "down",
 546               "shift DOWN", "shrinkDown",
 547            "shift KP_DOWN", "shrinkDown",
 548                   "ESCAPE", "escape",
 549                  "ctrl F9", "minimize",
 550                 "ctrl F10", "maximize",
 551                  "ctrl F6", "selectNextFrame",
 552                 "ctrl TAB", "selectNextFrame",
 553              "ctrl alt F6", "selectNextFrame",
 554        "shift ctrl alt F6", "selectPreviousFrame",
 555                 "ctrl F12", "navigateNext",
 556           "shift ctrl F12", "navigatePrevious"
 557               }),
 558 
 559             "Panel.background", table.get("control"),
 560             "Panel.foreground", table.get("textText"),
 561             "Panel.font", dialogPlain12,
 562 
 563             "ProgressBar.font", dialogPlain12,
 564             "ProgressBar.foreground", controlDarker,
 565             "ProgressBar.background", table.get("control"),
 566             "ProgressBar.selectionForeground", table.get("control"),
 567             "ProgressBar.selectionBackground", table.get("controlText"),
 568             "ProgressBar.border", loweredBevelBorder,
 569             "ProgressBar.cellLength", new Integer(6),
 570             "ProgressBar.cellSpacing", new Integer(0),
 571 
 572             // Buttons
 573             "Button.margin", new InsetsUIResource(2, 4, 2, 4),
 574             "Button.border", buttonBorder,
 575             "Button.background", table.get("control"),
 576             "Button.foreground", table.get("controlText"),
 577             "Button.select", table.get("controlLightShadow"),
 578             "Button.font", dialogPlain12,
 579             "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
 580                           "SPACE", "pressed",
 581                  "released SPACE", "released"
 582               }),
 583 
 584             "CheckBox.textIconGap", new Integer(8),
 585             "CheckBox.margin", new InsetsUIResource(4, 2, 4, 2),
 586             "CheckBox.icon", checkBoxIcon,
 587             "CheckBox.focus", table.get("activeCaptionBorder"),
 588             "CheckBox.focusInputMap",
 589                new UIDefaults.LazyInputMap(new Object[] {
 590                             "SPACE", "pressed",
 591                    "released SPACE", "released"
 592                  }),
 593 
 594             "RadioButton.margin", new InsetsUIResource(4, 2, 4, 2),
 595             "RadioButton.textIconGap", new Integer(8),
 596             "RadioButton.background", table.get("control"),
 597             "RadioButton.foreground", table.get("controlText"),
 598             "RadioButton.icon", radioButtonIcon,
 599             "RadioButton.focus", table.get("activeCaptionBorder"),
 600             "RadioButton.icon", radioButtonIcon,
 601             "RadioButton.focusInputMap",
 602                new UIDefaults.LazyInputMap(new Object[] {
 603                           "SPACE", "pressed",
 604                  "released SPACE", "released"
 605               }),
 606 
 607             "ToggleButton.border", toggleButtonBorder,
 608             "ToggleButton.background", table.get("control"),
 609             "ToggleButton.foreground", table.get("controlText"),
 610             "ToggleButton.focus", table.get("controlText"),
 611             "ToggleButton.select", table.get("controlLightShadow"),
 612             "ToggleButton.focusInputMap",
 613               new UIDefaults.LazyInputMap(new Object[] {
 614                             "SPACE", "pressed",
 615                    "released SPACE", "released"
 616                 }),
 617 
 618             // Menus
 619             "Menu.border", menuMarginBorder,
 620             "Menu.font", dialogPlain12,
 621             "Menu.acceleratorFont", dialogPlain12,
 622             "Menu.acceleratorSelectionForeground", menuItemPressedForeground,
 623             "Menu.foreground", table.get("menuText"),
 624             "Menu.background", table.get("menu"),
 625             "Menu.selectionForeground", menuItemPressedForeground,
 626             "Menu.selectionBackground", menuItemPressedBackground,
 627             "Menu.checkIcon", menuItemCheckIcon,
 628             "Menu.arrowIcon", menuArrowIcon,
 629             "Menu.menuPopupOffsetX", new Integer(0),
 630             "Menu.menuPopupOffsetY", new Integer(0),
 631             "Menu.submenuPopupOffsetX", new Integer(-2),
 632             "Menu.submenuPopupOffsetY", new Integer(3),
 633             "Menu.shortcutKeys", new int[] {KeyEvent.ALT_MASK,
 634                                             KeyEvent.META_MASK},
 635             "Menu.cancelMode", "hideMenuTree",
 636 
 637             "MenuBar.border", menuBarBorder,
 638             "MenuBar.background", table.get("menu"),
 639             "MenuBar.foreground", table.get("menuText"),
 640             "MenuBar.font", dialogPlain12,
 641             "MenuBar.windowBindings", new Object[] {
 642                 "F10", "takeFocus" },
 643 
 644             "MenuItem.border", menuMarginBorder,
 645             "MenuItem.font", dialogPlain12,
 646             "MenuItem.acceleratorFont", dialogPlain12,
 647             "MenuItem.acceleratorSelectionForeground", menuItemPressedForeground,
 648             "MenuItem.foreground", table.get("menuText"),
 649             "MenuItem.background", table.get("menu"),
 650             "MenuItem.selectionForeground", menuItemPressedForeground,
 651             "MenuItem.selectionBackground", menuItemPressedBackground,
 652             "MenuItem.checkIcon", menuItemCheckIcon,
 653             "MenuItem.arrowIcon", menuItemArrowIcon,
 654 
 655             "RadioButtonMenuItem.border", menuMarginBorder,
 656             "RadioButtonMenuItem.font", dialogPlain12,
 657             "RadioButtonMenuItem.acceleratorFont", dialogPlain12,
 658             "RadioButtonMenuItem.acceleratorSelectionForeground", menuItemPressedForeground,
 659             "RadioButtonMenuItem.foreground", table.get("menuText"),
 660             "RadioButtonMenuItem.background", table.get("menu"),
 661             "RadioButtonMenuItem.selectionForeground", menuItemPressedForeground,
 662             "RadioButtonMenuItem.selectionBackground", menuItemPressedBackground,
 663             "RadioButtonMenuItem.checkIcon", radioButtonIcon,
 664             "RadioButtonMenuItem.arrowIcon", menuItemArrowIcon,
 665 
 666             "CheckBoxMenuItem.border", menuMarginBorder,
 667             "CheckBoxMenuItem.font", dialogPlain12,
 668             "CheckBoxMenuItem.acceleratorFont", dialogPlain12,
 669             "CheckBoxMenuItem.acceleratorSelectionForeground", menuItemPressedForeground,
 670             "CheckBoxMenuItem.foreground", table.get("menuText"),
 671             "CheckBoxMenuItem.background", table.get("menu"),
 672             "CheckBoxMenuItem.selectionForeground", menuItemPressedForeground,
 673             "CheckBoxMenuItem.selectionBackground", menuItemPressedBackground,
 674             "CheckBoxMenuItem.checkIcon", checkBoxIcon,
 675             "CheckBoxMenuItem.arrowIcon", menuItemArrowIcon,
 676 
 677             "PopupMenu.background", table.get("menu"),
 678             "PopupMenu.border", popupMenuBorder,
 679             "PopupMenu.foreground", table.get("menuText"),
 680             "PopupMenu.font", dialogPlain12,
 681             "PopupMenu.consumeEventOnClose", Boolean.TRUE,
 682 
 683             "Label.font", dialogPlain12,
 684             "Label.background", table.get("control"),
 685             "Label.foreground", table.get("controlText"),
 686 
 687             "Separator.shadow", table.get("controlShadow"),          // DEPRECATED - DO NOT USE!
 688             "Separator.highlight", table.get("controlLtHighlight"),  // DEPRECATED - DO NOT USE!
 689 
 690             "Separator.background", table.get("controlLtHighlight"),
 691             "Separator.foreground", table.get("controlShadow"),
 692 
 693             "List.focusCellHighlightBorder", focusCellHighlightBorder,
 694             "List.focusInputMap",
 695                new UIDefaults.LazyInputMap(new Object[] {
 696                              "COPY", "copy",
 697                             "PASTE", "paste",
 698                               "CUT", "cut",
 699                    "control INSERT", "copy",
 700                      "shift INSERT", "paste",
 701                      "shift DELETE", "cut",
 702                                "UP", "selectPreviousRow",
 703                             "KP_UP", "selectPreviousRow",
 704                          "shift UP", "selectPreviousRowExtendSelection",
 705                       "shift KP_UP", "selectPreviousRowExtendSelection",
 706                     "ctrl shift UP", "selectPreviousRowExtendSelection",
 707                  "ctrl shift KP_UP", "selectPreviousRowExtendSelection",
 708                           "ctrl UP", "selectPreviousRowChangeLead",
 709                        "ctrl KP_UP", "selectPreviousRowChangeLead",
 710                              "DOWN", "selectNextRow",
 711                           "KP_DOWN", "selectNextRow",
 712                        "shift DOWN", "selectNextRowExtendSelection",
 713                     "shift KP_DOWN", "selectNextRowExtendSelection",
 714                   "ctrl shift DOWN", "selectNextRowExtendSelection",
 715                "ctrl shift KP_DOWN", "selectNextRowExtendSelection",
 716                         "ctrl DOWN", "selectNextRowChangeLead",
 717                      "ctrl KP_DOWN", "selectNextRowChangeLead",
 718                              "LEFT", "selectPreviousColumn",
 719                           "KP_LEFT", "selectPreviousColumn",
 720                        "shift LEFT", "selectPreviousColumnExtendSelection",
 721                     "shift KP_LEFT", "selectPreviousColumnExtendSelection",
 722                   "ctrl shift LEFT", "selectPreviousColumnExtendSelection",
 723                "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
 724                         "ctrl LEFT", "selectPreviousColumnChangeLead",
 725                      "ctrl KP_LEFT", "selectPreviousColumnChangeLead",
 726                             "RIGHT", "selectNextColumn",
 727                          "KP_RIGHT", "selectNextColumn",
 728                       "shift RIGHT", "selectNextColumnExtendSelection",
 729                    "shift KP_RIGHT", "selectNextColumnExtendSelection",
 730                  "ctrl shift RIGHT", "selectNextColumnExtendSelection",
 731               "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
 732                        "ctrl RIGHT", "selectNextColumnChangeLead",
 733                     "ctrl KP_RIGHT", "selectNextColumnChangeLead",
 734                              "HOME", "selectFirstRow",
 735                        "shift HOME", "selectFirstRowExtendSelection",
 736                   "ctrl shift HOME", "selectFirstRowExtendSelection",
 737                         "ctrl HOME", "selectFirstRowChangeLead",
 738                               "END", "selectLastRow",
 739                         "shift END", "selectLastRowExtendSelection",
 740                    "ctrl shift END", "selectLastRowExtendSelection",
 741                          "ctrl END", "selectLastRowChangeLead",
 742                           "PAGE_UP", "scrollUp",
 743                     "shift PAGE_UP", "scrollUpExtendSelection",
 744                "ctrl shift PAGE_UP", "scrollUpExtendSelection",
 745                      "ctrl PAGE_UP", "scrollUpChangeLead",
 746                         "PAGE_DOWN", "scrollDown",
 747                   "shift PAGE_DOWN", "scrollDownExtendSelection",
 748              "ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
 749                    "ctrl PAGE_DOWN", "scrollDownChangeLead",
 750                            "ctrl A", "selectAll",
 751                        "ctrl SLASH", "selectAll",
 752                   "ctrl BACK_SLASH", "clearSelection",
 753                             "SPACE", "addToSelection",
 754                        "ctrl SPACE", "toggleAndAnchor",
 755                       "shift SPACE", "extendTo",
 756                  "ctrl shift SPACE", "moveSelectionTo"
 757                  }),
 758 
 759             "DesktopIcon.icon", SwingUtilities2.makeIcon(getClass(),
 760                                                          MotifLookAndFeel.class,
 761                                                          "icons/DesktopIcon.gif"),
 762             "DesktopIcon.border", null,
 763             // These are a little odd, MotifInternalFrameUI isntalls em!
 764             "DesktopIcon.windowBindings", new Object[]
 765               { "ESCAPE", "hideSystemMenu" },
 766 
 767             "InternalFrame.activeTitleBackground", table.get("activeCaptionBorder"),
 768             "InternalFrame.inactiveTitleBackground", table.get("inactiveCaptionBorder"),
 769             "InternalFrame.windowBindings", new Object[] {
 770                 "shift ESCAPE", "showSystemMenu",
 771                   "ctrl SPACE", "showSystemMenu",
 772                       "ESCAPE", "hideSystemMenu"
 773             },
 774 
 775             "ScrollBar.background", scrollBarTrack,
 776             "ScrollBar.foreground", table.get("control"),
 777             "ScrollBar.track", scrollBarTrack,
 778             "ScrollBar.trackHighlight", table.get("controlDkShadow"),
 779             "ScrollBar.thumb", table.get("control"),
 780             "ScrollBar.thumbHighlight", table.get("controlHighlight"),
 781             "ScrollBar.thumbDarkShadow", table.get("controlDkShadow"),
 782             "ScrollBar.thumbShadow", table.get("controlShadow"),
 783             "ScrollBar.border", loweredBevelBorder,
 784             "ScrollBar.allowsAbsolutePositioning", Boolean.TRUE,
 785             "ScrollBar.ancestorInputMap",
 786                new UIDefaults.LazyInputMap(new Object[] {
 787                        "RIGHT", "positiveUnitIncrement",
 788                     "KP_RIGHT", "positiveUnitIncrement",
 789                         "DOWN", "positiveUnitIncrement",
 790                      "KP_DOWN", "positiveUnitIncrement",
 791                    "PAGE_DOWN", "positiveBlockIncrement",
 792               "ctrl PAGE_DOWN", "positiveBlockIncrement",
 793                         "LEFT", "negativeUnitIncrement",
 794                      "KP_LEFT", "negativeUnitIncrement",
 795                           "UP", "negativeUnitIncrement",
 796                        "KP_UP", "negativeUnitIncrement",
 797                      "PAGE_UP", "negativeBlockIncrement",
 798                 "ctrl PAGE_UP", "negativeBlockIncrement",
 799                         "HOME", "minScroll",
 800                          "END", "maxScroll"
 801                  }),
 802 
 803             "ScrollPane.font", dialogPlain12,
 804             "ScrollPane.background", table.get("control"),
 805             "ScrollPane.foreground", table.get("controlText"),
 806             "ScrollPane.border", null,
 807             "ScrollPane.viewportBorder", loweredBevelBorder,
 808             "ScrollPane.ancestorInputMap",
 809                new UIDefaults.LazyInputMap(new Object[] {
 810                            "RIGHT", "unitScrollRight",
 811                         "KP_RIGHT", "unitScrollRight",
 812                             "DOWN", "unitScrollDown",
 813                          "KP_DOWN", "unitScrollDown",
 814                             "LEFT", "unitScrollLeft",
 815                          "KP_LEFT", "unitScrollLeft",
 816                               "UP", "unitScrollUp",
 817                            "KP_UP", "unitScrollUp",
 818                          "PAGE_UP", "scrollUp",
 819                        "PAGE_DOWN", "scrollDown",
 820                     "ctrl PAGE_UP", "scrollLeft",
 821                   "ctrl PAGE_DOWN", "scrollRight",
 822                        "ctrl HOME", "scrollHome",
 823                         "ctrl END", "scrollEnd"
 824                  }),
 825 
 826             "Slider.font", dialogPlain12,
 827             "Slider.border", focusBevelBorder,
 828             "Slider.foreground", table.get("control"),
 829             "Slider.background", controlDarker,
 830             "Slider.highlight", table.get("controlHighlight"),
 831             "Slider.shadow", table.get("controlShadow"),
 832             "Slider.focus", table.get("controlDkShadow"),
 833             "Slider.focusInsets", sliderFocusInsets,
 834             "Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
 835                          "RIGHT", "positiveUnitIncrement",
 836                       "KP_RIGHT", "positiveUnitIncrement",
 837                           "DOWN", "negativeUnitIncrement",
 838                        "KP_DOWN", "negativeUnitIncrement",
 839                 "ctrl PAGE_DOWN", "negativeBlockIncrement",
 840                           "LEFT", "negativeUnitIncrement",
 841                        "KP_LEFT", "negativeUnitIncrement",
 842                             "UP", "positiveUnitIncrement",
 843                          "KP_UP", "positiveUnitIncrement",
 844                   "ctrl PAGE_UP", "positiveBlockIncrement",
 845                           "HOME", "minScroll",
 846                            "END", "maxScroll"
 847             }),
 848 
 849             // Spinner
 850             "Spinner.ancestorInputMap",
 851                new UIDefaults.LazyInputMap(new Object[] {
 852                                "UP", "increment",
 853                             "KP_UP", "increment",
 854                              "DOWN", "decrement",
 855                           "KP_DOWN", "decrement",
 856                }),
 857             "Spinner.border", textFieldBorder,
 858 
 859             "SplitPane.background", table.get("control"),
 860             "SplitPane.highlight", table.get("controlHighlight"),
 861             "SplitPane.shadow", table.get("controlShadow"),
 862             "SplitPane.dividerSize", new Integer(20),
 863             "SplitPane.activeThumb", table.get("activeCaptionBorder"),
 864             "SplitPane.ancestorInputMap",
 865                new UIDefaults.LazyInputMap(new Object[] {
 866                         "UP", "negativeIncrement",
 867                       "DOWN", "positiveIncrement",
 868                       "LEFT", "negativeIncrement",
 869                      "RIGHT", "positiveIncrement",
 870                      "KP_UP", "negativeIncrement",
 871                    "KP_DOWN", "positiveIncrement",
 872                    "KP_LEFT", "negativeIncrement",
 873                   "KP_RIGHT", "positiveIncrement",
 874                       "HOME", "selectMin",
 875                        "END", "selectMax",
 876                         "F8", "startResize",
 877                         "F6", "toggleFocus",
 878                   "ctrl TAB", "focusOutForward",
 879             "ctrl shift TAB", "focusOutBackward"
 880                }),
 881 
 882             "TabbedPane.font", dialogPlain12,
 883             "TabbedPane.background", table.get("control"),
 884             "TabbedPane.foreground", table.get("controlText"),
 885             "TabbedPane.light", table.get("controlHighlight"),
 886             "TabbedPane.highlight", table.get("controlLtHighlight"),
 887             "TabbedPane.shadow", table.get("controlShadow"),
 888             "TabbedPane.darkShadow", table.get("controlShadow"),
 889             "TabbedPane.unselectedTabBackground", unselectedTabBackground,
 890             "TabbedPane.unselectedTabForeground", unselectedTabForeground,
 891             "TabbedPane.unselectedTabHighlight", unselectedTabHighlight,
 892             "TabbedPane.unselectedTabShadow", unselectedTabShadow,
 893             "TabbedPane.focus", table.get("activeCaptionBorder"),
 894             "TabbedPane.tabInsets", tabbedPaneTabInsets,
 895             "TabbedPane.selectedTabPadInsets", tabbedPaneTabPadInsets,
 896             "TabbedPane.tabAreaInsets", tabbedPaneTabAreaInsets,
 897             "TabbedPane.contentBorderInsets", tabbedPaneContentBorderInsets,
 898             "TabbedPane.focusInputMap",
 899               new UIDefaults.LazyInputMap(new Object[] {
 900                          "RIGHT", "navigateRight",
 901                       "KP_RIGHT", "navigateRight",
 902                           "LEFT", "navigateLeft",
 903                        "KP_LEFT", "navigateLeft",
 904                             "UP", "navigateUp",
 905                          "KP_UP", "navigateUp",
 906                           "DOWN", "navigateDown",
 907                        "KP_DOWN", "navigateDown",
 908                      "ctrl DOWN", "requestFocusForVisibleComponent",
 909                   "ctrl KP_DOWN", "requestFocusForVisibleComponent",
 910                 }),
 911             "TabbedPane.ancestorInputMap",
 912                new UIDefaults.LazyInputMap(new Object[] {
 913                    "ctrl PAGE_DOWN", "navigatePageDown",
 914                      "ctrl PAGE_UP", "navigatePageUp",
 915                           "ctrl UP", "requestFocus",
 916                        "ctrl KP_UP", "requestFocus",
 917                  }),
 918 
 919 
 920             "Tree.background", controlDarker,                              // default: dark slate blue
 921             "Tree.hash", table.get("controlDkShadow"),                     // default: black
 922             "Tree.iconShadow", table.get("controlShadow"),
 923             "Tree.iconHighlight", table.get("controlHighlight"),
 924             "Tree.iconBackground", table.get("control"),
 925             "Tree.iconForeground", table.get("controlShadow"),             // default: black
 926             "Tree.textBackground", controlDarker,             // default: dark slate blue
 927             "Tree.textForeground", table.get("textText"),           // default: black
 928             "Tree.selectionBackground", table.get("text"),            // default: white
 929             "Tree.selectionForeground", table.get("textText"),              // default: black
 930             "Tree.selectionBorderColor", table.get("activeCaptionBorder"), // default: maroon
 931             "Tree.openIcon", treeOpenIcon,
 932             "Tree.closedIcon", treeClosedIcon,
 933             "Tree.leafIcon", treeLeafIcon,
 934             "Tree.expandedIcon", treeExpandedIcon,
 935             "Tree.collapsedIcon", treeCollapsedIcon,
 936             "Tree.editorBorder", focusBorder,
 937             "Tree.editorBorderSelectionColor", table.get("activeCaptionBorder"),
 938             "Tree.rowHeight", new Integer(18),
 939             "Tree.drawsFocusBorderAroundIcon", Boolean.TRUE,
 940             "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
 941                                 "COPY", "copy",
 942                                "PASTE", "paste",
 943                                  "CUT", "cut",
 944                       "control INSERT", "copy",
 945                         "shift INSERT", "paste",
 946                         "shift DELETE", "cut",
 947                                   "UP", "selectPrevious",
 948                                "KP_UP", "selectPrevious",
 949                             "shift UP", "selectPreviousExtendSelection",
 950                          "shift KP_UP", "selectPreviousExtendSelection",
 951                        "ctrl shift UP", "selectPreviousExtendSelection",
 952                     "ctrl shift KP_UP", "selectPreviousExtendSelection",
 953                              "ctrl UP", "selectPreviousChangeLead",
 954                           "ctrl KP_UP", "selectPreviousChangeLead",
 955                                 "DOWN", "selectNext",
 956                              "KP_DOWN", "selectNext",
 957                           "shift DOWN", "selectNextExtendSelection",
 958                        "shift KP_DOWN", "selectNextExtendSelection",
 959                      "ctrl shift DOWN", "selectNextExtendSelection",
 960                   "ctrl shift KP_DOWN", "selectNextExtendSelection",
 961                            "ctrl DOWN", "selectNextChangeLead",
 962                         "ctrl KP_DOWN", "selectNextChangeLead",
 963                                "RIGHT", "selectChild",
 964                             "KP_RIGHT", "selectChild",
 965                                 "LEFT", "selectParent",
 966                              "KP_LEFT", "selectParent",
 967                              "PAGE_UP", "scrollUpChangeSelection",
 968                        "shift PAGE_UP", "scrollUpExtendSelection",
 969                   "ctrl shift PAGE_UP", "scrollUpExtendSelection",
 970                         "ctrl PAGE_UP", "scrollUpChangeLead",
 971                            "PAGE_DOWN", "scrollDownChangeSelection",
 972                      "shift PAGE_DOWN", "scrollDownExtendSelection",
 973                 "ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
 974                       "ctrl PAGE_DOWN", "scrollDownChangeLead",
 975                                 "HOME", "selectFirst",
 976                           "shift HOME", "selectFirstExtendSelection",
 977                      "ctrl shift HOME", "selectFirstExtendSelection",
 978                            "ctrl HOME", "selectFirstChangeLead",
 979                                  "END", "selectLast",
 980                            "shift END", "selectLastExtendSelection",
 981                       "ctrl shift END", "selectLastExtendSelection",
 982                             "ctrl END", "selectLastChangeLead",
 983                                   "F2", "startEditing",
 984                               "ctrl A", "selectAll",
 985                           "ctrl SLASH", "selectAll",
 986                      "ctrl BACK_SLASH", "clearSelection",
 987                            "ctrl LEFT", "scrollLeft",
 988                         "ctrl KP_LEFT", "scrollLeft",
 989                           "ctrl RIGHT", "scrollRight",
 990                        "ctrl KP_RIGHT", "scrollRight",
 991                                "SPACE", "addToSelection",
 992                           "ctrl SPACE", "toggleAndAnchor",
 993                          "shift SPACE", "extendTo",
 994                     "ctrl shift SPACE", "moveSelectionTo"
 995               }),
 996             "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
 997                 "ESCAPE", "cancel" }),
 998 
 999             "Table.focusCellHighlightBorder", focusCellHighlightBorder,
1000             "Table.scrollPaneBorder", null,
1001             "Table.dropLineShortColor", table.get("activeCaptionBorder"),
1002 
1003             //      "Table.background", white,  // cell background color
1004             "Table.ancestorInputMap",
1005                new UIDefaults.LazyInputMap(new Object[] {
1006                                  "COPY", "copy",
1007                                 "PASTE", "paste",
1008                                   "CUT", "cut",
1009                        "control INSERT", "copy",
1010                          "shift INSERT", "paste",
1011                          "shift DELETE", "cut",
1012                                 "RIGHT", "selectNextColumn",
1013                              "KP_RIGHT", "selectNextColumn",
1014                           "shift RIGHT", "selectNextColumnExtendSelection",
1015                        "shift KP_RIGHT", "selectNextColumnExtendSelection",
1016                      "ctrl shift RIGHT", "selectNextColumnExtendSelection",
1017                   "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
1018                            "ctrl RIGHT", "selectNextColumnChangeLead",
1019                         "ctrl KP_RIGHT", "selectNextColumnChangeLead",
1020                                  "LEFT", "selectPreviousColumn",
1021                               "KP_LEFT", "selectPreviousColumn",
1022                            "shift LEFT", "selectPreviousColumnExtendSelection",
1023                         "shift KP_LEFT", "selectPreviousColumnExtendSelection",
1024                       "ctrl shift LEFT", "selectPreviousColumnExtendSelection",
1025                    "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
1026                             "ctrl LEFT", "selectPreviousColumnChangeLead",
1027                          "ctrl KP_LEFT", "selectPreviousColumnChangeLead",
1028                                  "DOWN", "selectNextRow",
1029                               "KP_DOWN", "selectNextRow",
1030                            "shift DOWN", "selectNextRowExtendSelection",
1031                         "shift KP_DOWN", "selectNextRowExtendSelection",
1032                       "ctrl shift DOWN", "selectNextRowExtendSelection",
1033                    "ctrl shift KP_DOWN", "selectNextRowExtendSelection",
1034                             "ctrl DOWN", "selectNextRowChangeLead",
1035                          "ctrl KP_DOWN", "selectNextRowChangeLead",
1036                                    "UP", "selectPreviousRow",
1037                                 "KP_UP", "selectPreviousRow",
1038                              "shift UP", "selectPreviousRowExtendSelection",
1039                           "shift KP_UP", "selectPreviousRowExtendSelection",
1040                         "ctrl shift UP", "selectPreviousRowExtendSelection",
1041                      "ctrl shift KP_UP", "selectPreviousRowExtendSelection",
1042                               "ctrl UP", "selectPreviousRowChangeLead",
1043                            "ctrl KP_UP", "selectPreviousRowChangeLead",
1044                                  "HOME", "selectFirstColumn",
1045                            "shift HOME", "selectFirstColumnExtendSelection",
1046                       "ctrl shift HOME", "selectFirstRowExtendSelection",
1047                             "ctrl HOME", "selectFirstRow",
1048                                   "END", "selectLastColumn",
1049                             "shift END", "selectLastColumnExtendSelection",
1050                        "ctrl shift END", "selectLastRowExtendSelection",
1051                              "ctrl END", "selectLastRow",
1052                               "PAGE_UP", "scrollUpChangeSelection",
1053                         "shift PAGE_UP", "scrollUpExtendSelection",
1054                    "ctrl shift PAGE_UP", "scrollLeftExtendSelection",
1055                          "ctrl PAGE_UP", "scrollLeftChangeSelection",
1056                             "PAGE_DOWN", "scrollDownChangeSelection",
1057                       "shift PAGE_DOWN", "scrollDownExtendSelection",
1058                  "ctrl shift PAGE_DOWN", "scrollRightExtendSelection",
1059                        "ctrl PAGE_DOWN", "scrollRightChangeSelection",
1060                                   "TAB", "selectNextColumnCell",
1061                             "shift TAB", "selectPreviousColumnCell",
1062                                 "ENTER", "selectNextRowCell",
1063                           "shift ENTER", "selectPreviousRowCell",
1064                                "ctrl A", "selectAll",
1065                            "ctrl SLASH", "selectAll",
1066                       "ctrl BACK_SLASH", "clearSelection",
1067                                "ESCAPE", "cancel",
1068                                    "F2", "startEditing",
1069                                 "SPACE", "addToSelection",
1070                            "ctrl SPACE", "toggleAndAnchor",
1071                           "shift SPACE", "extendTo",
1072                      "ctrl shift SPACE", "moveSelectionTo",
1073                                    "F8", "focusHeader"
1074                  }),
1075 
1076 
1077             "FormattedTextField.focusInputMap",
1078               new UIDefaults.LazyInputMap(new Object[] {
1079                            "ctrl C", DefaultEditorKit.copyAction,
1080                            "ctrl V", DefaultEditorKit.pasteAction,
1081                            "ctrl X", DefaultEditorKit.cutAction,
1082                              "COPY", DefaultEditorKit.copyAction,
1083                             "PASTE", DefaultEditorKit.pasteAction,
1084                               "CUT", DefaultEditorKit.cutAction,
1085                        "shift LEFT", DefaultEditorKit.selectionBackwardAction,
1086                     "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction,
1087                       "shift RIGHT", DefaultEditorKit.selectionForwardAction,
1088                    "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction,
1089                         "ctrl LEFT", DefaultEditorKit.previousWordAction,
1090                      "ctrl KP_LEFT", DefaultEditorKit.previousWordAction,
1091                        "ctrl RIGHT", DefaultEditorKit.nextWordAction,
1092                     "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction,
1093                   "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
1094                "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction,
1095                  "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction,
1096               "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction,
1097                            "ctrl A", DefaultEditorKit.selectAllAction,
1098                              "HOME", DefaultEditorKit.beginLineAction,
1099                               "END", DefaultEditorKit.endLineAction,
1100                        "shift HOME", DefaultEditorKit.selectionBeginLineAction,
1101                         "shift END", DefaultEditorKit.selectionEndLineAction,
1102                        "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
1103                  "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
1104                            "ctrl H", DefaultEditorKit.deletePrevCharAction,
1105                            "DELETE", DefaultEditorKit.deleteNextCharAction,
1106                       "ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
1107                   "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
1108                             "RIGHT", DefaultEditorKit.forwardAction,
1109                              "LEFT", DefaultEditorKit.backwardAction,
1110                          "KP_RIGHT", DefaultEditorKit.forwardAction,
1111                           "KP_LEFT", DefaultEditorKit.backwardAction,
1112                             "ENTER", JTextField.notifyAction,
1113                   "ctrl BACK_SLASH", "unselect",
1114                    "control shift O", "toggle-componentOrientation",
1115                            "ESCAPE", "reset-field-edit",
1116                                "UP", "increment",
1117                             "KP_UP", "increment",
1118                              "DOWN", "decrement",
1119                           "KP_DOWN", "decrement",
1120               }),
1121 
1122             // ToolBar.
1123             "ToolBar.ancestorInputMap",
1124                new UIDefaults.LazyInputMap(new Object[] {
1125                         "UP", "navigateUp",
1126                      "KP_UP", "navigateUp",
1127                       "DOWN", "navigateDown",
1128                    "KP_DOWN", "navigateDown",
1129                       "LEFT", "navigateLeft",
1130                    "KP_LEFT", "navigateLeft",
1131                      "RIGHT", "navigateRight",
1132                   "KP_RIGHT", "navigateRight"
1133                  }),
1134 
1135 
1136 
1137             "ComboBox.control", table.get("control"),
1138             "ComboBox.controlForeground", black,
1139             "ComboBox.background", table.get("window"),
1140             "ComboBox.foreground", black,
1141             "ComboBox.border", comboBoxBorder,
1142             "ComboBox.selectionBackground", black,
1143             "ComboBox.selectionForeground", table.get("text"),
1144             "ComboBox.disabledBackground", table.get("control"),
1145             "ComboBox.disabledForeground", table.get("textInactiveText"),
1146             "ComboBox.font", dialogPlain12,
1147             "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
1148                    "ESCAPE", "hidePopup",
1149                   "PAGE_UP", "pageUpPassThrough",
1150                 "PAGE_DOWN", "pageDownPassThrough",
1151                      "HOME", "homePassThrough",
1152                       "END", "endPassThrough",
1153                      "DOWN", "selectNext",
1154                   "KP_DOWN", "selectNext",
1155                        "UP", "selectPrevious",
1156                     "KP_UP", "selectPrevious",
1157                     "SPACE", "spacePopup",
1158                     "ENTER", "enterPressed"
1159 
1160               }),
1161 
1162             "TextField.caretForeground", black,
1163             "TextField.caretBlinkRate", new Integer(500),
1164             "TextField.inactiveForeground", table.get("textInactiveText"),
1165             "TextField.selectionBackground", table.get("textHighlight"),
1166             "TextField.selectionForeground", table.get("textHighlightText"),
1167             "TextField.background", table.get("window"),
1168             "TextField.foreground", table.get("textText"),
1169             "TextField.font", sansSerifPlain12,
1170             "TextField.border", textFieldBorder,
1171             "TextField.focusInputMap", fieldInputMap,
1172 
1173             "PasswordField.caretForeground", black,
1174             "PasswordField.caretBlinkRate", new Integer(500),
1175             "PasswordField.inactiveForeground", table.get("textInactiveText"),
1176             "PasswordField.selectionBackground", table.get("textHighlight"),
1177             "PasswordField.selectionForeground", table.get("textHighlightText"),
1178             "PasswordField.background", table.get("window"),
1179             "PasswordField.foreground", table.get("textText"),
1180             "PasswordField.font", monospacedPlain12,
1181             "PasswordField.border", textFieldBorder,
1182             "PasswordField.focusInputMap", passwordInputMap,
1183 
1184             "TextArea.caretForeground", black,
1185             "TextArea.caretBlinkRate", new Integer(500),
1186             "TextArea.inactiveForeground", table.get("textInactiveText"),
1187             "TextArea.selectionBackground", table.get("textHighlight"),
1188             "TextArea.selectionForeground", table.get("textHighlightText"),
1189             "TextArea.background", table.get("window"),
1190             "TextArea.foreground", table.get("textText"),
1191             "TextArea.font", monospacedPlain12,
1192             "TextArea.border", marginBorder,
1193             "TextArea.focusInputMap", multilineInputMap,
1194 
1195             "TextPane.caretForeground", black,
1196             "TextPane.caretBlinkRate", new Integer(500),
1197             "TextPane.inactiveForeground", table.get("textInactiveText"),
1198             "TextPane.selectionBackground", lightGray,
1199             "TextPane.selectionForeground", table.get("textHighlightText"),
1200             "TextPane.background", white,
1201             "TextPane.foreground", table.get("textText"),
1202             "TextPane.font", serifPlain12,
1203             "TextPane.border", marginBorder,
1204             "TextPane.focusInputMap", multilineInputMap,
1205 
1206             "EditorPane.caretForeground", red,
1207             "EditorPane.caretBlinkRate", new Integer(500),
1208             "EditorPane.inactiveForeground", table.get("textInactiveText"),
1209             "EditorPane.selectionBackground", lightGray,
1210             "EditorPane.selectionForeground", table.get("textHighlightText"),
1211             "EditorPane.background", white,
1212             "EditorPane.foreground", table.get("textText"),
1213             "EditorPane.font", serifPlain12,
1214             "EditorPane.border", marginBorder,
1215             "EditorPane.focusInputMap", multilineInputMap,
1216 
1217 
1218             "FileChooser.ancestorInputMap",
1219                new UIDefaults.LazyInputMap(new Object[] {
1220                      "ESCAPE", "cancelSelection",
1221                      "ENTER", "approveSelection",
1222                 "ctrl ENTER", "approveSelection"
1223                  }),
1224 
1225 
1226             "ToolTip.border", raisedBevelBorder,
1227             "ToolTip.background", table.get("info"),
1228             "ToolTip.foreground", table.get("infoText"),
1229 
1230             // These window InputMap bindings are used when the Menu is
1231             // selected.
1232             "PopupMenu.selectedWindowInputMapBindings", new Object[] {
1233                   "ESCAPE", "cancel",
1234                      "TAB", "cancel",
1235                "shift TAB", "cancel",
1236                     "DOWN", "selectNext",
1237                  "KP_DOWN", "selectNext",
1238                       "UP", "selectPrevious",
1239                    "KP_UP", "selectPrevious",
1240                     "LEFT", "selectParent",
1241                  "KP_LEFT", "selectParent",
1242                    "RIGHT", "selectChild",
1243                 "KP_RIGHT", "selectChild",
1244                    "ENTER", "return",
1245                    "SPACE", "return"
1246             },
1247 
1248 
1249             "OptionPane.border", optionPaneBorder,
1250             "OptionPane.messageAreaBorder", optionPaneMessageAreaBorder,
1251             "OptionPane.buttonAreaBorder", optionPaneButtonAreaBorder,
1252             "OptionPane.errorIcon", SwingUtilities2.makeIcon(getClass(),
1253                                                              MotifLookAndFeel.class,
1254                                                              "icons/Error.gif"),
1255             "OptionPane.informationIcon", SwingUtilities2.makeIcon(getClass(),
1256                                                                    MotifLookAndFeel.class,
1257                                                                    "icons/Inform.gif"),
1258             "OptionPane.warningIcon", SwingUtilities2.makeIcon(getClass(),
1259                                                                MotifLookAndFeel.class,
1260                                                                "icons/Warn.gif"),
1261             "OptionPane.questionIcon", SwingUtilities2.makeIcon(getClass(),
1262                                                                 MotifLookAndFeel.class,
1263                                                                 "icons/Question.gif"),
1264             "OptionPane.windowBindings", new Object[] {
1265                 "ESCAPE", "close" },
1266 
1267             // These bindings are only enabled when there is a default
1268             // button set on the rootpane.
1269             "RootPane.defaultButtonWindowKeyBindings", new Object[] {
1270                              "ENTER", "press",
1271                     "released ENTER", "release",
1272                         "ctrl ENTER", "press",
1273                "ctrl released ENTER", "release"
1274               },
1275         };
1276 
1277         table.putDefaults(defaults);
1278     }
1279 
1280 }