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

  1. /*
  2.  * @(#)BasicLookAndFeel.java    1.97 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.basic;
  22.  
  23. import java.awt.Font;
  24. import java.awt.Color;
  25. import java.awt.SystemColor;
  26.  
  27. import com.sun.java.swing.LookAndFeel;
  28. import com.sun.java.swing.BorderFactory;
  29. import com.sun.java.swing.JComponent;
  30. import com.sun.java.swing.ImageIcon;
  31. import com.sun.java.swing.UIDefaults;
  32. import com.sun.java.swing.UIManager;
  33. import com.sun.java.swing.border.*;
  34. import com.sun.java.swing.plaf.*;
  35. import java.net.URL;
  36. import java.io.Serializable;
  37.  
  38. import java.net.URL;
  39.  
  40. /**
  41.  * Implements the a standard base LookAndFeel class from which
  42.  * standard desktop LookAndFeel classes (JLF, Mac, Windows, etc.)
  43.  * can be derived.  This class cannot be instantiated directly,
  44.  * however the UI classes "Basic" defines can be.
  45.  * <p>
  46.  * Warning: serialized objects of this class will not be compatible with
  47.  * future swing releases.  The current serialization support is appropriate 
  48.  * for short term storage or RMI between Swing1.0 applications.  It will
  49.  * not be possible to load serialized Swing1.0 objects with future releases
  50.  * of Swing.  The JDK1.2 release of Swing will be the compatibility
  51.  * baseline for the serialized form of Swing objects.
  52.  *
  53.  * @version 1.97 02/04/98
  54.  * @author unknown
  55.  */
  56. public abstract class BasicLookAndFeel extends LookAndFeel implements Serializable
  57. {
  58.  
  59.     public UIDefaults getDefaults() {
  60.     UIDefaults table = new UIDefaults();
  61.  
  62.     initClassDefaults(table);
  63.     initSystemColorDefaults(table);
  64.     initComponentDefaults(table);
  65.  
  66.     return table;
  67.     }
  68.  
  69.     /** 
  70.      * Initialize the uiClassID to BasicComponentUI mapping.
  71.      * The JComponent classes define their own uiClassID constants
  72.      * (see AbstractComponent.getUIClassID).  This table must
  73.      * map those constants to a BasicComponentUI class of the
  74.      * appropriate type.
  75.      * 
  76.      * @see #getDefaults
  77.      */
  78.     protected void initClassDefaults(UIDefaults table)
  79.     {
  80.     String basicPackageName = "com.sun.java.swing.plaf.basic.";
  81.     Object[] uiDefaults = {
  82.            "ButtonUI", basicPackageName + "BasicButtonUI",
  83.          "CheckBoxUI", basicPackageName + "BasicCheckBoxUI",
  84.              "ColorChooserUI", basicPackageName + "BasicColorChooserUI",
  85.           "MenuBarUI", basicPackageName + "BasicMenuBarUI",
  86.              "MenuUI", basicPackageName + "BasicMenuUI",
  87.          "MenuItemUI", basicPackageName + "BasicMenuItemUI",
  88.      "CheckBoxMenuItemUI", basicPackageName + "BasicCheckBoxMenuItemUI",
  89.       "RadioButtonMenuItemUI", basicPackageName + "BasicRadioButtonMenuItemUI",
  90.           "RadioButtonUI", basicPackageName + "BasicRadioButtonUI",
  91.          "ToggleButtonUI", basicPackageName + "BasicToggleButtonUI",
  92.         "PopupMenuUI", basicPackageName + "BasicPopupMenuUI",
  93.           "ProgressBarUI", basicPackageName + "BasicProgressBarUI",
  94.         "ScrollBarUI", basicPackageName + "BasicScrollBarUI",
  95.            "ScrollPaneUI", basicPackageName + "BasicScrollPaneUI",
  96.         "SplitPaneUI", basicPackageName + "BasicSplitPaneUI",
  97.            "SliderUI", basicPackageName + "BasicSliderUI",
  98.           "SpinnerUI", basicPackageName + "BasicSpinnerUI",
  99.         "SeparatorUI", basicPackageName + "BasicSeparatorUI",
  100.            "TabbedPaneUI", basicPackageName + "BasicTabbedPaneUI",
  101.          "TextAreaUI", basicPackageName + "BasicTextAreaUI",
  102.         "TextFieldUI", basicPackageName + "BasicTextFieldUI",
  103.         "PasswordFieldUI", basicPackageName + "BasicPasswordFieldUI",
  104.          "TextPaneUI", basicPackageName + "BasicTextPaneUI",
  105.                "EditorPaneUI", basicPackageName + "BasicEditorPaneUI",
  106.              "TreeUI", basicPackageName + "BasicTreeUI",
  107.             "LabelUI", basicPackageName + "BasicLabelUI",
  108.              "ListUI", basicPackageName + "BasicListUI",
  109.           "ToolBarUI", basicPackageName + "BasicToolBarUI",
  110.           "ToolTipUI", basicPackageName + "BasicToolTipUI",
  111.          "ComboBoxUI", basicPackageName + "BasicComboBoxUI",
  112.             "TableUI", basicPackageName + "BasicTableUI",
  113.           "TableHeaderUI", basicPackageName + "BasicTableHeaderUI",
  114.         "InternalFrameUI", basicPackageName + "BasicInternalFrameUI",
  115.        "StandardDialogUI", basicPackageName + "BasicStandardDialogUI",
  116.           "DesktopPaneUI", basicPackageName + "BasicDesktopPaneUI",
  117.           "DesktopIconUI", basicPackageName + "BasicDesktopIconUI",
  118.         "DirectoryPaneUI", basicPackageName + "BasicDirectoryPaneUI",
  119.           "FileChooserUI", basicPackageName + "BasicFileChooserUI",
  120.            "OptionPaneUI", basicPackageName + "BasicOptionPaneUI"
  121.     };
  122.  
  123.     table.putDefaults(uiDefaults);
  124.     }
  125.  
  126.     /**
  127.      * Load the SystemColors into the defaults table.  The keys
  128.      * for SystemColor defaults are the same as the names of
  129.      * the public fields in SystemColor.  If the table is being
  130.      * created on a native Windows platform we use the SystemColor
  131.      * values, otherwise we create color objects whose values match
  132.      * the defaults Windows95 colors.
  133.      */
  134.     protected void initSystemColorDefaults(UIDefaults table)
  135.     {
  136.     String[] systemColors = {
  137.               "desktop", "#005C5C", /* Color of the desktop background */
  138.       "activeCaption", "#000080", /* Color for captions (title bars) when they are active. */
  139.       "activeCaptionText", "#FFFFFF", /* Text color for text in captions (title bars). */
  140.     "activeCaptionBorder", "#C0C0C0", /* Border color for caption (title bar) window borders. */
  141.         "inactiveCaption", "#808080", /* Color for captions (title bars) when not active. */
  142.     "inactiveCaptionText", "#C0C0C0", /* Text color for text in inactive captions (title bars). */
  143.   "inactiveCaptionBorder", "#C0C0C0", /* Border color for inactive caption (title bar) window borders. */
  144.              "window", "#FFFFFF", /* Default color for the interior of windows */
  145.        "windowBorder", "#000000", /* ??? */
  146.          "windowText", "#000000", /* ??? */
  147.            "menu", "#C0C0C0", /* Background color for menus */
  148.            "menuText", "#000000", /* Text color for menus  */
  149.            "text", "#C0C0C0", /* Text background color */
  150.            "textText", "#000000", /* Text foreground color */
  151.       "textHighlight", "#000080", /* Text background color when selected */
  152.       "textHighlightText", "#FFFFFF", /* Text color when selected */
  153.        "textInactiveText", "#808080", /* Text color when disabled */
  154.             "control", "#C0C0C0", /* Default color for controls (buttons, sliders, etc) */
  155.         "controlText", "#000000", /* Default color for text in controls */
  156.        "controlHighlight", "#FFFFFF", /* Specular highlight (opposite of the shadow) */
  157.      "controlLtHighlight", "#E0E0E0", /* Highlight color for controls */
  158.       "controlShadow", "#808080", /* Shadow color for controls */
  159.         "controlDkShadow", "#000000", /* Dark shadow color for controls */
  160.           "scrollbar", "#E0E0E0", /* Scrollbar background (usually the "track") */
  161.            "info", "#FFFFE1", /* ??? */
  162.            "infoText", "#000000"  /* ??? */
  163.     };
  164.  
  165.     loadSystemColors(table, systemColors);
  166.     }
  167.  
  168.  
  169.     /**
  170.      * If this is the native look and feel the initial values for the
  171.      * system color properties are the same as the SystemColor constants.
  172.      * If not we use the integer color values in the <code>systemColors</code>
  173.      * argument.
  174.      */
  175.     protected void loadSystemColors(UIDefaults table, String[] systemColors)
  176.     {
  177.     /* PENDING(hmuller) We don't load the system colors below because
  178.      * they're not reliable.  Hopefully we'll be able to do better in 
  179.      * a future version of AWT.
  180.      */
  181.     if (false && isNativeLookAndFeel()) {
  182.         for(int i = 0; i < systemColors.length; i += 2) {
  183.         Color color = Color.black;
  184.         try {
  185.             String name = systemColors[i];
  186.             color = (Color)(SystemColor.class.getField(name).get(null));
  187.         } catch (Exception e) { 
  188.         }
  189.         table.put(systemColors[i], new ColorUIResource(color));
  190.         }
  191.     } else {
  192.         for(int i = 0; i < systemColors.length; i += 2) {
  193.         Color color = Color.black;
  194.         try {
  195.             color = Color.decode(systemColors[i + 1]);
  196.         } 
  197.         catch(NumberFormatException e) {
  198.             e.printStackTrace();
  199.         }
  200.         table.put(systemColors[i], new ColorUIResource(color));
  201.         }
  202.     }
  203.     }
  204.  
  205.     
  206.     protected void initComponentDefaults(UIDefaults table) 
  207.     {
  208.     // *** Fonts
  209.     FontUIResource dialogPlain12 = new FontUIResource("Dialog", Font.PLAIN, 12);
  210.     FontUIResource serifPlain12 = new FontUIResource("Serif", Font.PLAIN, 12);
  211.     FontUIResource sansSerifPlain12 = new FontUIResource("SansSerif", Font.PLAIN, 12);
  212.     FontUIResource monospacedPlain12 = new FontUIResource("Monospaced", Font.PLAIN, 12);
  213.     FontUIResource dialogBold12 = new FontUIResource("Dialog", Font.BOLD, 12);
  214.  
  215.     // *** Colors
  216.     ColorUIResource red = new ColorUIResource(Color.red);
  217.     ColorUIResource black = new ColorUIResource(Color.black);
  218.         ColorUIResource white = new ColorUIResource(Color.white);
  219.     ColorUIResource yellow = new ColorUIResource(Color.yellow);
  220.         ColorUIResource gray = new ColorUIResource(Color.gray);
  221.     ColorUIResource lightGray = new ColorUIResource(Color.lightGray);
  222.     ColorUIResource darkGray = new ColorUIResource(Color.darkGray);
  223.     ColorUIResource scrollBarTrack = new ColorUIResource(224, 224, 224);
  224.     ColorUIResource treeSelection = new ColorUIResource(Color.red);
  225.     ColorUIResource menuItemPressedBackground = new ColorUIResource(0,0,128);
  226.     ColorUIResource menuItemPressedForeground = new ColorUIResource(255,255,255);
  227.  
  228.  
  229.     // *** List 
  230.     Object listCellRendererActiveValue = new UIDefaults.ActiveValue() {
  231.         public Object createValue(UIDefaults table) { 
  232.         return new BasicListCellRenderer.UIResource();
  233.         }
  234.     };
  235.  
  236.     // *** ComboBox
  237.         Object comboBoxRendererActiveValue  = new UIDefaults.ActiveValue() {
  238.             public Object createValue(UIDefaults table) {
  239.                 return new BasicComboBoxRenderer.UIResource();
  240.             }
  241.         };
  242.  
  243.         Object comboBoxEditorActiveValue  = new UIDefaults.ActiveValue() {
  244.             public Object createValue(UIDefaults table) {
  245.                 return new BasicComboBoxEditor.UIResource();
  246.             }
  247.         };
  248.  
  249.     // *** ScrollPane
  250.     Object scrollPaneBorder = new UIDefaults.LazyValue() {
  251.         public Object createValue(UIDefaults table) {
  252.         return BorderUIResource.getEtchedBorderUIResource();
  253.         }
  254.     };
  255.  
  256.     Object tableScrollPaneBorder = new BorderUIResource(new BevelBorder(BevelBorder.LOWERED));
  257.  
  258.  
  259.     // *** Text
  260.     Object multilineTextBorder = new UIDefaults.LazyValue() {
  261.         public Object createValue(UIDefaults table) {
  262.         return BasicMarginBorder.getMarginBorder();
  263.         }
  264.     };
  265.  
  266.     Object fieldTextBorder = new UIDefaults.LazyValue() {
  267.             public Object createValue(UIDefaults table) {
  268.         return new BorderUIResource(new CompoundBorder(
  269.                                             BasicFieldBorder.getFieldBorder(),
  270.                         BasicMarginBorder.getMarginBorder()));
  271.         }
  272.     };
  273.  
  274.     Object caretBlinkRate = new UIDefaults.LazyValue() {
  275.             public Object createValue(UIDefaults table) {
  276.         return new Integer(500);
  277.         }
  278.     };
  279.  
  280.     // *** ToolTips
  281.         Object toolTipBorder = new UIDefaults.LazyValue() {
  282.             public Object createValue(UIDefaults table) {
  283.                 return BorderUIResource.getBlackLineBorderUIResource();
  284.             }
  285.         };
  286.                                    
  287.  
  288.     // *** Buttons
  289.     Object buttonBorder = new UIDefaults.LazyValue() {
  290.       public Object createValue(UIDefaults table) {
  291.         return new BorderUIResource(new CompoundBorder(
  292.                               BasicBorderFactory.getButtonBorder(),
  293.                               BasicMarginBorder.getMarginBorder()));
  294.       }
  295.     };
  296.  
  297.     Object buttonToggleBorder = new UIDefaults.LazyValue() {
  298.       public Object createValue(UIDefaults table) {
  299.         return new BorderUIResource(new CompoundBorder(
  300.                       BasicBorderFactory.getToggleButtonBorder(),
  301.                       BasicMarginBorder.getMarginBorder()));
  302.       }
  303.     };
  304.  
  305.     Object radioButtonBorder = new UIDefaults.LazyValue() {
  306.       public Object createValue(UIDefaults table) {
  307.         return new BorderUIResource(new CompoundBorder(
  308.                       BasicBorderFactory.getRadioButtonBorder(),
  309.                       BasicMarginBorder.getMarginBorder()));
  310.       }
  311.     };
  312.  
  313.     Object internalFrameBorder = new UIDefaults.LazyValue() {
  314.       public Object createValue(UIDefaults table) {
  315.         return new BorderUIResource( BorderFactory.createCompoundBorder(
  316.                 new BevelBorder(BevelBorder.RAISED,
  317.                     BasicGraphicsUtils.control,
  318.                     BasicGraphicsUtils.controlHighlight,
  319.                     BasicGraphicsUtils.controlBlack,
  320.                     BasicGraphicsUtils.controlShadow),
  321.                 BorderFactory.createLineBorder(
  322.                     BasicGraphicsUtils.control, 1)));
  323.       }
  324.     };
  325.  
  326.     Object menuMarginBorder = new UIDefaults.LazyValue() {
  327.         public Object createValue(UIDefaults table) {
  328.         return new BorderUIResource(BasicMarginBorder.getMarginBorder());
  329.         }
  330.     };
  331.       
  332.     Object menuBarBorder = new UIDefaults.LazyValue(){
  333.       public Object createValue(UIDefaults table) {
  334.         return new BorderUIResource(BasicBorderFactory.getMenuBarBorder());
  335.       }
  336.     };
  337.  
  338.     Object popupMenuBorder = new UIDefaults.LazyValue(){
  339.       public Object createValue(UIDefaults table) {
  340.         return new BorderUIResource(BorderFactory.createRaisedBevelBorder());
  341.       }
  342.     };
  343.  
  344.     Object titledBorderBorder = new UIDefaults.LazyValue(){
  345.       public Object createValue(UIDefaults table) {
  346.         return new BorderUIResource(BorderFactory.createEtchedBorder());
  347.       };
  348.     };
  349.  
  350.     Object toolBarBorder = new UIDefaults.LazyValue(){
  351.         public Object createValue(UIDefaults table) {
  352.         return new BorderUIResource(//new CompoundBorder(
  353.                         BorderFactory.createEtchedBorder()//,
  354.                         //BasicMarginBorder.getMarginBorder())
  355.             );
  356.         }
  357.     };
  358.  
  359.     Object selectedColorBorder = new UIDefaults.LazyValue(){
  360.       public Object createValue(UIDefaults table) {
  361.         return new BorderUIResource(BorderFactory.createLoweredBevelBorder());
  362.       };
  363.     };
  364.  
  365.     Object menuItemCheckIcon = new UIDefaults.LazyValue() {
  366.         public Object createValue(UIDefaults table) {
  367.         return BasicIconFactory.getMenuItemCheckIcon();
  368.         }
  369.     };
  370.  
  371.     Object menuItemArrowIcon = new UIDefaults.LazyValue() {
  372.         public Object createValue(UIDefaults table) {
  373.         return BasicIconFactory.getMenuItemArrowIcon();
  374.         }
  375.     };
  376.  
  377.     Object menuArrowIcon = new UIDefaults.LazyValue() {
  378.         public Object createValue(UIDefaults table) {
  379.         return BasicIconFactory.getMenuArrowIcon();
  380.         }
  381.     };
  382.  
  383.     Object checkBoxIcon = new UIDefaults.LazyValue() {
  384.         public Object createValue(UIDefaults table) {
  385.         return BasicIconFactory.getCheckBoxIcon();
  386.         }
  387.     };
  388.  
  389.     Object radioButtonIcon = new UIDefaults.LazyValue() {
  390.         public Object createValue(UIDefaults table) {
  391.         return BasicIconFactory.getRadioButtonIcon();
  392.         }
  393.     };
  394.  
  395.  
  396.     Object checkBoxMenuItemIcon = new UIDefaults.LazyValue() {
  397.         public Object createValue(UIDefaults table) {
  398.         return BasicIconFactory.getCheckBoxMenuItemIcon();
  399.         }
  400.     };
  401.  
  402.     Object radioButtonMenuItemIcon = new UIDefaults.LazyValue() {
  403.         public Object createValue(UIDefaults table) {
  404.         return BasicIconFactory.getRadioButtonMenuItemIcon();
  405.         }
  406.     };
  407.  
  408.     Object optionPaneBorder = new UIDefaults.LazyValue(){
  409.       public Object createValue(UIDefaults table) {
  410.         return new BorderUIResource(new EmptyBorder(10, 10, 12, 10));
  411.       };
  412.     };
  413.  
  414.     // ** for table
  415.     class DimensionUIResource extends java.awt.Dimension implements UIResource {
  416.       DimensionUIResource() { super(); };
  417.       DimensionUIResource(int x, int y) { super(x, y); };
  418.     }
  419.  
  420.     Object cellEditorBorder = new UIDefaults.LazyValue(){
  421.       public Object createValue(UIDefaults table) {
  422.         return new BorderUIResource(LineBorder.createBlackLineBorder());
  423.       };
  424.     };
  425.  
  426.     Object focusCellHighlightBorder = new BorderUIResource( new LineBorder(yellow) );
  427.  
  428.     Object[] defaults = {
  429.         "Desktop.background", table.get("desktop"),
  430.  
  431.         "Panel.background", table.get("control"),
  432.         "Panel.foreground", table.get("textText"),
  433.         "Panel.font", dialogPlain12,
  434.  
  435.         "Button.border", buttonBorder,
  436.         "Button.background", table.get("control"),
  437.         "Button.foreground", table.get("controlText"),
  438.         "Button.focus", table.get("controlText"),
  439.         "Button.font", dialogPlain12,
  440.         "Button.pressed", table.get("control"),
  441.  
  442.         "ToggleButton.border", buttonToggleBorder,
  443.         "ToggleButton.background", table.get("control"),
  444.         "ToggleButton.foreground", table.get("controlText"),
  445.         "ToggleButton.focus", table.get("controlText"),
  446.         "ToggleButton.font", dialogPlain12,
  447.         "ToggleButton.pressed", table.get("control"),
  448.  
  449.         "RadioButton.background", table.get("control"),
  450.         "RadioButton.foreground", table.get("controlText"),
  451.         "RadioButton.font", dialogPlain12,
  452.         "RadioButton.icon", radioButtonIcon,
  453.         "RadioButton.border", radioButtonBorder,
  454.         "RadioButton.focus", black,
  455.  
  456.         "CheckBox.icon", checkBoxIcon,
  457.         "CheckBox.focus", black,
  458.  
  459.         "RadioButtonMenuItem.icon", radioButtonMenuItemIcon,
  460.         "CheckBoxMenuItem.icon", checkBoxMenuItemIcon,
  461.  
  462.         "MenuBar.border", menuBarBorder,
  463.         "MenuBar.background", table.get("menu"),
  464.         "MenuBar.foreground", table.get("menuText"),
  465.         "MenuBar.font", dialogPlain12,
  466.  
  467.         "Menu.border", menuMarginBorder,
  468.         "Menu.font", dialogPlain12,
  469.         "Menu.foreground", table.get("menuText"),
  470.         "Menu.background", table.get("menu"),
  471.         "Menu.pressedForeground", menuItemPressedForeground,
  472.         "Menu.pressedBackground", menuItemPressedBackground,
  473.         "Menu.arrowIcon", menuArrowIcon,
  474.  
  475.         "MenuItem.border", menuMarginBorder,
  476.         "MenuItem.borderPainted", Boolean.FALSE,
  477.         "MenuItem.font", dialogPlain12,
  478.         "MenuItem.foreground", table.get("menuText"),
  479.         "MenuItem.background", table.get("menu"),
  480.         "MenuItem.pressedForeground", menuItemPressedForeground,
  481.         "MenuItem.pressedBackground", menuItemPressedBackground,
  482.         "MenuItem.disabledForeground", null,
  483.         "MenuItem.acceleratorFont", dialogPlain12,
  484.         "MenuItem.acceleratorForeground", table.get("menuText"),
  485.         "MenuItem.acceleratorPressedForeground", menuItemPressedForeground,
  486.         "MenuItem.checkIcon", menuItemCheckIcon,
  487.         "MenuItem.arrowIcon", menuItemArrowIcon,
  488.  
  489.         "PopupMenu.background", table.get("menu"),
  490.         "PopupMenu.border", popupMenuBorder,        
  491.         "PopupMenu.foreground", table.get("menuText"),
  492.         "PopupMenu.font", dialogPlain12,
  493.  
  494.         "Label.font", dialogPlain12,
  495.         "Label.background", table.get("control"),
  496.         "Label.foreground", table.get("controlText"),
  497.         "Label.disabled", white,
  498.         "Label.disabledShadow", table.get("controlShadow"),
  499.  
  500.         "List.selectionBackground", table.get("textHighlight"), 
  501.         "List.selectionForeground", table.get("textHighlightText"),
  502.          "List.background", table.get("window"),
  503.         "List.foreground", table.get("textText"),
  504.         "List.focusCellHighlightBorder", focusCellHighlightBorder,
  505.         "List.font", dialogPlain12,
  506.         "List.cellRenderer", listCellRendererActiveValue,
  507.         "List.border", null,
  508.  
  509.             "ComboBox.renderer", comboBoxRendererActiveValue,
  510.             "ComboBox.editor",   comboBoxEditorActiveValue,
  511.             "ComboBox.background", white/*table.get("text")*/,
  512.             "ComboBox.foreground", black/*table.get("TextText")*/,
  513.             "ComboBox.selectedBackground", table.get("textHighlight"),
  514.             "ComboBox.selectedForeground", table.get("textHighlightText"),
  515.             "ComboBox.font", dialogPlain12,
  516.             "ComboBox.disabledBackground", table.get("control"),
  517.             "ComboBox.disabledForeground", table.get("textInactiveText"),
  518.  
  519.         "TextField.caretForeground", black,
  520.         "TextField.caretBlinkRate", caretBlinkRate,
  521.         "TextField.inactiveForeground", table.get("textInactiveText"),
  522.         "TextField.selectionBackground", table.get("textHighlight"),
  523.         "TextField.selectionForeground", table.get("textHighlightText"),
  524.         "TextField.background", table.get("window"),
  525.         "TextField.foreground", table.get("textText"),
  526.         "TextField.font", sansSerifPlain12,
  527.         "TextField.border", fieldTextBorder,
  528.         
  529.         "PasswordField.caretForeground", black,
  530.         "PasswordField.caretBlinkRate", caretBlinkRate,
  531.         "PasswordField.inactiveForeground", table.get("textInactiveText"),
  532.         "PasswordField.selectionBackground", table.get("textHighlight"),
  533.         "PasswordField.selectionForeground", table.get("textHighlightText"),
  534.         "PasswordField.background", table.get("window"),
  535.         "PasswordField.foreground", table.get("textText"),
  536.         "PasswordField.font", monospacedPlain12,
  537.         "PasswordField.border", fieldTextBorder,
  538.         
  539.         "TextArea.caretForeground", black,
  540.         "TextArea.caretBlinkRate", caretBlinkRate,
  541.         "TextArea.inactiveForeground", table.get("textInactiveText"),
  542.         "TextArea.selectionBackground", table.get("textHighlight"),
  543.         "TextArea.selectionForeground", table.get("textHighlightText"),
  544.         "TextArea.background", table.get("window"),
  545.         "TextArea.foreground", table.get("textText"),
  546.         "TextArea.font", monospacedPlain12,
  547.         "TextArea.border", multilineTextBorder,
  548.         
  549.         "TextPane.caretForeground", black,
  550.         "TextPane.inactiveForeground", table.get("textInactiveText"),
  551.         "TextPane.selectionBackground", lightGray,
  552.         "TextPane.selectionForeground", table.get("textHighlightText"),
  553.         "TextPane.background", white,
  554.         "TextPane.foreground", table.get("textText"),
  555.         "TextPane.font", serifPlain12,
  556.         "TextPane.border", multilineTextBorder,
  557.         
  558.         "EditorPane.caretForeground", red,
  559.         "EditorPane.inactiveForeground", table.get("textInactiveText"),
  560.         "EditorPane.selectionBackground", lightGray,
  561.         "EditorPane.selectionForeground", table.get("textHighlightText"),
  562.         "EditorPane.background", white,
  563.         "EditorPane.foreground", table.get("textText"),
  564.         "EditorPane.font", serifPlain12,
  565.         "EditorPane.border", multilineTextBorder,
  566.         
  567.         "ScrollBar.background", scrollBarTrack,
  568.         "ScrollBar.foreground", table.get("control"),
  569.         "ScrollBar.track", scrollBarTrack,
  570.         "ScrollBar.trackHighlight", table.get("controlDkShadow"),
  571.         "ScrollBar.thumb", table.get("control"),
  572.         "ScrollBar.thumbHighlight", table.get("controlHighlight"),
  573.         "ScrollBar.thumbDarkShadow", table.get("controlDkShadow"),
  574.         "ScrollBar.thumbLightShadow", table.get("controlShadow"),
  575.         "ScrollBar.border", null,
  576.  
  577.         "ScrollPane.border", scrollPaneBorder,
  578.         "ScrollPane.font", dialogPlain12,
  579.         "ScrollPane.background", table.get("control"),
  580.         "ScrollPane.foreground", table.get("controlText"),
  581.         "ScrollPane.viewportBorder", null,
  582.  
  583.         "Slider.border", null,
  584.         "Slider.foreground", table.get("control"),
  585.         "Slider.background", table.get("control"),
  586.         "Slider.highlight", table.get("controlHighlight"),
  587.         "Slider.shadow", table.get("controlShadow"),
  588.         "Slider.focus", table.get("controlDkShadow"),
  589.  
  590.         "SplitPane.background", table.get("control"),
  591.         "SplitPane.highlight", table.get("controllHighlight"),
  592.         "SplitPane.shadow", table.get("controlShadow"),
  593.  
  594.             "TabbedPane.font", dialogPlain12,
  595.             "TabbedPane.tabBackground", table.get("control"),
  596.             "TabbedPane.tabForeground", table.get("controlText"),
  597.             "TabbedPane.tabHighlight", table.get("controlHighlight"),
  598.             "TabbedPane.tabShadow", table.get("controlShadow"),
  599.             "TabbedPane.tabDarkShadow", table.get("controlDkShadow"),
  600.             "TabbedPane.focus", black,
  601.  
  602.         "Table.font", dialogPlain12,
  603.         "Table.foreground", table.get("controlText"),  // cell text color
  604.         "Table.background", table.get("window"),  // cell background color
  605.         "Table.selectionForeground", table.get("textHighlightText"),
  606.         "Table.selectionBackground", table.get("textHighlight"),
  607.               "Table.gridColor", gray,  // grid line color
  608.         "Table.focusCellHighlightBorder", focusCellHighlightBorder,
  609.         "Table.focusCellBackground", table.get("window"),
  610.         "Table.focusCellForeground", table.get("controlText"),
  611.         "Table.scrollPaneBorder", tableScrollPaneBorder,
  612.  
  613.         "TableHeader.font", dialogPlain12, 
  614.         "TableHeader.foreground", table.get("controlText"), // header text color
  615.         "TableHeader.background", table.get("control"), // header background
  616.    
  617.  
  618.             "TitledBorder.font", dialogPlain12,
  619.             "TitledBorder.titleColor", table.get("controlText"),
  620.             "TitledBorder.border", titledBorderBorder,
  621.  
  622.         "ToolBar.border", toolBarBorder,
  623.         "ToolBar.background", table.get("control"),
  624.         "ToolBar.foreground", table.get("controlText"),
  625.         "ToolBar.font", dialogPlain12,
  626.         "ToolBar.dockingColor", table.get("control"),
  627.         "ToolBar.floatingColor", table.get("control"),
  628.         "ToolBar.dockingBorderColor", red, 
  629.         "ToolBar.floatingBorderColor", darkGray,
  630.         
  631.             "ToolTip.font", sansSerifPlain12,
  632.             "ToolTip.border", toolTipBorder,
  633.             "ToolTip.background", table.get("info"),
  634.             "ToolTip.foreground", table.get("infoText"),
  635.  
  636.         "Tree.background", white,
  637.         "Tree.hash", gray,
  638.         "Tree.textSelectionColor", white,
  639.         "Tree.textNonSelectionColor", black,
  640.         "Tree.borderSelectionColor", black,
  641.         "Tree.backgroundSelectionColor", treeSelection,
  642.         "Tree.backgroundNonSelectionColor", white,
  643.         "Tree.openIcon", LookAndFeel.makeIcon(getClass(), "icons/TreeOpen.gif"),
  644.         "Tree.closedIcon", LookAndFeel.makeIcon(getClass(), "icons/TreeClosed.gif"),
  645.         "Tree.leafIcon", LookAndFeel.makeIcon(getClass(), "icons/TreeLeaf.gif"),
  646.         "Tree.expandedIcon", null,
  647.         "Tree.collapsedIcon", null,
  648.  
  649.         "FileChooser.newFolder", LookAndFeel.makeIcon(getClass(), "icons/NewFolder.gif"),
  650.         "FileChooser.upFolder", LookAndFeel.makeIcon(getClass(), "icons/UpFolder.gif"),
  651.         "FileChooser.homeFolder", LookAndFeel.makeIcon(getClass(), "icons/HomeFolder.gif"),
  652.         "FileChooser.detailsView", LookAndFeel.makeIcon(getClass(), "icons/DetailsView.gif"),
  653.         "FileChooser.listView", LookAndFeel.makeIcon(getClass(), "icons/ListView.gif"),
  654.  
  655.         "DirectoryPane.directoryIcon", LookAndFeel.makeIcon(getClass(), "icons/Directory.gif"),
  656.         "DirectoryPane.fileIcon", LookAndFeel.makeIcon(getClass(), "icons/File.gif"),
  657.         "DirectoryPane.computerIcon", LookAndFeel.makeIcon(getClass(), "icons/Computer.gif"),
  658.         "DirectoryPane.hardDriveIcon", LookAndFeel.makeIcon(getClass(), "icons/HardDrive.gif"),
  659.         "DirectoryPane.floppyDriveIcon", LookAndFeel.makeIcon(getClass(), "icons/FloppyDrive.gif"),
  660.  
  661.         "ProgressBar.font", dialogPlain12,
  662.         "ProgressBar.foreground",  table.get("textHighlight"), 
  663.         "ProgressBar.background", table.get("control"), 
  664.  
  665.         "OptionPane.font", dialogPlain12,
  666.         "OptionPane.background", table.get("control"),
  667.         "OptionPane.foreground", table.get("controlText"),
  668.         "OptionPane.border", optionPaneBorder,
  669.  
  670.         "OptionPane.errorIcon", LookAndFeel.makeIcon(getClass(), 
  671.                                                          "icons/Error.gif"),
  672.         "OptionPane.informationIcon", LookAndFeel.makeIcon(getClass(), 
  673.                                                                "icons/Inform.gif"),
  674.         "OptionPane.warningIcon", LookAndFeel.makeIcon(getClass(), 
  675.                                                            "icons/Warn.gif"),
  676.         "OptionPane.questionIcon", LookAndFeel.makeIcon(getClass(), 
  677.                                                             "icons/Question.gif"),
  678.  
  679.             "ColorChooser.font", dialogPlain12,
  680.             "ColorChooser.background", table.get("control"),
  681.             "ColorChooser.foreground", table.get("controlText"),
  682.             "ColorChooser.selectedColorBorder", selectedColorBorder,
  683.  
  684.             "InternalFrame.icon", LookAndFeel.makeIcon(getClass(),
  685.                                                        "icons/JavaCup.gif"),
  686.         "InternalFrame.border", internalFrameBorder,
  687.             "InternalFrame.titleFont", dialogBold12,
  688.  
  689.             // Default frame icons are undefined for Basic.
  690.             "InternalFrame.maximizeIcon", 
  691.                 BasicIconFactory.createEmptyFrameIcon(),
  692.             "InternalFrame.minimizeIcon", 
  693.                 BasicIconFactory.createEmptyFrameIcon(),
  694.             "InternalFrame.iconifyIcon", 
  695.                 BasicIconFactory.createEmptyFrameIcon(),
  696.             "InternalFrame.closeIcon", 
  697.                 BasicIconFactory.createEmptyFrameIcon(),
  698.  
  699.         "DesktopIcon.border", null
  700.     };
  701.  
  702.     table.putDefaults(defaults);
  703.     }
  704. }
  705.