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