1 /*
   2  * Copyright (c) 2011, 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.apple.laf;
  27 
  28 import java.awt.*;
  29 import java.security.PrivilegedAction;
  30 import java.util.*;
  31 
  32 import javax.swing.*;
  33 import javax.swing.border.Border;
  34 import javax.swing.plaf.*;
  35 import javax.swing.plaf.basic.BasicLookAndFeel;
  36 
  37 import sun.swing.*;
  38 import apple.laf.*;
  39 
  40 @SuppressWarnings("serial") // Superclass is not serializable across versions
  41 public class AquaLookAndFeel extends BasicLookAndFeel {
  42     static final String sOldPropertyPrefix = "com.apple.macos."; // old prefix for things like 'useScreenMenuBar'
  43     static final String sPropertyPrefix = "apple.laf."; // new prefix for things like 'useScreenMenuBar'
  44 
  45     // for lazy initalizers. Following the pattern from metal.
  46     private static final String PKG_PREFIX = "com.apple.laf.";
  47     private static final String kAquaImageFactoryName = PKG_PREFIX + "AquaImageFactory";
  48     private static final String kAquaFontsName = PKG_PREFIX + "AquaFonts";
  49 
  50     /**
  51      * Return a short string that identifies this look and feel, e.g.
  52      * "CDE/Motif".  This string should be appropriate for a menu item.
  53      * Distinct look and feels should have different names, e.g.
  54      * a subclass of MotifLookAndFeel that changes the way a few components
  55      * are rendered should be called "CDE/Motif My Way"; something
  56      * that would be useful to a user trying to select a L&F from a list
  57      * of names.
  58      */
  59     public String getName() {
  60         return "Mac OS X";
  61     }
  62 
  63     /**
  64      * Return a string that identifies this look and feel.  This string
  65      * will be used by applications/services that want to recognize
  66      * well known look and feel implementations.  Presently
  67      * the well known names are "Motif", "Windows", "Mac", "Metal".  Note
  68      * that a LookAndFeel derived from a well known superclass
  69      * that doesn't make any fundamental changes to the look or feel
  70      * shouldn't override this method.
  71      */
  72     public String getID() {
  73         return "Aqua";
  74     }
  75 
  76     /**
  77      * Return a one line description of this look and feel implementation,
  78      * e.g. "The CDE/Motif Look and Feel".   This string is intended for
  79      * the user, e.g. in the title of a window or in a ToolTip message.
  80      */
  81     public String getDescription() {
  82         return "Aqua Look and Feel for Mac OS X";
  83     }
  84 
  85     /**
  86      * Returns true if the <code>LookAndFeel</code> returned
  87      * <code>RootPaneUI</code> instances support providing Window decorations
  88      * in a <code>JRootPane</code>.
  89      * <p>
  90      * The default implementation returns false, subclasses that support
  91      * Window decorations should override this and return true.
  92      *
  93      * @return True if the RootPaneUI instances created support client side
  94      *             decorations
  95      * @see JDialog#setDefaultLookAndFeelDecorated
  96      * @see JFrame#setDefaultLookAndFeelDecorated
  97      * @see JRootPane#setWindowDecorationStyle
  98      * @since 1.4
  99      */
 100     public boolean getSupportsWindowDecorations() {
 101         return false;
 102     }
 103 
 104     /**
 105      * If the underlying platform has a "native" look and feel, and this
 106      * is an implementation of it, return true.
 107      */
 108     public boolean isNativeLookAndFeel() {
 109         return true;
 110     }
 111 
 112     /**
 113      * Return true if the underlying platform supports and or permits
 114      * this look and feel.  This method returns false if the look
 115      * and feel depends on special resources or legal agreements that
 116      * aren't defined for the current platform.
 117      *
 118      * @see UIManager#setLookAndFeel
 119      */
 120     public boolean isSupportedLookAndFeel() {
 121         return true;
 122     }
 123 
 124     /**
 125      * UIManager.setLookAndFeel calls this method before the first
 126      * call (and typically the only call) to getDefaults().  Subclasses
 127      * should do any one-time setup they need here, rather than
 128      * in a static initializer, because look and feel class objects
 129      * may be loaded just to discover that isSupportedLookAndFeel()
 130      * returns false.
 131      *
 132      * @see #uninitialize
 133      * @see UIManager#setLookAndFeel
 134      */
 135     public void initialize() {
 136         java.security.AccessController.doPrivileged(new PrivilegedAction<Void>() {
 137                 public Void run() {
 138                     System.loadLibrary("osxui");
 139                     return null;
 140                 }
 141             });
 142 
 143         java.security.AccessController.doPrivileged(new PrivilegedAction<Void>(){
 144             @Override
 145             public Void run() {
 146                 JRSUIControl.initJRSUI();
 147                 return null;
 148             }
 149         });
 150 
 151         super.initialize();
 152         final ScreenPopupFactory spf = new ScreenPopupFactory();
 153         spf.setActive(true);
 154         PopupFactory.setSharedInstance(spf);
 155 
 156         KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventPostProcessor(AquaMnemonicHandler.getInstance());
 157     }
 158 
 159     /**
 160      * UIManager.setLookAndFeel calls this method just before we're
 161      * replaced by a new default look and feel.   Subclasses may
 162      * choose to free up some resources here.
 163      *
 164      * @see #initialize
 165      */
 166     public void uninitialize() {
 167         KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventPostProcessor(AquaMnemonicHandler.getInstance());
 168 
 169         final PopupFactory popupFactory = PopupFactory.getSharedInstance();
 170         if (popupFactory != null && popupFactory instanceof ScreenPopupFactory) {
 171             ((ScreenPopupFactory)popupFactory).setActive(false);
 172         }
 173 
 174         super.uninitialize();
 175     }
 176 
 177     /**
 178      * Returns an <code>ActionMap</code>.
 179      * <P>
 180      * This <code>ActionMap</code> contains <code>Actions</code> that
 181      * embody the ability to render an auditory cue. These auditory
 182      * cues map onto user and system activities that may be useful
 183      * for an end user to know about (such as a dialog box appearing).
 184      * <P>
 185      * At the appropriate time in a <code>JComponent</code> UI's lifecycle,
 186      * the ComponentUI is responsible for getting the appropriate
 187      * <code>Action</code> out of the <code>ActionMap</code> and passing
 188      * it on to <code>playSound</code>.
 189      * <P>
 190      * The <code>Actions</code> in this <code>ActionMap</code> are
 191      * created by the <code>createAudioAction</code> method.
 192      *
 193      * @return      an ActionMap containing Actions
 194      *              responsible for rendering auditory cues
 195      * @see #createAudioAction
 196      * @see #playSound(Action)
 197      * @since 1.4
 198      */
 199     protected ActionMap getAudioActionMap() {
 200         ActionMap audioActionMap = (ActionMap)UIManager.get("AuditoryCues.actionMap");
 201         if (audioActionMap != null) return audioActionMap;
 202 
 203         final Object[] acList = (Object[])UIManager.get("AuditoryCues.cueList");
 204         if (acList != null) {
 205             audioActionMap = new ActionMapUIResource();
 206             for (int counter = acList.length - 1; counter >= 0; counter--) {
 207                 audioActionMap.put(acList[counter], createAudioAction(acList[counter]));
 208             }
 209         }
 210         UIManager.getLookAndFeelDefaults().put("AuditoryCues.actionMap", audioActionMap);
 211 
 212         return audioActionMap;
 213     }
 214 
 215     /**
 216      * We override getDefaults() so we can install our own debug defaults
 217      * if needed for testing
 218      */
 219     public UIDefaults getDefaults() {
 220         final UIDefaults table = new UIDefaults();
 221         // use debug defaults if you want to see every query into the defaults object.
 222         //UIDefaults table = new DebugDefaults();
 223         try {
 224             // PopupFactory.getSharedInstance().setPopupType(2);
 225             initClassDefaults(table);
 226 
 227             // Here we install all the Basic defaults in case we missed some in our System color
 228             // or component defaults that follow. Eventually we will take this out.
 229             // This is a big negative to performance so we want to get it out as soon
 230             // as we are comfortable with the Aqua defaults.
 231             super.initSystemColorDefaults(table);
 232             super.initComponentDefaults(table);
 233 
 234             // Because the last elements added win in precedence we add all of our aqua elements here.
 235             initSystemColorDefaults(table);
 236             initComponentDefaults(table);
 237         } catch(final Exception e) {
 238             e.printStackTrace();
 239         }
 240         return table;
 241     }
 242 
 243     /**
 244      * Initialize the defaults table with the name of the ResourceBundle
 245      * used for getting localized defaults.  Also initialize the default
 246      * locale used when no locale is passed into UIDefaults.get().  The
 247      * default locale should generally not be relied upon. It is here for
 248      * compatibility with releases prior to 1.4.
 249      */
 250     private void initResourceBundle(final UIDefaults table) {
 251         table.setDefaultLocale(Locale.getDefault());
 252         table.addResourceBundle(PKG_PREFIX + "resources.aqua");
 253         try {
 254             final ResourceBundle aquaProperties = ResourceBundle.getBundle(PKG_PREFIX + "resources.aqua");
 255             final Enumeration<String> propertyKeys = aquaProperties.getKeys();
 256 
 257             while (propertyKeys.hasMoreElements()) {
 258                 final String key = propertyKeys.nextElement();
 259                 table.put(key, aquaProperties.getString(key));
 260             }
 261         } catch (final Exception e) {
 262         }
 263     }
 264 
 265     /**
 266      * This is the last step in the getDefaults routine usually called from our superclass
 267      */
 268     protected void initComponentDefaults(final UIDefaults table) {
 269         initResourceBundle(table);
 270 
 271         final InsetsUIResource zeroInsets = new InsetsUIResource(0, 0, 0, 0);
 272         final InsetsUIResource menuItemMargin = zeroInsets;
 273 
 274         // <rdar://problem/5189013> Entire Java application window refreshes when moving off Shortcut menu item
 275         final Boolean useOpaqueComponents = Boolean.TRUE;
 276 
 277         final Boolean buttonShouldBeOpaque = AquaUtils.shouldUseOpaqueButtons() ? Boolean.TRUE : Boolean.FALSE;
 278 
 279         // *** List value objects
 280         final Object listCellRendererActiveValue = new UIDefaults.ActiveValue(){
 281             public Object createValue(UIDefaults defaultsTable) {
 282                 return new DefaultListCellRenderer.UIResource();
 283             }
 284         };
 285 
 286         // SJA - I'm basing this on what is in the MetalLookAndFeel class, but
 287         // without being based on BasicLookAndFeel. We want more flexibility.
 288         // The key to doing this well is to use Lazy initializing classes as
 289         // much as possible.
 290 
 291         // Here I want to go to native and get all the values we'd need for colors etc.
 292         final Border toolTipBorder = new BorderUIResource.EmptyBorderUIResource(2, 0, 2, 0);
 293         final ColorUIResource toolTipBackground = new ColorUIResource(255, 255, (int)(255.0 * 0.80));
 294         final ColorUIResource black = new ColorUIResource(Color.black);
 295         final ColorUIResource white = new ColorUIResource(Color.white);
 296         final ColorUIResource smokyGlass = new ColorUIResource(new Color(0, 0, 0, 152));
 297         final ColorUIResource dockIconRim = new ColorUIResource(new Color(192, 192, 192, 192));
 298         final ColorUIResource mediumTranslucentBlack = new ColorUIResource(new Color(0, 0, 0, 100));
 299         final ColorUIResource translucentWhite = new ColorUIResource(new Color(255, 255, 255, 254));
 300     //    final ColorUIResource lightGray = new ColorUIResource(232, 232, 232);
 301         final ColorUIResource disabled = new ColorUIResource(0.5f, 0.5f, 0.5f);
 302         final ColorUIResource disabledShadow = new ColorUIResource(0.25f, 0.25f, 0.25f);
 303         final ColorUIResource selected = new ColorUIResource(1.0f, 0.4f, 0.4f);
 304 
 305         // Contrast tab UI colors
 306 
 307         final ColorUIResource selectedTabTitlePressedColor = new ColorUIResource(240, 240, 240);
 308         final ColorUIResource selectedTabTitleDisabledColor = new ColorUIResource(new Color(1, 1, 1, 0.55f));
 309         final ColorUIResource selectedTabTitleNormalColor = white;
 310         final ColorUIResource selectedTabTitleShadowDisabledColor = new ColorUIResource(new Color(0, 0, 0, 0.25f));
 311         final ColorUIResource selectedTabTitleShadowNormalColor = mediumTranslucentBlack;
 312         final ColorUIResource nonSelectedTabTitleNormalColor = black;
 313 
 314         final ColorUIResource toolbarDragHandleColor = new ColorUIResource(140, 140, 140);
 315 
 316         // sja todo Make these lazy values so we only get them when required - if we deem it necessary
 317         // it may be the case that we think the overhead of a proxy lazy value is not worth delaying
 318         // creating the object if we think that most swing apps will use this.
 319         // the lazy value is useful for delaying initialization until this default value is actually
 320         // accessed by the LAF instead of at init time, so making it lazy should speed up
 321         // our launch times of Swing apps.
 322 
 323         // *** Text value objects
 324         final Object marginBorder = new SwingLazyValue("javax.swing.plaf.basic.BasicBorders$MarginBorder");
 325 
 326         final Object zero = new Integer(0);
 327         final Object editorMargin = zeroInsets; // this is not correct - look at TextEdit to determine the right margin
 328         final Object textCaretBlinkRate = new Integer(500);
 329         final Object textFieldBorder = new SwingLazyValue(PKG_PREFIX + "AquaTextFieldBorder", "getTextFieldBorder");
 330         final Object textAreaBorder = marginBorder; // text areas have no real border - radar 311073
 331 
 332         final Object scollListBorder = new SwingLazyValue(PKG_PREFIX + "AquaScrollRegionBorder", "getScrollRegionBorder");
 333         final Object aquaTitledBorder = new SwingLazyValue(PKG_PREFIX + "AquaGroupBorder", "getBorderForTitledBorder");
 334         final Object aquaInsetBorder = new SwingLazyValue(PKG_PREFIX + "AquaGroupBorder", "getTitlelessBorder");
 335 
 336         final Border listHeaderBorder = AquaTableHeaderBorder.getListHeaderBorder();
 337         final Border zeroBorder = new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0);
 338 
 339         // we can't seem to proxy Colors
 340         final Color selectionBackground = AquaImageFactory.getSelectionBackgroundColorUIResource();
 341         final Color selectionForeground = AquaImageFactory.getSelectionForegroundColorUIResource();
 342         final Color selectionInactiveBackground = AquaImageFactory.getSelectionInactiveBackgroundColorUIResource();
 343         final Color selectionInactiveForeground = AquaImageFactory.getSelectionInactiveForegroundColorUIResource();
 344 
 345         final Color textHighlightText = AquaImageFactory.getTextSelectionForegroundColorUIResource();
 346         final Color textHighlight = AquaImageFactory.getTextSelectionBackgroundColorUIResource();
 347         final Color textHighlightInactive = new ColorUIResource(212, 212, 212);
 348 
 349         final Color textInactiveText = disabled;
 350         final Color textForeground = black;
 351         final Color textBackground = white;
 352         final Color textInactiveBackground = white;
 353 
 354         final Color textPasswordFieldCapsLockIconColor = mediumTranslucentBlack;
 355 
 356         final Object internalFrameBorder = new SwingLazyValue("javax.swing.plaf.basic.BasicBorders", "getInternalFrameBorder");
 357         final Color desktopBackgroundColor = new ColorUIResource(new Color(65, 105, 170));//SystemColor.desktop
 358 
 359         final Color focusRingColor = AquaImageFactory.getFocusRingColorUIResource();
 360         final Border focusCellHighlightBorder = new BorderUIResource.LineBorderUIResource(focusRingColor);
 361 
 362         final Color windowBackgroundColor = AquaImageFactory.getWindowBackgroundColorUIResource();
 363         final Color panelBackgroundColor = windowBackgroundColor;
 364         final Color tabBackgroundColor = windowBackgroundColor;
 365         final Color controlBackgroundColor = windowBackgroundColor;
 366 
 367         final Object controlFont = new SwingLazyValue(kAquaFontsName, "getControlTextFont");
 368         final Object controlSmallFont = new SwingLazyValue(kAquaFontsName, "getControlTextSmallFont");
 369         final Object alertHeaderFont = new SwingLazyValue(kAquaFontsName, "getAlertHeaderFont");
 370         final Object menuFont = new SwingLazyValue(kAquaFontsName, "getMenuFont");
 371         final Object viewFont = new SwingLazyValue(kAquaFontsName, "getViewFont");
 372 
 373         final Color menuBackgroundColor = new ColorUIResource(Color.white);
 374         final Color menuForegroundColor = black;
 375 
 376         final Color menuSelectedForegroundColor = white;
 377         final Color menuSelectedBackgroundColor = focusRingColor;
 378 
 379         final Color menuDisabledBackgroundColor = menuBackgroundColor;
 380         final Color menuDisabledForegroundColor = disabled;
 381 
 382         final Color menuAccelForegroundColor = black;
 383         final Color menuAccelSelectionForegroundColor = black;
 384 
 385         final Border menuBorder = new AquaMenuBorder();
 386 
 387         final UIDefaults.LazyInputMap controlFocusInputMap = new UIDefaults.LazyInputMap(new Object[]{
 388             "SPACE", "pressed",
 389             "released SPACE", "released"
 390         });
 391 
 392         // sja testing
 393         final Object confirmIcon = new SwingLazyValue(kAquaImageFactoryName, "getConfirmImageIcon"); // AquaImageFactory.getConfirmImageIcon();
 394         final Object cautionIcon = new SwingLazyValue(kAquaImageFactoryName, "getCautionImageIcon"); // AquaImageFactory.getCautionImageIcon();
 395         final Object stopIcon = new SwingLazyValue(kAquaImageFactoryName, "getStopImageIcon"); // AquaImageFactory.getStopImageIcon();
 396         final Object securityIcon = new SwingLazyValue(kAquaImageFactoryName, "getLockImageIcon"); // AquaImageFactory.getLockImageIcon();
 397 
 398         final AquaKeyBindings aquaKeyBindings = AquaKeyBindings.instance();
 399 
 400         final Object[] defaults = {
 401             "control", windowBackgroundColor, /* Default color for controls (buttons, sliders, etc) */
 402 
 403             // Buttons
 404             "Button.background", controlBackgroundColor,
 405             "Button.foreground", black,
 406             "Button.disabledText", disabled,
 407             "Button.select", selected,
 408             "Button.border", new SwingLazyValue(PKG_PREFIX + "AquaButtonBorder", "getDynamicButtonBorder"),
 409             "Button.font", controlFont,
 410             "Button.textIconGap", new Integer(4),
 411             "Button.textShiftOffset", zero, // radar 3308129 - aqua doesn't move images when pressed.
 412             "Button.focusInputMap", controlFocusInputMap,
 413             "Button.margin", new InsetsUIResource(0, 2, 0, 2),
 414             "Button.opaque", buttonShouldBeOpaque,
 415 
 416             "CheckBox.background", controlBackgroundColor,
 417             "CheckBox.foreground", black,
 418             "CheckBox.disabledText", disabled,
 419             "CheckBox.select", selected,
 420             "CheckBox.icon", new SwingLazyValue(PKG_PREFIX + "AquaButtonCheckBoxUI", "getSizingCheckBoxIcon"),
 421             "CheckBox.font", controlFont,
 422             "CheckBox.border", AquaButtonBorder.getBevelButtonBorder(),
 423             "CheckBox.margin", new InsetsUIResource(1, 1, 0, 1),
 424             // radar 3583849. This property never gets
 425             // used. The border for the Checkbox gets overridden
 426             // by AquaRadiButtonUI.setThemeBorder(). Needs refactoring. (vm)
 427             // why is button focus commented out?
 428             //"CheckBox.focus", getFocusColor(),
 429             "CheckBox.focusInputMap", controlFocusInputMap,
 430 
 431             "CheckBoxMenuItem.font", menuFont,
 432             "CheckBoxMenuItem.acceleratorFont", menuFont,
 433             "CheckBoxMenuItem.background", menuBackgroundColor,
 434             "CheckBoxMenuItem.foreground", menuForegroundColor,
 435             "CheckBoxMenuItem.selectionBackground", menuSelectedBackgroundColor,
 436             "CheckBoxMenuItem.selectionForeground", menuSelectedForegroundColor,
 437             "CheckBoxMenuItem.disabledBackground", menuDisabledBackgroundColor,
 438             "CheckBoxMenuItem.disabledForeground", menuDisabledForegroundColor,
 439             "CheckBoxMenuItem.acceleratorForeground", menuAccelForegroundColor,
 440             "CheckBoxMenuItem.acceleratorSelectionForeground", menuAccelSelectionForegroundColor,
 441             "CheckBoxMenuItem.acceleratorDelimiter", "",
 442             "CheckBoxMenuItem.border", menuBorder, // for inset calculation
 443             "CheckBoxMenuItem.margin", menuItemMargin,
 444             "CheckBoxMenuItem.borderPainted", Boolean.TRUE,
 445             "CheckBoxMenuItem.checkIcon", new SwingLazyValue(kAquaImageFactoryName, "getMenuItemCheckIcon"),
 446             "CheckBoxMenuItem.dashIcon", new SwingLazyValue(kAquaImageFactoryName, "getMenuItemDashIcon"),
 447             //"CheckBoxMenuItem.arrowIcon", null,
 448 
 449             "ColorChooser.background", panelBackgroundColor,
 450 
 451             // *** ComboBox
 452             "ComboBox.font", controlFont,
 453             "ComboBox.background", controlBackgroundColor, //menuBackgroundColor, // "menu" when it has no scrollbar, "listView" when it does
 454             "ComboBox.foreground", menuForegroundColor,
 455             "ComboBox.selectionBackground", menuSelectedBackgroundColor,
 456             "ComboBox.selectionForeground", menuSelectedForegroundColor,
 457             "ComboBox.disabledBackground", menuDisabledBackgroundColor,
 458             "ComboBox.disabledForeground", menuDisabledForegroundColor,
 459             "ComboBox.ancestorInputMap", aquaKeyBindings.getComboBoxInputMap(),
 460 
 461             "DesktopIcon.border", internalFrameBorder,
 462             "DesktopIcon.borderColor", smokyGlass,
 463             "DesktopIcon.borderRimColor", dockIconRim,
 464             "DesktopIcon.labelBackground", mediumTranslucentBlack,
 465             "Desktop.background", desktopBackgroundColor,
 466 
 467             "EditorPane.focusInputMap", aquaKeyBindings.getMultiLineTextInputMap(),
 468             "EditorPane.font", controlFont,
 469             "EditorPane.background", textBackground,
 470             "EditorPane.foreground", textForeground,
 471             "EditorPane.selectionBackground", textHighlight,
 472             "EditorPane.selectionForeground", textHighlightText,
 473             "EditorPane.caretForeground", textForeground,
 474             "EditorPane.caretBlinkRate", textCaretBlinkRate,
 475             "EditorPane.inactiveForeground", textInactiveText,
 476             "EditorPane.inactiveBackground", textInactiveBackground,
 477             "EditorPane.border", textAreaBorder,
 478             "EditorPane.margin", editorMargin,
 479 
 480             "FileChooser.newFolderIcon", AquaIcon.SystemIcon.getFolderIconUIResource(),
 481             "FileChooser.upFolderIcon", AquaIcon.SystemIcon.getFolderIconUIResource(),
 482             "FileChooser.homeFolderIcon", AquaIcon.SystemIcon.getDesktopIconUIResource(),
 483             "FileChooser.detailsViewIcon", AquaIcon.SystemIcon.getComputerIconUIResource(),
 484             "FileChooser.listViewIcon", AquaIcon.SystemIcon.getComputerIconUIResource(),
 485 
 486             "FileView.directoryIcon", AquaIcon.SystemIcon.getFolderIconUIResource(),
 487             "FileView.fileIcon", AquaIcon.SystemIcon.getDocumentIconUIResource(),
 488             "FileView.computerIcon", AquaIcon.SystemIcon.getDesktopIconUIResource(),
 489             "FileView.hardDriveIcon", AquaIcon.SystemIcon.getHardDriveIconUIResource(),
 490             "FileView.floppyDriveIcon", AquaIcon.SystemIcon.getFloppyIconUIResource(),
 491 
 492             // File View
 493             "FileChooser.cancelButtonMnemonic", zero,
 494             "FileChooser.saveButtonMnemonic", zero,
 495             "FileChooser.openButtonMnemonic", zero,
 496             "FileChooser.updateButtonMnemonic", zero,
 497             "FileChooser.helpButtonMnemonic", zero,
 498             "FileChooser.directoryOpenButtonMnemonic", zero,
 499 
 500             "FileChooser.lookInLabelMnemonic", zero,
 501             "FileChooser.fileNameLabelMnemonic", zero,
 502             "FileChooser.filesOfTypeLabelMnemonic", zero,
 503 
 504             "Focus.color", focusRingColor,
 505 
 506             "FormattedTextField.focusInputMap", aquaKeyBindings.getFormattedTextFieldInputMap(),
 507             "FormattedTextField.font", controlFont,
 508             "FormattedTextField.background", textBackground,
 509             "FormattedTextField.foreground", textForeground,
 510             "FormattedTextField.inactiveForeground", textInactiveText,
 511             "FormattedTextField.inactiveBackground", textInactiveBackground,
 512             "FormattedTextField.selectionBackground", textHighlight,
 513             "FormattedTextField.selectionForeground", textHighlightText,
 514             "FormattedTextField.caretForeground", textForeground,
 515             "FormattedTextField.caretBlinkRate", textCaretBlinkRate,
 516             "FormattedTextField.border", textFieldBorder,
 517             "FormattedTextField.margin", zeroInsets,
 518 
 519             "IconButton.font", controlSmallFont,
 520 
 521             "InternalFrame.titleFont", menuFont,
 522             "InternalFrame.background", windowBackgroundColor,
 523             "InternalFrame.borderColor", windowBackgroundColor,
 524             "InternalFrame.borderShadow", Color.red,
 525             "InternalFrame.borderDarkShadow", Color.green,
 526             "InternalFrame.borderHighlight", Color.blue,
 527             "InternalFrame.borderLight", Color.yellow,
 528             "InternalFrame.opaque", Boolean.FALSE,
 529             "InternalFrame.border", null, //internalFrameBorder,
 530             "InternalFrame.icon", null,
 531 
 532             "InternalFrame.paletteBorder", null,//internalFrameBorder,
 533             "InternalFrame.paletteTitleFont", menuFont,
 534             "InternalFrame.paletteBackground", windowBackgroundColor,
 535 
 536             "InternalFrame.optionDialogBorder", null,//internalFrameBorder,
 537             "InternalFrame.optionDialogTitleFont", menuFont,
 538             "InternalFrame.optionDialogBackground", windowBackgroundColor,
 539 
 540             /* Default frame icons are undefined for Basic. */
 541 
 542             "InternalFrame.closeIcon", new SwingLazyValue(PKG_PREFIX + "AquaInternalFrameUI", "exportCloseIcon"),
 543             "InternalFrame.maximizeIcon", new SwingLazyValue(PKG_PREFIX + "AquaInternalFrameUI", "exportZoomIcon"),
 544             "InternalFrame.iconifyIcon", new SwingLazyValue(PKG_PREFIX + "AquaInternalFrameUI", "exportMinimizeIcon"),
 545             "InternalFrame.minimizeIcon", new SwingLazyValue(PKG_PREFIX + "AquaInternalFrameUI", "exportMinimizeIcon"),
 546             // this could be either grow or icon
 547             // we decided to make it icon so that anyone who uses
 548             // these for ui will have different icons for max and min
 549             // these icons are pretty crappy to use in Mac OS X since
 550             // they really are interactive but we have to return a static
 551             // icon for now.
 552 
 553             // InternalFrame Auditory Cue Mappings
 554             "InternalFrame.closeSound", null,
 555             "InternalFrame.maximizeSound", null,
 556             "InternalFrame.minimizeSound", null,
 557             "InternalFrame.restoreDownSound", null,
 558             "InternalFrame.restoreUpSound", null,
 559 
 560             "InternalFrame.activeTitleBackground", windowBackgroundColor,
 561             "InternalFrame.activeTitleForeground", textForeground,
 562             "InternalFrame.inactiveTitleBackground", windowBackgroundColor,
 563             "InternalFrame.inactiveTitleForeground", textInactiveText,
 564             "InternalFrame.windowBindings", new Object[]{
 565                 "shift ESCAPE", "showSystemMenu",
 566                 "ctrl SPACE", "showSystemMenu",
 567                 "ESCAPE", "hideSystemMenu"
 568             },
 569 
 570             // Radar [3543438]. We now define the TitledBorder properties for font and color.
 571             // Aqua HIG doesn't define TitledBorders as Swing does. Eventually, we might want to
 572             // re-think TitledBorder to behave more like a Box (NSBox). (vm)
 573             "TitledBorder.font", controlFont,
 574             "TitledBorder.titleColor", black,
 575         //    "TitledBorder.border", -- we inherit this property from BasicLookAndFeel (etched border)
 576             "TitledBorder.aquaVariant", aquaTitledBorder, // this is the border that matches what aqua really looks like
 577             "InsetBorder.aquaVariant", aquaInsetBorder, // this is the title-less variant
 578 
 579             // *** Label
 580             "Label.font", controlFont, // themeLabelFont is for small things like ToolbarButtons
 581             "Label.background", controlBackgroundColor,
 582             "Label.foreground", black,
 583             "Label.disabledForeground", disabled,
 584             "Label.disabledShadow", disabledShadow,
 585             "Label.opaque", useOpaqueComponents,
 586             "Label.border", null,
 587 
 588             "List.font", viewFont, // [3577901] Aqua HIG says "default font of text in lists and tables" should be 12 point (vm).
 589             "List.background", white,
 590             "List.foreground", black,
 591             "List.selectionBackground", selectionBackground,
 592             "List.selectionForeground", selectionForeground,
 593             "List.selectionInactiveBackground", selectionInactiveBackground,
 594             "List.selectionInactiveForeground", selectionInactiveForeground,
 595             "List.focusCellHighlightBorder", focusCellHighlightBorder,
 596             "List.border", null,
 597             "List.cellRenderer", listCellRendererActiveValue,
 598 
 599             "List.sourceListBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaListUI", "getSourceListBackgroundPainter"),
 600             "List.sourceListSelectionBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaListUI", "getSourceListSelectionBackgroundPainter"),
 601             "List.sourceListFocusedSelectionBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaListUI", "getSourceListFocusedSelectionBackgroundPainter"),
 602             "List.evenRowBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaListUI", "getListEvenBackgroundPainter"),
 603             "List.oddRowBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaListUI", "getListOddBackgroundPainter"),
 604 
 605             // <rdar://Problem/3743210> The modifier for the Mac is meta, not control.
 606             "List.focusInputMap", aquaKeyBindings.getListInputMap(),
 607 
 608             //"List.scrollPaneBorder", listBoxBorder, // Not used in Swing1.1
 609             //"ListItem.border", ThemeMenu.listItemBorder(), // for inset calculation
 610 
 611             // *** Menus
 612             "Menu.font", menuFont,
 613             "Menu.acceleratorFont", menuFont,
 614             "Menu.background", menuBackgroundColor,
 615             "Menu.foreground", menuForegroundColor,
 616             "Menu.selectionBackground", menuSelectedBackgroundColor,
 617             "Menu.selectionForeground", menuSelectedForegroundColor,
 618             "Menu.disabledBackground", menuDisabledBackgroundColor,
 619             "Menu.disabledForeground", menuDisabledForegroundColor,
 620             "Menu.acceleratorForeground", menuAccelForegroundColor,
 621             "Menu.acceleratorSelectionForeground", menuAccelSelectionForegroundColor,
 622             //"Menu.border", ThemeMenu.menuItemBorder(), // for inset calculation
 623             "Menu.border", menuBorder,
 624             "Menu.borderPainted", Boolean.FALSE,
 625             "Menu.margin", menuItemMargin,
 626             //"Menu.checkIcon", emptyCheckIcon, // A non-drawing GlyphIcon to make the spacing consistent
 627             "Menu.arrowIcon", new SwingLazyValue(kAquaImageFactoryName, "getMenuArrowIcon"),
 628             "Menu.consumesTabs", Boolean.TRUE,
 629             "Menu.menuPopupOffsetY", new Integer(1),
 630             "Menu.submenuPopupOffsetY", new Integer(-4),
 631 
 632             "MenuBar.font", menuFont,
 633             "MenuBar.background", menuBackgroundColor, // not a menu item, not selected
 634             "MenuBar.foreground", menuForegroundColor,
 635             "MenuBar.border", new AquaMenuBarBorder(), // sja make lazy!
 636             "MenuBar.margin", new InsetsUIResource(0, 8, 0, 8), // sja make lazy!
 637             "MenuBar.selectionBackground", menuSelectedBackgroundColor, // not a menu item, is selected
 638             "MenuBar.selectionForeground", menuSelectedForegroundColor,
 639             "MenuBar.disabledBackground", menuDisabledBackgroundColor, //ThemeBrush.GetThemeBrushForMenu(false, false), // not a menu item, not selected
 640             "MenuBar.disabledForeground", menuDisabledForegroundColor,
 641             "MenuBar.backgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaMenuPainter", "getMenuBarPainter"),
 642             "MenuBar.selectedBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaMenuPainter", "getSelectedMenuBarItemPainter"),
 643 
 644             "MenuItem.font", menuFont,
 645             "MenuItem.acceleratorFont", menuFont,
 646             "MenuItem.background", menuBackgroundColor,
 647             "MenuItem.foreground", menuForegroundColor,
 648             "MenuItem.selectionBackground", menuSelectedBackgroundColor,
 649             "MenuItem.selectionForeground", menuSelectedForegroundColor,
 650             "MenuItem.disabledBackground", menuDisabledBackgroundColor,
 651             "MenuItem.disabledForeground", menuDisabledForegroundColor,
 652             "MenuItem.acceleratorForeground", menuAccelForegroundColor,
 653             "MenuItem.acceleratorSelectionForeground", menuAccelSelectionForegroundColor,
 654             "MenuItem.acceleratorDelimiter", "",
 655             "MenuItem.border", menuBorder,
 656             "MenuItem.margin", menuItemMargin,
 657             "MenuItem.borderPainted", Boolean.TRUE,
 658             //"MenuItem.checkIcon", emptyCheckIcon, // A non-drawing GlyphIcon to make the spacing consistent
 659             //"MenuItem.arrowIcon", null,
 660             "MenuItem.selectedBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaMenuPainter", "getSelectedMenuItemPainter"),
 661 
 662             // *** OptionPane
 663             // You can additionaly define OptionPane.messageFont which will
 664             // dictate the fonts used for the message, and
 665             // OptionPane.buttonFont, which defines the font for the buttons.
 666             "OptionPane.font", alertHeaderFont,
 667             "OptionPane.messageFont", controlFont,
 668             "OptionPane.buttonFont", controlFont,
 669             "OptionPane.background", windowBackgroundColor,
 670             "OptionPane.foreground", black,
 671             "OptionPane.messageForeground", black,
 672             "OptionPane.border", new BorderUIResource.EmptyBorderUIResource(12, 21, 17, 21),
 673             "OptionPane.messageAreaBorder", zeroBorder,
 674             "OptionPane.buttonAreaBorder", new BorderUIResource.EmptyBorderUIResource(13, 0, 0, 0),
 675             "OptionPane.minimumSize", new DimensionUIResource(262, 90),
 676 
 677             "OptionPane.errorIcon", stopIcon,
 678             "OptionPane.informationIcon", confirmIcon,
 679             "OptionPane.warningIcon", cautionIcon,
 680             "OptionPane.questionIcon", confirmIcon,
 681             "_SecurityDecisionIcon", securityIcon,
 682             "OptionPane.windowBindings", new Object[]{"ESCAPE", "close"},
 683             // OptionPane Auditory Cue Mappings
 684             "OptionPane.errorSound", null,
 685             "OptionPane.informationSound", null, // Info and Plain
 686             "OptionPane.questionSound", null,
 687             "OptionPane.warningSound", null,
 688             "OptionPane.buttonClickThreshhold", new Integer(500),
 689             "OptionPane.yesButtonMnemonic", "",
 690             "OptionPane.noButtonMnemonic", "",
 691             "OptionPane.okButtonMnemonic", "",
 692             "OptionPane.cancelButtonMnemonic", "",
 693 
 694             "Panel.font", controlFont,
 695             "Panel.background", panelBackgroundColor, //new ColorUIResource(0.5647f, 0.9957f, 0.5059f),
 696             "Panel.foreground", black,
 697             "Panel.opaque", useOpaqueComponents,
 698 
 699             "PasswordField.focusInputMap", aquaKeyBindings.getPasswordFieldInputMap(),
 700             "PasswordField.font", controlFont,
 701             "PasswordField.background", textBackground,
 702             "PasswordField.foreground", textForeground,
 703             "PasswordField.inactiveForeground", textInactiveText,
 704             "PasswordField.inactiveBackground", textInactiveBackground,
 705             "PasswordField.selectionBackground", textHighlight,
 706             "PasswordField.selectionForeground", textHighlightText,
 707             "PasswordField.caretForeground", textForeground,
 708             "PasswordField.caretBlinkRate", textCaretBlinkRate,
 709             "PasswordField.border", textFieldBorder,
 710             "PasswordField.margin", zeroInsets,
 711             "PasswordField.echoChar", new Character((char)0x25CF),
 712             "PasswordField.capsLockIconColor", textPasswordFieldCapsLockIconColor,
 713 
 714             "PopupMenu.font", menuFont,
 715             "PopupMenu.background", menuBackgroundColor,
 716             // Fix for 7154516: make popups opaque
 717             "PopupMenu.translucentBackground", white,
 718             "PopupMenu.foreground", menuForegroundColor,
 719             "PopupMenu.selectionBackground", menuSelectedBackgroundColor,
 720             "PopupMenu.selectionForeground", menuSelectedForegroundColor,
 721             "PopupMenu.border", menuBorder,
 722 //            "PopupMenu.margin",
 723 
 724             "ProgressBar.font", controlFont,
 725             "ProgressBar.foreground", black,
 726             "ProgressBar.background", controlBackgroundColor,
 727             "ProgressBar.selectionForeground", black,
 728             "ProgressBar.selectionBackground", white,
 729             "ProgressBar.border", new BorderUIResource(BorderFactory.createEmptyBorder()),
 730             "ProgressBar.repaintInterval", new Integer(20),
 731 
 732             "RadioButton.background", controlBackgroundColor,
 733             "RadioButton.foreground", black,
 734             "RadioButton.disabledText", disabled,
 735             "RadioButton.select", selected,
 736             "RadioButton.icon", new SwingLazyValue(PKG_PREFIX + "AquaButtonRadioUI", "getSizingRadioButtonIcon"),
 737             "RadioButton.font", controlFont,
 738             "RadioButton.border", AquaButtonBorder.getBevelButtonBorder(),
 739             "RadioButton.margin", new InsetsUIResource(1, 1, 0, 1),
 740             "RadioButton.focusInputMap", controlFocusInputMap,
 741 
 742             "RadioButtonMenuItem.font", menuFont,
 743             "RadioButtonMenuItem.acceleratorFont", menuFont,
 744             "RadioButtonMenuItem.background", menuBackgroundColor,
 745             "RadioButtonMenuItem.foreground", menuForegroundColor,
 746             "RadioButtonMenuItem.selectionBackground", menuSelectedBackgroundColor,
 747             "RadioButtonMenuItem.selectionForeground", menuSelectedForegroundColor,
 748             "RadioButtonMenuItem.disabledBackground", menuDisabledBackgroundColor,
 749             "RadioButtonMenuItem.disabledForeground", menuDisabledForegroundColor,
 750             "RadioButtonMenuItem.acceleratorForeground", menuAccelForegroundColor,
 751             "RadioButtonMenuItem.acceleratorSelectionForeground", menuAccelSelectionForegroundColor,
 752             "RadioButtonMenuItem.acceleratorDelimiter", "",
 753             "RadioButtonMenuItem.border", menuBorder, // for inset calculation
 754             "RadioButtonMenuItem.margin", menuItemMargin,
 755             "RadioButtonMenuItem.borderPainted", Boolean.TRUE,
 756             "RadioButtonMenuItem.checkIcon", new SwingLazyValue(kAquaImageFactoryName, "getMenuItemCheckIcon"),
 757             "RadioButtonMenuItem.dashIcon", new SwingLazyValue(kAquaImageFactoryName, "getMenuItemDashIcon"),
 758             //"RadioButtonMenuItem.arrowIcon", null,
 759 
 760             "Separator.background", null,
 761             "Separator.foreground", new ColorUIResource(0xD4, 0xD4, 0xD4),
 762 
 763             "ScrollBar.border", null,
 764             "ScrollBar.focusInputMap", aquaKeyBindings.getScrollBarInputMap(),
 765             "ScrollBar.focusInputMap.RightToLeft", aquaKeyBindings.getScrollBarRightToLeftInputMap(),
 766             "ScrollBar.width", new Integer(16),
 767             "ScrollBar.background", white,
 768             "ScrollBar.foreground", black,
 769 
 770             "ScrollPane.font", controlFont,
 771             "ScrollPane.background", white,
 772             "ScrollPane.foreground", black, //$
 773             "ScrollPane.border", scollListBorder,
 774             "ScrollPane.viewportBorder", null,
 775 
 776             "ScrollPane.ancestorInputMap", aquaKeyBindings.getScrollPaneInputMap(),
 777             "ScrollPane.ancestorInputMap.RightToLeft", new UIDefaults.LazyInputMap(new Object[]{}),
 778 
 779             "Viewport.font", controlFont,
 780             "Viewport.background", white, // The background for tables, lists, etc
 781             "Viewport.foreground", black,
 782 
 783             // *** Slider
 784             "Slider.foreground", black, "Slider.background", controlBackgroundColor,
 785             "Slider.font", controlSmallFont,
 786             //"Slider.highlight", table.get("controlLtHighlight"),
 787             //"Slider.shadow", table.get("controlShadow"),
 788             //"Slider.focus", table.get("controlDkShadow"),
 789             "Slider.tickColor", new ColorUIResource(Color.GRAY),
 790             "Slider.border", null,
 791             "Slider.focusInsets", new InsetsUIResource(2, 2, 2, 2),
 792             "Slider.focusInputMap", aquaKeyBindings.getSliderInputMap(),
 793             "Slider.focusInputMap.RightToLeft", aquaKeyBindings.getSliderRightToLeftInputMap(),
 794 
 795             // *** Spinner
 796             "Spinner.font", controlFont,
 797             "Spinner.background", controlBackgroundColor,
 798             "Spinner.foreground", black,
 799             "Spinner.border", null,
 800             "Spinner.arrowButtonSize", new Dimension(16, 5),
 801             "Spinner.ancestorInputMap", aquaKeyBindings.getSpinnerInputMap(),
 802             "Spinner.editorBorderPainted", Boolean.TRUE,
 803             "Spinner.editorAlignment", SwingConstants.TRAILING,
 804 
 805             // *** SplitPane
 806             //"SplitPane.highlight", table.get("controlLtHighlight"),
 807             //"SplitPane.shadow", table.get("controlShadow"),
 808             "SplitPane.background", panelBackgroundColor,
 809             "SplitPane.border", scollListBorder,
 810             "SplitPane.dividerSize", new Integer(9), //$
 811             "SplitPaneDivider.border", null, // AquaSplitPaneDividerUI draws it
 812             "SplitPaneDivider.horizontalGradientVariant", new SwingLazyValue(PKG_PREFIX + "AquaSplitPaneDividerUI", "getHorizontalSplitDividerGradientVariant"),
 813 
 814             // *** TabbedPane
 815             "TabbedPane.font", controlFont,
 816             "TabbedPane.smallFont", controlSmallFont,
 817             "TabbedPane.useSmallLayout", Boolean.FALSE,//sSmallTabs ? Boolean.TRUE : Boolean.FALSE,
 818             "TabbedPane.background", tabBackgroundColor, // for bug [3398277] use a background color so that
 819             // tabs on a custom pane get erased when they are removed.
 820             "TabbedPane.foreground", black, //ThemeTextColor.GetThemeTextColor(AppearanceConstants.kThemeTextColorTabFrontActive),
 821             //"TabbedPane.lightHighlight", table.get("controlLtHighlight"),
 822             //"TabbedPane.highlight", table.get("controlHighlight"),
 823             //"TabbedPane.shadow", table.get("controlShadow"),
 824             //"TabbedPane.darkShadow", table.get("controlDkShadow"),
 825             //"TabbedPane.focus", table.get("controlText"),
 826             "TabbedPane.opaque", useOpaqueComponents,
 827             "TabbedPane.textIconGap", new Integer(4),
 828             "TabbedPane.tabInsets", new InsetsUIResource(0, 10, 3, 10), // Label within tab (top, left, bottom, right)
 829             //"TabbedPane.rightTabInsets", new InsetsUIResource(0, 10, 3, 10), // Label within tab (top, left, bottom, right)
 830             "TabbedPane.leftTabInsets", new InsetsUIResource(0, 10, 3, 10), // Label within tab
 831             "TabbedPane.rightTabInsets", new InsetsUIResource(0, 10, 3, 10), // Label within tab
 832             //"TabbedPane.tabAreaInsets", new InsetsUIResource(3, 9, -1, 9), // Tabs relative to edge of pane (negative value for overlapping)
 833             "TabbedPane.tabAreaInsets", new InsetsUIResource(3, 9, -1, 9), // Tabs relative to edge of pane (negative value for overlapping)
 834             // (top = side opposite pane, left = edge || to pane, bottom = side adjacent to pane, right = left) - see rotateInsets
 835             "TabbedPane.contentBorderInsets", new InsetsUIResource(8, 0, 0, 0), // width of border
 836             //"TabbedPane.selectedTabPadInsets", new InsetsUIResource(0, 0, 1, 0), // Really outsets, this is where we allow for overlap
 837             "TabbedPane.selectedTabPadInsets", new InsetsUIResource(0, 0, 0, 0), // Really outsets, this is where we allow for overlap
 838             "TabbedPane.tabsOverlapBorder", Boolean.TRUE,
 839             "TabbedPane.selectedTabTitlePressedColor", selectedTabTitlePressedColor,
 840             "TabbedPane.selectedTabTitleDisabledColor", selectedTabTitleDisabledColor,
 841             "TabbedPane.selectedTabTitleNormalColor", selectedTabTitleNormalColor,
 842             "TabbedPane.selectedTabTitleShadowDisabledColor", selectedTabTitleShadowDisabledColor,
 843             "TabbedPane.selectedTabTitleShadowNormalColor", selectedTabTitleShadowNormalColor,
 844             "TabbedPane.nonSelectedTabTitleNormalColor", nonSelectedTabTitleNormalColor,
 845 
 846             // *** Table
 847             "Table.font", viewFont, // [3577901] Aqua HIG says "default font of text in lists and tables" should be 12 point (vm).
 848             "Table.foreground", black, // cell text color
 849             "Table.background", white, // cell background color
 850             "Table.selectionForeground", selectionForeground,
 851             "Table.selectionBackground", selectionBackground,
 852             "Table.selectionInactiveBackground", selectionInactiveBackground,
 853             "Table.selectionInactiveForeground", selectionInactiveForeground,
 854             "Table.gridColor", white, // grid line color
 855             "Table.focusCellBackground", textHighlightText,
 856             "Table.focusCellForeground", textHighlight,
 857             "Table.focusCellHighlightBorder", focusCellHighlightBorder,
 858             "Table.scrollPaneBorder", scollListBorder,
 859 
 860             "Table.ancestorInputMap", aquaKeyBindings.getTableInputMap(),
 861             "Table.ancestorInputMap.RightToLeft", aquaKeyBindings.getTableRightToLeftInputMap(),
 862 
 863             "TableHeader.font", controlSmallFont,
 864             "TableHeader.foreground", black,
 865             "TableHeader.background", white, // header background
 866             "TableHeader.cellBorder", listHeaderBorder,
 867 
 868             // *** Text
 869             "TextArea.focusInputMap", aquaKeyBindings.getMultiLineTextInputMap(),
 870             "TextArea.font", controlFont,
 871             "TextArea.background", textBackground,
 872             "TextArea.foreground", textForeground,
 873             "TextArea.inactiveForeground", textInactiveText,
 874             "TextArea.inactiveBackground", textInactiveBackground,
 875             "TextArea.selectionBackground", textHighlight,
 876             "TextArea.selectionForeground", textHighlightText,
 877             "TextArea.caretForeground", textForeground,
 878             "TextArea.caretBlinkRate", textCaretBlinkRate,
 879             "TextArea.border", textAreaBorder,
 880             "TextArea.margin", zeroInsets,
 881 
 882             "TextComponent.selectionBackgroundInactive", textHighlightInactive,
 883 
 884             "TextField.focusInputMap", aquaKeyBindings.getTextFieldInputMap(),
 885             "TextField.font", controlFont,
 886             "TextField.background", textBackground,
 887             "TextField.foreground", textForeground,
 888             "TextField.inactiveForeground", textInactiveText,
 889             "TextField.inactiveBackground", textInactiveBackground,
 890             "TextField.selectionBackground", textHighlight,
 891             "TextField.selectionForeground", textHighlightText,
 892             "TextField.caretForeground", textForeground,
 893             "TextField.caretBlinkRate", textCaretBlinkRate,
 894             "TextField.border", textFieldBorder,
 895             "TextField.margin", zeroInsets,
 896 
 897             "TextPane.focusInputMap", aquaKeyBindings.getMultiLineTextInputMap(),
 898             "TextPane.font", controlFont,
 899             "TextPane.background", textBackground,
 900             "TextPane.foreground", textForeground,
 901             "TextPane.selectionBackground", textHighlight,
 902             "TextPane.selectionForeground", textHighlightText,
 903             "TextPane.caretForeground", textForeground,
 904             "TextPane.caretBlinkRate", textCaretBlinkRate,
 905             "TextPane.inactiveForeground", textInactiveText,
 906             "TextPane.inactiveBackground", textInactiveBackground,
 907             "TextPane.border", textAreaBorder,
 908             "TextPane.margin", editorMargin,
 909 
 910             // *** ToggleButton
 911             "ToggleButton.background", controlBackgroundColor,
 912             "ToggleButton.foreground", black,
 913             "ToggleButton.disabledText", disabled,
 914             // we need to go through and find out if these are used, and if not what to set
 915             // so that subclasses will get good aqua like colors.
 916             //    "ToggleButton.select", getControlShadow(),
 917             //    "ToggleButton.text", getControl(),
 918             //    "ToggleButton.disabledSelectedText", getControlDarkShadow(),
 919             //    "ToggleButton.disabledBackground", getControl(),
 920             //    "ToggleButton.disabledSelectedBackground", getControlShadow(),
 921             //"ToggleButton.focus", getFocusColor(),
 922             "ToggleButton.border", new SwingLazyValue(PKG_PREFIX + "AquaButtonBorder", "getDynamicButtonBorder"), // sja make this lazy!
 923             "ToggleButton.font", controlFont,
 924             "ToggleButton.focusInputMap", controlFocusInputMap,
 925             "ToggleButton.margin", new InsetsUIResource(2, 2, 2, 2),
 926 
 927             // *** ToolBar
 928             "ToolBar.font", controlFont,
 929             "ToolBar.background", panelBackgroundColor,
 930             "ToolBar.foreground", new ColorUIResource(Color.gray),
 931             "ToolBar.dockingBackground", panelBackgroundColor,
 932             "ToolBar.dockingForeground", selectionBackground,
 933             "ToolBar.floatingBackground", panelBackgroundColor,
 934             "ToolBar.floatingForeground", new ColorUIResource(Color.darkGray),
 935             "ToolBar.border", new SwingLazyValue(PKG_PREFIX + "AquaToolBarUI", "getToolBarBorder"),
 936             "ToolBar.borderHandleColor", toolbarDragHandleColor,
 937             //"ToolBar.separatorSize", new DimensionUIResource( 10, 10 ),
 938             "ToolBar.separatorSize", null,
 939 
 940             // *** ToolBarButton
 941             "ToolBarButton.margin", new InsetsUIResource(3, 3, 3, 3),
 942             "ToolBarButton.insets", new InsetsUIResource(1, 1, 1, 1),
 943 
 944             // *** ToolTips
 945             "ToolTip.font", controlSmallFont,
 946             //$ Tooltips - Same color as help balloons?
 947             "ToolTip.background", toolTipBackground,
 948             "ToolTip.foreground", black,
 949             "ToolTip.border", toolTipBorder,
 950 
 951             // *** Tree
 952             "Tree.font", viewFont, // [3577901] Aqua HIG says "default font of text in lists and tables" should be 12 point (vm).
 953             "Tree.background", white,
 954             "Tree.foreground", black,
 955             // for now no lines
 956             "Tree.hash", white, //disabled, // Line color
 957             "Tree.line", white, //disabled, // Line color
 958             "Tree.textForeground", black,
 959             "Tree.textBackground", white,
 960             "Tree.selectionForeground", selectionForeground,
 961             "Tree.selectionBackground", selectionBackground,
 962             "Tree.selectionInactiveBackground", selectionInactiveBackground,
 963             "Tree.selectionInactiveForeground", selectionInactiveForeground,
 964             "Tree.selectionBorderColor", selectionBackground, // match the background so it looks like we don't draw anything
 965             "Tree.editorBorderSelectionColor", null, // The EditTextFrame provides its own border
 966             // "Tree.editorBorder", textFieldBorder, // If you still have Sun bug 4376328 in DefaultTreeCellEditor, it has to have the same insets as TextField.border
 967             "Tree.leftChildIndent", new Integer(7),//$
 968             "Tree.rightChildIndent", new Integer(13),//$
 969             "Tree.rowHeight", new Integer(19),// iconHeight + 3, to match finder - a zero would have the renderer decide, except that leaves the icons touching
 970             "Tree.scrollsOnExpand", Boolean.FALSE,
 971             "Tree.openIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeOpenFolderIcon"), // Open folder icon
 972             "Tree.closedIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeFolderIcon"), // Closed folder icon
 973             "Tree.leafIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeDocumentIcon"), // Document icon
 974             "Tree.expandedIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeExpandedIcon"),
 975             "Tree.collapsedIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeCollapsedIcon"),
 976             "Tree.rightToLeftCollapsedIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeRightToLeftCollapsedIcon"),
 977             "Tree.changeSelectionWithFocus", Boolean.TRUE,
 978             "Tree.drawsFocusBorderAroundIcon", Boolean.FALSE,
 979 
 980             "Tree.focusInputMap", aquaKeyBindings.getTreeInputMap(),
 981             "Tree.focusInputMap.RightToLeft", aquaKeyBindings.getTreeRightToLeftInputMap(),
 982             "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[]{"ESCAPE", "cancel"}),};
 983 
 984         table.putDefaults(defaults);
 985 
 986         Object aaTextInfo = SwingUtilities2.AATextInfo.getAATextInfo(true);
 987         table.put(SwingUtilities2.AA_TEXT_PROPERTY_KEY, aaTextInfo);
 988     }
 989 
 990     protected void initSystemColorDefaults(final UIDefaults table) {
 991 //        String[] defaultSystemColors = {
 992 //                  "desktop", "#005C5C", /* Color of the desktop background */
 993 //          "activeCaption", "#000080", /* Color for captions (title bars) when they are active. */
 994 //          "activeCaptionText", "#FFFFFF", /* Text color for text in captions (title bars). */
 995 //        "activeCaptionBorder", "#C0C0C0", /* Border color for caption (title bar) window borders. */
 996 //            "inactiveCaption", "#808080", /* Color for captions (title bars) when not active. */
 997 //        "inactiveCaptionText", "#C0C0C0", /* Text color for text in inactive captions (title bars). */
 998 //      "inactiveCaptionBorder", "#C0C0C0", /* Border color for inactive caption (title bar) window borders. */
 999 //                 "window", "#FFFFFF", /* Default color for the interior of windows */
1000 //           "windowBorder", "#000000", /* ??? */
1001 //             "windowText", "#000000", /* ??? */
1002 //               "menu", "#C0C0C0", /* Background color for menus */
1003 //               "menuText", "#000000", /* Text color for menus  */
1004 //               "text", "#C0C0C0", /* Text background color */
1005 //               "textText", "#000000", /* Text foreground color */
1006 //          "textHighlight", "#000080", /* Text background color when selected */
1007 //          "textHighlightText", "#FFFFFF", /* Text color when selected */
1008 //           "textInactiveText", "#808080", /* Text color when disabled */
1009 //                "control", "#C0C0C0", /* Default color for controls (buttons, sliders, etc) */
1010 //            "controlText", "#000000", /* Default color for text in controls */
1011 //           "controlHighlight", "#C0C0C0", /* Specular highlight (opposite of the shadow) */
1012 //         "controlLtHighlight", "#FFFFFF", /* Highlight color for controls */
1013 //          "controlShadow", "#808080", /* Shadow color for controls */
1014 //            "controlDkShadow", "#000000", /* Dark shadow color for controls */
1015 //              "scrollbar", "#E0E0E0", /* Scrollbar background (usually the "track") */
1016 //               "info", "#FFFFE1", /* ??? */
1017 //               "infoText", "#000000"  /* ??? */
1018 //        };
1019 //
1020 //        loadSystemColors(table, defaultSystemColors, isNativeLookAndFeel());
1021     }
1022 
1023     /**
1024      * Initialize the uiClassID to AquaComponentUI mapping.
1025      * The JComponent classes define their own uiClassID constants
1026      * (see AbstractComponent.getUIClassID).  This table must
1027      * map those constants to a BasicComponentUI class of the
1028      * appropriate type.
1029      *
1030      * @see #getDefaults
1031      */
1032     protected void initClassDefaults(final UIDefaults table) {
1033         final String basicPackageName = "javax.swing.plaf.basic.";
1034 
1035         final Object[] uiDefaults = {
1036             "ButtonUI", PKG_PREFIX + "AquaButtonUI",
1037             "CheckBoxUI", PKG_PREFIX + "AquaButtonCheckBoxUI",
1038             "CheckBoxMenuItemUI", PKG_PREFIX + "AquaMenuItemUI",
1039             "LabelUI", PKG_PREFIX + "AquaLabelUI",
1040             "ListUI", PKG_PREFIX + "AquaListUI",
1041             "MenuUI", PKG_PREFIX + "AquaMenuUI",
1042             "MenuItemUI", PKG_PREFIX + "AquaMenuItemUI",
1043             "OptionPaneUI", PKG_PREFIX + "AquaOptionPaneUI",
1044             "PanelUI", PKG_PREFIX + "AquaPanelUI",
1045             "RadioButtonMenuItemUI", PKG_PREFIX + "AquaMenuItemUI",
1046             "RadioButtonUI", PKG_PREFIX + "AquaButtonRadioUI",
1047             "ProgressBarUI", PKG_PREFIX + "AquaProgressBarUI",
1048             "RootPaneUI", PKG_PREFIX + "AquaRootPaneUI",
1049             "SliderUI", PKG_PREFIX + "AquaSliderUI",
1050             "ScrollBarUI", PKG_PREFIX + "AquaScrollBarUI",
1051             "TabbedPaneUI", PKG_PREFIX + (JRSUIUtils.TabbedPane.shouldUseTabbedPaneContrastUI() ? "AquaTabbedPaneContrastUI" : "AquaTabbedPaneUI"),
1052             "TableUI", PKG_PREFIX + "AquaTableUI",
1053             "ToggleButtonUI", PKG_PREFIX + "AquaButtonToggleUI",
1054             "ToolBarUI", PKG_PREFIX + "AquaToolBarUI",
1055             "ToolTipUI", PKG_PREFIX + "AquaToolTipUI",
1056             "TreeUI", PKG_PREFIX + "AquaTreeUI",
1057 
1058             "InternalFrameUI", PKG_PREFIX + "AquaInternalFrameUI",
1059             "DesktopIconUI", PKG_PREFIX + "AquaInternalFrameDockIconUI",
1060             "DesktopPaneUI", PKG_PREFIX + "AquaInternalFramePaneUI",
1061             "EditorPaneUI", PKG_PREFIX + "AquaEditorPaneUI",
1062             "TextFieldUI", PKG_PREFIX + "AquaTextFieldUI",
1063             "TextPaneUI", PKG_PREFIX + "AquaTextPaneUI",
1064             "ComboBoxUI", PKG_PREFIX + "AquaComboBoxUI",
1065             "PopupMenuUI", PKG_PREFIX + "AquaPopupMenuUI",
1066             "TextAreaUI", PKG_PREFIX + "AquaTextAreaUI",
1067             "MenuBarUI", PKG_PREFIX + "AquaMenuBarUI",
1068             "FileChooserUI", PKG_PREFIX + "AquaFileChooserUI",
1069             "PasswordFieldUI", PKG_PREFIX + "AquaTextPasswordFieldUI",
1070             "TableHeaderUI", PKG_PREFIX + "AquaTableHeaderUI",
1071 
1072             "FormattedTextFieldUI", PKG_PREFIX + "AquaTextFieldFormattedUI",
1073 
1074             "SpinnerUI", PKG_PREFIX + "AquaSpinnerUI",
1075             "SplitPaneUI", PKG_PREFIX + "AquaSplitPaneUI",
1076             "ScrollPaneUI", PKG_PREFIX + "AquaScrollPaneUI",
1077 
1078             "PopupMenuSeparatorUI", PKG_PREFIX + "AquaPopupMenuSeparatorUI",
1079             "SeparatorUI", PKG_PREFIX + "AquaPopupMenuSeparatorUI",
1080             "ToolBarSeparatorUI", PKG_PREFIX + "AquaToolBarSeparatorUI",
1081 
1082             // as we implement aqua versions of the swing elements
1083             // we will aad the com.apple.laf.FooUI classes to this table.
1084 
1085             "ColorChooserUI", basicPackageName + "BasicColorChooserUI",
1086 
1087             // text UIs
1088             "ViewportUI", basicPackageName + "BasicViewportUI",
1089         };
1090         table.putDefaults(uiDefaults);
1091     }
1092 }