AquaLookAndFeel.java 58.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
/*
 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Oracle designates this
 * particular file as subject to the "Classpath" exception as provided
 * by Oracle in the LICENSE file that accompanied this code.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */

package com.apple.laf;

import java.awt.*;
import java.security.PrivilegedAction;
import java.util.*;

import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.plaf.*;
import javax.swing.plaf.basic.BasicLookAndFeel;

import sun.swing.*;
import apple.laf.*;

import com.apple.resources.MacOSXResourceBundle;

public class AquaLookAndFeel extends BasicLookAndFeel {
    static final String sOldPropertyPrefix = "com.apple.macos."; // old prefix for things like 'useScreenMenuBar'
    static final String sPropertyPrefix = "apple.laf."; // new prefix for things like 'useScreenMenuBar'

    // for lazy initalizers. Following the pattern from metal.
    private static final String PKG_PREFIX = "com.apple.laf.";
    private static final String kAquaImageFactoryName = PKG_PREFIX + "AquaImageFactory";
    private static final String kAquaFontsName = PKG_PREFIX + "AquaFonts";

    /**
     * Return a short string that identifies this look and feel, e.g.
     * "CDE/Motif".  This string should be appropriate for a menu item.
     * Distinct look and feels should have different names, e.g.
     * a subclass of MotifLookAndFeel that changes the way a few components
     * are rendered should be called "CDE/Motif My Way"; something
     * that would be useful to a user trying to select a L&F from a list
     * of names.
     */
    public String getName() {
        return "Mac OS X";
    }

    /**
     * Return a string that identifies this look and feel.  This string
     * will be used by applications/services that want to recognize
     * well known look and feel implementations.  Presently
     * the well known names are "Motif", "Windows", "Mac", "Metal".  Note
     * that a LookAndFeel derived from a well known superclass
     * that doesn't make any fundamental changes to the look or feel
     * shouldn't override this method.
     */
    public String getID() {
        return "Aqua";
    }

    /**
     * Return a one line description of this look and feel implementation,
     * e.g. "The CDE/Motif Look and Feel".   This string is intended for
     * the user, e.g. in the title of a window or in a ToolTip message.
     */
    public String getDescription() {
        return "Aqua Look and Feel for Mac OS X";
    }

    /**
     * Returns true if the <code>LookAndFeel</code> returned
     * <code>RootPaneUI</code> instances support providing Window decorations
     * in a <code>JRootPane</code>.
     * <p>
     * The default implementation returns false, subclasses that support
     * Window decorations should override this and return true.
     *
     * @return True if the RootPaneUI instances created support client side
     *             decorations
     * @see JDialog#setDefaultLookAndFeelDecorated
     * @see JFrame#setDefaultLookAndFeelDecorated
     * @see JRootPane#setWindowDecorationStyle
     * @since 1.4
     */
    public boolean getSupportsWindowDecorations() {
        return false;
    }

    /**
     * If the underlying platform has a "native" look and feel, and this
     * is an implementation of it, return true.
     */
    public boolean isNativeLookAndFeel() {
        return true;
    }

    /**
     * Return true if the underlying platform supports and or permits
     * this look and feel.  This method returns false if the look
     * and feel depends on special resources or legal agreements that
     * aren't defined for the current platform.
     *
     * @see UIManager#setLookAndFeel
     */
    public boolean isSupportedLookAndFeel() {
        return true;
    }

    /**
     * UIManager.setLookAndFeel calls this method before the first
     * call (and typically the only call) to getDefaults().  Subclasses
     * should do any one-time setup they need here, rather than
     * in a static initializer, because look and feel class objects
     * may be loaded just to discover that isSupportedLookAndFeel()
     * returns false.
     *
     * @see #uninitialize
     * @see UIManager#setLookAndFeel
     */
    public void initialize() {
137 138 139 140 141 142 143 144
        java.security.AccessController.doPrivileged(new PrivilegedAction<Void>() {
                public Void run() {
                    System.loadLibrary("osxui");
                    return null;
                }
            });

        java.security.AccessController.doPrivileged(new PrivilegedAction<Void>(){
145
            @Override
146
            public Void run() {
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092
                JRSUIControl.initJRSUI();
                return null;
            }
        });

        super.initialize();
        final ScreenPopupFactory spf = new ScreenPopupFactory();
        spf.setActive(true);
        PopupFactory.setSharedInstance(spf);

        KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventPostProcessor(AquaMnemonicHandler.getInstance());
    }

    /**
     * UIManager.setLookAndFeel calls this method just before we're
     * replaced by a new default look and feel.   Subclasses may
     * choose to free up some resources here.
     *
     * @see #initialize
     */
    public void uninitialize() {
        KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventPostProcessor(AquaMnemonicHandler.getInstance());

        final PopupFactory popupFactory = PopupFactory.getSharedInstance();
        if (popupFactory != null && popupFactory instanceof ScreenPopupFactory) {
            ((ScreenPopupFactory)popupFactory).setActive(false);
        }

        super.uninitialize();
    }

    /**
     * Returns an <code>ActionMap</code>.
     * <P>
     * This <code>ActionMap</code> contains <code>Actions</code> that
     * embody the ability to render an auditory cue. These auditory
     * cues map onto user and system activities that may be useful
     * for an end user to know about (such as a dialog box appearing).
     * <P>
     * At the appropriate time in a <code>JComponent</code> UI's lifecycle,
     * the ComponentUI is responsible for getting the appropriate
     * <code>Action</code> out of the <code>ActionMap</code> and passing
     * it on to <code>playSound</code>.
     * <P>
     * The <code>Actions</code> in this <code>ActionMap</code> are
     * created by the <code>createAudioAction</code> method.
     *
     * @return      an ActionMap containing Actions
     *              responsible for rendering auditory cues
     * @see #createAudioAction
     * @see #playSound(Action)
     * @since 1.4
     */
    protected ActionMap getAudioActionMap() {
        ActionMap audioActionMap = (ActionMap)UIManager.get("AuditoryCues.actionMap");
        if (audioActionMap != null) return audioActionMap;

        final Object[] acList = (Object[])UIManager.get("AuditoryCues.cueList");
        if (acList != null) {
            audioActionMap = new ActionMapUIResource();
            for (int counter = acList.length - 1; counter >= 0; counter--) {
                audioActionMap.put(acList[counter], createAudioAction(acList[counter]));
            }
        }
        UIManager.getLookAndFeelDefaults().put("AuditoryCues.actionMap", audioActionMap);

        return audioActionMap;
    }

    /**
     * We override getDefaults() so we can install our own debug defaults
     * if needed for testing
     */
    public UIDefaults getDefaults() {
        final UIDefaults table = new UIDefaults();
        // use debug defaults if you want to see every query into the defaults object.
        //UIDefaults table = new DebugDefaults();
        try {
            // PopupFactory.getSharedInstance().setPopupType(2);
            initClassDefaults(table);

            // Here we install all the Basic defaults in case we missed some in our System color
            // or component defaults that follow. Eventually we will take this out.
            // This is a big negative to performance so we want to get it out as soon
            // as we are comfortable with the Aqua defaults.
            super.initSystemColorDefaults(table);
            super.initComponentDefaults(table);

            // Because the last elements added win in precedence we add all of our aqua elements here.
            initSystemColorDefaults(table);
            initComponentDefaults(table);
        } catch(final Exception e) {
            e.printStackTrace();
        }
        return table;
    }

    /**
     * Initialize the defaults table with the name of the ResourceBundle
     * used for getting localized defaults.  Also initialize the default
     * locale used when no locale is passed into UIDefaults.get().  The
     * default locale should generally not be relied upon. It is here for
     * compatability with releases prior to 1.4.
     */
    private void initResourceBundle(final UIDefaults table) {
        table.setDefaultLocale(Locale.getDefault());
        try {
            final ResourceBundle aquaProperties = MacOSXResourceBundle.getMacResourceBundle(PKG_PREFIX + "resources.aqua");
            final Enumeration<String> propertyKeys = aquaProperties.getKeys();

            while (propertyKeys.hasMoreElements()) {
                final String key = propertyKeys.nextElement();
                table.put(key, aquaProperties.getString(key));
            }
        } catch (final Exception e) {
            table.addResourceBundle(PKG_PREFIX + "resources.aqua");
        }
    }

    /**
     * This is the last step in the getDefaults routine usually called from our superclass
     */
    protected void initComponentDefaults(final UIDefaults table) {
        initResourceBundle(table);

        final InsetsUIResource zeroInsets = new InsetsUIResource(0, 0, 0, 0);
        final InsetsUIResource menuItemMargin = zeroInsets;

        // <rdar://problem/5189013> Entire Java application window refreshes when moving off Shortcut menu item
        final Boolean useOpaqueComponents = Boolean.TRUE;

        final Boolean buttonShouldBeOpaque = AquaUtils.shouldUseOpaqueButtons() ? Boolean.TRUE : Boolean.FALSE;

        // *** List value objects
        final Object listCellRendererActiveValue = new UIDefaults.ActiveValue(){
            public Object createValue(UIDefaults defaultsTable) {
                return new DefaultListCellRenderer.UIResource();
            }
        };

        // SJA - I'm basing this on what is in the MetalLookAndFeel class, but
        // without being based on BasicLookAndFeel. We want more flexibility.
        // The key to doing this well is to use Lazy initializing classes as
        // much as possible.

        // Here I want to go to native and get all the values we'd need for colors etc.
        final Border toolTipBorder = new BorderUIResource.EmptyBorderUIResource(2, 0, 2, 0);
        final ColorUIResource toolTipBackground = new ColorUIResource(255, 255, (int)(255.0 * 0.80));
        final ColorUIResource black = new ColorUIResource(Color.black);
        final ColorUIResource white = new ColorUIResource(Color.white);
        final ColorUIResource smokyGlass = new ColorUIResource(new Color(0, 0, 0, 152));
        final ColorUIResource dockIconRim = new ColorUIResource(new Color(192, 192, 192, 192));
        final ColorUIResource mediumTranslucentBlack = new ColorUIResource(new Color(0, 0, 0, 100));
        final ColorUIResource translucentWhite = new ColorUIResource(new Color(255, 255, 255, 254));
    //    final ColorUIResource lightGray = new ColorUIResource(232, 232, 232);
        final ColorUIResource disabled = new ColorUIResource(0.5f, 0.5f, 0.5f);
        final ColorUIResource disabledShadow = new ColorUIResource(0.25f, 0.25f, 0.25f);
        final ColorUIResource selected = new ColorUIResource(1.0f, 0.4f, 0.4f);

        // Contrast tab UI colors

        final ColorUIResource selectedTabTitlePressedColor = new ColorUIResource(240, 240, 240);
        final ColorUIResource selectedTabTitleDisabledColor = new ColorUIResource(new Color(1, 1, 1, 0.55f));
        final ColorUIResource selectedTabTitleNormalColor = white;
        final ColorUIResource selectedTabTitleShadowDisabledColor = new ColorUIResource(new Color(0, 0, 0, 0.25f));
        final ColorUIResource selectedTabTitleShadowNormalColor = mediumTranslucentBlack;
        final ColorUIResource nonSelectedTabTitleNormalColor = black;

        final ColorUIResource toolbarDragHandleColor = new ColorUIResource(140, 140, 140);

        // sja todo Make these lazy values so we only get them when required - if we deem it necessary
        // it may be the case that we think the overhead of a proxy lazy value is not worth delaying
        // creating the object if we think that most swing apps will use this.
        // the lazy value is useful for delaying initialization until this default value is actually
        // accessed by the LAF instead of at init time, so making it lazy should speed up
        // our launch times of Swing apps.

        // *** Text value objects
        final Object marginBorder = new SwingLazyValue("javax.swing.plaf.basic.BasicBorders$MarginBorder");

        final Object zero = new Integer(0);
        final Object editorMargin = zeroInsets; // this is not correct - look at TextEdit to determine the right margin
        final Object textCaretBlinkRate = new Integer(500);
        final Object textFieldBorder = new SwingLazyValue(PKG_PREFIX + "AquaTextFieldBorder", "getTextFieldBorder");
        final Object textAreaBorder = marginBorder; // text areas have no real border - radar 311073

        final Object scollListBorder = new SwingLazyValue(PKG_PREFIX + "AquaScrollRegionBorder", "getScrollRegionBorder");
        final Object aquaTitledBorder = new SwingLazyValue(PKG_PREFIX + "AquaGroupBorder", "getBorderForTitledBorder");
        final Object aquaInsetBorder = new SwingLazyValue(PKG_PREFIX + "AquaGroupBorder", "getTitlelessBorder");

        final Border listHeaderBorder = AquaTableHeaderBorder.getListHeaderBorder();
        final Border zeroBorder = new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0);

        // we can't seem to proxy Colors
        final Color selectionBackground = AquaImageFactory.getSelectionBackgroundColorUIResource();
        final Color selectionForeground = AquaImageFactory.getSelectionForegroundColorUIResource();
        final Color selectionInactiveBackground = AquaImageFactory.getSelectionInactiveBackgroundColorUIResource();
        final Color selectionInactiveForeground = AquaImageFactory.getSelectionInactiveForegroundColorUIResource();

        final Color textHighlightText = AquaImageFactory.getTextSelectionForegroundColorUIResource();
        final Color textHighlight = AquaImageFactory.getTextSelectionBackgroundColorUIResource();
        final Color textHighlightInactive = new ColorUIResource(212, 212, 212);

        final Color textInactiveText = disabled;
        final Color textForeground = black;
        final Color textBackground = white;
        final Color textInactiveBackground = white;

        final Color textPasswordFieldCapsLockIconColor = mediumTranslucentBlack;

        final Object internalFrameBorder = new SwingLazyValue("javax.swing.plaf.basic.BasicBorders", "getInternalFrameBorder");
        final Color desktopBackgroundColor = new ColorUIResource(new Color(65, 105, 170));//SystemColor.desktop

        final Color focusRingColor = AquaImageFactory.getFocusRingColorUIResource();
        final Border focusCellHighlightBorder = new BorderUIResource.LineBorderUIResource(focusRingColor);

        final Color windowBackgroundColor = AquaImageFactory.getWindowBackgroundColorUIResource();
        final Color panelBackgroundColor = windowBackgroundColor;
        final Color tabBackgroundColor = windowBackgroundColor;
        final Color controlBackgroundColor = windowBackgroundColor;

        final Object controlFont = new SwingLazyValue(kAquaFontsName, "getControlTextFont");
        final Object controlSmallFont = new SwingLazyValue(kAquaFontsName, "getControlTextSmallFont");
        final Object alertHeaderFont = new SwingLazyValue(kAquaFontsName, "getAlertHeaderFont");
        final Object menuFont = new SwingLazyValue(kAquaFontsName, "getMenuFont");
        final Object viewFont = new SwingLazyValue(kAquaFontsName, "getViewFont");

        final Color menuBackgroundColor = new ColorUIResource(Color.white);
        final Color menuForegroundColor = black;

        final Color menuSelectedForegroundColor = white;
        final Color menuSelectedBackgroundColor = focusRingColor;

        final Color menuDisabledBackgroundColor = menuBackgroundColor;
        final Color menuDisabledForegroundColor = disabled;

        final Color menuAccelForegroundColor = black;
        final Color menuAccelSelectionForegroundColor = black;

        final Border menuBorder = new AquaMenuBorder();

        final UIDefaults.LazyInputMap controlFocusInputMap = new UIDefaults.LazyInputMap(new Object[]{
            "SPACE", "pressed",
            "released SPACE", "released"
        });

        // sja testing
        final Object confirmIcon = new SwingLazyValue(kAquaImageFactoryName, "getConfirmImageIcon"); // AquaImageFactory.getConfirmImageIcon();
        final Object cautionIcon = new SwingLazyValue(kAquaImageFactoryName, "getCautionImageIcon"); // AquaImageFactory.getCautionImageIcon();
        final Object stopIcon = new SwingLazyValue(kAquaImageFactoryName, "getStopImageIcon"); // AquaImageFactory.getStopImageIcon();
        final Object securityIcon = new SwingLazyValue(kAquaImageFactoryName, "getLockImageIcon"); // AquaImageFactory.getLockImageIcon();

        final AquaKeyBindings aquaKeyBindings = AquaKeyBindings.instance();

        final Object[] defaults = {
            "control", windowBackgroundColor, /* Default color for controls (buttons, sliders, etc) */

            // Buttons
            "Button.background", controlBackgroundColor,
            "Button.foreground", black,
            "Button.disabledText", disabled,
            "Button.select", selected,
            "Button.border", new SwingLazyValue(PKG_PREFIX + "AquaButtonBorder", "getDynamicButtonBorder"),
            "Button.font", controlFont,
            "Button.textIconGap", new Integer(4),
            "Button.textShiftOffset", zero, // radar 3308129 - aqua doesn't move images when pressed.
            "Button.focusInputMap", controlFocusInputMap,
            "Button.margin", new InsetsUIResource(0, 2, 0, 2),
            "Button.opaque", buttonShouldBeOpaque,

            "CheckBox.background", controlBackgroundColor,
            "CheckBox.foreground", black,
            "CheckBox.disabledText", disabled,
            "CheckBox.select", selected,
            "CheckBox.icon", new SwingLazyValue(PKG_PREFIX + "AquaButtonCheckBoxUI", "getSizingCheckBoxIcon"),
            "CheckBox.font", controlFont,
            "CheckBox.border", AquaButtonBorder.getBevelButtonBorder(),
            "CheckBox.margin", new InsetsUIResource(1, 1, 0, 1),
            // radar 3583849. This property never gets
            // used. The border for the Checkbox gets overridden
            // by AquaRadiButtonUI.setThemeBorder(). Needs refactoring. (vm)
            // why is button focus commented out?
            //"CheckBox.focus", getFocusColor(),
            "CheckBox.focusInputMap", controlFocusInputMap,

            "CheckBoxMenuItem.font", menuFont,
            "CheckBoxMenuItem.acceleratorFont", menuFont,
            "CheckBoxMenuItem.background", menuBackgroundColor,
            "CheckBoxMenuItem.foreground", menuForegroundColor,
            "CheckBoxMenuItem.selectionBackground", menuSelectedBackgroundColor,
            "CheckBoxMenuItem.selectionForeground", menuSelectedForegroundColor,
            "CheckBoxMenuItem.disabledBackground", menuDisabledBackgroundColor,
            "CheckBoxMenuItem.disabledForeground", menuDisabledForegroundColor,
            "CheckBoxMenuItem.acceleratorForeground", menuAccelForegroundColor,
            "CheckBoxMenuItem.acceleratorSelectionForeground", menuAccelSelectionForegroundColor,
            "CheckBoxMenuItem.acceleratorDelimiter", "",
            "CheckBoxMenuItem.border", menuBorder, // for inset calculation
            "CheckBoxMenuItem.margin", menuItemMargin,
            "CheckBoxMenuItem.borderPainted", Boolean.TRUE,
            "CheckBoxMenuItem.checkIcon", new SwingLazyValue(kAquaImageFactoryName, "getMenuItemCheckIcon"),
            "CheckBoxMenuItem.dashIcon", new SwingLazyValue(kAquaImageFactoryName, "getMenuItemDashIcon"),
            //"CheckBoxMenuItem.arrowIcon", null,

            "ColorChooser.background", panelBackgroundColor,

            // *** ComboBox
            "ComboBox.font", controlFont,
            "ComboBox.background", controlBackgroundColor, //menuBackgroundColor, // "menu" when it has no scrollbar, "listView" when it does
            "ComboBox.foreground", menuForegroundColor,
            "ComboBox.selectionBackground", menuSelectedBackgroundColor,
            "ComboBox.selectionForeground", menuSelectedForegroundColor,
            "ComboBox.disabledBackground", menuDisabledBackgroundColor,
            "ComboBox.disabledForeground", menuDisabledForegroundColor,
            "ComboBox.ancestorInputMap", aquaKeyBindings.getComboBoxInputMap(),

            "DesktopIcon.border", internalFrameBorder,
            "DesktopIcon.borderColor", smokyGlass,
            "DesktopIcon.borderRimColor", dockIconRim,
            "DesktopIcon.labelBackground", mediumTranslucentBlack,
            "Desktop.background", desktopBackgroundColor,

            "EditorPane.focusInputMap", aquaKeyBindings.getMultiLineTextInputMap(),
            "EditorPane.font", controlFont,
            "EditorPane.background", textBackground,
            "EditorPane.foreground", textForeground,
            "EditorPane.selectionBackground", textHighlight,
            "EditorPane.selectionForeground", textHighlightText,
            "EditorPane.caretForeground", textForeground,
            "EditorPane.caretBlinkRate", textCaretBlinkRate,
            "EditorPane.inactiveForeground", textInactiveText,
            "EditorPane.inactiveBackground", textInactiveBackground,
            "EditorPane.border", textAreaBorder,
            "EditorPane.margin", editorMargin,

            "FileChooser.newFolderIcon", AquaIcon.SystemIcon.getFolderIconUIResource(),
            "FileChooser.upFolderIcon", AquaIcon.SystemIcon.getFolderIconUIResource(),
            "FileChooser.homeFolderIcon", AquaIcon.SystemIcon.getDesktopIconUIResource(),
            "FileChooser.detailsViewIcon", AquaIcon.SystemIcon.getComputerIconUIResource(),
            "FileChooser.listViewIcon", AquaIcon.SystemIcon.getComputerIconUIResource(),

            "FileView.directoryIcon", AquaIcon.SystemIcon.getFolderIconUIResource(),
            "FileView.fileIcon", AquaIcon.SystemIcon.getDocumentIconUIResource(),
            "FileView.computerIcon", AquaIcon.SystemIcon.getDesktopIconUIResource(),
            "FileView.hardDriveIcon", AquaIcon.SystemIcon.getHardDriveIconUIResource(),
            "FileView.floppyDriveIcon", AquaIcon.SystemIcon.getFloppyIconUIResource(),

            // File View
            "FileChooser.cancelButtonMnemonic", zero,
            "FileChooser.saveButtonMnemonic", zero,
            "FileChooser.openButtonMnemonic", zero,
            "FileChooser.updateButtonMnemonic", zero,
            "FileChooser.helpButtonMnemonic", zero,
            "FileChooser.directoryOpenButtonMnemonic", zero,

            "FileChooser.lookInLabelMnemonic", zero,
            "FileChooser.fileNameLabelMnemonic", zero,
            "FileChooser.filesOfTypeLabelMnemonic", zero,

            "Focus.color", focusRingColor,

            "FormattedTextField.focusInputMap", aquaKeyBindings.getFormattedTextFieldInputMap(),
            "FormattedTextField.font", controlFont,
            "FormattedTextField.background", textBackground,
            "FormattedTextField.foreground", textForeground,
            "FormattedTextField.inactiveForeground", textInactiveText,
            "FormattedTextField.inactiveBackground", textInactiveBackground,
            "FormattedTextField.selectionBackground", textHighlight,
            "FormattedTextField.selectionForeground", textHighlightText,
            "FormattedTextField.caretForeground", textForeground,
            "FormattedTextField.caretBlinkRate", textCaretBlinkRate,
            "FormattedTextField.border", textFieldBorder,
            "FormattedTextField.margin", zeroInsets,

            "IconButton.font", controlSmallFont,

            "InternalFrame.titleFont", menuFont,
            "InternalFrame.background", windowBackgroundColor,
            "InternalFrame.borderColor", windowBackgroundColor,
            "InternalFrame.borderShadow", Color.red,
            "InternalFrame.borderDarkShadow", Color.green,
            "InternalFrame.borderHighlight", Color.blue,
            "InternalFrame.borderLight", Color.yellow,
            "InternalFrame.opaque", Boolean.FALSE,
            "InternalFrame.border", null, //internalFrameBorder,
            "InternalFrame.icon", null,

            "InternalFrame.paletteBorder", null,//internalFrameBorder,
            "InternalFrame.paletteTitleFont", menuFont,
            "InternalFrame.paletteBackground", windowBackgroundColor,

            "InternalFrame.optionDialogBorder", null,//internalFrameBorder,
            "InternalFrame.optionDialogTitleFont", menuFont,
            "InternalFrame.optionDialogBackground", windowBackgroundColor,

            /* Default frame icons are undefined for Basic. */

            "InternalFrame.closeIcon", new SwingLazyValue(PKG_PREFIX + "AquaInternalFrameUI", "exportCloseIcon"),
            "InternalFrame.maximizeIcon", new SwingLazyValue(PKG_PREFIX + "AquaInternalFrameUI", "exportZoomIcon"),
            "InternalFrame.iconifyIcon", new SwingLazyValue(PKG_PREFIX + "AquaInternalFrameUI", "exportMinimizeIcon"),
            "InternalFrame.minimizeIcon", new SwingLazyValue(PKG_PREFIX + "AquaInternalFrameUI", "exportMinimizeIcon"),
            // this could be either grow or icon
            // we decided to make it icon so that anyone who uses
            // these for ui will have different icons for max and min
            // these icons are pretty crappy to use in Mac OS X since
            // they really are interactive but we have to return a static
            // icon for now.

            // InternalFrame Auditory Cue Mappings
            "InternalFrame.closeSound", null,
            "InternalFrame.maximizeSound", null,
            "InternalFrame.minimizeSound", null,
            "InternalFrame.restoreDownSound", null,
            "InternalFrame.restoreUpSound", null,

            "InternalFrame.activeTitleBackground", windowBackgroundColor,
            "InternalFrame.activeTitleForeground", textForeground,
            "InternalFrame.inactiveTitleBackground", windowBackgroundColor,
            "InternalFrame.inactiveTitleForeground", textInactiveText,
            "InternalFrame.windowBindings", new Object[]{
                "shift ESCAPE", "showSystemMenu",
                "ctrl SPACE", "showSystemMenu",
                "ESCAPE", "hideSystemMenu"
            },

            // Radar [3543438]. We now define the TitledBorder properties for font and color.
            // Aqua HIG doesn't define TitledBorders as Swing does. Eventually, we might want to
            // re-think TitledBorder to behave more like a Box (NSBox). (vm)
            "TitledBorder.font", controlFont,
            "TitledBorder.titleColor", black,
        //    "TitledBorder.border", -- we inherit this property from BasicLookAndFeel (etched border)
            "TitledBorder.aquaVariant", aquaTitledBorder, // this is the border that matches what aqua really looks like
            "InsetBorder.aquaVariant", aquaInsetBorder, // this is the title-less variant

            // *** Label
            "Label.font", controlFont, // themeLabelFont is for small things like ToolbarButtons
            "Label.background", controlBackgroundColor,
            "Label.foreground", black,
            "Label.disabledForeground", disabled,
            "Label.disabledShadow", disabledShadow,
            "Label.opaque", useOpaqueComponents,
            "Label.border", null,

            "List.font", viewFont, // [3577901] Aqua HIG says "default font of text in lists and tables" should be 12 point (vm).
            "List.background", white,
            "List.foreground", black,
            "List.selectionBackground", selectionBackground,
            "List.selectionForeground", selectionForeground,
            "List.selectionInactiveBackground", selectionInactiveBackground,
            "List.selectionInactiveForeground", selectionInactiveForeground,
            "List.focusCellHighlightBorder", focusCellHighlightBorder,
            "List.border", null,
            "List.cellRenderer", listCellRendererActiveValue,

            "List.sourceListBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaListUI", "getSourceListBackgroundPainter"),
            "List.sourceListSelectionBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaListUI", "getSourceListSelectionBackgroundPainter"),
            "List.sourceListFocusedSelectionBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaListUI", "getSourceListFocusedSelectionBackgroundPainter"),
            "List.evenRowBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaListUI", "getListEvenBackgroundPainter"),
            "List.oddRowBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaListUI", "getListOddBackgroundPainter"),

            // <rdar://Problem/3743210> The modifier for the Mac is meta, not control.
            "List.focusInputMap", aquaKeyBindings.getListInputMap(),

            //"List.scrollPaneBorder", listBoxBorder, // Not used in Swing1.1
            //"ListItem.border", ThemeMenu.listItemBorder(), // for inset calculation

            // *** Menus
            "Menu.font", menuFont,
            "Menu.acceleratorFont", menuFont,
            "Menu.background", menuBackgroundColor,
            "Menu.foreground", menuForegroundColor,
            "Menu.selectionBackground", menuSelectedBackgroundColor,
            "Menu.selectionForeground", menuSelectedForegroundColor,
            "Menu.disabledBackground", menuDisabledBackgroundColor,
            "Menu.disabledForeground", menuDisabledForegroundColor,
            "Menu.acceleratorForeground", menuAccelForegroundColor,
            "Menu.acceleratorSelectionForeground", menuAccelSelectionForegroundColor,
            //"Menu.border", ThemeMenu.menuItemBorder(), // for inset calculation
            "Menu.border", menuBorder,
            "Menu.borderPainted", Boolean.FALSE,
            "Menu.margin", menuItemMargin,
            //"Menu.checkIcon", emptyCheckIcon, // A non-drawing GlyphIcon to make the spacing consistent
            "Menu.arrowIcon", new SwingLazyValue(kAquaImageFactoryName, "getMenuArrowIcon"),
            "Menu.consumesTabs", Boolean.TRUE,
            "Menu.menuPopupOffsetY", new Integer(1),
            "Menu.submenuPopupOffsetY", new Integer(-4),

            "MenuBar.font", menuFont,
            "MenuBar.background", menuBackgroundColor, // not a menu item, not selected
            "MenuBar.foreground", menuForegroundColor,
            "MenuBar.border", new AquaMenuBarBorder(), // sja make lazy!
            "MenuBar.margin", new InsetsUIResource(0, 8, 0, 8), // sja make lazy!
            "MenuBar.selectionBackground", menuSelectedBackgroundColor, // not a menu item, is selected
            "MenuBar.selectionForeground", menuSelectedForegroundColor,
            "MenuBar.disabledBackground", menuDisabledBackgroundColor, //ThemeBrush.GetThemeBrushForMenu(false, false), // not a menu item, not selected
            "MenuBar.disabledForeground", menuDisabledForegroundColor,
            "MenuBar.backgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaMenuPainter", "getMenuBarPainter"),
            "MenuBar.selectedBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaMenuPainter", "getSelectedMenuBarItemPainter"),

            "MenuItem.font", menuFont,
            "MenuItem.acceleratorFont", menuFont,
            "MenuItem.background", menuBackgroundColor,
            "MenuItem.foreground", menuForegroundColor,
            "MenuItem.selectionBackground", menuSelectedBackgroundColor,
            "MenuItem.selectionForeground", menuSelectedForegroundColor,
            "MenuItem.disabledBackground", menuDisabledBackgroundColor,
            "MenuItem.disabledForeground", menuDisabledForegroundColor,
            "MenuItem.acceleratorForeground", menuAccelForegroundColor,
            "MenuItem.acceleratorSelectionForeground", menuAccelSelectionForegroundColor,
            "MenuItem.acceleratorDelimiter", "",
            "MenuItem.border", menuBorder,
            "MenuItem.margin", menuItemMargin,
            "MenuItem.borderPainted", Boolean.TRUE,
            //"MenuItem.checkIcon", emptyCheckIcon, // A non-drawing GlyphIcon to make the spacing consistent
            //"MenuItem.arrowIcon", null,
            "MenuItem.selectedBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaMenuPainter", "getSelectedMenuItemPainter"),

            // *** OptionPane
            // You can additionaly define OptionPane.messageFont which will
            // dictate the fonts used for the message, and
            // OptionPane.buttonFont, which defines the font for the buttons.
            "OptionPane.font", alertHeaderFont,
            "OptionPane.messageFont", controlFont,
            "OptionPane.buttonFont", controlFont,
            "OptionPane.background", windowBackgroundColor,
            "OptionPane.foreground", black,
            "OptionPane.messageForeground", black,
            "OptionPane.border", new BorderUIResource.EmptyBorderUIResource(12, 21, 17, 21),
            "OptionPane.messageAreaBorder", zeroBorder,
            "OptionPane.buttonAreaBorder", new BorderUIResource.EmptyBorderUIResource(13, 0, 0, 0),
            "OptionPane.minimumSize", new DimensionUIResource(262, 90),

            "OptionPane.errorIcon", stopIcon,
            "OptionPane.informationIcon", confirmIcon,
            "OptionPane.warningIcon", cautionIcon,
            "OptionPane.questionIcon", confirmIcon,
            "_SecurityDecisionIcon", securityIcon,
            "OptionPane.windowBindings", new Object[]{"ESCAPE", "close"},
            // OptionPane Auditory Cue Mappings
            "OptionPane.errorSound", null,
            "OptionPane.informationSound", null, // Info and Plain
            "OptionPane.questionSound", null,
            "OptionPane.warningSound", null,
            "OptionPane.buttonClickThreshhold", new Integer(500),
            "OptionPane.yesButtonMnemonic", "",
            "OptionPane.noButtonMnemonic", "",
            "OptionPane.okButtonMnemonic", "",
            "OptionPane.cancelButtonMnemonic", "",

            "Panel.font", controlFont,
            "Panel.background", panelBackgroundColor, //new ColorUIResource(0.5647f, 0.9957f, 0.5059f),
            "Panel.foreground", black,
            "Panel.opaque", useOpaqueComponents,

            "PasswordField.focusInputMap", aquaKeyBindings.getTextFieldInputMap(),
            "PasswordField.font", controlFont,
            "PasswordField.background", textBackground,
            "PasswordField.foreground", textForeground,
            "PasswordField.inactiveForeground", textInactiveText,
            "PasswordField.inactiveBackground", textInactiveBackground,
            "PasswordField.selectionBackground", textHighlight,
            "PasswordField.selectionForeground", textHighlightText,
            "PasswordField.caretForeground", textForeground,
            "PasswordField.caretBlinkRate", textCaretBlinkRate,
            "PasswordField.border", textFieldBorder,
            "PasswordField.margin", zeroInsets,
            "PasswordField.echoChar", new Character((char)0x25CF),
            "PasswordField.capsLockIconColor", textPasswordFieldCapsLockIconColor,

            "PopupMenu.font", menuFont,
            "PopupMenu.background", menuBackgroundColor,
            "PopupMenu.translucentBackground", translucentWhite,
            "PopupMenu.foreground", menuForegroundColor,
            "PopupMenu.selectionBackground", menuSelectedBackgroundColor,
            "PopupMenu.selectionForeground", menuSelectedForegroundColor,
            "PopupMenu.border", menuBorder,
//            "PopupMenu.margin",

            "ProgressBar.font", controlFont,
            "ProgressBar.foreground", black,
            "ProgressBar.background", controlBackgroundColor,
            "ProgressBar.selectionForeground", black,
            "ProgressBar.selectionBackground", white,
            "ProgressBar.border", new BorderUIResource(BorderFactory.createEmptyBorder()),
            "ProgressBar.repaintInterval", new Integer(20),

            "RadioButton.background", controlBackgroundColor,
            "RadioButton.foreground", black,
            "RadioButton.disabledText", disabled,
            "RadioButton.select", selected,
            "RadioButton.icon", new SwingLazyValue(PKG_PREFIX + "AquaButtonRadioUI", "getSizingRadioButtonIcon"),
            "RadioButton.font", controlFont,
            "RadioButton.border", AquaButtonBorder.getBevelButtonBorder(),
            "RadioButton.margin", new InsetsUIResource(1, 1, 0, 1),
            "RadioButton.focusInputMap", controlFocusInputMap,

            "RadioButtonMenuItem.font", menuFont,
            "RadioButtonMenuItem.acceleratorFont", menuFont,
            "RadioButtonMenuItem.background", menuBackgroundColor,
            "RadioButtonMenuItem.foreground", menuForegroundColor,
            "RadioButtonMenuItem.selectionBackground", menuSelectedBackgroundColor,
            "RadioButtonMenuItem.selectionForeground", menuSelectedForegroundColor,
            "RadioButtonMenuItem.disabledBackground", menuDisabledBackgroundColor,
            "RadioButtonMenuItem.disabledForeground", menuDisabledForegroundColor,
            "RadioButtonMenuItem.acceleratorForeground", menuAccelForegroundColor,
            "RadioButtonMenuItem.acceleratorSelectionForeground", menuAccelSelectionForegroundColor,
            "RadioButtonMenuItem.acceleratorDelimiter", "",
            "RadioButtonMenuItem.border", menuBorder, // for inset calculation
            "RadioButtonMenuItem.margin", menuItemMargin,
            "RadioButtonMenuItem.borderPainted", Boolean.TRUE,
            "RadioButtonMenuItem.checkIcon", new SwingLazyValue(kAquaImageFactoryName, "getMenuItemCheckIcon"),
            "RadioButtonMenuItem.dashIcon", new SwingLazyValue(kAquaImageFactoryName, "getMenuItemDashIcon"),
            //"RadioButtonMenuItem.arrowIcon", null,

            "Separator.background", null,
            "Separator.foreground", new ColorUIResource(0xD4, 0xD4, 0xD4),

            "ScrollBar.border", null,
            "ScrollBar.focusInputMap", aquaKeyBindings.getScrollBarInputMap(),
            "ScrollBar.focusInputMap.RightToLeft", aquaKeyBindings.getScrollBarRightToLeftInputMap(),
            "ScrollBar.width", new Integer(16),
            "ScrollBar.background", white,
            "ScrollBar.foreground", black,

            "ScrollPane.font", controlFont,
            "ScrollPane.background", white,
            "ScrollPane.foreground", black, //$
            "ScrollPane.border", scollListBorder,
            "ScrollPane.viewportBorder", null,

            "ScrollPane.ancestorInputMap", aquaKeyBindings.getScrollPaneInputMap(),
            "ScrollPane.ancestorInputMap.RightToLeft", new UIDefaults.LazyInputMap(new Object[]{}),

            "Viewport.font", controlFont,
            "Viewport.background", white, // The background for tables, lists, etc
            "Viewport.foreground", black,

            // *** Slider
            "Slider.foreground", black, "Slider.background", controlBackgroundColor,
            "Slider.font", controlSmallFont,
            //"Slider.highlight", table.get("controlLtHighlight"),
            //"Slider.shadow", table.get("controlShadow"),
            //"Slider.focus", table.get("controlDkShadow"),
            "Slider.tickColor", new ColorUIResource(Color.GRAY),
            "Slider.border", null,
            "Slider.focusInsets", new InsetsUIResource(2, 2, 2, 2),
            "Slider.focusInputMap", aquaKeyBindings.getSliderInputMap(),
            "Slider.focusInputMap.RightToLeft", aquaKeyBindings.getSliderRightToLeftInputMap(),

            // *** Spinner
            "Spinner.font", controlFont,
            "Spinner.background", controlBackgroundColor,
            "Spinner.foreground", black,
            "Spinner.border", null,
            "Spinner.arrowButtonSize", new Dimension(16, 5),
            "Spinner.ancestorInputMap", aquaKeyBindings.getSpinnerInputMap(),
            "Spinner.editorBorderPainted", Boolean.TRUE,
            "Spinner.editorAlignment", SwingConstants.TRAILING,

            // *** SplitPane
            //"SplitPane.highlight", table.get("controlLtHighlight"),
            //"SplitPane.shadow", table.get("controlShadow"),
            "SplitPane.background", panelBackgroundColor,
            "SplitPane.border", scollListBorder,
            "SplitPane.dividerSize", new Integer(9), //$
            "SplitPaneDivider.border", null, // AquaSplitPaneDividerUI draws it
            "SplitPaneDivider.horizontalGradientVariant", new SwingLazyValue(PKG_PREFIX + "AquaSplitPaneDividerUI", "getHorizontalSplitDividerGradientVariant"),

            // *** TabbedPane
            "TabbedPane.font", controlFont,
            "TabbedPane.smallFont", controlSmallFont,
            "TabbedPane.useSmallLayout", Boolean.FALSE,//sSmallTabs ? Boolean.TRUE : Boolean.FALSE,
            "TabbedPane.background", tabBackgroundColor, // for bug [3398277] use a background color so that
            // tabs on a custom pane get erased when they are removed.
            "TabbedPane.foreground", black, //ThemeTextColor.GetThemeTextColor(AppearanceConstants.kThemeTextColorTabFrontActive),
            //"TabbedPane.lightHighlight", table.get("controlLtHighlight"),
            //"TabbedPane.highlight", table.get("controlHighlight"),
            //"TabbedPane.shadow", table.get("controlShadow"),
            //"TabbedPane.darkShadow", table.get("controlDkShadow"),
            //"TabbedPane.focus", table.get("controlText"),
            "TabbedPane.opaque", useOpaqueComponents,
            "TabbedPane.textIconGap", new Integer(4),
            "TabbedPane.tabInsets", new InsetsUIResource(0, 10, 3, 10), // Label within tab (top, left, bottom, right)
            //"TabbedPane.rightTabInsets", new InsetsUIResource(0, 10, 3, 10), // Label within tab (top, left, bottom, right)
            "TabbedPane.leftTabInsets", new InsetsUIResource(0, 10, 3, 10), // Label within tab
            "TabbedPane.rightTabInsets", new InsetsUIResource(0, 10, 3, 10), // Label within tab
            //"TabbedPane.tabAreaInsets", new InsetsUIResource(3, 9, -1, 9), // Tabs relative to edge of pane (negative value for overlapping)
            "TabbedPane.tabAreaInsets", new InsetsUIResource(3, 9, -1, 9), // Tabs relative to edge of pane (negative value for overlapping)
            // (top = side opposite pane, left = edge || to pane, bottom = side adjacent to pane, right = left) - see rotateInsets
            "TabbedPane.contentBorderInsets", new InsetsUIResource(8, 0, 0, 0), // width of border
            //"TabbedPane.selectedTabPadInsets", new InsetsUIResource(0, 0, 1, 0), // Really outsets, this is where we allow for overlap
            "TabbedPane.selectedTabPadInsets", new InsetsUIResource(0, 0, 0, 0), // Really outsets, this is where we allow for overlap
            "TabbedPane.tabsOverlapBorder", Boolean.TRUE,
            "TabbedPane.selectedTabTitlePressedColor", selectedTabTitlePressedColor,
            "TabbedPane.selectedTabTitleDisabledColor", selectedTabTitleDisabledColor,
            "TabbedPane.selectedTabTitleNormalColor", selectedTabTitleNormalColor,
            "TabbedPane.selectedTabTitleShadowDisabledColor", selectedTabTitleShadowDisabledColor,
            "TabbedPane.selectedTabTitleShadowNormalColor", selectedTabTitleShadowNormalColor,
            "TabbedPane.nonSelectedTabTitleNormalColor", nonSelectedTabTitleNormalColor,

            // *** Table
            "Table.font", viewFont, // [3577901] Aqua HIG says "default font of text in lists and tables" should be 12 point (vm).
            "Table.foreground", black, // cell text color
            "Table.background", white, // cell background color
            "Table.selectionForeground", selectionForeground,
            "Table.selectionBackground", selectionBackground,
            "Table.selectionInactiveBackground", selectionInactiveBackground,
            "Table.selectionInactiveForeground", selectionInactiveForeground,
            "Table.gridColor", white, // grid line color
            "Table.focusCellBackground", textHighlightText,
            "Table.focusCellForeground", textHighlight,
            "Table.focusCellHighlightBorder", focusCellHighlightBorder,
            "Table.scrollPaneBorder", scollListBorder,

            "Table.ancestorInputMap", aquaKeyBindings.getTableInputMap(),
            "Table.ancestorInputMap.RightToLeft", aquaKeyBindings.getTableRightToLeftInputMap(),

            "TableHeader.font", controlSmallFont,
            "TableHeader.foreground", black,
            "TableHeader.background", white, // header background
            "TableHeader.cellBorder", listHeaderBorder,

            // *** Text
            "TextArea.focusInputMap", aquaKeyBindings.getMultiLineTextInputMap(),
            "TextArea.font", controlFont,
            "TextArea.background", textBackground,
            "TextArea.foreground", textForeground,
            "TextArea.inactiveForeground", textInactiveText,
            "TextArea.inactiveBackground", textInactiveBackground,
            "TextArea.selectionBackground", textHighlight,
            "TextArea.selectionForeground", textHighlightText,
            "TextArea.caretForeground", textForeground,
            "TextArea.caretBlinkRate", textCaretBlinkRate,
            "TextArea.border", textAreaBorder,
            "TextArea.margin", zeroInsets,

            "TextComponent.selectionBackgroundInactive", textHighlightInactive,

            "TextField.focusInputMap", aquaKeyBindings.getTextFieldInputMap(),
            "TextField.font", controlFont,
            "TextField.background", textBackground,
            "TextField.foreground", textForeground,
            "TextField.inactiveForeground", textInactiveText,
            "TextField.inactiveBackground", textInactiveBackground,
            "TextField.selectionBackground", textHighlight,
            "TextField.selectionForeground", textHighlightText,
            "TextField.caretForeground", textForeground,
            "TextField.caretBlinkRate", textCaretBlinkRate,
            "TextField.border", textFieldBorder,
            "TextField.margin", zeroInsets,

            "TextPane.focusInputMap", aquaKeyBindings.getMultiLineTextInputMap(),
            "TextPane.font", controlFont,
            "TextPane.background", textBackground,
            "TextPane.foreground", textForeground,
            "TextPane.selectionBackground", textHighlight,
            "TextPane.selectionForeground", textHighlightText,
            "TextPane.caretForeground", textForeground,
            "TextPane.caretBlinkRate", textCaretBlinkRate,
            "TextPane.inactiveForeground", textInactiveText,
            "TextPane.inactiveBackground", textInactiveBackground,
            "TextPane.border", textAreaBorder,
            "TextPane.margin", editorMargin,

            // *** ToggleButton
            "ToggleButton.background", controlBackgroundColor,
            "ToggleButton.foreground", black,
            "ToggleButton.disabledText", disabled,
            // we need to go through and find out if these are used, and if not what to set
            // so that subclasses will get good aqua like colors.
            //    "ToggleButton.select", getControlShadow(),
            //    "ToggleButton.text", getControl(),
            //    "ToggleButton.disabledSelectedText", getControlDarkShadow(),
            //    "ToggleButton.disabledBackground", getControl(),
            //    "ToggleButton.disabledSelectedBackground", getControlShadow(),
            //"ToggleButton.focus", getFocusColor(),
            "ToggleButton.border", new SwingLazyValue(PKG_PREFIX + "AquaButtonBorder", "getDynamicButtonBorder"), // sja make this lazy!
            "ToggleButton.font", controlFont,
            "ToggleButton.focusInputMap", controlFocusInputMap,
            "ToggleButton.margin", new InsetsUIResource(2, 2, 2, 2),

            // *** ToolBar
            "ToolBar.font", controlFont,
            "ToolBar.background", panelBackgroundColor,
            "ToolBar.foreground", new ColorUIResource(Color.gray),
            "ToolBar.dockingBackground", panelBackgroundColor,
            "ToolBar.dockingForeground", selectionBackground,
            "ToolBar.floatingBackground", panelBackgroundColor,
            "ToolBar.floatingForeground", new ColorUIResource(Color.darkGray),
            "ToolBar.border", new SwingLazyValue(PKG_PREFIX + "AquaToolBarUI", "getToolBarBorder"),
            "ToolBar.borderHandleColor", toolbarDragHandleColor,
            //"ToolBar.separatorSize", new DimensionUIResource( 10, 10 ),
            "ToolBar.separatorSize", null,

            // *** ToolBarButton
            "ToolBarButton.margin", new InsetsUIResource(3, 3, 3, 3),
            "ToolBarButton.insets", new InsetsUIResource(1, 1, 1, 1),

            // *** ToolTips
            "ToolTip.font", controlSmallFont,
            //$ Tooltips - Same color as help balloons?
            "ToolTip.background", toolTipBackground,
            "ToolTip.foreground", black,
            "ToolTip.border", toolTipBorder,

            // *** Tree
            "Tree.font", viewFont, // [3577901] Aqua HIG says "default font of text in lists and tables" should be 12 point (vm).
            "Tree.background", white,
            "Tree.foreground", black,
            // for now no lines
            "Tree.hash", white, //disabled, // Line color
            "Tree.line", white, //disabled, // Line color
            "Tree.textForeground", black,
            "Tree.textBackground", white,
            "Tree.selectionForeground", selectionForeground,
            "Tree.selectionBackground", selectionBackground,
            "Tree.selectionInactiveBackground", selectionInactiveBackground,
            "Tree.selectionInactiveForeground", selectionInactiveForeground,
            "Tree.selectionBorderColor", selectionBackground, // match the background so it looks like we don't draw anything
            "Tree.editorBorderSelectionColor", null, // The EditTextFrame provides its own border
            // "Tree.editorBorder", textFieldBorder, // If you still have Sun bug 4376328 in DefaultTreeCellEditor, it has to have the same insets as TextField.border
            "Tree.leftChildIndent", new Integer(7),//$
            "Tree.rightChildIndent", new Integer(13),//$
            "Tree.rowHeight", new Integer(19),// iconHeight + 3, to match finder - a zero would have the renderer decide, except that leaves the icons touching
            "Tree.scrollsOnExpand", Boolean.FALSE,
            "Tree.openIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeOpenFolderIcon"), // Open folder icon
            "Tree.closedIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeFolderIcon"), // Closed folder icon
            "Tree.leafIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeDocumentIcon"), // Document icon
            "Tree.expandedIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeExpandedIcon"),
            "Tree.collapsedIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeCollapsedIcon"),
            "Tree.rightToLeftCollapsedIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeRightToLeftCollapsedIcon"),
            "Tree.changeSelectionWithFocus", Boolean.TRUE,
            "Tree.drawsFocusBorderAroundIcon", Boolean.FALSE,

            "Tree.focusInputMap", aquaKeyBindings.getTreeInputMap(),
            "Tree.focusInputMap.RightToLeft", aquaKeyBindings.getTreeRightToLeftInputMap(),
            "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[]{"ESCAPE", "cancel"}),};

        table.putDefaults(defaults);

        Object aaTextInfo = SwingUtilities2.AATextInfo.getAATextInfo(true);
        table.put(SwingUtilities2.AA_TEXT_PROPERTY_KEY, aaTextInfo);
    }

    protected void initSystemColorDefaults(final UIDefaults table) {
//        String[] defaultSystemColors = {
//                  "desktop", "#005C5C", /* Color of the desktop background */
//          "activeCaption", "#000080", /* Color for captions (title bars) when they are active. */
//          "activeCaptionText", "#FFFFFF", /* Text color for text in captions (title bars). */
//        "activeCaptionBorder", "#C0C0C0", /* Border color for caption (title bar) window borders. */
//            "inactiveCaption", "#808080", /* Color for captions (title bars) when not active. */
//        "inactiveCaptionText", "#C0C0C0", /* Text color for text in inactive captions (title bars). */
//      "inactiveCaptionBorder", "#C0C0C0", /* Border color for inactive caption (title bar) window borders. */
//                 "window", "#FFFFFF", /* Default color for the interior of windows */
//           "windowBorder", "#000000", /* ??? */
//             "windowText", "#000000", /* ??? */
//               "menu", "#C0C0C0", /* Background color for menus */
//               "menuText", "#000000", /* Text color for menus  */
//               "text", "#C0C0C0", /* Text background color */
//               "textText", "#000000", /* Text foreground color */
//          "textHighlight", "#000080", /* Text background color when selected */
//          "textHighlightText", "#FFFFFF", /* Text color when selected */
//           "textInactiveText", "#808080", /* Text color when disabled */
//                "control", "#C0C0C0", /* Default color for controls (buttons, sliders, etc) */
//            "controlText", "#000000", /* Default color for text in controls */
//           "controlHighlight", "#C0C0C0", /* Specular highlight (opposite of the shadow) */
//         "controlLtHighlight", "#FFFFFF", /* Highlight color for controls */
//          "controlShadow", "#808080", /* Shadow color for controls */
//            "controlDkShadow", "#000000", /* Dark shadow color for controls */
//              "scrollbar", "#E0E0E0", /* Scrollbar background (usually the "track") */
//               "info", "#FFFFE1", /* ??? */
//               "infoText", "#000000"  /* ??? */
//        };
//
//        loadSystemColors(table, defaultSystemColors, isNativeLookAndFeel());
    }

    /**
     * Initialize the uiClassID to AquaComponentUI mapping.
     * The JComponent classes define their own uiClassID constants
     * (see AbstractComponent.getUIClassID).  This table must
     * map those constants to a BasicComponentUI class of the
     * appropriate type.
     *
     * @see #getDefaults
     */
    protected void initClassDefaults(final UIDefaults table) {
        final String basicPackageName = "javax.swing.plaf.basic.";

        final Object[] uiDefaults = {
            "ButtonUI", PKG_PREFIX + "AquaButtonUI",
            "CheckBoxUI", PKG_PREFIX + "AquaButtonCheckBoxUI",
            "CheckBoxMenuItemUI", PKG_PREFIX + "AquaMenuItemUI",
            "LabelUI", PKG_PREFIX + "AquaLabelUI",
            "ListUI", PKG_PREFIX + "AquaListUI",
            "MenuUI", PKG_PREFIX + "AquaMenuUI",
            "MenuItemUI", PKG_PREFIX + "AquaMenuItemUI",
            "OptionPaneUI", PKG_PREFIX + "AquaOptionPaneUI",
            "PanelUI", PKG_PREFIX + "AquaPanelUI",
            "RadioButtonMenuItemUI", PKG_PREFIX + "AquaMenuItemUI",
            "RadioButtonUI", PKG_PREFIX + "AquaButtonRadioUI",
            "ProgressBarUI", PKG_PREFIX + "AquaProgressBarUI",
            "RootPaneUI", PKG_PREFIX + "AquaRootPaneUI",
            "SliderUI", PKG_PREFIX + "AquaSliderUI",
            "ScrollBarUI", PKG_PREFIX + "AquaScrollBarUI",
            "TabbedPaneUI", PKG_PREFIX + (JRSUIUtils.TabbedPane.shouldUseTabbedPaneContrastUI() ? "AquaTabbedPaneContrastUI" : "AquaTabbedPaneUI"),
            "TableUI", PKG_PREFIX + "AquaTableUI",
            "ToggleButtonUI", PKG_PREFIX + "AquaButtonToggleUI",
            "ToolBarUI", PKG_PREFIX + "AquaToolBarUI",
            "ToolTipUI", PKG_PREFIX + "AquaToolTipUI",
            "TreeUI", PKG_PREFIX + "AquaTreeUI",

            "InternalFrameUI", PKG_PREFIX + "AquaInternalFrameUI",
            "DesktopIconUI", PKG_PREFIX + "AquaInternalFrameDockIconUI",
            "DesktopPaneUI", PKG_PREFIX + "AquaInternalFramePaneUI",
            "EditorPaneUI", PKG_PREFIX + "AquaEditorPaneUI",
            "TextFieldUI", PKG_PREFIX + "AquaTextFieldUI",
            "TextPaneUI", PKG_PREFIX + "AquaTextPaneUI",
            "ComboBoxUI", PKG_PREFIX + "AquaComboBoxUI",
            "PopupMenuUI", PKG_PREFIX + "AquaPopupMenuUI",
            "TextAreaUI", PKG_PREFIX + "AquaTextAreaUI",
            "MenuBarUI", PKG_PREFIX + "AquaMenuBarUI",
            "FileChooserUI", PKG_PREFIX + "AquaFileChooserUI",
            "PasswordFieldUI", PKG_PREFIX + "AquaTextPasswordFieldUI",
            "TableHeaderUI", PKG_PREFIX + "AquaTableHeaderUI",

            "FormattedTextFieldUI", PKG_PREFIX + "AquaTextFieldFormattedUI",

            "SpinnerUI", PKG_PREFIX + "AquaSpinnerUI",
            "SplitPaneUI", PKG_PREFIX + "AquaSplitPaneUI",
            "ScrollPaneUI", PKG_PREFIX + "AquaScrollPaneUI",

            "PopupMenuSeparatorUI", PKG_PREFIX + "AquaPopupMenuSeparatorUI",
            "SeparatorUI", PKG_PREFIX + "AquaPopupMenuSeparatorUI",
            "ToolBarSeparatorUI", PKG_PREFIX + "AquaToolBarSeparatorUI",

            // as we implement aqua versions of the swing elements
            // we will aad the com.apple.laf.FooUI classes to this table.

            "ColorChooserUI", basicPackageName + "BasicColorChooserUI",

            // text UIs
            "ViewportUI", basicPackageName + "BasicViewportUI",
        };
        table.putDefaults(uiDefaults);
    }
}