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

  1. /*
  2.  * @(#)MotifLookAndFeel.java    1.75 98/02/04
  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. package com.sun.java.swing.plaf.motif;
  22.  
  23.  
  24. import java.awt.Color;
  25. import java.awt.Font;
  26.  
  27. import com.sun.java.swing.*;
  28. import com.sun.java.swing.plaf.*;
  29. import com.sun.java.swing.border.*;
  30.  
  31. import com.sun.java.swing.plaf.basic.BasicLookAndFeel;
  32. import com.sun.java.swing.plaf.basic.BasicMarginBorder;
  33. import com.sun.java.swing.plaf.basic.BasicComboBoxRenderer;
  34. import com.sun.java.swing.plaf.basic.BasicComboBoxEditor;
  35.  
  36. /**
  37.  * Implements the Motif Look and Feel.
  38.  * UI classes not implemented specifically for Motif will
  39.  * default to those implemented in Basic.  
  40.  * <p>
  41.  * Warning: serialized objects of this class will not be compatible with
  42.  * future swing releases.  The current serialization support is appropriate
  43.  * for short term storage or RMI between Swing1.0 applications.  It will
  44.  * not be possible to load serialized Swing1.0 objects with future releases
  45.  * of Swing.  The JDK1.2 release of Swing will be the compatibility
  46.  * baseline for the serialized form of Swing objects.
  47.  *
  48.  * @version 1.75 02/04/98
  49.  * @author unknown
  50.  */
  51. public class MotifLookAndFeel extends BasicLookAndFeel
  52. {
  53.     public String getName() {
  54.     return "CDE/Motif";
  55.     }
  56.  
  57.     public String getID() {
  58.     return "Motif";
  59.     }
  60.  
  61.     public String getDescription() {
  62.     return "The CDE/Motif Look and Feel";
  63.     }
  64.  
  65.  
  66.     public boolean isNativeLookAndFeel() {
  67.     String osName = System.getProperty("os.name");
  68.     return (osName != null) && (osName.indexOf("Solaris") != -1);
  69.     }
  70.  
  71.  
  72.     public boolean isSupportedLookAndFeel() {
  73.     return true;
  74.     }
  75.  
  76.  
  77.     /**
  78.      * Load the SystemColors into the defaults table.  The keys
  79.      * for SystemColor defaults are the same as the names of
  80.      * the public fields in SystemColor.  If the table is being
  81.      * created on a native Motif platform we use the SystemColor
  82.      * values, otherwise we create color objects whose values match
  83.      * the default CDE/Motif colors.
  84.      */
  85.     protected void initSystemColorDefaults(UIDefaults table)
  86.     {
  87.     String[] systemColors = {
  88.                  "desktop", "#005C5C", /* Color of the desktop background */
  89.             "activeCaption", "#000080", /* Color for captions (title bars) when they are active. */
  90.         "activeCaptionText", "#FFFFFF", /* Text color for text in captions (title bars). */
  91.       "activeCaptionBorder", "#B24D7A", /* Border color for caption (title bar) window borders. */
  92.           "inactiveCaption", "#AEB2C3", /* Color for captions (title bars) when not active. */
  93.       "inactiveCaptionText", "#000000", /* Text color for text in inactive captions (title bars). */
  94.     "inactiveCaptionBorder", "#AEB2C3", /* Border color for inactive caption (title bar) window borders. */
  95.                "window", "#AEB2C3", /* Default color for the interior of windows */
  96.              "windowBorder", "#AEB2C3", /* ??? */
  97.            "windowText", "#000000", /* ??? */
  98.              "menu", "#AEB2C3", /* ??? */
  99.              "menuText", "#000000", /* ??? */
  100.              "text", "#FFF7E9", /* Text background color */
  101.              "textText", "#000000", /* Text foreground color */
  102.         "textHighlight", "#000000", /* Text background color when selected */
  103.         "textHighlightText", "#FFF7E9", /* Text color when selected */
  104.          "textInactiveText", "#808080", /* Text color when disabled */
  105.               "control", "#AEB2C3", /* Default color for controls (buttons, sliders, etc) */
  106.           "controlText", "#000000", /* Default color for text in controls */
  107.          "controlHighlight", "#DCDEE5", /* Highlight color for controls */
  108.        "controlLtHighlight", "#DCDEE5", /* Light highlight color for controls */
  109.         "controlShadow", "#63656F", /* Shadow color for controls */
  110.        "controlLightShadow", "#9397A5", /* Shadow color for controls */          
  111.           "controlDkShadow", "#000000", /* Dark shadow color for controls */
  112.             "scrollbar", "#AEB2C3", /* Scrollbar ??? color. PENDING(jeff) foreground? background? ?*/
  113.              "info", "#FFF7E9", /* ??? */
  114.              "infoText", "#000000"  /* ??? */
  115.     };
  116.  
  117.     loadSystemColors(table, systemColors);
  118.     }
  119.  
  120.  
  121.     protected void initClassDefaults(UIDefaults table)
  122.     {
  123.     super.initClassDefaults(table);
  124.  
  125.     String motifPackageName = "com.sun.java.swing.plaf.motif.";
  126.     Object[] uiDefaults = {
  127.            "ButtonUI", motifPackageName + "MotifButtonUI",
  128.          "CheckBoxUI", motifPackageName + "MotifCheckBoxUI",
  129.          "DirectoryPaneUI", motifPackageName + "MotifDirectoryPaneUI",
  130.            "FileChooserUI", motifPackageName + "MotifFileChooserUI",
  131.                     "LabelUI", motifPackageName + "MotifLabelUI",
  132.           "MenuBarUI", motifPackageName + "MotifMenuBarUI",
  133.              "MenuUI", motifPackageName + "MotifMenuUI",
  134.          "MenuItemUI", motifPackageName + "MotifMenuItemUI",
  135.      "CheckBoxMenuItemUI", motifPackageName + "MotifCheckBoxMenuItemUI",
  136.       "RadioButtonMenuItemUI", motifPackageName + "MotifRadioButtonMenuItemUI",
  137.           "RadioButtonUI", motifPackageName + "MotifRadioButtonUI",
  138.          "ToggleButtonUI", motifPackageName + "MotifToggleButtonUI",
  139.         "PopupMenuUI", motifPackageName + "MotifPopupMenuUI",
  140.           "ProgressBarUI", motifPackageName + "MotifProgressBarUI",
  141.         "ScrollBarUI", motifPackageName + "MotifScrollBarUI",
  142.                "ScrollPaneUI", motifPackageName + "MotifScrollPaneUI",
  143.            "SliderUI", motifPackageName + "MotifSliderUI",
  144.             "SplitPaneUI", motifPackageName + "MotifSplitPaneUI",
  145.            "TabbedPaneUI", motifPackageName + "MotifTabbedPaneUI",
  146.          "TextAreaUI", motifPackageName + "MotifTextAreaUI",
  147.         "TextFieldUI", motifPackageName + "MotifTextFieldUI",
  148.         "PasswordFieldUI", motifPackageName + "MotifPasswordFieldUI",
  149.          "TextPaneUI", motifPackageName + "MotifTextPaneUI",
  150.            "EditorPaneUI", motifPackageName + "MotifEditorPaneUI",
  151.              "TreeUI", motifPackageName + "MotifTreeUI",
  152.         "InternalFrameUI", motifPackageName + "MotifInternalFrameUI",
  153.           "DesktopPaneUI", motifPackageName + "MotifDesktopPaneUI",
  154.             "SeparatorUI", motifPackageName + "MotifSeparatorUI",
  155.             "OptionPaneUI", motifPackageName + "MotifOptionPaneUI",
  156.                   "ComboBoxUI", motifPackageName + "MotifComboBoxUI",
  157.           "DesktopIconUI", motifPackageName + "MotifDesktopIconUI",
  158.     };
  159.  
  160.     table.putDefaults(uiDefaults);
  161.     }
  162.  
  163.     protected void initComponentDefaults(UIDefaults table) 
  164.     {
  165.     super.initComponentDefaults(table);
  166.  
  167.     FontUIResource dialogPlain12 = new FontUIResource("Dialog", 
  168.                                                           Font.PLAIN, 12);
  169.     FontUIResource serifPlain12 = new FontUIResource("Serif", 
  170.                                                           Font.PLAIN, 12);
  171.     FontUIResource sansSerifPlain12 = new FontUIResource("SansSerif", 
  172.                                                           Font.PLAIN, 12);
  173.     FontUIResource monospacedPlain12 = new FontUIResource("Monospaced", 
  174.                                                           Font.PLAIN, 12);
  175.     ColorUIResource red = new ColorUIResource(Color.red);
  176.     ColorUIResource black = new ColorUIResource(Color.black);
  177.         ColorUIResource white = new ColorUIResource(Color.white);
  178.     ColorUIResource lightGray = new ColorUIResource(Color.lightGray);
  179.     ColorUIResource controlDarker = new ColorUIResource(147, 151, 165);  // slate blue
  180.     ColorUIResource scrollBarTrack = controlDarker;
  181.     ColorUIResource menuItemPressedBackground = new ColorUIResource(165,165,165);
  182.     ColorUIResource menuItemPressedForeground = new ColorUIResource(0,0,0);
  183.  
  184.  
  185.     Object loweredBevelBorder = new UIDefaults.LazyValue() {
  186.         public Object createValue(UIDefaults table) {
  187.         return MotifBorderFactory.getLoweredBevelBorder();
  188.         }
  189.     };
  190.  
  191.     Object focusBevelBorder = new UIDefaults.LazyValue() {
  192.         public Object createValue(UIDefaults table) {
  193.         return new BorderUIResource( new CompoundBorder(
  194.             MotifBorderFactory.getFocusBorder(),
  195.             MotifBorderFactory.getLoweredBevelBorder()) );
  196.         }
  197.     };
  198.  
  199.     Object raisedBevelBorder = new UIDefaults.LazyValue() {
  200.         public Object createValue(UIDefaults table) {
  201.         return MotifBorderFactory.getRaisedBevelBorder();
  202.         }
  203.     };
  204.  
  205.     Object buttonBorder = new UIDefaults.LazyValue() {
  206.         public Object createValue(UIDefaults table) {
  207.         return new BorderUIResource( new CompoundBorder(
  208.             MotifBorderFactory.getButtonBorder(),
  209.             BasicMarginBorder.getMarginBorder()) );
  210.         }
  211.     }; 
  212.     
  213.     Object buttonToggleBorder = new UIDefaults.LazyValue() {
  214.         public Object createValue(UIDefaults table) {
  215.         return new BorderUIResource( new CompoundBorder(
  216.             MotifBorderFactory.getToggleButtonBorder(),
  217.             BasicMarginBorder.getMarginBorder()) );
  218.         }
  219.     };
  220.  
  221.     Object fieldTextBorder = new UIDefaults.LazyValue() {
  222.         public Object createValue(UIDefaults table) {
  223.         return MotifBorderFactory.getFieldBorder();
  224.         }
  225.     };
  226.  
  227.  
  228.     Object multilineTextBorder = new UIDefaults.LazyValue() {
  229.         public Object createValue(UIDefaults table) {
  230.         return BasicMarginBorder.getMarginBorder();
  231.         }
  232.     };
  233.  
  234.     Object menuItemCheckIcon = new UIDefaults.LazyValue() {
  235.         public Object createValue(UIDefaults table) {
  236.         return MotifIconFactory.getMenuItemCheckIcon();
  237.         }
  238.     };
  239.  
  240.     Object menuItemArrowIcon = new UIDefaults.LazyValue() {
  241.         public Object createValue(UIDefaults table) {
  242.         return MotifIconFactory.getMenuItemArrowIcon();
  243.         }
  244.     };
  245.  
  246.     Object menuArrowIcon = new UIDefaults.LazyValue() {
  247.         public Object createValue(UIDefaults table) {
  248.         return MotifIconFactory.getMenuArrowIcon();
  249.         }
  250.     };
  251.  
  252.     Object checkBoxIcon = new UIDefaults.LazyValue() {
  253.         public Object createValue(UIDefaults table) {
  254.         return MotifIconFactory.getCheckBoxIcon();
  255.         }
  256.     };
  257.  
  258.     Object radioButtonIcon = new UIDefaults.LazyValue() {
  259.         public Object createValue(UIDefaults table) {
  260.         return MotifIconFactory.getRadioButtonIcon();
  261.         }
  262.     };
  263.  
  264.     Object unselectedTabBackground = new UIDefaults.LazyValue() {
  265.         public Object createValue(UIDefaults table) { 
  266.         Color c = (Color)table.get("control");
  267.                 return new ColorUIResource(Math.max((int)(c.getRed()*.85),0), 
  268.                                            Math.max((int)(c.getGreen()*.85),0), 
  269.                                            Math.max((int)(c.getBlue()*.85),0));
  270.         }
  271.     };
  272.  
  273.     Object unselectedTabForeground = new UIDefaults.LazyValue() {
  274.         public Object createValue(UIDefaults table) { 
  275.         Color c = (Color)table.get("controlText");
  276.                 return new ColorUIResource(Math.max((int)(c.getRed()*.85),0), 
  277.                                            Math.max((int)(c.getGreen()*.85),0), 
  278.                                            Math.max((int)(c.getBlue()*.85),0));
  279.         }
  280.     };
  281.  
  282.     Object unselectedTabShadow = new UIDefaults.LazyValue() {
  283.         public Object createValue(UIDefaults table) { 
  284.         Color c = (Color)table.get("control");
  285.                 Color base = new Color(Math.max((int)(c.getRed()*.85),0), 
  286.                                        Math.max((int)(c.getGreen()*.85),0), 
  287.                                        Math.max((int)(c.getBlue()*.85),0));
  288.                 return new ColorUIResource(base.darker());
  289.         }
  290.     };
  291.  
  292.     Object unselectedTabHighlight = new UIDefaults.LazyValue() {
  293.         public Object createValue(UIDefaults table) { 
  294.         Color c = (Color)table.get("control");
  295.                 Color base = new Color(Math.max((int)(c.getRed()*.85),0), 
  296.                                        Math.max((int)(c.getGreen()*.85),0), 
  297.                                        Math.max((int)(c.getBlue()*.85),0));
  298.                 return new ColorUIResource(base.brighter());
  299.         }
  300.     };
  301.  
  302.  
  303.     // *** Tree
  304.  
  305.     Object treeOpenIcon = LookAndFeel.makeIcon(getClass(), 
  306.                                                            "icons/TreeOpen.gif");
  307.  
  308.     Object treeClosedIcon = LookAndFeel.makeIcon(getClass(), 
  309.                                                              "icons/TreeClosed.gif");
  310.  
  311.     Object treeLeafIcon = new UIDefaults.LazyValue() {
  312.         public Object createValue(UIDefaults table) {
  313.         return MotifTreeCellRenderer.loadLeafIcon();
  314.         }
  315.     };
  316.  
  317.     Object treeExpandedIcon = new UIDefaults.LazyValue() {
  318.         public Object createValue(UIDefaults table) {
  319.         return MotifTreeUI.MotifExpandedIcon.createExpandedIcon();
  320.         }
  321.     };
  322.  
  323.     Object treeCollapsedIcon = new UIDefaults.LazyValue() {
  324.         public Object createValue(UIDefaults table) {
  325.         return MotifTreeUI.MotifCollapsedIcon.createCollapsedIcon();
  326.         }
  327.     };
  328.  
  329.  
  330.         Object comboBoxRendererActiveValue  = new UIDefaults.ActiveValue() {
  331.             public Object createValue(UIDefaults table) {
  332.                 return new MotifComboBoxRenderer.UIResource();
  333.             }
  334.         };
  335.  
  336.         Object comboBoxEditorActiveValue  = new UIDefaults.ActiveValue() {
  337.             public Object createValue(UIDefaults table) {
  338.                 return new BasicComboBoxEditor.UIResource();
  339.             }
  340.         };
  341.  
  342.     Object menuBarBorder = new UIDefaults.LazyValue(){
  343.       public Object createValue(UIDefaults table) {
  344.         return MotifBorderFactory.getMenuBarBorder();
  345.         // implements UIResource
  346.       }
  347.     };
  348.  
  349.     Object menuMarginBorder = new UIDefaults.LazyValue() {
  350.         public Object createValue(UIDefaults table) {
  351.         return new BorderUIResource(new CompoundBorder(
  352.                    MotifBorderFactory.getLoweredBevelBorder(),
  353.                BasicMarginBorder.getMarginBorder()) );
  354.         }
  355.     };
  356.  
  357.     Object popupMenuBorder = new UIDefaults.LazyValue(){
  358.       public Object createValue(UIDefaults table) {
  359.         return new BorderUIResource(MotifBorderFactory.getRaisedBevelBorder());
  360.       }
  361.     };
  362.     Object focusCellHighlightBorder = new BorderUIResource( 
  363.                           new LineBorder((Color)table.get("activeCaptionBorder")) );
  364.  
  365.     Object[] defaults = {
  366.  
  367.         "Desktop.background", table.get("desktop"),
  368.  
  369.         "Panel.background", table.get("control"),
  370.         "Panel.foreground", table.get("textText"),
  371.         "Panel.font", dialogPlain12,
  372.  
  373.         "ProgressBar.foreground", controlDarker,
  374.  
  375.         "Button.border", buttonBorder,
  376.         "Button.background", table.get("control"),
  377.         "Button.foreground", table.get("controlText"),
  378.         "Button.focus", table.get("controlText"),
  379.         "Button.pressed", table.get("controlLightShadow"),
  380.         "Button.font", dialogPlain12,
  381.  
  382.         "Button.shadow", controlDarker,
  383.  
  384.  
  385.         "RadioButton.background", table.get("control"),
  386.         "RadioButton.foreground", table.get("controlText"),
  387.         "RadioButton.font", dialogPlain12,
  388.         "RadioButton.icon", radioButtonIcon,
  389.         "RadioButton.focus", table.get("activeCaptionBorder"),
  390.         "RadioButton.icon", radioButtonIcon,
  391.  
  392.         "CheckBox.icon", checkBoxIcon,
  393.         "CheckBox.focus", table.get("activeCaptionBorder"),
  394.  
  395.         "RadioButtonMenuItem.icon", radioButtonIcon,
  396.         "CheckBoxMenuItem.icon", checkBoxIcon,
  397.  
  398.         "ToggleButton.border", buttonToggleBorder,
  399.         "ToggleButton.background", table.get("control"),
  400.         "ToggleButton.foreground", table.get("controlText"),
  401.         "ToggleButton.focus", table.get("controlText"),
  402.         "ToggleButton.selected",  table.get("controlLightShadow"),
  403.         "ToggleButton.pressed", table.get("controlLightShadow"),
  404.         "ToggleButton.font", dialogPlain12,
  405.  
  406.         "Menu.border", menuMarginBorder,
  407.         "Menu.font", dialogPlain12,
  408.         "Menu.foreground", table.get("menuText"),
  409.         "Menu.background", table.get("menu"),
  410.         "Menu.pressedForeground", menuItemPressedForeground,
  411.         "Menu.pressedBackground", menuItemPressedBackground,
  412.         "Menu.arrowIcon", menuArrowIcon,
  413.  
  414.         "MenuBar.border", menuBarBorder,
  415.         "MenuBar.background", table.get("menu"),
  416.         "MenuBar.foreground", table.get("menuText"),
  417.         "MenuBar.font", dialogPlain12,
  418.  
  419.         "MenuItem.border", menuMarginBorder,
  420.         "MenuItem.font", dialogPlain12,
  421.         "MenuItem.acceleratorFont", dialogPlain12,
  422.         "MenuItem.foreground", table.get("menuText"),
  423.         "MenuItem.background", table.get("menu"),
  424.         "MenuItem.pressedForeground", menuItemPressedForeground,
  425.         "MenuItem.pressedBackground", menuItemPressedBackground,
  426.         "MenuItem.checkIcon", menuItemCheckIcon,
  427.         "MenuItem.arrowIcon", menuItemArrowIcon,
  428.  
  429.         "PopupMenu.background", table.get("menu"),
  430.         "PopupMenu.border", popupMenuBorder,        
  431.         "PopupMenu.foreground", table.get("menuText"),
  432.         "PopupMenu.font", dialogPlain12,
  433.  
  434.         "Label.font", dialogPlain12,
  435.         "Label.background", table.get("control"),
  436.         "Label.foreground", table.get("controlText"),
  437.  
  438.         "List.focusCellHighlightBorder", focusCellHighlightBorder,
  439.  
  440.         "DesktopIcon.icon", LookAndFeel.makeIcon(getClass(), 
  441.                                                              "icons/DesktopIcon.gif"),
  442.  
  443.         "ScrollBar.background", scrollBarTrack,
  444.         "ScrollBar.foreground", table.get("control"),
  445.         "ScrollBar.track", scrollBarTrack,
  446.         "ScrollBar.trackHighlight", table.get("controlDkShadow"),
  447.         "ScrollBar.thumb", table.get("control"),
  448.         "ScrollBar.thumbHighlight", table.get("controlHighlight"),
  449.         "ScrollBar.thumbDarkShadow", table.get("controlDkShadow"),
  450.         "ScrollBar.thumbLightShadow", table.get("controlShadow"),
  451.         "ScrollBar.border", loweredBevelBorder,
  452.  
  453.         "ScrollPane.border", null,
  454.         "ScrollPane.font", dialogPlain12,
  455.         "ScrollPane.background", table.get("control"),
  456.         "ScrollPane.foreground", table.get("controlText"),
  457.         "ScrollPane.viewportBorder", loweredBevelBorder,
  458.  
  459.         "Slider.border", focusBevelBorder,
  460.         "Slider.foreground", table.get("control"),
  461.         "Slider.background", controlDarker,
  462.         "Slider.highlight", table.get("controlHighlight"),
  463.         "Slider.shadow", table.get("controlShadow"),
  464.         "Slider.focus", table.get("controlDkShadow"),
  465.  
  466.         "SplitPane.background", table.get("control"),
  467.         "SplitPane.highlight", table.get("controlHighlight"),
  468.         "SplitPane.shadow", table.get("controlShadow"),
  469.  
  470.             "TabbedPane.font", dialogPlain12,
  471.         "TabbedPane.tabBackground", table.get("control"),
  472.         "TabbedPane.tabForeground", table.get("controlText"),
  473.         "TabbedPane.tabHighlight", table.get("controlHighlight"),
  474.         "TabbedPane.tabShadow", table.get("controlShadow"),
  475.         "TabbedPane.unselectedTabBackground", unselectedTabBackground,
  476.         "TabbedPane.unselectedTabForeground", unselectedTabForeground,
  477.         "TabbedPane.unselectedTabHighlight", unselectedTabHighlight,
  478.         "TabbedPane.unselectedTabShadow", unselectedTabShadow,
  479.             "TabbedPane.focus", table.get("activeCaptionBorder"),
  480.  
  481.  
  482.         "Tree.background", controlDarker,                              // default: dark slate blue
  483.         "Tree.hash", table.get("controlDkShadow"),                     // default: black
  484.         "Tree.iconShadow", table.get("controlShadow"),
  485.         "Tree.iconHighlight", table.get("controlHighlight"),
  486.         "Tree.iconBackground", table.get("control"),                              
  487.         "Tree.iconForeground", table.get("controlShadow"),             // default: black
  488.         "Tree.borderSelectionColor", table.get("activeCaptionBorder"), // default: maroon
  489.         "Tree.textSelectionColor", table.get("textText"),              // default: black
  490.         "Tree.textNonSelectionColor", table.get("textText"),           // default: black
  491.         "Tree.backgroundSelectionColor", table.get("text"),            // default: white
  492.         "Tree.backgroundNonSelectionColor", controlDarker,             // default: dark slate blue
  493.         "Tree.backgroundNonSelectionColor", controlDarker,             // default: dark slate blue
  494.         "Tree.openIcon", treeOpenIcon,
  495.         "Tree.closedIcon", treeClosedIcon,
  496.         "Tree.leafIcon", treeLeafIcon,
  497.         "Tree.expandedIcon", treeExpandedIcon,
  498.         "Tree.collapsedIcon", treeCollapsedIcon,
  499.  
  500.               "Table.focusCellHighlightBorder", focusCellHighlightBorder,
  501.         "Table.scrollPaneBorder", null,
  502.  
  503.         //        "Table.background", white,  // cell background color
  504.         //        "Table.focusCellBackground", white,
  505.  
  506.  
  507.  
  508.             "ComboBox.control", table.get("control"),
  509.             "ComboBox.controlForeground", black,
  510.             "ComboBox.renderer", comboBoxRendererActiveValue,
  511.             "ComboBox.editor",   comboBoxEditorActiveValue,
  512.             "ComboBox.background", table.get("text"), 
  513.             "ComboBox.foreground", black,
  514.             "ComboBox.selectedBackground", black,
  515.             "ComboBox.selectedForeground", table.get("text"),
  516.             "ComboBox.disabledBackground", table.get("control"),
  517.             "ComboBox.disabledForeground", table.get("textInactiveText"),
  518.             "ComboBox.font", dialogPlain12,
  519.  
  520.         "TextField.caretForeground", black,
  521.         "TextField.caretBlinkRate", new Integer(500),
  522.         "TextField.inactiveForeground", table.get("textInactiveText"),
  523.         "TextField.selectionBackground", table.get("textHighlight"),
  524.         "TextField.selectionForeground", table.get("textHighlightText"),
  525.         "TextField.background", table.get("window"),
  526.         "TextField.foreground", table.get("textText"),
  527.         "TextField.font", sansSerifPlain12,
  528.         "TextField.border", fieldTextBorder,
  529.         
  530.         "PasswordField.caretForeground", black,
  531.         "PasswordField.caretBlinkRate", new Integer(500),
  532.         "PasswordField.inactiveForeground", table.get("textInactiveText"),
  533.         "PasswordField.selectionBackground", table.get("textHighlight"),
  534.         "PasswordField.selectionForeground", table.get("textHighlightText"),
  535.         "PasswordField.background", table.get("window"),
  536.         "PasswordField.foreground", table.get("textText"),
  537.         "PasswordField.font", monospacedPlain12,
  538.         "PasswordField.border", fieldTextBorder,
  539.         
  540.         "TextArea.caretForeground", black,
  541.         "TextArea.caretBlinkRate", new Integer(500),
  542.         "TextArea.inactiveForeground", table.get("textInactiveText"),
  543.         "TextArea.selectionBackground", table.get("textHighlight"),
  544.         "TextArea.selectionForeground", table.get("textHighlightText"),
  545.         "TextArea.background", table.get("window"),
  546.         "TextArea.foreground", table.get("textText"),
  547.         "TextArea.font", monospacedPlain12,
  548.         "TextArea.border", multilineTextBorder,
  549.         
  550.         "TextPane.caretForeground", black,
  551.         "TextPane.caretBlinkRate", new Integer(500),
  552.         "TextPane.inactiveForeground", table.get("textInactiveText"),
  553.         "TextPane.selectionBackground", lightGray,
  554.         "TextPane.selectionForeground", table.get("textHighlightText"),
  555.         "TextPane.background", white,
  556.         "TextPane.foreground", table.get("textText"),
  557.         "TextPane.font", serifPlain12,
  558.         "TextPane.border", multilineTextBorder,
  559.         
  560.         "EditorPane.caretForeground", red,
  561.         "EditorPane.caretBlinkRate", new Integer(500),
  562.         "EditorPane.inactiveForeground", table.get("textInactiveText"),
  563.         "EditorPane.selectionBackground", lightGray,
  564.         "EditorPane.selectionForeground", table.get("textHighlightText"),
  565.         "EditorPane.background", white,
  566.         "EditorPane.foreground", table.get("textText"),
  567.         "EditorPane.font", serifPlain12,
  568.         "EditorPane.border", multilineTextBorder,
  569.  
  570.         "ToolTip.border", raisedBevelBorder,
  571.         "ToolTip.background", table.get("info"),
  572.         "ToolTip.foreground", table.get("infoText"),
  573.  
  574.         "OptionPane.errorIcon", LookAndFeel.makeIcon(getClass(), 
  575.                                                          "icons/Error.gif"),
  576.         "OptionPane.informationIcon", LookAndFeel.makeIcon(getClass(), 
  577.                                                                "icons/Inform.gif"),
  578.         "OptionPane.warningIcon", LookAndFeel.makeIcon(getClass(), 
  579.                                                            "icons/Warn.gif"),
  580.         "OptionPane.questionIcon", LookAndFeel.makeIcon(getClass(), 
  581.                                                             "icons/Question.gif")
  582.     };
  583.  
  584.     table.putDefaults(defaults);
  585.     }
  586.  
  587. }
  588.  
  589.