OSDN Git Service

Imported GNU Classpath 0.20
[pf3gnuchains/gcc-fork.git] / libjava / classpath / javax / swing / plaf / metal / MetalLookAndFeel.java
1 /* MetalLookAndFeel.java
2    Copyright (C) 2002, 2005 Free Software Foundation, Inc.
3
4 This file is part of GNU Classpath.
5
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING.  If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 USA.
20
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library.  Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
25
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module.  An independent module is a module which is not derived from
33 or based on this library.  If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so.  If you do not wish to do so, delete this
36 exception statement from your version. */
37
38
39 package javax.swing.plaf.metal;
40
41 import java.awt.Color;
42 import java.awt.Font;
43
44 import javax.swing.LookAndFeel;
45 import javax.swing.UIDefaults;
46 import javax.swing.UIManager;
47 import javax.swing.plaf.BorderUIResource;
48 import javax.swing.plaf.ColorUIResource;
49 import javax.swing.plaf.FontUIResource;
50 import javax.swing.plaf.InsetsUIResource;
51 import javax.swing.plaf.BorderUIResource.LineBorderUIResource;
52 import javax.swing.plaf.basic.BasicLookAndFeel;
53
54
55 /**
56  * A custom look and feel that is designed to look similar across different
57  * operating systems.  To install this look and feel, add the following code 
58  * (or something similar) near the start of your application:</p>
59  * <pre>
60  * try
61  * {
62  * &nbsp;&nbsp;UIManager.setLookAndFeel(new MetalLookAndFeel());
63  * }
64  * catch (UnsupportedLookAndFeelException e)
65  * {
66  * &nbsp;&nbsp;e.printStackTrace();
67  * }</pre>
68  */
69 public class MetalLookAndFeel extends BasicLookAndFeel
70 {          
71   private static final long serialVersionUID = 6680646159193457980L;
72   
73   /** The current theme. */
74   private static MetalTheme theme;
75   
76   /** The look and feel defaults. */
77   private UIDefaults LAF_defaults;
78
79   /**
80    * Creates a new instance of the Metal look and feel.
81    */
82   public MetalLookAndFeel()
83   {
84     createDefaultTheme();
85   }
86
87   /**
88    * Sets the current theme to a new instance of {@link DefaultMetalTheme}.
89    */
90   protected void createDefaultTheme()
91   {
92     if (theme == null)
93       setCurrentTheme(new DefaultMetalTheme());
94   }
95
96   /**
97    * Returns <code>false</code> to indicate that this look and feel does not
98    * attempt to emulate the look and feel of native applications on the host
99    * platform.
100    * 
101    * @return <code>false</code>.
102    */
103   public boolean isNativeLookAndFeel()
104   {
105     return false;
106   }
107
108   /**
109    * Returns <code>true</code> to indicate that this look and feel is supported
110    * on all platforms.
111    * 
112    * @return <code>true</code>.
113    */
114   public boolean isSupportedLookAndFeel()
115   {
116     return true;
117   }
118
119   /**
120    * Returns a string describing the look and feel.  In this case, the method
121    * returns "Metal look and feel".
122    * 
123    * @return A string describing the look and feel.
124    */
125   public String getDescription()
126   {
127     return "The Java(tm) Look and Feel";
128   }
129
130   /**
131    * Returns the look and feel identifier.
132    * 
133    * @return "MetalLookAndFeel".
134    */
135   public String getID()
136   {
137     return "Metal";
138   }
139
140   /**
141    * Returns the look and feel name.
142    * 
143    * @return "MetalLookAndFeel".
144    */
145   public String getName()
146   {
147     return "Metal";
148   }
149
150   public UIDefaults getDefaults()
151   {
152     if (LAF_defaults == null)
153       {
154         LAF_defaults = super.getDefaults();
155
156         // add custom theme entries to the table
157         if (theme != null)
158           theme.addCustomEntriesToTable(LAF_defaults);
159       }
160     
161     // Returns the default values for this look and feel. 
162     return LAF_defaults;
163   }
164
165   /**
166    * Returns the accelerator foreground color from the installed theme.
167    * 
168    * @return The accelerator foreground color.
169    */
170   public static ColorUIResource getAcceleratorForeground()
171   {
172     if (theme != null)
173       return theme.getAcceleratorForeground();
174     return null;
175   }
176
177   /**
178    * Returns the accelerator selected foreground color from the installed 
179    * theme.
180    * 
181    * @return The accelerator selected foreground color.
182    */
183   public static ColorUIResource getAcceleratorSelectedForeground()
184   {
185     if (theme != null)
186       return theme.getAcceleratorSelectedForeground();
187     return null;
188   }
189
190   /**
191    * Returns the color black from the installed theme.
192    * 
193    * @return The color black.
194    */
195   public static ColorUIResource getBlack()
196   {
197     if (theme != null)
198       return theme.getBlack();
199     return null;
200   }
201
202   /**
203    * Returns the control color from the installed theme.
204    * 
205    * @return The control color.
206    */
207   public static ColorUIResource getControl()
208   {
209     if (theme != null)
210       return theme.getControl();
211     return null;
212   }
213
214   /**
215    * Returns the color used for dark shadows on controls, from the installed
216    * theme.
217    * 
218    * @return The color used for dark shadows on controls.
219    */
220   public static ColorUIResource getControlDarkShadow()
221   {
222     if (theme != null)
223       return theme.getControlDarkShadow();
224     return null;
225   }
226
227   /**
228    * Returns the color used for disabled controls, from the installed theme.
229    * 
230    * @return The color used for disabled controls.
231    */
232   public static ColorUIResource getControlDisabled()
233   {
234     if (theme != null)
235       return theme.getControlDisabled();
236     return null;
237   }
238
239   /**
240    * Returns the color used to draw highlights for controls, from the installed
241    * theme.
242    * 
243    * @return The color used to draw highlights for controls.
244    */
245   public static ColorUIResource getControlHighlight()
246   {
247     if (theme != null)
248       return theme.getControlHighlight();
249     return null;
250   }
251
252   /**
253    * Returns the color used to display control info, from the installed 
254    * theme.
255    * 
256    * @return The color used to display control info.
257    */
258   public static ColorUIResource getControlInfo()
259   {
260     if (theme != null)
261       return theme.getControlInfo();
262     return null;
263   }
264
265   /**
266    * Returns the color used to draw shadows for controls, from the installed
267    * theme.
268    * 
269    * @return The color used to draw shadows for controls.
270    */
271   public static ColorUIResource getControlShadow()
272   {
273     if (theme != null)
274       return theme.getControlShadow();
275     return null;
276   }
277
278   /**
279    * Returns the color used for text on controls, from the installed theme.
280    * 
281    * @return The color used for text on controls.
282    */
283   public static ColorUIResource getControlTextColor()
284   {
285     if (theme != null)
286       return theme.getControlTextColor();
287     return null;
288   }
289
290   /**
291    * Returns the font used for text on controls, from the installed theme.
292    * 
293    * @return The font used for text on controls.
294    */
295   public static FontUIResource getControlTextFont()
296   {
297     if (theme != null)
298       return theme.getControlTextFont();
299     return null;
300   }
301
302   /**
303    * Returns the color used for the desktop background, from the installed 
304    * theme.
305    * 
306    * @return The color used for the desktop background.
307    */
308   public static ColorUIResource getDesktopColor()
309   {
310     if (theme != null)
311       return theme.getDesktopColor();
312     return null;
313   }
314
315   /**
316    * Returns the color used to draw focus highlights, from the installed 
317    * theme.
318    * 
319    * @return The color used to draw focus highlights.
320    */
321   public static ColorUIResource getFocusColor()
322   {
323     if (theme != null)
324       return theme.getFocusColor();
325     return null;
326   }
327
328   /**
329    * Returns the color used to draw highlighted text, from the installed
330    * theme.
331    * 
332    * @return The color used to draw highlighted text.
333    */
334   public static ColorUIResource getHighlightedTextColor()
335   {
336     if (theme != null)
337       return theme.getHighlightedTextColor();
338     return null;
339   }
340
341   /**
342    * Returns the color used to draw text on inactive controls, from the
343    * installed theme.
344    * 
345    * @return The color used to draw text on inactive controls.
346    */
347   public static ColorUIResource getInactiveControlTextColor()
348   {
349     if (theme != null)
350       return theme.getInactiveControlTextColor();
351     return null;
352   }
353
354   /**
355    * Returns the color used to draw inactive system text, from the installed
356    * theme.
357    * 
358    * @return The color used to draw inactive system text.
359    */
360   public static ColorUIResource getInactiveSystemTextColor()
361   {
362     if (theme != null)
363       return theme.getInactiveSystemTextColor();
364     return null;
365   }
366
367   /**
368    * Returns the background color for menu items, from the installed theme.
369    * 
370    * @return The background color for menu items.
371    * 
372    * @see #getMenuSelectedBackground()
373    */
374   public static ColorUIResource getMenuBackground()
375   {
376     if (theme != null)
377       return theme.getMenuBackground();
378     return null;
379   }
380
381   /**
382    * Returns the foreground color for disabled menu items, from the installed
383    * theme.
384    * 
385    * @return The foreground color for disabled menu items.
386    * 
387    * @see #getMenuForeground()
388    */
389   public static ColorUIResource getMenuDisabledForeground()
390   {
391     if (theme != null)
392       return theme.getMenuDisabledForeground();
393     return null;
394   }
395
396   /**
397    * Returns the foreground color for menu items, from the installed theme.
398    * 
399    * @return The foreground color for menu items.
400    * 
401    * @see #getMenuDisabledForeground()
402    * @see #getMenuSelectedForeground()
403    */
404   public static ColorUIResource getMenuForeground()
405   {
406     if (theme != null)
407       return theme.getMenuForeground();
408     return null;
409   }
410
411   /**
412    * Returns the background color for selected menu items, from the installed
413    * theme.
414    * 
415    * @return The background color for selected menu items.
416    * 
417    * @see #getMenuBackground()
418    */
419   public static ColorUIResource getMenuSelectedBackground()
420   {
421     if (theme != null)
422       return theme.getMenuSelectedBackground();
423     return null;
424   }
425
426   /**
427    * Returns the foreground color for selected menu items, from the installed
428    * theme.
429    * 
430    * @return The foreground color for selected menu items.
431    * 
432    * @see #getMenuForeground()
433    */
434   public static ColorUIResource getMenuSelectedForeground()
435   {
436     if (theme != null)
437       return theme.getMenuSelectedForeground();
438     return null;
439   }
440
441   /**
442    * Returns the font used for text in menus, from the installed theme.
443    * 
444    * @return The font used for text in menus.
445    */
446   public static FontUIResource getMenuTextFont()
447   {
448     if (theme != null)
449       return theme.getMenuTextFont();
450     return null;
451   }
452
453   /**
454    * Returns the primary color for controls, from the installed theme.
455    * 
456    * @return The primary color for controls.
457    */
458   public static ColorUIResource getPrimaryControl()
459   {
460     if (theme != null)
461       return theme.getPrimaryControl();
462     return null;
463   }
464
465   /**
466    * Returns the primary color for the dark shadow on controls, from the 
467    * installed theme.
468    * 
469    * @return The primary color for the dark shadow on controls.
470    */
471   public static ColorUIResource getPrimaryControlDarkShadow()
472   {
473     if (theme != null)
474       return theme.getPrimaryControlDarkShadow();
475     return null;
476   }
477
478   /**
479    * Returns the primary color for the highlight on controls, from the 
480    * installed theme.
481    * 
482    * @return The primary color for the highlight on controls.
483    */
484   public static ColorUIResource getPrimaryControlHighlight()
485   {
486     if (theme != null)
487       return theme.getPrimaryControlHighlight();
488     return null;
489   }
490
491   /**
492    * Returns the primary color for the information on controls, from the 
493    * installed theme.
494    * 
495    * @return The primary color for the information on controls.
496    */
497   public static ColorUIResource getPrimaryControlInfo()
498   {
499     if (theme != null)
500       return theme.getPrimaryControlInfo();
501     return null;
502   }
503
504   /**
505    * Returns the primary color for the shadow on controls, from the installed
506    * theme.
507    * 
508    * @return The primary color for the shadow on controls.
509    */
510   public static ColorUIResource getPrimaryControlShadow()
511   {
512     if (theme != null)
513       return theme.getPrimaryControlShadow();
514     return null;
515   }
516
517   /**
518    * Returns the background color for separators, from the installed theme.
519    * 
520    * @return The background color for separators.
521    */
522   public static ColorUIResource getSeparatorBackground()
523   {
524     if (theme != null)
525       return theme.getSeparatorBackground();
526     return null;
527   }
528
529   /**
530    * Returns the foreground color for separators, from the installed theme.
531    * 
532    * @return The foreground color for separators.
533    */
534   public static ColorUIResource getSeparatorForeground()
535   {
536     if (theme != null)
537       return theme.getSeparatorForeground();
538     return null;
539   }
540
541   /**
542    * Returns the font used for sub text, from the installed theme.
543    * 
544    * @return The font used for sub text.
545    */
546   public static FontUIResource getSubTextFont()
547   {
548     if (theme != null)
549       return theme.getSubTextFont();
550     return null;
551   }
552
553   /**
554    * Returns the color used for system text, from the installed theme.
555    * 
556    * @return The color used for system text.
557    */
558   public static ColorUIResource getSystemTextColor()
559   {
560     if (theme != null)
561       return theme.getSystemTextColor();
562     return null;
563   }
564
565   /**
566    * Returns the font used for system text, from the installed theme.
567    * 
568    * @return The font used for system text.
569    */
570   public static FontUIResource getSystemTextFont()
571   {
572     if (theme != null)
573       return theme.getSystemTextFont();
574     return null;
575   }
576
577   /**
578    * Returns the color used to highlight text, from the installed theme.
579    * 
580    * @return The color used to highlight text.
581    */
582   public static ColorUIResource getTextHighlightColor()
583   {
584     if (theme != null)
585       return theme.getTextHighlightColor();
586     return null;
587   }
588
589   /**
590    * Returns the color used to display user text, from the installed theme.
591    * 
592    * @return The color used to display user text.
593    */
594   public static ColorUIResource getUserTextColor()
595   {
596     if (theme != null)
597       return theme.getUserTextColor();
598     return null;
599   }
600
601   /**
602    * Returns the font used for user text, obtained from the current theme.
603    * 
604    * @return The font used for user text.
605    */
606   public static FontUIResource getUserTextFont()
607   {
608     if (theme != null)
609       return theme.getUserTextFont();
610     return null;
611   }
612
613   /**
614    * Returns the color used for white, from the installed theme.
615    * 
616    * @return The color used for white.
617    */
618   public static ColorUIResource getWhite()
619   {
620     if (theme != null)
621       return theme.getWhite();
622     return null;
623   }
624
625   /**
626    * Returns the window background color, from the installed theme.
627    * 
628    * @return The window background color.
629    */
630   public static ColorUIResource getWindowBackground()
631   {
632     if (theme != null)
633       return theme.getWindowBackground();
634     return null;
635   }
636
637   /**
638    * Returns the window title background color, from the installed theme.
639    * 
640    * @return The window title background color.
641    */
642   public static ColorUIResource getWindowTitleBackground()
643   {
644     if (theme != null)
645       return theme.getWindowTitleBackground();
646     return null;
647   }
648
649   /**
650    * Returns the window title font from the current theme.
651    * 
652    * @return The window title font.
653    * 
654    * @see MetalTheme
655    */
656   public static FontUIResource getWindowTitleFont()
657   {
658     if (theme != null)
659       return theme.getWindowTitleFont();
660     return null;
661   }
662
663   /**
664    * Returns the window title foreground color, from the installed theme.
665    * 
666    * @return The window title foreground color.
667    */
668   public static ColorUIResource getWindowTitleForeground()
669   {
670     if (theme != null)
671       return theme.getWindowTitleForeground();
672     return null;
673   }
674
675   /**
676    * Returns the background color for an inactive window title, from the 
677    * installed theme.
678    * 
679    * @return The background color for an inactive window title.
680    */
681   public static ColorUIResource getWindowTitleInactiveBackground()
682   {
683     if (theme != null)
684       return theme.getWindowTitleInactiveBackground();
685     return null;
686   }
687
688   /**
689    * Returns the foreground color for an inactive window title, from the 
690    * installed theme.
691    * 
692    * @return The foreground color for an inactive window title.
693    */
694   public static ColorUIResource getWindowTitleInactiveForeground()
695   {
696     if (theme != null)
697       return theme.getWindowTitleInactiveForeground();
698     return null;
699   }
700
701   /**
702    * Sets the current theme for the look and feel.  Note that the theme must be 
703    * set <em>before</em> the look and feel is installed.  To change the theme 
704    * for an already running application that is using the 
705    * {@link MetalLookAndFeel}, first set the theme with this method, then 
706    * create a new instance of {@link MetalLookAndFeel} and install it in the 
707    * usual way (see {@link UIManager#setLookAndFeel(LookAndFeel)}).
708    * 
709    * @param theme  the theme (<code>null</code> not permitted).
710    * 
711    * @throws NullPointerException if <code>theme</code> is <code>null</code>.
712    */
713   public static void setCurrentTheme(MetalTheme theme)
714   {
715     if (theme == null)
716       throw new NullPointerException("Null 'theme' not permitted.");
717     MetalLookAndFeel.theme = theme;
718   }
719
720   /**
721    * Sets the ComponentUI classes for all Swing components to the Metal
722    * implementations.
723    *
724    * In particular this sets the following keys:
725    *
726    * <table>
727    * <tr>
728    * <th>Key</th><th>Value</th>
729    * </tr><tr>
730    * <td>ButtonUI</td><td>{@link MetalButtonUI}</td>
731    * </tr><tr>
732    * <td>CheckBoxUI</td><td>{@link MetalCheckBoxUI}</td>
733    * </tr><tr>
734    * <td>ComboBoxUI</td><td>{@link MetalComboBoxUI}</td>
735    * </tr><tr>
736    * <td>DesktopIconUI</td><td>{@link MetalDesktopIconUI}</td>
737    * </tr><tr>
738    * <td>InternalFrameUI</td><td>{@link MetalInternalFrameUI}</td>
739    * </tr><tr>
740    * <td>LabelUI</td><td>{@link MetalLabelUI}</td>
741    * </tr><tr>
742    * <td>PopupMenuSeparatorUI</td><td>{@link MetalPopupMenuSeparatorUI}</td>
743    * </tr><tr>
744    * <td>ProgressBarUI</td><td>{@link MetalProgressBarUI}</td>
745    * </tr><tr>
746    * <td>RadioButtonUI</td><td>{@link MetalRadioButtonUI}</td>
747    * </tr><tr>
748    * <td>RootPaneUI</td><td>{@link MetalRootPaneUI}</td>
749    * </tr><tr>
750    * <td>ScrollBarUI</td><td>{@link MetalScrollBarUI}</td>
751    * </tr><tr>
752    * <td>ScrollPaneUI</td><td>{@link MetalScrollPaneUI}</td>
753    * </tr><tr>
754    * <td>SeparatorUI</td><td>{@link MetalSeparatorUI}</td>
755    * </tr><tr>
756    * <td>SliderUI</td><td>{@link MetalSliderUI}</td>
757    * </tr><tr>
758    * <td>SplitPaneUI</td><td>{@link MetalSplitPaneUI}</td>
759    * </tr><tr>
760    * <td>TabbedPaneUI</td><td>{@link MetalTabbedPaneUI}</td>
761    * </tr><tr>
762    * <td>TextFieldUI</td><td>{@link MetalTextFieldUI}</td>
763    * </tr><tr>
764    * <td>ToggleButtonUI</td><td>{@link MetalToggleButtonUI}</td>
765    * </tr><tr>
766    * <td>ToolBarUI</td><td>{@link MetalToolBarUI}</td>
767    * </tr><tr>
768    * <td>ToolTipUI</td><td>{@link MetalToolTipUI}</td>
769    * </tr><tr>
770    * <td>TreeUI</td><td>{@link MetalTreeUI}</td>
771    * </tr><tr>
772    * </table>
773    *
774    * @param defaults the UIDefaults where the class defaults are added
775    */
776   protected void initClassDefaults(UIDefaults defaults)
777   {
778     super.initClassDefaults(defaults);
779
780     // Variables
781     Object[] uiDefaults;
782     // Initialize Class Defaults
783     uiDefaults = new Object[] {
784       "ButtonUI", "javax.swing.plaf.metal.MetalButtonUI",
785       "CheckBoxUI", "javax.swing.plaf.metal.MetalCheckBoxUI",
786       "ComboBoxUI", "javax.swing.plaf.metal.MetalComboBoxUI",
787       "DesktopIconUI", "javax.swing.plaf.metal.MetalDesktopIconUI",
788       "FileChooserUI", "javax.swing.plaf.metal.MetalFileChooserUI",
789       "InternalFrameUI", "javax.swing.plaf.metal.MetalInternalFrameUI",
790       "LabelUI", "javax.swing.plaf.metal.MetalLabelUI",
791       "MenuBarUI", "javax.swing.plaf.metal.MetalMenuBarUI",
792       "PopupMenuSeparatorUI",
793       "javax.swing.plaf.metal.MetalPopupMenuSeparatorUI",
794       "ProgressBarUI", "javax.swing.plaf.metal.MetalProgressBarUI",
795       "RadioButtonUI", "javax.swing.plaf.metal.MetalRadioButtonUI",
796       "RootPaneUI", "javax.swing.plaf.metal.MetalRootPaneUI",
797       "ScrollBarUI", "javax.swing.plaf.metal.MetalScrollBarUI",
798       "ScrollPaneUI", "javax.swing.plaf.metal.MetalScrollPaneUI",
799       "SeparatorUI", "javax.swing.plaf.metal.MetalSeparatorUI",
800       "SliderUI", "javax.swing.plaf.metal.MetalSliderUI",
801       "SplitPaneUI", "javax.swing.plaf.metal.MetalSplitPaneUI",
802       "TabbedPaneUI", "javax.swing.plaf.metal.MetalTabbedPaneUI",
803       "TextFieldUI", "javax.swing.plaf.metal.MetalTextFieldUI",
804       "ToggleButtonUI", "javax.swing.plaf.metal.MetalToggleButtonUI",
805       "ToolBarUI", "javax.swing.plaf.metal.MetalToolBarUI",
806       "ToolTipUI", "javax.swing.plaf.metal.MetalToolTipUI",
807       "TreeUI", "javax.swing.plaf.metal.MetalTreeUI",
808     };
809     // Add Class Defaults to UI Defaults table
810     defaults.putDefaults(uiDefaults);
811   }
812
813   /**
814    * Initializes the component defaults for the Metal Look &amp; Feel.
815    *
816    * In particular this sets the following keys (the colors are given
817    * as RGB hex values):
818    *
819    * <table>
820    * <tr>
821    * <th>Key</th><th>Value</th>
822    * </tr><tr>
823    * <td>Button.background</td><td>0xcccccc</td>
824    * </tr><tr>
825    * <td>Button.border</td><td>{@link MetalBorders#getButtonBorder()}</td>
826    * </tr><tr>
827    * <td>Button.font</td><td>{@link #getControlTextFont}</td>
828    * </tr><tr>
829    * <td>Button.margin</td><td><code>new java.awt.Insets(2, 14, 2, 14)</code>
830    * </td>
831    * </tr><tr>
832    * <td>CheckBox.background</td><td>0xcccccc</td>
833    * </tr><tr>
834    * <td>CheckBoxMenuItem.background</td><td>0xcccccc</td>
835    * </tr><tr>
836    * <td>ToolBar.background</td><td>0xcccccc</td>
837    * </tr><tr>
838    * <td>Panel.background</td><td>0xcccccc</td>
839    * </tr><tr>
840    * <td>Slider.background</td><td>0xcccccc</td>
841    * </tr><tr>
842    * <td>OptionPane.background</td><td>0xcccccc</td>
843    * </tr><tr>
844    * <td>ProgressBar.background</td><td>0xcccccc</td>
845    * </tr><tr>
846    * <td>TabbedPane.background</td><td>0xcccccc</td>
847    * </tr><tr>
848    * <td>Label.background</td><td>0xcccccc</td>
849    * </tr><tr>
850    * <td>Label.font</td><td>{@link #getControlTextFont}</td>
851    * </tr><tr>
852    * <td>Menu.background</td><td>0xcccccc</td>
853    * </tr><tr>
854    * <td>MenuBar.background</td><td>0xcccccc</td>
855    * </tr><tr>
856    * <td>MenuItem.background</td><td>0xcccccc</td>
857    * </tr><tr>
858    * <td>ScrollBar.background</td><td>0xcccccc</td>
859    * </tr><tr>
860    * <td>PopupMenu.border</td>
861    * <td><code>new javax.swing.plaf.metal.MetalBorders.PopupMenuBorder()</td>
862    * </tr><tr>
863    * </table>
864    *
865    * @param defaults the UIDefaults instance to which the values are added
866    */
867   protected void initComponentDefaults(UIDefaults defaults)
868   {
869     super.initComponentDefaults(defaults);
870     Object[] myDefaults = new Object[] {
871       "Button.background", getControl(),
872       "Button.border", MetalBorders.getButtonBorder(),
873       "Button.darkShadow", getControlDarkShadow(),
874       "Button.disabledText", getInactiveControlTextColor(),
875       "Button.focus", getFocusColor(),
876       "Button.font", getControlTextFont(),
877       "Button.foreground", getControlTextColor(),
878       "Button.highlight", getControlHighlight(),
879       "Button.light", getControlHighlight(),
880       "Button.margin", new InsetsUIResource(2, 14, 2, 14),
881       "Button.select", getControlShadow(),
882       "Button.shadow", getControlShadow(),
883
884       "CheckBox.background", getControl(),
885       "CheckBox.border", MetalBorders.getButtonBorder(),
886       "CheckBox.disabledText", getInactiveControlTextColor(),
887       "CheckBox.focus", getFocusColor(),
888       "CheckBox.font", new FontUIResource("Dialog", Font.BOLD, 12),
889       "CheckBox.foreground", getControlTextColor(),
890       "CheckBox.icon",
891       new UIDefaults.ProxyLazyValue
892           ("javax.swing.plaf.metal.MetalCheckBoxIcon"),
893       "CheckBox.checkIcon",
894       new UIDefaults.ProxyLazyValue
895       ("javax.swing.plaf.metal.MetalCheckBoxIcon"),
896       "Checkbox.select", getControlShadow(),
897
898       "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10),
899       "CheckBoxMenuItem.acceleratorForeground", getAcceleratorForeground(),
900       "CheckBoxMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(),
901       "CheckBoxMenuItem.background", getMenuBackground(),
902       "CheckBoxMenuItem.borderPainted", new Boolean(true),
903       "CheckBoxMenuItem.commandSound", "sounds/MenuItemCommand.wav",
904       "CheckBoxMenuItem.checkIcon", MetalIconFactory.getCheckBoxMenuItemIcon(),
905       "CheckBoxMenuItem.disabledForeground", getMenuDisabledForeground(),
906       "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.BOLD, 12),
907       "CheckBoxMenuItem.foreground", getMenuForeground(),
908       "CheckBoxMenuItem.selectionBackground", getMenuSelectedBackground(),
909       "CheckBoxMenuItem.selectionForeground", getMenuSelectedForeground(),
910
911       "ColorChooser.background", getControl(),
912       "ColorChooser.foreground", getControlTextColor(),
913       "ColorChooser.rgbBlueMnemonic", new Integer(0),
914       "ColorChooser.rgbGreenMnemonic", new Integer(0),
915       "ColorChooser.rgbRedMnemonic", new Integer(0),
916       "ColorChooser.swatchesDefaultRecentColor", getControl(),
917
918       "ComboBox.background", getControl(),
919       "ComboBox.buttonBackground", getControl(),
920       "ComboBox.buttonDarkShadow", getControlDarkShadow(),
921       "ComboBox.buttonHighlight", getControlHighlight(),
922       "ComboBox.buttonShadow", getControlShadow(),
923       "ComboBox.disabledBackground", getControl(),
924       "ComboBox.disabledForeground", getInactiveSystemTextColor(),
925       "ComboBox.font", new FontUIResource("Dialog", Font.BOLD, 12),
926       "ComboBox.foreground", getControlTextColor(),
927       "ComboBox.selectionBackground", getPrimaryControlShadow(),
928       "ComboBox.selectionForeground", getControlTextColor(),
929
930       "Desktop.background", getDesktopColor(),
931
932       "DesktopIcon.background", getControl(),
933       "DesktopIcon.foreground", getControlTextColor(),
934       "DesktopIcon.width", new Integer(160),
935       "DesktopIcon.border", MetalBorders.getDesktopIconBorder(),
936
937       "EditorPane.background", getWindowBackground(),
938       "EditorPane.caretForeground", getUserTextColor(),
939       "EditorPane.font", new FontUIResource("Dialog", Font.BOLD, 12),
940       "EditorPane.foreground",  getUserTextColor(),
941       "EditorPane.inactiveForeground",  getInactiveSystemTextColor(),
942       "EditorPane.selectionBackground", getTextHighlightColor(),
943       "EditorPane.selectionForeground", getHighlightedTextColor(),
944       
945       "FormattedTextField.background", getWindowBackground(),
946       "FormattedTextField.border",
947       new BorderUIResource(MetalBorders.getTextFieldBorder()),
948       "FormattedTextField.caretForeground", getUserTextColor(),
949       "FormattedTextField.font", new FontUIResource("Dialog", Font.PLAIN, 12),
950       "FormattedTextField.foreground",  getUserTextColor(),
951       "FormattedTextField.inactiveBackground",  getControl(),
952       "FormattedTextField.inactiveForeground",  getInactiveSystemTextColor(),
953       "FormattedTextField.selectionBackground", getTextHighlightColor(),
954       "FormattedTextField.selectionForeground", getHighlightedTextColor(),
955
956       "FileChooser.upFolderIcon", 
957           MetalIconFactory.getFileChooserUpFolderIcon(),
958       "FileChooser.listViewIcon", 
959           MetalIconFactory.getFileChooserListViewIcon(),
960       "FileChooser.newFolderIcon", 
961           MetalIconFactory.getFileChooserNewFolderIcon(),
962       "FileChooser.homeFolderIcon", 
963           MetalIconFactory.getFileChooserHomeFolderIcon(),
964       "FileChooser.detailsViewIcon", 
965           MetalIconFactory.getFileChooserDetailViewIcon(),
966       "FileChooser.fileNameLabelMnemonic", new Integer(78),
967       "FileChooser.filesOfTypeLabelMnemonic",new Integer(84),
968       "FileChooser.lookInLabelMnemonic", new Integer(73),
969       "FileView.computerIcon", MetalIconFactory.getTreeComputerIcon(),
970       "FileView.directoryIcon", MetalIconFactory.getTreeFolderIcon(),
971       "FileView.fileIcon", MetalIconFactory.getTreeLeafIcon(),
972       "FileView.floppyDriveIcon", MetalIconFactory.getTreeFloppyDriveIcon(),
973       "FileView.hardDriveIcon", MetalIconFactory.getTreeHardDriveIcon(),
974
975       "InternalFrame.activeTitleBackground", getWindowTitleBackground(),
976       "InternalFrame.activeTitleForeground", getWindowTitleForeground(),
977       "InternalFrame.border", new MetalBorders.InternalFrameBorder(),
978       "InternalFrame.borderColor", getControl(),
979       "InternalFrame.borderDarkShadow", getControlDarkShadow(),
980       "InternalFrame.borderHighlight", getControlHighlight(),
981       "InternalFrame.borderLight", getControlHighlight(),
982       "InternalFrame.borderShadow", getControlShadow(),
983       "InternalFrame.icon", MetalIconFactory.getInternalFrameDefaultMenuIcon(),
984       "InternalFrame.closeIcon", 
985         MetalIconFactory.getInternalFrameCloseIcon(16),
986       "InternalFrame.closeSound", "sounds/FrameClose.wav",
987       "InternalFrame.inactiveTitleBackground", getWindowTitleInactiveBackground(),
988       "InternalFrame.inactiveTitleForeground", getWindowTitleInactiveForeground(),
989       "InternalFrame.maximizeIcon", 
990         MetalIconFactory.getInternalFrameMaximizeIcon(16),
991       "InternalFrame.maximizeSound", "sounds/FrameMaximize.wav",
992       "InternalFrame.iconifyIcon", 
993         MetalIconFactory.getInternalFrameMinimizeIcon(16),
994       "InternalFrame.minimizeSound", "sounds/FrameMinimize.wav",
995       "InternalFrame.paletteBorder", new MetalBorders.PaletteBorder(),
996       "InternalFrame.paletteCloseIcon", new MetalIconFactory.PaletteCloseIcon(),
997       "InternalFrame.paletteTitleHeight", new Integer(11),
998       "InternalFrame.restoreDownSound", "sounds/FrameRestoreDown.wav",
999       "InternalFrame.restoreUpSound", "sounds/FrameRestoreUp.wav",
1000
1001       "Label.background", getControl(),
1002       "Label.disabledForeground", getInactiveSystemTextColor(),
1003       "Label.disabledShadow", getControlShadow(),
1004       "Label.font", getControlTextFont(),
1005       "Label.foreground", getSystemTextColor(),
1006
1007       "List.font", getControlTextFont(),
1008       "List.background", getWindowBackground(),
1009       "List.foreground", getUserTextColor(),
1010       "List.selectionBackground", getTextHighlightColor(),
1011       "List.selectionForeground", getHighlightedTextColor(),
1012       "List.focusCellHighlightBorder", 
1013         new LineBorderUIResource(MetalLookAndFeel.getFocusColor()),
1014
1015       "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10),
1016       "Menu.acceleratorForeground", getAcceleratorForeground(),
1017       "Menu.acceleratorSelectionForeground", getAcceleratorSelectedForeground(),
1018       "Menu.arrowIcon", MetalIconFactory.getMenuArrowIcon(),
1019       "Menu.background", getMenuBackground(),
1020       "Menu.border", new MetalBorders.MenuItemBorder(),
1021       "Menu.borderPainted", Boolean.TRUE,
1022       "MenuItem.commandSound", "sounds/MenuItemCommand.wav",
1023       "Menu.disabledForeground", getMenuDisabledForeground(),
1024       "Menu.font", getControlTextFont(),
1025       "Menu.foreground", getMenuForeground(),
1026       "Menu.selectionBackground", getMenuSelectedBackground(),
1027       "Menu.selectionForeground", getMenuSelectedForeground(),
1028       "Menu.submenuPopupOffsetX", new Integer(-4),
1029       "Menu.submenuPopupOffsetY", new Integer(-3),
1030
1031       "MenuBar.background", getMenuBackground(),
1032       "MenuBar.border", new MetalBorders.MenuBarBorder(),
1033       "MenuBar.font", getControlTextFont(),
1034       "MenuBar.foreground", getMenuForeground(),
1035       "MenuBar.highlight", getControlHighlight(),
1036       "MenuBar.shadow", getControlShadow(),
1037
1038       "MenuItem.acceleratorDelimiter", "-",
1039       "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10),
1040       "MenuItem.acceleratorForeground", getAcceleratorForeground(),
1041       "MenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(),
1042       "MenuItem.arrowIcon", MetalIconFactory.getMenuItemArrowIcon(),
1043       "MenuItem.background", getMenuBackground(),
1044       "MenuItem.border", new MetalBorders.MenuItemBorder(),
1045       "MenuItem.borderPainted", Boolean.TRUE,
1046       "MenuItem.disabledForeground", getMenuDisabledForeground(),
1047       "MenuItem.font", getControlTextFont(),
1048       "MenuItem.foreground", getMenuForeground(),
1049       "MenuItem.selectionBackground", getMenuSelectedBackground(),
1050       "MenuItem.selectionForeground", getMenuSelectedForeground(),
1051
1052       "OptionPane.background", getControl(),
1053       "OptionPane.errorSound", "sounds/OptionPaneError.wav",
1054       "OptionPane.informationSound", "sounds/OptionPaneInformation.wav",
1055       "OptionPane.questionSound", "sounds/OptionPaneQuestion.wav",
1056       "OptionPane.warningSound", "sounds/OptionPaneWarning.wav",
1057       "OptionPane.errorDialog.border.background", new ColorUIResource(153, 51, 51), 
1058       "OptionPane.errorDialog.titlePane.background", new ColorUIResource(255, 153, 153),
1059       "OptionPane.errorDialog.titlePane.foreground", new ColorUIResource(51, 0, 0),
1060       "OptionPane.errorDialog.titlePane.shadow", new ColorUIResource(204, 102, 102),
1061       "OptionPane.foreground", getControlTextColor(),
1062       "OptionPane.messageForeground", getControlTextColor(),
1063       "OptionPane.questionDialog.border.background", new ColorUIResource(51, 102, 51),
1064       "OptionPane.questionDialog.titlePane.background", new ColorUIResource(153, 204, 153),
1065       "OptionPane.questionDialog.titlePane.foreground", new ColorUIResource(0, 51, 0),
1066       "OptionPane.questionDialog.titlePane.shadow", new ColorUIResource(102, 153, 102),
1067       "OptionPane.warningDialog.border.background", new ColorUIResource(153, 102, 51),
1068       "OptionPane.warningDialog.titlePane.background", new ColorUIResource(255, 204, 153),
1069       "OptionPane.warningDialog.titlePane.foreground", new ColorUIResource(102, 51, 0),
1070       "OptionPane.warningDialog.titlePane.shadow", new ColorUIResource(204, 153, 102),
1071
1072       "Panel.background", getControl(),
1073       "Panel.foreground", getUserTextColor(),
1074
1075       "PasswordField.background", getWindowBackground(),
1076       "PasswordField.border",
1077       new BorderUIResource(MetalBorders.getTextFieldBorder()),
1078       "PasswordField.caretForeground", getUserTextColor(),
1079       "PasswordField.foreground", getUserTextColor(),
1080       "PasswordField.font", new FontUIResource("Dialog", Font.PLAIN, 12),
1081       "PasswordField.inactiveBackground", getControl(),
1082       "PasswordField.inactiveForeground", getInactiveSystemTextColor(),
1083       "PasswordField.selectionBackground", getTextHighlightColor(),
1084       "PasswordField.selectionForeground", getHighlightedTextColor(),
1085
1086       "PopupMenu.background", getMenuBackground(),
1087       "PopupMenu.border", new MetalBorders.PopupMenuBorder(),
1088       "PopupMenu.font", new FontUIResource("Dialog", Font.BOLD, 12),
1089       "PopupMenu.foreground", getMenuForeground(),
1090       "PopupMenu.popupSound", "sounds/PopupMenuPopup.wav",
1091
1092       "ProgressBar.background", getControl(),
1093       "ProgressBar.border", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1),
1094       "ProgressBar.font", new FontUIResource("Dialog", Font.BOLD, 12),
1095       "ProgressBar.foreground", getPrimaryControlShadow(),
1096       "ProgressBar.selectionBackground", getPrimaryControlDarkShadow(),
1097       "ProgressBar.selectionForeground", getControl(),
1098
1099       "RadioButton.background", getControl(),
1100       "RadioButton.darkShadow", getControlDarkShadow(),
1101       "RadioButton.disabledText", getInactiveControlTextColor(),
1102       "RadioButton.icon",
1103       new UIDefaults.LazyValue()
1104       {
1105         public Object createValue(UIDefaults def)
1106           {
1107             return MetalIconFactory.getRadioButtonIcon();
1108           }
1109       },
1110       "RadioButton.focus", MetalLookAndFeel.getFocusColor(),
1111       "RadioButton.font", MetalLookAndFeel.getControlTextFont(),
1112       "RadioButton.foreground", getControlTextColor(),
1113       "RadioButton.highlight", getControlHighlight(),
1114       "RadioButton.light", getControlHighlight(),
1115       "RadioButton.select", getControlShadow(),
1116       "RadioButton.shadow", getControlShadow(),
1117
1118       "RadioButtonMenuItem.acceleratorFont", new Font("Dialog", Font.PLAIN, 10),
1119       "RadioButtonMenuItem.acceleratorForeground", getAcceleratorForeground(),
1120       "RadioButtonMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(),
1121       "RadioButtonMenuItem.background", getMenuBackground(),
1122       "RadioButtonMenuItem.border", new MetalBorders.MenuItemBorder(),
1123       "RadioButtonMenuItem.borderPainted", Boolean.TRUE,
1124       "RadioButtonMenuItem.checkIcon", 
1125         MetalIconFactory.getRadioButtonMenuItemIcon(),
1126       "RadioButtonMenuItem.commandSound", "sounds/MenuItemCommand.wav",
1127       "RadioButtonMenuItem.disabledForeground", getMenuDisabledForeground(),
1128       "RadioButtonMenuItem.font", MetalLookAndFeel.getControlTextFont(),
1129       "RadioButtonMenuItem.foreground", getMenuForeground(),
1130       "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2),
1131       "RadioButtonMenuItem.selectionBackground", 
1132         MetalLookAndFeel.getMenuSelectedBackground(),
1133       "RadioButtonMenuItem.selectionForeground", 
1134         MetalLookAndFeel.getMenuSelectedForeground(),
1135
1136       "ScrollBar.allowsAbsolutePositioning", Boolean.TRUE,
1137       "ScrollBar.background", getControl(),
1138       "ScrollBar.darkShadow", getControlDarkShadow(),
1139       "ScrollBar.foreground", getControl(),
1140       "ScrollBar.highlight", getControlHighlight(),
1141       "ScrollBar.shadow", getControlShadow(),
1142       "ScrollBar.thumb", getPrimaryControlShadow(),
1143       "ScrollBar.thumbDarkShadow", getControlDarkShadow(),
1144       "ScrollBar.thumbHighlight", getPrimaryControl(),
1145       "ScrollBar.thumbShadow", getPrimaryControlDarkShadow(),
1146       "ScrollBar.track", getControl(),
1147       "ScrollBar.trackHighlight", getControlDarkShadow(),
1148       "ScrollBar.width", new Integer(17),
1149
1150       "ScrollPane.background", getControl(),
1151       "ScrollPane.border", new MetalBorders.ScrollPaneBorder(),
1152       "ScrollPane.foreground", getControlTextColor(),
1153
1154       "Separator.background", getSeparatorBackground(),
1155       "Separator.foreground", getSeparatorForeground(),
1156       "Separator.highlight", getControlHighlight(),
1157       "Separator.shadow", getControlShadow(),
1158
1159       "Slider.background", getControl(),
1160       "Slider.focus", getFocusColor(),
1161       "Slider.focusInsets", new InsetsUIResource(0, 0, 0, 0),
1162       "Slider.foreground", getPrimaryControlShadow(),
1163       "Slider.highlight", getControlHighlight(),
1164       "Slider.horizontalThumbIcon", 
1165       MetalIconFactory.getHorizontalSliderThumbIcon(),
1166       "Slider.majorTickLength", new Integer(6),
1167       "Slider.shadow", getControlShadow(),
1168       "Slider.trackWidth", new Integer(7),
1169       "Slider.verticalThumbIcon", 
1170       MetalIconFactory.getVerticalSliderThumbIcon(),
1171
1172       "Spinner.arrowButtonInsets", new InsetsUIResource(0, 0, 0, 0),
1173       "Spinner.background", getControl(),
1174       "Spinner.font", new FontUIResource("Dialog", Font.BOLD, 12),
1175       "Spinner.foreground", getControl(),
1176
1177       "SplitPane.background", getControl(),
1178       "SplitPane.darkShadow", getControlDarkShadow(),
1179       "SplitPane.dividerFocusColor", getPrimaryControl(),
1180       "SplitPane.dividerSize", new Integer(10),
1181       "SplitPane.highlight", getControlHighlight(),
1182       "SplitPane.shadow", getControlShadow(),
1183
1184       "SplitPaneDivider.draggingColor", Color.DARK_GRAY,
1185
1186       "TabbedPane.background", getControlShadow(),
1187       "TabbedPane.darkShadow", getControlDarkShadow(),
1188       "TabbedPane.focus", getPrimaryControlDarkShadow(),
1189       "TabbedPane.font", new FontUIResource("Dialog", Font.BOLD, 12),
1190       "TabbedPane.foreground", getControlTextColor(),
1191       "TabbedPane.highlight", getControlHighlight(),
1192       "TabbedPane.light", getControl(),
1193       "TabbedPane.selected", getControl(),
1194       "TabbedPane.selectHighlight", getControlHighlight(),
1195       "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1),
1196       "TabbedPane.shadow", getControlShadow(),
1197       "TabbedPane.tabAreaBackground", getControl(),
1198       "TabbedPane.tabAreaInsets", new InsetsUIResource(4, 2, 0, 6),
1199       "TabbedPane.tabInsets", new InsetsUIResource(0, 9, 1, 9),
1200       
1201       "Table.background", getWindowBackground(),
1202       "Table.focusCellBackground", getWindowBackground(),
1203       "Table.focusCellForeground", getControlTextColor(),
1204       "Table.foreground", getControlTextColor(),
1205       "Table.focusCellHighlightBorder",
1206       new BorderUIResource.LineBorderUIResource(getControlShadow()),
1207       "Table.focusCellBackground", getWindowBackground(),
1208       "Table.gridColor", getControlDarkShadow(),
1209       "Table.selectionBackground", new ColorUIResource(204, 204, 255),
1210       "Table.selectionForeground", new ColorUIResource(0, 0, 0),
1211
1212       "TableHeader.background", getControl(),
1213       "TableHeader.cellBorder", new MetalBorders.TableHeaderBorder(),
1214       "TableHeader.foreground", getControlTextColor(),
1215
1216       "TextArea.background", getWindowBackground(),
1217       "TextArea.caretForeground", getUserTextColor(),
1218       "TextArea.font", new FontUIResource("Dialog", Font.PLAIN, 12),
1219       "TextArea.foreground", getUserTextColor(),
1220       "TextArea.inactiveForeground", getInactiveSystemTextColor(),
1221       "TextArea.selectionBackground", getTextHighlightColor(),
1222       "TextArea.selectionForeground", getHighlightedTextColor(),
1223
1224       "TextField.background", getWindowBackground(),
1225       "TextField.border",
1226       new BorderUIResource(MetalBorders.getTextFieldBorder()),
1227       "TextField.caretForeground", getUserTextColor(),
1228       "TextField.darkShadow", getControlDarkShadow(),
1229       "TextField.font", new FontUIResource("Dialog", Font.PLAIN, 12),
1230       "TextField.foreground", getUserTextColor(),
1231       "TextField.highlight", getControlHighlight(),
1232       "TextField.inactiveBackground", getControl(),
1233       "TextField.inactiveForeground", getInactiveSystemTextColor(),
1234       "TextField.light", getControlHighlight(),
1235       "TextField.selectionBackground", getTextHighlightColor(),
1236       "TextField.selectionForeground", getHighlightedTextColor(),
1237       "TextField.shadow", getControlShadow(),
1238      
1239       "TextPane.background", getWindowBackground(),
1240       "TextPane.caretForeground", getUserTextColor(),
1241       "TextPane.font", new FontUIResource("Dialog", Font.PLAIN, 12),
1242       "TextPane.foreground", getUserTextColor(),
1243       "TextPane.inactiveForeground", getInactiveSystemTextColor(),
1244       "TextPane.selectionBackground", getTextHighlightColor(),
1245       "TextPane.selectionForeground", getHighlightedTextColor(),
1246
1247       "TitledBorder.font", new FontUIResource("Dialog", Font.BOLD, 12),
1248       "TitledBorder.titleColor", getSystemTextColor(),
1249
1250       "ToggleButton.background", getControl(),
1251       "ToggleButton.border", MetalBorders.getToggleButtonBorder(),
1252       "ToggleButton.darkShadow", getControlDarkShadow(),
1253       "ToggleButton.disabledText", getInactiveControlTextColor(),
1254       "ToggleButton.focus", getFocusColor(),
1255       "ToggleButton.font", getControlTextFont(),
1256       "ToggleButton.foreground", getControlTextColor(),
1257       "ToggleButton.highlight", getControlHighlight(),
1258       "ToggleButton.light", getControlHighlight(),
1259       "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14),
1260       "ToggleButton.select", getControlShadow(),
1261       "ToggleButton.shadow", getControlShadow(),
1262
1263       "ToolBar.background", getMenuBackground(),
1264       "ToolBar.darkShadow", getControlDarkShadow(),
1265       "ToolBar.dockingBackground", getMenuBackground(),
1266       "ToolBar.dockingForeground", getPrimaryControlDarkShadow(),
1267       "ToolBar.floatingBackground", getMenuBackground(),
1268       "ToolBar.floatingForeground", getPrimaryControl(),
1269       "ToolBar.font", new FontUIResource("Dialog", Font.BOLD, 12),
1270       "ToolBar.foreground", getMenuForeground(),
1271       "ToolBar.highlight", getControlHighlight(),
1272       "ToolBar.light", getControlHighlight(),
1273       "ToolBar.shadow", getControlShadow(),
1274       "ToolBar.border", new MetalBorders.ToolBarBorder(),
1275
1276       "ToolTip.background", getPrimaryControl(),
1277       "ToolTip.backgroundInactive", getControl(),
1278       "ToolTip.border", new BorderUIResource.LineBorderUIResource(getPrimaryControlDarkShadow(), 1),
1279       "ToolTip.borderInactive", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1),
1280       "ToolTip.font", new FontUIResource("Dialog", Font.PLAIN, 12),
1281       "ToolTip.foreground", getPrimaryControlInfo(),
1282       "ToolTip.foregroundInactive", getControlDarkShadow(),
1283       "ToolTip.hideAccelerator", Boolean.FALSE,
1284
1285       "Tree.background", getWindowBackground(),
1286       "Tree.closedIcon", MetalIconFactory.getTreeFolderIcon(),
1287       "Tree.collapsedIcon", MetalIconFactory.getTreeControlIcon(true),
1288       "Tree.expandedIcon", MetalIconFactory.getTreeControlIcon(false),
1289       "Tree.font", new FontUIResource("Dialog", Font.PLAIN, 12),
1290       "Tree.foreground", getUserTextColor(),
1291       "Tree.hash", getPrimaryControl(),
1292       "Tree.leafIcon", MetalIconFactory.getTreeLeafIcon(),
1293       "Tree.leftChildIndent", new Integer(7),
1294       "Tree.line", getPrimaryControl(),
1295       "Tree.openIcon", MetalIconFactory.getTreeFolderIcon(),
1296       "Tree.rightChildIndent", new Integer(13),
1297       "Tree.rowHeight", new Integer(0),
1298       "Tree.scrollsOnExpand", Boolean.TRUE,
1299       "Tree.selectionBackground", getTextHighlightColor(),
1300       "Tree.selectionBorder", new BorderUIResource.LineBorderUIResource(new Color(102, 102, 153)),
1301       "Tree.selectionBorderColor", getFocusColor(),
1302       "Tree.selectionForeground", getHighlightedTextColor(),
1303       "Tree.textBackground", getWindowBackground(),
1304       "Tree.textForeground", getUserTextColor(),
1305
1306       "Viewport.background", getControl(),
1307       "Viewport.foreground", getUserTextColor()
1308     };
1309     defaults.putDefaults(myDefaults);
1310   }
1311
1312   /**
1313    * Initializes the system color defaults.
1314    *
1315    * In particular this sets the following keys:
1316    *
1317    * <table>
1318    * <tr>
1319    * <th>Key</th><th>Value</th><th>Description</th>
1320    * </tr><tr>
1321    * <td>control</td><td>0xcccccc</td><td>The default color for components</td>
1322    * </tr>
1323    * </table>
1324    */
1325   protected void initSystemColorDefaults(UIDefaults defaults)
1326   {
1327     super.initSystemColorDefaults(defaults);
1328     Object[] uiDefaults;
1329     uiDefaults = new Object[] {
1330       "control", new ColorUIResource(getControl()),
1331       "desktop", new ColorUIResource(getDesktopColor())
1332     };
1333     defaults.putDefaults(uiDefaults);
1334   }
1335
1336   /**
1337    * Returns the current theme setting for the Metal L&amp;F.
1338    *
1339    * @return the current theme setting for the Metal L&amp;F
1340    */
1341   public static MetalTheme getCurrentTheme()
1342   {
1343     return theme;
1344   }
1345 }