home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 November / Chip_1998-11_cd.bin / tema / Cafe / jfc.bin / MacLookAndFeel.java < prev    next >
Text File  |  1998-02-26  |  41KB  |  873 lines

  1. /*
  2.  * @(#)MacLookAndFeel.java    1.12 98/02/06
  3.  *
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  *
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  *
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  *
  19.  */
  20.  
  21.  
  22. package com.sun.java.swing.plaf.mac;
  23.  
  24.  
  25. import java.awt.Color;
  26. import java.awt.Font;
  27. import java.net.URL;
  28. import java.io.*;
  29.  
  30.  
  31. import com.sun.java.swing.*;
  32. import com.sun.java.swing.plaf.*;
  33. import com.sun.java.swing.border.*;
  34.  
  35. import com.sun.java.swing.plaf.basic.BasicLookAndFeel;
  36. import com.sun.java.swing.plaf.basic.BasicMarginBorder;
  37. import com.sun.java.swing.plaf.basic.BasicComboBoxRenderer;
  38. import com.sun.java.swing.plaf.basic.BasicComboBoxEditor;
  39.  
  40. /**
  41.  * <p>
  42.  * Warning: serialized objects of this class will not be compatible with
  43.  * future swing releases.  The current serialization support is appropriate
  44.  * for short term storage or RMI between Swing1.0 applications.  It will
  45.  * not be possible to load serialized Swing1.0 objects with future releases
  46.  * of Swing.  The JDK1.2 release of Swing will be the compatibility
  47.  * baseline for the serialized form of Swing objects.
  48.  *
  49.  * @version 1.12 02/06/98
  50.  * @author Symantec
  51.  */
  52.  
  53. public class MacLookAndFeel extends BasicLookAndFeel 
  54. {
  55.     public String getName() {
  56.         return "Macintosh";
  57.     }
  58.  
  59.  
  60.     public String getID() {
  61.         return "Macintosh";
  62.     }
  63.  
  64.  
  65.     public String getDescription() {
  66.         return "The Macintosh Look and Feel";
  67.     }
  68.  
  69.  
  70.     public boolean isNativeLookAndFeel() {
  71.         return MacUtilities.IsMacOS();
  72.     }
  73.  
  74.  
  75.     public boolean isSupportedLookAndFeel() {
  76.     return isNativeLookAndFeel();
  77.     }
  78.  
  79.  
  80.     /**
  81.      * Load the SystemColors into the defaults table.
  82.      * Included is the ramp from the Grayscale Appearance
  83.      * Specification
  84.      */
  85.     protected void initSystemColorDefaults(UIDefaults table)
  86.     {
  87.         Object[] grayscaleAppearanceColors =
  88.         {
  89.             "GrayscaleAppearanceB",        MacUtilities.GrayscaleAppearanceB,    /* Grayscale Appearance Color B */
  90.             "GrayscaleAppearanceW",        MacUtilities.GrayscaleAppearanceW,    /* Grayscale Appearance Color W */
  91.             "GrayscaleAppearance1",        MacUtilities.GrayscaleAppearance1,    /* Grayscale Appearance Color 1 */
  92.             "GrayscaleAppearance2",        MacUtilities.GrayscaleAppearance2,    /* Grayscale Appearance Color 2 */
  93.             "GrayscaleAppearance3",        MacUtilities.GrayscaleAppearance3,    /* Grayscale Appearance Color 3 */
  94.             "GrayscaleAppearance4",        MacUtilities.GrayscaleAppearance4,    /* Grayscale Appearance Color 4 */
  95.             "GrayscaleAppearance5",        MacUtilities.GrayscaleAppearance5,    /* Grayscale Appearance Color 5 */
  96.             "GrayscaleAppearance6",        MacUtilities.GrayscaleAppearance6,    /* Grayscale Appearance Color 6 */
  97.             "GrayscaleAppearance7",        MacUtilities.GrayscaleAppearance7,    /* Grayscale Appearance Color 7 */
  98.             "GrayscaleAppearance8",        MacUtilities.GrayscaleAppearance8,    /* Grayscale Appearance Color 8 */
  99.             "GrayscaleAppearance9",        MacUtilities.GrayscaleAppearance9,    /* Grayscale Appearance Color 9 */
  100.             "GrayscaleAppearance10",    MacUtilities.GrayscaleAppearance10,    /* Grayscale Appearance Color 10 */
  101.             "GrayscaleAppearance11",    MacUtilities.GrayscaleAppearance11,    /* Grayscale Appearance Color 11 */
  102.             "GrayscaleAppearance12",    MacUtilities.GrayscaleAppearance12,    /* Grayscale Appearance Color 12 */
  103.             "GrayscaleAppearanceA1",    MacUtilities.GrayscaleAppearanceA1,    /* Grayscale Appearance Color A1 */
  104.             "GrayscaleAppearanceA2",    MacUtilities.GrayscaleAppearanceA2,    /* Grayscale Appearance Color A2 */
  105.  
  106. /*****************************************************
  107.  *
  108.  *            Use these colors when an accent (tinged) version of the grayscale color is desired.
  109.  *            These entries are set in AppearanceFilter.setAppearance().
  110.  *
  111.  *            "AccentAppearance1",        AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance1),
  112.  *            "AccentAppearance2",        AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance2),
  113.  *            "AccentAppearance3",        AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance3),
  114.  *            "AccentAppearance4",        AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance4),
  115.  *            "AccentAppearance5",        AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance5),
  116.  *            "AccentAppearance6",        AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance6),
  117.  *            "AccentAppearance7",        AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance7),
  118.  *            "AccentAppearance8",        AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance8),
  119.  *            "AccentAppearance9",        AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance9),
  120.  *            "AccentAppearance10",        AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance10),
  121.  *            "AccentAppearance11",        AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance11),
  122.  *            "AccentAppearance12",        AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance12),
  123.  *            "AccentAppearanceA1",        AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearanceA1),
  124.  *            "AccentAppearanceA2",        AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearanceA2),
  125.  ******************************************************/
  126.         };
  127.  
  128.         for(int i = 0; i < grayscaleAppearanceColors.length; i += 2)
  129.         {
  130.             table.put((String)grayscaleAppearanceColors[i], grayscaleAppearanceColors[i + 1]);
  131.         }
  132.  
  133.         
  134.         
  135.         // textHighlight is correct in SystemColor.
  136.         ColorUIResource textHighlight;
  137.         try {
  138.             textHighlight = new ColorUIResource((Color)(java.awt.SystemColor.class.getField("textHighlight").get(null)));
  139.         } catch (Exception e) { 
  140.             textHighlight = null;
  141.         }
  142.  
  143.  
  144.         Object[] defaultSystemColors =
  145.         {
  146.                 "desktop", "#005C5C",    MacUtilities.GrayscaleAppearance4,    /* Color of the desktop background */
  147.           "activeCaption", "#000080",    MacUtilities.GrayscaleAppearance3,    /* Color for captions (title bars) when they are active. */
  148.       "activeCaptionText", "#000000",                null,                    /* Text color for text in captions (title bars). */
  149.     "activeCaptionBorder", "#CCCCCC",    MacUtilities.GrayscaleAppearance3,    /* Border color for caption (title bar) window borders. */
  150.         "inactiveCaption", "#DDDDDD",    MacUtilities.GrayscaleAppearance2,    /* Color for captions (title bars) when not active. */
  151.     "inactiveCaptionText", "#888888",    MacUtilities.GrayscaleAppearance7,    /* Text color for text in inactive captions (title bars). */
  152.   "inactiveCaptionBorder", "#DDDDDD",    MacUtilities.GrayscaleAppearance2,    /* Border color for inactive caption (title bar) window borders. */
  153.                  "window", "#FFFFFF",    MacUtilities.GrayscaleAppearance2,    /* Default color for the interior of windows */
  154.            "windowBorder", "#DDDDDD",    MacUtilities.GrayscaleAppearance2,    /* ??? */
  155.              "windowText", "#000000",                null,                    /* ??? */
  156.                    "menu", "#DDDDDD",    MacUtilities.GrayscaleAppearance2,    /* Background color for menus */
  157.                "menuText", "#000000",                null,                    /* Text color for menus  */
  158.                    "text", "#C0C0C0",                null,                    /* Text background color */
  159.                "textText", "#000000",                null,                    /* Text foreground color */
  160.           "textHighlight", "#000000",            textHighlight,                /* Text background color when selected */
  161.       "textHighlightText", "#C0C0C0",    MacUtilities.GrayscaleAppearanceB,    /* Text color when selected */
  162.        "textInactiveText", "#808080",                null,                    /* Text color when disabled */
  163.                 "control", "#C0C0C0",    MacUtilities.GrayscaleAppearance2,    /* Default color for controls (buttons, sliders, etc) */
  164.             "controlText", "#000000",                null,                    /* Default color for text in controls */
  165.        "controlHighlight", "#FFFFFF",                null,                    /* Specular highlight (opposite of the shadow) */
  166.      "controlLtHighlight", "#E0E0E0",                null,                    /* Highlight color for controls */
  167.           "controlShadow", "#808080",                null,                    /* Shadow color for controls */
  168.         "controlDkShadow", "#000000",                null,                    /* Dark shadow color for controls */
  169.               "scrollbar", "#DDDDDD",    MacUtilities.GrayscaleAppearance2,    /* Scrollbar background (usually the "track") */
  170.                    "info", "#FFFFCC",                null,                    
  171.                "infoText", "#000000",                null,                    
  172.      "controlLightShadow", "#9397A5",                null,                    /* Shadow color for controls */  
  173.         };
  174.  
  175.         loadSystemColors(table, defaultSystemColors);
  176.     }
  177.  
  178.  
  179.  
  180.     /**
  181.      * If this is the native look and feel the initial values for the
  182.      * system color properties are the same as the SystemColor constants.
  183.      * If not we use the integer color values in the <code>systemColors</code>
  184.      * argument.
  185.      */
  186.     protected void loadSystemColors(UIDefaults table, Object[] systemColors)
  187.     {
  188.         if (false && isNativeLookAndFeel()) {
  189.             for(int i = 0; i < systemColors.length; i += 3) {
  190.                 Color color = Color.black;
  191.                 try {
  192.                     String name = (String) systemColors[i];
  193.                     color = (Color)(java.awt.SystemColor.class.getField(name).get(null));
  194.                 } catch (Exception e) { 
  195.                 }
  196.                 table.put((String) systemColors[i], new ColorUIResource(color));
  197.             }
  198.         } else {
  199.             for(int i = 0; i < systemColors.length; i += 3) {
  200.                 if (systemColors[i + 2] != null)
  201.                 {
  202.                     table.put((String) systemColors[i], (ColorUIResource) systemColors[i + 2]);
  203.                 }
  204.                 else
  205.                 {
  206.                     Color color = Color.black;
  207.                     try {
  208.                         color = Color.decode((String) systemColors[i + 1]);
  209.                     } 
  210.                     catch(NumberFormatException e) {
  211.                         e.printStackTrace();
  212.                     }
  213.                     table.put((String) systemColors[i], new ColorUIResource(color));
  214.                 }
  215.             }
  216.         }
  217.     }
  218.  
  219.     protected void initClassDefaults(UIDefaults table)
  220.     {
  221.     super.initClassDefaults(table);
  222.  
  223.     String macPackageName = "com.sun.java.swing.plaf.mac.";
  224.     Object[] uiDefaults = {
  225.                 "ButtonUI", macPackageName + "MacButtonUI",
  226.               "CheckBoxUI", macPackageName + "MacCheckBoxUI",
  227.                  "LabelUI", macPackageName + "MacLabelUI",
  228.                   "ListUI", macPackageName + "MacListUI",
  229.                "MenuBarUI", macPackageName + "MacMenuBarUI",
  230.                   "MenuUI", macPackageName + "MacMenuUI",
  231.               "MenuItemUI", macPackageName + "MacMenuItemUI",
  232.       "CheckBoxMenuItemUI", macPackageName + "MacCheckBoxMenuItemUI",
  233.    "RadioButtonMenuItemUI", macPackageName + "MacRadioButtonMenuItemUI",
  234.            "RadioButtonUI", macPackageName + "MacRadioButtonUI",
  235.           "ToggleButtonUI", macPackageName + "MacToggleButtonUI",
  236.              "PopupMenuUI", macPackageName + "MacPopupMenuUI",
  237.            "ProgressBarUI", macPackageName + "MacProgressBarUI",
  238.              "ScrollBarUI", macPackageName + "MacScrollBarUI",
  239.                 "SliderUI", macPackageName + "MacSliderUI",
  240.                "SpinnerUI", macPackageName + "MacSpinnerUI",
  241.              "SplitPaneUI", macPackageName + "MacSplitPaneUI",
  242.             "TabbedPaneUI", macPackageName + "MacTabbedPaneUI",
  243.                  "TableUI", macPackageName + "MacTableUI",
  244.            "TableHeaderUI", macPackageName + "MacTableHeaderUI",
  245.               "TextAreaUI", macPackageName + "MacTextAreaUI",
  246.              "TextFieldUI", macPackageName + "MacTextFieldUI",
  247.          "PasswordFieldUI", macPackageName + "MacPasswordFieldUI",
  248.               "TextPaneUI", macPackageName + "MacTextPaneUI",
  249.             "EditorPaneUI", macPackageName + "MacEditorPaneUI",
  250.                   "TreeUI", macPackageName + "MacTreeUI",
  251.          "InternalFrameUI", macPackageName + "MacInternalFrameUI",
  252.            "DesktopPaneUI", macPackageName + "MacDesktopPaneUI",
  253.              "SeparatorUI", macPackageName + "MacSeparatorUI",
  254.             "OptionPaneUI", macPackageName + "MacOptionPaneUI",
  255.               "ComboBoxUI", macPackageName + "MacComboBoxUI",
  256.       "ComboBoxMenuItemUI", macPackageName + "MacComboBoxMenuItemUI",
  257.            "DesktopIconUI", macPackageName + "MacDesktopIconUI",
  258.                "ToolTipUI", macPackageName + "MacToolTipUI",
  259.     };
  260.  
  261.     table.putDefaults(uiDefaults);
  262.     }
  263.  
  264.  
  265.     /**
  266.      * Utility method that creates a UIDefaults.ActiveValue that creates
  267.      * an colorized grayscale Color UIResource for the specified <code>accent</code>
  268.      * color.
  269.      */
  270.     private final Object makeAccentColor(final String accent)
  271.     {
  272.         return new UIDefaults.ActiveValue() {
  273.             public Object createValue(UIDefaults table) {
  274.                 return table.get(accent);
  275.             }
  276.         };
  277.     }
  278.  
  279.     /**
  280.      * Utility method that creates a UIDefaults.LazyValue that creates
  281.      * an ImageIcon UIResource for the specified <code>gifFile</code>
  282.      * filename.
  283.      */
  284.     private final Object makeIcon(final String gifFile)
  285.     {
  286.         return LookAndFeel.makeIcon(getClass(), gifFile);
  287.     }
  288.  
  289.     /**
  290.      * Utility method that creates a UIDefaults.LazyValue that creates
  291.      * an ImageIcon (Not a UIResource) for the specified <code>gifFile</code>
  292.      * filename.
  293.      */
  294.     private static Object makeImageIcon(final String gifFile)
  295.     {
  296.         return new UIDefaults.LazyValue()
  297.         {
  298.             public Object createValue(UIDefaults table)
  299.             {
  300.                 byte[] buffer = null;
  301.                 try
  302.                 {
  303.                     /* Copy resource into a byte array.  This is
  304.                     * necessary because several browsers consider
  305.                     * Class.getResource a security risk because it
  306.                     * can be used to load additional classes.
  307.                     * Class.getResourceAsStream just returns raw
  308.                     * bytes, which we can convert to an image.
  309.                     */
  310.                     InputStream resource = getClass().getResourceAsStream(gifFile);
  311.                     if (resource == null)
  312.                     {
  313.                         System.err.println(getClass().getName() + "/" + 
  314.                         gifFile + " not found.");
  315.                         return null; 
  316.                     }
  317.                     BufferedInputStream in = new BufferedInputStream(resource);
  318.                     ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
  319.                     buffer = new byte[1024];
  320.                     int n;
  321.                     while ((n = in.read(buffer)) > 0)
  322.                     {
  323.                         out.write(buffer, 0, n);
  324.                     }
  325.                     in.close();
  326.                     out.flush();
  327.                     
  328.                     buffer = out.toByteArray();
  329.                     if (buffer.length == 0)
  330.                     {
  331.                         System.err.println("warning: " + gifFile + " is zero-length");
  332.                         return null;
  333.                     }
  334.                 }
  335.                 catch (IOException ioe)
  336.                 {
  337.                     System.err.println(ioe.toString());
  338.                     return null;
  339.                 }                
  340.                 return new ImageIcon(buffer);
  341.             }
  342.         };
  343.     }
  344.  
  345.  
  346.     protected void initComponentDefaults(UIDefaults table)
  347.     {
  348.     super.initComponentDefaults(table);
  349.     
  350.     AppearanceFilter.setAppearance(getCurrentAppearance(), table);
  351.  
  352.     FontUIResource dialogPlain12 = new FontUIResource("Dialog", 
  353.                                                           Font.PLAIN, 12);
  354.     FontUIResource serifPlain12 = new FontUIResource("Serif", 
  355.                                                           Font.PLAIN, 12);
  356.     FontUIResource sansSerifPlain9 = new FontUIResource("SansSerif", 
  357.                                                           Font.PLAIN, 9);
  358.     FontUIResource sansSerifPlain10 = new FontUIResource("SansSerif", 
  359.                                                           Font.PLAIN, 10);
  360.     FontUIResource sansSerifPlain12 = new FontUIResource("SansSerif", 
  361.                                                           Font.PLAIN, 12);
  362.     FontUIResource monospacedPlain12 = new FontUIResource("Monospaced", 
  363.                                                           Font.PLAIN, 12);
  364.     ColorUIResource black = new ColorUIResource(Color.black);
  365.         ColorUIResource white = new ColorUIResource(Color.white);
  366.     ColorUIResource controlDarker = new ColorUIResource(147, 151, 165);  // slate blue
  367.  
  368.     Object loweredBevelBorder = new UIDefaults.LazyValue() {
  369.         public Object createValue(UIDefaults table) {
  370.         return MacBorderFactory.getLoweredBevelBorder();
  371.         }
  372.     };
  373.  
  374.     Object raisedBevelBorder = new UIDefaults.LazyValue() {
  375.         public Object createValue(UIDefaults table) {
  376.         return MacBorderFactory.getRaisedBevelBorder();
  377.         }
  378.     };
  379.  
  380.     Object buttonBorder = new UIDefaults.LazyValue() {
  381.         public Object createValue(UIDefaults table) {
  382.         return new BorderUIResource(new CompoundBorder(
  383.                             MacBorderFactory.getButtonBorder(),
  384.                             BasicMarginBorder.getMarginBorder()));
  385.         }
  386.     }; 
  387.     
  388.     Object textBorder = new UIDefaults.LazyValue() {
  389.         public Object createValue(UIDefaults table) {
  390.         return new CompoundBorder(
  391.             MacBorderFactory.getTextBorder(),
  392.             BasicMarginBorder.getMarginBorder());
  393.         }
  394.     };
  395.     
  396.     Object buttonToggleBorder = new UIDefaults.LazyValue() {
  397.         public Object createValue(UIDefaults table) {
  398.         return new CompoundBorder(
  399.             MacBorderFactory.getToggleButtonBorder(),
  400.             BasicMarginBorder.getMarginBorder());
  401.         }
  402.     };
  403.  
  404.     Object fieldTextBorder = new UIDefaults.LazyValue() {
  405.         public Object createValue(UIDefaults table) {
  406.         return MacBorderFactory.getFieldBorder();
  407.         }
  408.     };
  409.  
  410.  
  411.     Object multilineTextBorder = new UIDefaults.LazyValue() {
  412.         public Object createValue(UIDefaults table) {
  413.         return MacBorderFactory.getTextBorder();
  414.         }
  415.     };
  416.  
  417.     Object comboBoxEditorActiveValue  = new UIDefaults.ActiveValue() {
  418.         public Object createValue(UIDefaults table) {
  419.             return new MacComboBoxEditor.UIResource();
  420.         }
  421.     };
  422.  
  423.     Object menuBarBorder = new UIDefaults.LazyValue(){
  424.         public Object createValue(UIDefaults table) {
  425.         return MacBorderFactory.getMenuBarBorder();
  426.         }
  427.     };
  428.  
  429.     Object popupMenuBorder = new UIDefaults.LazyValue(){
  430.         public Object createValue(UIDefaults table) {
  431.         return MacBorderFactory.getPopupMenuBorder();
  432.         }
  433.     };
  434.  
  435.     Object menuArrowIcon = new UIDefaults.LazyValue() {
  436.         public Object createValue(UIDefaults table) {
  437.         return MacMenuUtilities.getMenuArrowIcon();
  438.         }
  439.     };
  440.  
  441.     Object checkBoxMenuItemIcon = new UIDefaults.LazyValue() {
  442.         public Object createValue(UIDefaults table) {
  443.         return MacMenuUtilities.getCheckBoxMenuItemIcon();
  444.         }
  445.     };
  446.  
  447.     Object menuItemCheckIcon = new UIDefaults.LazyValue() {
  448.         public Object createValue(UIDefaults table) {
  449.         return MacMenuUtilities.getMenuItemCheckIcon();
  450.         }
  451.     };
  452.  
  453.     Object menuPressedBackground = makeAccentColor("AccentAppearance10");
  454.  
  455.     Object radioButtonIcon = new UIDefaults.LazyValue() {
  456.         public Object createValue(UIDefaults table) {
  457.             return MacIconFactory.getRadioButtonIcon();
  458.         }
  459.     };
  460.     
  461.     Object checkBoxIcon = new UIDefaults.LazyValue() {
  462.         public Object createValue(UIDefaults table) {
  463.             return MacIconFactory.getCheckBoxIcon();
  464.         }
  465.     };
  466.  
  467.  
  468.  
  469.     Object cellEditorBorder = new UIDefaults.LazyValue(){
  470.       public Object createValue(UIDefaults table) {
  471.         return new BorderUIResource(LineBorder.createBlackLineBorder());
  472.       };
  473.     };
  474.     
  475.     Object[] defaults = {
  476.  
  477.         "Button.border", buttonBorder,
  478.         "Button.shadow", controlDarker,
  479.         "Button.font", dialogPlain12,
  480.  
  481.         "Panel.background", table.get("window"),
  482.  
  483.         "Control.disabledForeground", MacUtilities.GrayscaleAppearance7,        // Gray
  484.         "Control.disabledBackground", MacUtilities.GrayscaleAppearance2,        // LightGray
  485.         "Control.pressedForeground", MacUtilities.GrayscaleAppearanceW,            // White
  486.         "Control.pressedBackground", MacUtilities.GrayscaleAppearance9,            // DarkGray
  487.  
  488.         "ToggleButton.border", buttonToggleBorder,
  489.  
  490.         "MenuBar.border", menuBarBorder,
  491.  
  492.         "RadioButtonMenuItem.icon", checkBoxMenuItemIcon,
  493.         "CheckBoxMenuItem.icon", checkBoxMenuItemIcon,
  494.  
  495.         "Menu.pressedForeground", MacUtilities.GrayscaleAppearanceW,
  496.         "Menu.pressedBackground", menuPressedBackground,
  497.         "Menu.arrowIcon", menuArrowIcon,
  498.  
  499.         "MenuItem.pressedForeground", MacUtilities.GrayscaleAppearanceW,
  500.         "MenuItem.pressedBackground", menuPressedBackground,
  501.         "MenuItem.checkIcon", menuItemCheckIcon,
  502.         "MenuItem.arrowIcon", null,
  503.  
  504.         "PopupMenu.border", popupMenuBorder,        
  505.  
  506.         "Label.font", dialogPlain12,
  507.         "Label.background", table.get("control"),
  508.         "Label.foreground", table.get("controlText"),
  509.         
  510.         "List.selectedCellBackground", table.get("textHighlight"), 
  511.         "List.selectedCellForeground", MacUtilities.GrayscaleAppearanceB,
  512.          "List.defaultCellBackground", MacUtilities.GrayscaleAppearance8,
  513.         "List.defaultCellForeground", MacUtilities.GrayscaleAppearanceB,
  514.         "List.selectionBackground", table.get("textHighlight"), 
  515.         "List.selectionForeground", MacUtilities.GrayscaleAppearanceB,
  516.          "List.background", MacUtilities.GrayscaleAppearance3,
  517.         "List.foreground", MacUtilities.GrayscaleAppearanceB,
  518.         "List.focusCellHighlight", MacUtilities.GrayscaleAppearanceB,
  519.         "List.font", dialogPlain12,
  520.       //  "List.cellRenderer", listCellRendererActiveValue,
  521.         
  522.  
  523.         "DesktopIcon.icon", makeImageIcon("icons/DesktopIcon.gif"),
  524.  
  525.         // ProgressBar images and colors
  526.         "ProgressBar.foreground", controlDarker,
  527.         "ProgressBar.determLeft", makeImageIcon("icons/ProgressBarDetermLeft.gif"),
  528.         "ProgressBar.determHead", makeImageIcon("icons/ProgressBarHead.gif"),
  529.         "ProgressBar.determTop", makeImageIcon("icons/ProgressBarDetermTop.gif"),
  530.         "ProgressBar.determBottom", makeImageIcon("icons/ProgressBarDetermBottom.gif"),
  531.         "ProgressBar.outer5", MacUtilities.GrayscaleAppearance5,
  532.         "ProgressBar.outerW", MacUtilities.GrayscaleAppearanceW,
  533.         "ProgressBar.inner1", MacUtilities.GrayscaleAppearance1,
  534.         "ProgressBar.inner2", MacUtilities.GrayscaleAppearance2,
  535.         "ProgressBar.inner3", MacUtilities.GrayscaleAppearance3,
  536.         "ProgressBar.inner4", MacUtilities.GrayscaleAppearance4,
  537.         "ProgressBar.inner5", MacUtilities.GrayscaleAppearance5,
  538.         "ProgressBar.inner7", MacUtilities.GrayscaleAppearance7,
  539.         "ProgressBar.inner8", MacUtilities.GrayscaleAppearance8,
  540.         "ProgressBar.inner10", MacUtilities.GrayscaleAppearance10,
  541.         "ProgressBar.inner12", MacUtilities.GrayscaleAppearance12,
  542.         "ProgressBar.edge", MacUtilities.GrayscaleAppearanceB,
  543.         "ProgressBar.disabledEdge", MacUtilities.GrayscaleAppearance10,
  544.  
  545.         // PushButton images
  546.         "PushButton.up", makeImageIcon("icons/PushButtonUp.gif"),
  547.         "PushButton.down", makeImageIcon("icons/PushButtonDown.gif"),
  548.         "PushButton.disabled", makeImageIcon("icons/PushButtonDisabled.gif"),
  549.         "PushButton.defaultEnabled", makeImageIcon("icons/PushButtonDefaultEnabled.gif"),
  550.         "PushButton.defaultDisabled", makeImageIcon("icons/PushButtonDefaultDisabled.gif"),
  551.  
  552.         //Toggle Button images
  553.         //!!! LAB !!! Note "ToggleButtonLargeDisabledOff.gif", and "ToggleButtonSmallDisabledOff.gif"
  554.         //are truncated to fit in the Mac filesystem.
  555.         "ToggleButton.largeDisabledOn", makeImageIcon("icons/ToggleButtonLargeDisabledOn.gif"),
  556.         "ToggleButton.largeDisabledOff", makeImageIcon("icons/ToggleButtonLargeDisabledOf.gif"),
  557.         "ToggleButton.largeOn", makeImageIcon("icons/ToggleButtonLargeOn.gif"),
  558.         "ToggleButton.largePressed", makeImageIcon("icons/ToggleButtonLargePressed.gif"),
  559.         "ToggleButton.largeOff", makeImageIcon("icons/ToggleButtonLargeOff.gif"),
  560.         "ToggleButton.mediumDisabledOn", makeImageIcon("icons/ToggleButtonMedDisabledOn.gif"),
  561.         "ToggleButton.mediumDisabledOff", makeImageIcon("icons/ToggleButtonMedDisabledOff.gif"),
  562.         "ToggleButton.mediumOn", makeImageIcon("icons/ToggleButtonMedOn.gif"),
  563.         "ToggleButton.mediumPressed", makeImageIcon("icons/ToggleButtonMedPressed.gif"),
  564.         "ToggleButton.mediumOff", makeImageIcon("icons/ToggleButtonMedOff.gif"),
  565.         "ToggleButton.smallDisabledOn", makeImageIcon("icons/ToggleButtonSmallDisabledOn.gif"),
  566.         "ToggleButton.smallDisabledOff", makeImageIcon("icons/ToggleButtonSmallDisabledOf.gif"),
  567.         "ToggleButton.smallOn", makeImageIcon("icons/ToggleButtonSmallOn.gif"),
  568.         "ToggleButton.smallPressed", makeImageIcon("icons/ToggleButtonSmallPressed.gif"),
  569.         "ToggleButton.smallOff", makeImageIcon("icons/ToggleButtonSmallOff.gif"),
  570.  
  571.         // RadioButton images, colors, &c
  572.         "RadioButton.background", null,
  573.         "RadioButton.icon", radioButtonIcon,
  574.         "RadioButton.enabledOff", makeIcon("icons/RadioButtonEnabledOff.gif"),
  575.         "RadioButton.enabledOn", makeIcon("icons/RadioButtonEnabledOn.gif"),
  576.         "RadioButton.pressedOff", makeIcon("icons/RadioButtonPressedOff.gif"),
  577.         "RadioButton.pressedOn", makeIcon("icons/RadioButtonPressedOn.gif"),
  578.         "RadioButton.disabledOff", makeIcon("icons/RadioButtonDisabledOff.gif"),
  579.         "RadioButton.disabledOn", makeIcon("icons/RadioButtonDisabledOn.gif"),
  580.  
  581.         // CheckBox images, colors, &c
  582.         "CheckBox.icon", checkBoxIcon,
  583.         "CheckBox.enabledOff", makeIcon("icons/CheckBoxEnabledOff.gif"),
  584.         "CheckBox.enabledOn", makeIcon("icons/CheckBoxEnabledOn.gif"),
  585.         "CheckBox.pressedOff", makeIcon("icons/CheckBoxPressedOff.gif"),
  586.         "CheckBox.pressedOn", makeIcon("icons/CheckBoxPressedOn.gif"),
  587.         "CheckBox.disabledOff", makeIcon("icons/CheckBoxDisabledOff.gif"),
  588.         "CheckBox.disabledOn", makeIcon("icons/CheckBoxDisabledOn.gif"),
  589.  
  590.         // ScrollBar images, colors, &c
  591.         "ScrollBar.backgroundEnabled", MacUtilities.GrayscaleAppearance5,
  592.         "ScrollBar.backgroundDisabled", MacUtilities.GrayscaleAppearance1,
  593.         "ScrollBar.borderActive", MacUtilities.GrayscaleAppearanceB,
  594.         "ScrollBar.borderInactive", MacUtilities.GrayscaleAppearance10,
  595.  
  596.         "ScrollBar.bevelIn1", MacUtilities.GrayscaleAppearance8,
  597.         "ScrollBar.bevelIn2", MacUtilities.GrayscaleAppearance7,
  598.         "ScrollBar.bevelCorner", MacUtilities.GrayscaleAppearance5,
  599.         "ScrollBar.bevelOut2", MacUtilities.GrayscaleAppearance4,
  600.         "ScrollBar.bevelOut1", MacUtilities.GrayscaleAppearance3,
  601.  
  602.         "ScrollBar.border", null,
  603.  
  604.         "ScrollBar.upArrowDisabled", makeIcon("icons/ScrollUpArrowDisabled.gif"),
  605.         "ScrollBar.upArrowEnabled", makeIcon("icons/ScrollUpArrowEnabled.gif"),
  606.         "ScrollBar.upArrowPressed", makeIcon("icons/ScrollUpArrowPressed.gif"),
  607.         "ScrollBar.downArrowDisabled", makeIcon("icons/ScrollDownArrowDisabled.gif"),
  608.         "ScrollBar.downArrowEnabled", makeIcon("icons/ScrollDownArrowEnabled.gif"),
  609.         "ScrollBar.downArrowPressed", makeIcon("icons/ScrollDownArrowPressed.gif"),
  610.         "ScrollBar.rightArrowDisabled", makeIcon("icons/ScrollRightArrowDisabled.gif"),
  611.         "ScrollBar.rightArrowEnabled", makeIcon("icons/ScrollRightArrowEnabled.gif"),
  612.         "ScrollBar.rightArrowPressed", makeIcon("icons/ScrollRightArrowPressed.gif"),
  613.         "ScrollBar.leftArrowDisabled", makeIcon("icons/ScrollLeftArrowDisabled.gif"),
  614.         "ScrollBar.leftArrowEnabled", makeIcon("icons/ScrollLeftArrowEnabled.gif"),
  615.         "ScrollBar.leftArrowPressed", makeIcon("icons/ScrollLeftArrowPressed.gif"),
  616.  
  617.         "ScrollBar.horizontalBoxEnabled", makeImageIcon("icons/ScrollHorizontalBoxEnabled.gif"),
  618.         "ScrollBar.horizontalBoxPressed", makeImageIcon("icons/ScrollHorizontalBoxPressed.gif"),
  619.         "ScrollBar.verticalBoxEnabled", makeImageIcon("icons/ScrollVerticalBoxEnabled.gif"),
  620.         "ScrollBar.verticalBoxPressed", makeImageIcon("icons/ScrollVerticalBoxPressed.gif"),
  621.  
  622.         "ScrollPane.border", null,
  623.         "ScrollPane.viewportBorder", loweredBevelBorder,
  624.  
  625. //        "Slider.border", null,
  626.         "Slider.background", null,
  627.  
  628.         "Slider.tickColorEnabled", MacUtilities.GrayscaleAppearanceB,
  629.         "Slider.tickColorDisabled", MacUtilities.GrayscaleAppearance8,
  630.         "Slider.tickHilite", MacUtilities.GrayscaleAppearanceW,
  631.         "Slider.tickShadow", MacUtilities.GrayscaleAppearance7,
  632.  
  633.         "Slider.trackBorderEnabled", MacUtilities.GrayscaleAppearance12,
  634.         "Slider.trackFillEnabled", MacUtilities.GrayscaleAppearance5,
  635.         "Slider.trackBorderDisabled", MacUtilities.GrayscaleAppearance8,
  636.         "Slider.trackFillDisabled", MacUtilities.GrayscaleAppearance4,
  637.         "Slider.trackBevelIn", MacUtilities.GrayscaleAppearance5,
  638.         "Slider.trackBevelOut", MacUtilities.GrayscaleAppearanceW,
  639.  
  640.         "Slider.indicatorHorizontalEnabled", makeImageIcon("icons/SliderHorizEnabled.gif"),
  641.         "Slider.indicatorHorizontalDisabled", makeImageIcon("icons/SliderHorizDisabled.gif"),
  642.         "Slider.indicatorHorizontalPressed", makeImageIcon("icons/SliderHorizPressed.gif"),
  643.         "Slider.indicatorHorizontalDownEnabled", makeImageIcon("icons/SliderHorizDownEnabled.gif"),
  644.         "Slider.indicatorHorizontalDownDisabled", makeImageIcon("icons/SliderHorizDownDisabled.gif"),
  645.         "Slider.indicatorHorizontalDownPressed", makeImageIcon("icons/SliderHorizDownPressed.gif"),
  646.         "Slider.indicatorHorizontalUpEnabled", makeImageIcon("icons/SliderHorizUpEnabled.gif"),
  647.         "Slider.indicatorHorizontalUpDisabled", makeImageIcon("icons/SliderHorizUpDisabled.gif"),
  648.         "Slider.indicatorHorizontalUpPressed", makeImageIcon("icons/SliderHorizUpPressed.gif"),
  649.  
  650.         "Slider.indicatorVerticalEnabled", makeImageIcon("icons/SliderVertEnabled.gif"),
  651.         "Slider.indicatorVerticalDisabled", makeImageIcon("icons/SliderVertDisabled.gif"),
  652.         "Slider.indicatorVerticalPressed", makeImageIcon("icons/SliderVertPressed.gif"),
  653.         "Slider.indicatorVerticalLeftEnabled", makeImageIcon("icons/SliderVertLeftEnabled.gif"),
  654.         "Slider.indicatorVerticalLeftDisabled", makeImageIcon("icons/SliderVertLeftDisabled.gif"),
  655.         "Slider.indicatorVerticalLeftPressed", makeImageIcon("icons/SliderVertLeftPressed.gif"),
  656.         "Slider.indicatorVerticalRightEnabled", makeImageIcon("icons/SliderVertRightEnabled.gif"),
  657.         "Slider.indicatorVerticalRightDisabled", makeImageIcon("icons/SliderVertRightDisabled.gif"),
  658.         "Slider.indicatorVerticalRightPressed", makeImageIcon("icons/SliderVertRightPressed.gif"),
  659.  
  660.         "Spinner.fieldBackground", table.get("textHighlight"),
  661.         "Spinner.fieldForeground", MacUtilities.GrayscaleAppearanceB,
  662.  
  663.         "SplitPane.background", table.get("control"),
  664.         "SplitPane.highlight", table.get("controlHighlight"),
  665.         "SplitPane.shadow", table.get("controlShadow"),
  666.  
  667.         // Tabbed Pane font, colors & images
  668.         "TabbedPane.font", dialogPlain12,
  669.         "TabbedPane.enabledTabBackground", MacUtilities.GrayscaleAppearance3,
  670.         "TabbedPane.enabledTabForeground", MacUtilities.GrayscaleAppearanceB,
  671.         "TabbedPane.enabledTabHilite1", MacUtilities.GrayscaleAppearance3,
  672.         "TabbedPane.enabledTabHilite2", MacUtilities.GrayscaleAppearance2,
  673.  
  674.         "TabbedPane.selectedTabBackground", MacUtilities.GrayscaleAppearance1,
  675.         "TabbedPane.selectedTabForeground", MacUtilities.GrayscaleAppearanceB,
  676.         "TabbedPane.selectedTabHilite1", MacUtilities.GrayscaleAppearance3,
  677.         "TabbedPane.selectedTabHilite2", MacUtilities.GrayscaleAppearanceW,
  678.  
  679.         "TabbedPane.pressedTabBackground", MacUtilities.GrayscaleAppearance9,
  680.         "TabbedPane.pressedTabForeground", MacUtilities.GrayscaleAppearanceW,
  681.         "TabbedPane.pressedTabHilite1", MacUtilities.GrayscaleAppearance11,
  682.         "TabbedPane.pressedTabHilite2", MacUtilities.GrayscaleAppearance10,
  683.  
  684.         "TabbedPane.disabledTabBackground", MacUtilities.GrayscaleAppearance2,
  685.         "TabbedPane.disabledTabForeground", MacUtilities.GrayscaleAppearance7,
  686.         "TabbedPane.disabledTabHilite1", MacUtilities.GrayscaleAppearance2,
  687.         "TabbedPane.disabledTabHilite2", MacUtilities.GrayscaleAppearance2,
  688.  
  689.         "TabbedPane.enabledTabBorder", makeImageIcon("icons/TabbedPaneEnabledTabBorder.gif"),
  690.         "TabbedPane.selectedTabBorder", makeImageIcon("icons/TabbedPaneSelectedTabBorder.gif"),
  691.         "TabbedPane.pressededTabBorder", makeImageIcon("icons/TabbedPanePressedTabBorder.gif"),
  692.         "TabbedPane.disabledTabBorder", makeImageIcon("icons/TabbedPaneDisabledTabBorder.gif"),
  693.  
  694.         "TabbedPane.enabledPaneBackground", MacUtilities.GrayscaleAppearance1,
  695.         "TabbedPane.enabledPaneBorder", MacUtilities.GrayscaleAppearanceB,
  696.         "TabbedPane.enabledPaneBevelHilite1", MacUtilities.GrayscaleAppearance3,
  697.         "TabbedPane.enabledPaneBevelHilite2", MacUtilities.GrayscaleAppearanceW,
  698.         "TabbedPane.enabledPaneBevelShadow1", MacUtilities.GrayscaleAppearance6,
  699.         "TabbedPane.enabledPaneBevelShadow2", MacUtilities.GrayscaleAppearance4,
  700.         "TabbedPane.enabledPaneBevelAccent1", MacUtilities.GrayscaleAppearance2,
  701.         "TabbedPane.enabledPaneBevelAccent2", MacUtilities.GrayscaleAppearance1,
  702.         "TabbedPane.enabledPaneBevelAccent3", MacUtilities.GrayscaleAppearance7,
  703.  
  704.         "TabbedPane.disabledPaneBackground", MacUtilities.GrayscaleAppearance2,
  705.         "TabbedPane.disabledPaneBorder", MacUtilities.GrayscaleAppearance10,
  706.         "TabbedPane.disabledPaneBevelHilite1", MacUtilities.GrayscaleAppearance2,
  707.         "TabbedPane.disabledPaneBevelHilite2", MacUtilities.GrayscaleAppearance2,
  708.         "TabbedPane.disabledPaneBevelShadow1", MacUtilities.GrayscaleAppearance2,
  709.         "TabbedPane.disabledPaneBevelShadow2", MacUtilities.GrayscaleAppearance2,
  710.         "TabbedPane.disabledPaneBevelAccent1", MacUtilities.GrayscaleAppearance2,
  711.         "TabbedPane.disabledPaneBevelAccent2", MacUtilities.GrayscaleAppearance2,
  712.  
  713.         "Table.font", dialogPlain12,
  714.         "Table.border", null, 
  715.         "Table.foreground", table.get("controlText"),                  // cell text color
  716.         "Table.background", MacUtilities.GrayscaleAppearance1,         // cell background color
  717.         "Table.selectionForeground", MacUtilities.GrayscaleAppearanceB, 
  718.         "Table.selectionBackground", MacUtilities.GrayscaleAppearance2,
  719.         "Table.gridColor", MacUtilities.GrayscaleAppearanceW,          // grid line color
  720.         "Table.cellSpacing", new DimensionUIResource(0, 0),            // inter-cell spacing
  721.         "Table.cellEditorBorder", cellEditorBorder,                    // for currently edited cell
  722.  
  723.         "TableHeader.font", dialogPlain12, 
  724.         "TableHeader.foreground", table.get("controlText"),            // header text color
  725.         "TableHeader.background", MacUtilities.GrayscaleAppearance3,   // header background
  726.         "TableHeader.selectionForeground", MacUtilities.GrayscaleAppearanceB,
  727.         "TableHeader.selectionBackground", table.get("textHighlight"),
  728.         "TableHeader.gridColor", MacUtilities.GrayscaleAppearanceW,    // color of lines between column headings        
  729.         
  730.         "Tree.showsRootHandles", new Boolean(true),
  731.         "Tree.font", sansSerifPlain9,
  732.         "Tree.background", MacUtilities.GrayscaleAppearance2,
  733.         "Tree.textSelectionColor", table.get("textHighlight"),
  734.         "Tree.textNonSelectionColor", table.get("textText"),
  735.         "Tree.openIcon", makeIcon("icons/TreeOpen.gif"),
  736.         "Tree.closedIcon", makeIcon("icons/TreeClosed.gif"),
  737.         "Tree.selectedIcon", makeIcon("icons/TreeSelected.gif"),
  738.         "Tree.selectedLeafIcon", makeIcon("icons/TreeLeafSelected.gif"),
  739.         "Tree.leafIcon", makeIcon("icons/TreeLeaf.gif"),
  740.         "Tree.expandedIcon", makeIcon("icons/TreeExpanded.gif"),
  741.         "Tree.collapsedIcon", makeIcon("icons/TreeCollapsed.gif"),
  742.         "Tree.collapsedPressedIcon", makeIcon("icons/TreeCollapsedPressed.gif"),
  743.         "Tree.expandedPressedIcon", makeIcon("icons/TreeExpandedPressed.gif"),
  744.         "Tree.intermediateIcon", makeIcon("icons/TreeIntermediate.gif"),
  745.  
  746. //        "ComboBox.renderer", comboBoxRendererActiveValue,
  747.         "ComboBox.editor",   comboBoxEditorActiveValue,
  748.         "ComboBox.background", null, //table.get("MenuItem.background"),
  749.         "ComboBox.foreground", table.get("MenuItem.foreground"),
  750.         "ComboBox.selectedBackground", table.get("MenuItem.background"),
  751.         "ComboBox.selectedForeground", table.get("MenuItem.foreground"),
  752.         "ComboBox.font", table.get("MenuItem.font"),
  753.         
  754.         "ComboBoxArrowBorder.enabled", makeImageIcon("icons/ComboBoxArrowEnabled.gif"),
  755.         "ComboBoxArrowBorder.pressed", makeImageIcon("icons/ComboBoxArrowPressed.gif"),
  756.         "ComboBoxArrowBorder.disabled", makeImageIcon("icons/ComboBoxArrowDisabled.gif"),
  757.         "ComboBoxEditArrowBorder.enabled", makeImageIcon("icons/ComboBoxEditArrowEnabled.gif"),
  758.         "ComboBoxEditArrowBorder.pressed", makeImageIcon("icons/ComboBoxEditArrowPressed.gif"),
  759.         "ComboBoxEditArrowBorder.disabled", makeImageIcon("icons/ComboBoxEditArrowDisabled.gif"),
  760.         "ComboBoxBorder.enabled", makeImageIcon("icons/ComboBoxEnabled.gif"),
  761.         "ComboBoxBorder.pressed", makeImageIcon("icons/ComboBoxPressed.gif"),
  762.         "ComboBoxBorder.disabled", makeImageIcon("icons/ComboBoxDisabled.gif"),
  763.  
  764.         "TextField.caretForeground", MacUtilities.GrayscaleAppearanceB,
  765.         "TextField.caretBlinkRate", new Integer(500),
  766.         "TextField.inactiveForeground", table.get("textInactiveText"),
  767.         "TextField.selectionBackground", table.get("textHighlight"),
  768.         "TextField.selectionForeground", table.get("textHighlightText"),
  769.         "TextField.background", MacUtilities.GrayscaleAppearanceW,
  770.         "TextField.foreground", table.get("textText"),
  771.         "TextField.font", sansSerifPlain12,
  772.         "TextField.border", fieldTextBorder,
  773.         
  774.         "PasswordField.caretForeground", MacUtilities.GrayscaleAppearanceB,
  775.         "PasswordField.caretBlinkRate", new Integer(500),
  776.         "PasswordField.inactiveForeground", table.get("textInactiveText"),
  777.         "PasswordField.selectionBackground", table.get("textHighlight"),
  778.         "PasswordField.selectionForeground", table.get("textHighlightText"),
  779.         "PasswordField.background", MacUtilities.GrayscaleAppearanceW,
  780.         "PasswordField.foreground", table.get("textText"),
  781.         "PasswordField.font", sansSerifPlain12,
  782.         "PasswordField.border", fieldTextBorder,
  783.         
  784.         "TextArea.caretForeground", MacUtilities.GrayscaleAppearanceB,
  785.         "TextArea.caretBlinkRate", new Integer(500),
  786.         "TextArea.inactiveForeground", table.get("textInactiveText"),
  787.         "TextArea.selectionBackground", table.get("textHighlight"),
  788.         "TextArea.selectionForeground", table.get("textHighlightText"),
  789.         "TextArea.background", MacUtilities.GrayscaleAppearanceW,
  790.         "TextArea.foreground", table.get("textText"),
  791.         "TextArea.font", sansSerifPlain12,
  792.         "TextArea.border", multilineTextBorder,
  793.         
  794.         "TextPane.caretForeground", MacUtilities.GrayscaleAppearanceB,
  795.         "TextPane.caretBlinkRate", new Integer(500),
  796.         "TextPane.inactiveForeground", table.get("textInactiveText"),
  797.         "TextPane.selectionBackground", table.get("textHighlight"),
  798.         "TextPane.selectionForeground", table.get("textHighlightText"),
  799.         "TextPane.background", MacUtilities.GrayscaleAppearanceW,
  800.         "TextPane.foreground", table.get("textText"),
  801.         "TextPane.font", serifPlain12,
  802.         "TextPane.border", multilineTextBorder,
  803.         
  804.         "EditorPane.caretForeground", MacUtilities.GrayscaleAppearanceB,
  805.         "EditorPane.caretBlinkRate", new Integer(500),
  806.         "EditorPane.inactiveForeground", table.get("textInactiveText"),
  807.         "EditorPane.selectionBackground", table.get("textHighlight"),
  808.         "EditorPane.selectionForeground", table.get("textHighlightText"),
  809.         "EditorPane.background", MacUtilities.GrayscaleAppearanceW,
  810.         "EditorPane.foreground", table.get("textText"),
  811.         "EditorPane.font", serifPlain12,
  812.         "EditorPane.border", null,
  813.  
  814.         "ToolTip.font", sansSerifPlain10,
  815.         "ToolTip.border", null,
  816.         "ToolTip.background", table.get("info"),
  817.         "ToolTip.foreground", table.get("infoText"),
  818.  
  819.         "ToolBar.border", menuBarBorder,
  820.         "ToolBar.background", table.get("control"),
  821.         "ToolBar.foreground", table.get("controlText"),
  822.         "ToolBar.font", dialogPlain12,
  823.         "ToolBar.dockingColor", table.get("control"),
  824.         "ToolBar.floatingColor", table.get("control"),
  825.         "ToolBar.dockingBorderColor", AppearanceFilter.FilterColor(MacUtilities.GrayscaleAppearance8), 
  826.         "ToolBar.floatingBorderColor", table.get("control"),
  827.         
  828.         "OptionPane.errorIcon", makeIcon("icons/Error.gif"),
  829.         "OptionPane.informationIcon", makeIcon("icons/Inform.gif"),
  830.         "OptionPane.warningIcon", makeIcon("icons/Warn.gif"),
  831.         "OptionPane.questionIcon", makeIcon("icons/Inform.gif"),
  832.  
  833.         "FileChooser.newFolder", LookAndFeel.makeIcon(getClass(), "icons/NewFolder.gif"),
  834.         "FileChooser.upFolder", LookAndFeel.makeIcon(getClass(), "icons/UpFolder.gif"),
  835.         "FileChooser.homeFolder", LookAndFeel.makeIcon(getClass(), "icons/Folder.gif"),
  836.         "FileChooser.detailsView", LookAndFeel.makeIcon(getClass(), "icons/DetailsView.gif"),
  837.         "FileChooser.listView", LookAndFeel.makeIcon(getClass(), "icons/ListView.gif"),
  838.  
  839.         "DirectoryPane.directoryIcon", LookAndFeel.makeIcon(getClass(), "icons/Folder.gif"),
  840.         "DirectoryPane.fileIcon", LookAndFeel.makeIcon(getClass(), "icons/File.gif"),
  841.         "DirectoryPane.computerIcon", LookAndFeel.makeIcon(getClass(), "icons/Computer.gif"),
  842.         "DirectoryPane.hardDriveIcon", LookAndFeel.makeIcon(getClass(), "icons/HardDrive.gif"),
  843.         "DirectoryPane.floppyDriveIcon", LookAndFeel.makeIcon(getClass(), "icons/FloppyDrive.gif"),
  844.  
  845.         // Window images and colors
  846.         "Window.closeEnabled", makeIcon("icons/WindowCloseEnabled.gif"),
  847.         "Window.closePressed", makeIcon("icons/WindowClosePressed.gif"),
  848.         "Window.sizeEnabled", makeIcon("icons/WindowSizeEnabled.gif"),
  849.         "Window.zoomEnabled", makeIcon("icons/WindowZoomEnabled.gif"),
  850.         "Window.zoomPressed", makeIcon("icons/WindowZoomPressed.gif"),
  851.         "Window.minimizeEnabled", makeIcon("icons/WindowMinimizeEnabled.gif"),
  852.         "Window.minimizePressed", makeIcon("icons/WindowMinimizePressed.gif"),
  853.  
  854.     };
  855.  
  856.     table.putDefaults(defaults);
  857.     }
  858.  
  859.  
  860.     private static String defaultAppearance = null;
  861.     
  862.     public static void setCurrentAppearance(String appearanceName) {
  863.         defaultAppearance = appearanceName;
  864.     }
  865.     
  866.     private static String getCurrentAppearance() {
  867.         if (defaultAppearance != null)
  868.             return defaultAppearance;
  869.         return MacUtilities.GetAppearanceName();
  870.     }
  871. }
  872.  
  873.