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 import com.apple.resources.MacOSXResourceBundle;
  41 
  42 public class AquaLookAndFeel extends BasicLookAndFeel {
  43     static final String sOldPropertyPrefix = "com.apple.macos."; // old prefix for things like 'useScreenMenuBar'
  44     static final String sPropertyPrefix = "apple.laf."; // new prefix for things like 'useScreenMenuBar'
  45 
  46     // for lazy initalizers. Following the pattern from metal.
  47     private static final String PKG_PREFIX = "com.apple.laf.";
  48     private static final String kAquaImageFactoryName = PKG_PREFIX + "AquaImageFactory";
  49     private static final String kAquaFontsName = PKG_PREFIX + "AquaFonts";
  50 
  51     /**
  52      * Return a short string that identifies this look and feel, e.g.
  53      * "CDE/Motif".  This string should be appropriate for a menu item.
  54      * Distinct look and feels should have different names, e.g.
  55      * a subclass of MotifLookAndFeel that changes the way a few components
  56      * are rendered should be called "CDE/Motif My Way"; something
  57      * that would be useful to a user trying to select a L&F from a list
  58      * of names.
  59      */
  60     public String getName() {
  61         return "Mac OS X";
  62     }
  63 
  64     /**
  65      * Return a string that identifies this look and feel.  This string
  66      * will be used by applications/services that want to recognize
  67      * well known look and feel implementations.  Presently
  68      * the well known names are "Motif", "Windows", "Mac", "Metal".  Note
  69      * that a LookAndFeel derived from a well known superclass
  70      * that doesn't make any fundamental changes to the look or feel
  71      * shouldn't override this method.
  72      */
  73     public String getID() {
  74         return "Aqua";
  75     }
  76 
  77     /**
  78      * Return a one line description of this look and feel implementation,
  79      * e.g. "The CDE/Motif Look and Feel".   This string is intended for
  80      * the user, e.g. in the title of a window or in a ToolTip message.
  81      */
  82     public String getDescription() {
  83         return "Aqua Look and Feel for Mac OS X";
  84     }
  85 
  86     /**
  87      * Returns true if the <code>LookAndFeel</code> returned
  88      * <code>RootPaneUI</code> instances support providing Window decorations
  89      * in a <code>JRootPane</code>.
  90      * <p>
  91      * The default implementation returns false, subclasses that support
  92      * Window decorations should override this and return true.
  93      *
  94      * @return True if the RootPaneUI instances created support client side
  95      *             decorations
  96      * @see JDialog#setDefaultLookAndFeelDecorated
  97      * @see JFrame#setDefaultLookAndFeelDecorated
  98      * @see JRootPane#setWindowDecorationStyle
  99      * @since 1.4
 100      */
 101     public boolean getSupportsWindowDecorations() {
 102         return false;
 103     }
 104 
 105     /**
 106      * If the underlying platform has a "native" look and feel, and this
 107      * is an implementation of it, return true.
 108      */
 109     public boolean isNativeLookAndFeel() {
 110         return true;
 111     }
 112 
 113     /**
 114      * Return true if the underlying platform supports and or permits
 115      * this look and feel.  This method returns false if the look
 116      * and feel depends on special resources or legal agreements that
 117      * aren't defined for the current platform.
 118      *
 119      * @see UIManager#setLookAndFeel
 120      */
 121     public boolean isSupportedLookAndFeel() {
 122         return true;
 123     }
 124 
 125     /**
 126      * UIManager.setLookAndFeel calls this method before the first
 127      * call (and typically the only call) to getDefaults().  Subclasses
 128      * should do any one-time setup they need here, rather than
 129      * in a static initializer, because look and feel class objects
 130      * may be loaded just to discover that isSupportedLookAndFeel()
 131      * returns false.
 132      *
 133      * @see #uninitialize
 134      * @see UIManager#setLookAndFeel
 135      */
 136     public void initialize() {
 137         java.security.AccessController.doPrivileged((PrivilegedAction<?>)new sun.security.action.LoadLibraryAction("osxui"));
 138         java.security.AccessController.doPrivileged(new PrivilegedAction<Object>(){






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