1:
37:
38:
39: package ;
40:
41: import ;
42: import ;
43: import ;
44:
45: import ;
46: import ;
47: import ;
48: import ;
49: import ;
50: import ;
51: import ;
52: import ;
53: import ;
54:
55:
56:
60: public class MetalLookAndFeel extends BasicLookAndFeel
61: {
62: private static final long serialVersionUID = 6680646159193457980L;
63:
64:
65: private static MetalTheme theme;
66:
67:
68: private UIDefaults LAF_defaults;
69:
70:
73: public MetalLookAndFeel()
74: {
75: if (theme == null)
76: createDefaultTheme();
77: }
78:
79:
82: protected void createDefaultTheme()
83: {
84: setCurrentTheme(new DefaultMetalTheme());
85: }
86:
87:
94: public boolean isNativeLookAndFeel()
95: {
96: return false;
97: }
98:
99:
105: public boolean isSupportedLookAndFeel()
106: {
107: return true;
108: }
109:
110:
116: public String getDescription()
117: {
118: return "Metal look and feel";
119: }
120:
121:
126: public String getID()
127: {
128: return "MetalLookAndFeel";
129: }
130:
131:
136: public String getName()
137: {
138: return "MetalLookAndFeel";
139: }
140:
141: public UIDefaults getDefaults()
142: {
143: if (LAF_defaults == null)
144: {
145: LAF_defaults = super.getDefaults();
146:
147:
148: theme.addCustomEntriesToTable(LAF_defaults);
149: }
150:
151:
152: return LAF_defaults;
153: }
154:
155:
160: public static ColorUIResource getAcceleratorForeground()
161: {
162: return theme.getAcceleratorForeground();
163: }
164:
165:
171: public static ColorUIResource getAcceleratorSelectedForeground()
172: {
173: return theme.getAcceleratorSelectedForeground();
174: }
175:
176:
181: public static ColorUIResource getBlack()
182: {
183: return theme.getBlack();
184: }
185:
186:
191: public static ColorUIResource getControl()
192: {
193: return theme.getControl();
194: }
195:
196:
202: public static ColorUIResource getControlDarkShadow()
203: {
204: return theme.getControlDarkShadow();
205: }
206:
207:
212: public static ColorUIResource getControlDisabled()
213: {
214: return theme.getControlDisabled();
215: }
216:
217:
223: public static ColorUIResource getControlHighlight()
224: {
225: return theme.getControlHighlight();
226: }
227:
228:
234: public static ColorUIResource getControlInfo()
235: {
236: return theme.getControlInfo();
237: }
238:
239:
245: public static ColorUIResource getControlShadow()
246: {
247: return theme.getControlShadow();
248: }
249:
250:
255: public static ColorUIResource getControlTextColor()
256: {
257: return theme.getControlTextColor();
258: }
259:
260:
265: public static FontUIResource getControlTextFont()
266: {
267: return theme.getControlTextFont();
268: }
269:
270:
276: public static ColorUIResource getDesktopColor()
277: {
278: return theme.getDesktopColor();
279: }
280:
281:
287: public static ColorUIResource getFocusColor()
288: {
289: return theme.getFocusColor();
290: }
291:
292:
298: public static ColorUIResource getHighlightedTextColor()
299: {
300: return theme.getHighlightedTextColor();
301: }
302:
303:
309: public static ColorUIResource getInactiveControlTextColor()
310: {
311: return theme.getInactiveControlTextColor();
312: }
313:
314:
320: public static ColorUIResource getInactiveSystemTextColor()
321: {
322: return theme.getInactiveSystemTextColor();
323: }
324:
325:
332: public static ColorUIResource getMenuBackground()
333: {
334: return theme.getMenuBackground();
335: }
336:
337:
345: public static ColorUIResource getMenuDisabledForeground()
346: {
347: return theme.getMenuDisabledForeground();
348: }
349:
350:
358: public static ColorUIResource getMenuForeground()
359: {
360: return theme.getMenuForeground();
361: }
362:
363:
371: public static ColorUIResource getMenuSelectedBackground()
372: {
373: return theme.getMenuSelectedBackground();
374: }
375:
376:
384: public static ColorUIResource getMenuSelectedForeground()
385: {
386: return theme.getMenuSelectedForeground();
387: }
388:
389:
394: public static FontUIResource getMenuTextFont()
395: {
396: return theme.getMenuTextFont();
397: }
398:
399:
404: public static ColorUIResource getPrimaryControl()
405: {
406: return theme.getPrimaryControl();
407: }
408:
409:
415: public static ColorUIResource getPrimaryControlDarkShadow()
416: {
417: return theme.getPrimaryControlDarkShadow();
418: }
419:
420:
426: public static ColorUIResource getPrimaryControlHighlight()
427: {
428: return theme.getPrimaryControlHighlight();
429: }
430:
431:
437: public static ColorUIResource getPrimaryControlInfo()
438: {
439: return theme.getPrimaryControlInfo();
440: }
441:
442:
448: public static ColorUIResource getPrimaryControlShadow()
449: {
450: return theme.getPrimaryControlShadow();
451: }
452:
453:
458: public static ColorUIResource getSeparatorBackground()
459: {
460: return theme.getSeparatorBackground();
461: }
462:
463:
468: public static ColorUIResource getSeparatorForeground()
469: {
470: return theme.getSeparatorForeground();
471: }
472:
473:
478: public static FontUIResource getSubTextFont()
479: {
480: return theme.getSubTextFont();
481: }
482:
483:
488: public static ColorUIResource getSystemTextColor()
489: {
490: return theme.getSystemTextColor();
491: }
492:
493:
498: public static FontUIResource getSystemTextFont()
499: {
500: return theme.getSystemTextFont();
501: }
502:
503:
508: public static ColorUIResource getTextHighlightColor()
509: {
510: return theme.getTextHighlightColor();
511: }
512:
513:
518: public static ColorUIResource getUserTextColor()
519: {
520: return theme.getUserTextColor();
521: }
522:
523:
528: public static FontUIResource getUserTextFont()
529: {
530: return theme.getUserTextFont();
531: }
532:
533:
538: public static ColorUIResource getWhite()
539: {
540: return theme.getWhite();
541: }
542:
543:
548: public static ColorUIResource getWindowBackground()
549: {
550: return theme.getWindowBackground();
551: }
552:
553:
558: public static ColorUIResource getWindowTitleBackground()
559: {
560: return theme.getWindowTitleBackground();
561: }
562:
563:
570: public static FontUIResource getWindowTitleFont()
571: {
572: return theme.getWindowTitleFont();
573: }
574:
575:
580: public static ColorUIResource getWindowTitleForeground()
581: {
582: return theme.getWindowTitleForeground();
583: }
584:
585:
591: public static ColorUIResource getWindowTitleInactiveBackground()
592: {
593: return theme.getWindowTitleInactiveBackground();
594: }
595:
596:
602: public static ColorUIResource getWindowTitleInactiveForeground()
603: {
604: return theme.getWindowTitleInactiveForeground();
605: }
606:
607:
619: public static void setCurrentTheme(MetalTheme theme)
620: {
621: if (theme == null)
622: throw new NullPointerException("Null 'theme' not permitted.");
623: MetalLookAndFeel.theme = theme;
624: }
625:
626:
682: protected void initClassDefaults(UIDefaults defaults)
683: {
684: super.initClassDefaults(defaults);
685:
686:
687: Object[] uiDefaults;
688:
689: uiDefaults = new Object[] {
690: "ButtonUI", "javax.swing.plaf.metal.MetalButtonUI",
691: "CheckBoxUI", "javax.swing.plaf.metal.MetalCheckBoxUI",
692: "ComboBoxUI", "javax.swing.plaf.metal.MetalComboBoxUI",
693: "DesktopIconUI", "javax.swing.plaf.metal.MetalDesktopIconUI",
694: "InternalFrameUI", "javax.swing.plaf.metal.MetalInternalFrameUI",
695: "LabelUI", "javax.swing.plaf.metal.MetalLabelUI",
696: "PopupMenuSeparatorUI",
697: "javax.swing.plaf.metal.MetalPopupMenuSeparatorUI",
698: "ProgressBarUI", "javax.swing.plaf.metal.MetalProgressBarUI",
699: "RadioButtonUI", "javax.swing.plaf.metal.MetalRadioButtonUI",
700: "RootPaneUI", "javax.swing.plaf.metal.MetalRootPaneUI",
701: "ScrollBarUI", "javax.swing.plaf.metal.MetalScrollBarUI",
702: "ScrollPaneUI", "javax.swing.plaf.metal.MetalScrollPaneUI",
703: "SeparatorUI", "javax.swing.plaf.metal.MetalSeparatorUI",
704: "SliderUI", "javax.swing.plaf.metal.MetalSliderUI",
705: "SplitPaneUI", "javax.swing.plaf.metal.MetalSplitPaneUI",
706: "TabbedPaneUI", "javax.swing.plaf.metal.MetalTabbedPaneUI",
707: "TextFieldUI", "javax.swing.plaf.metal.MetalTextFieldUI",
708: "ToggleButtonUI", "javax.swing.plaf.metal.MetalToggleButtonUI",
709: "ToolBarUI", "javax.swing.plaf.metal.MetalToolBarUI",
710: "ToolTipUI", "javax.swing.plaf.metal.MetalToolTipUI",
711: "TreeUI", "javax.swing.plaf.metal.MetalTreeUI",
712: };
713:
714: defaults.putDefaults(uiDefaults);
715: }
716:
717:
771: protected void initComponentDefaults(UIDefaults defaults)
772: {
773: super.initComponentDefaults(defaults);
774: Object[] myDefaults = new Object[] {
775: "Button.background", getControl(),
776: "Button.border", MetalBorders.getButtonBorder(),
777: "Button.darkShadow", getControlDarkShadow(),
778: "Button.disabledText", getInactiveControlTextColor(),
779: "Button.focus", getFocusColor(),
780: "Button.font", getControlTextFont(),
781: "Button.foreground", getControlTextColor(),
782: "Button.highlight", getControlHighlight(),
783: "Button.light", getControlHighlight(),
784: "Button.margin", new InsetsUIResource(2, 14, 2, 14),
785: "Button.select", getControlShadow(),
786: "Button.shadow", getControlShadow(),
787:
788: "CheckBox.background", getControl(),
789: "CheckBox.border", MetalBorders.getButtonBorder(),
790: "CheckBox.disabledText", getInactiveControlTextColor(),
791: "CheckBox.focus", getFocusColor(),
792: "CheckBox.font", new FontUIResource("Dialog", Font.BOLD, 12),
793: "CheckBox.foreground", getControlTextColor(),
794: "CheckBox.icon",
795: new UIDefaults.ProxyLazyValue
796: ("javax.swing.plaf.metal.MetalCheckBoxIcon"),
797: "CheckBox.checkIcon",
798: new UIDefaults.ProxyLazyValue
799: ("javax.swing.plaf.metal.MetalCheckBoxIcon"),
800: "Checkbox.select", getControlShadow(),
801:
802: "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10),
803: "CheckBoxMenuItem.acceleratorForeground", getAcceleratorForeground(),
804: "CheckBoxMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(),
805: "CheckBoxMenuItem.background", getMenuBackground(),
806: "CheckBoxMenuItem.borderPainted", new Boolean(true),
807: "CheckBoxMenuItem.commandSound", "sounds/MenuItemCommand.wav",
808: "CheckBoxMenuItem.checkIcon", MetalIconFactory.getCheckBoxMenuItemIcon(),
809: "CheckBoxMenuItem.disabledForeground", getMenuDisabledForeground(),
810: "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.BOLD, 12),
811: "CheckBoxMenuItem.foreground", getMenuForeground(),
812: "CheckBoxMenuItem.selectionBackground", getMenuSelectedBackground(),
813: "CheckBoxMenuItem.selectionForeground", getMenuSelectedForeground(),
814:
815: "ColorChooser.background", getControl(),
816: "ColorChooser.foreground", getControlTextColor(),
817: "ColorChooser.rgbBlueMnemonic", new Integer(0),
818: "ColorChooser.rgbGreenMnemonic", new Integer(0),
819: "ColorChooser.rgbRedMnemonic", new Integer(0),
820: "ColorChooser.swatchesDefaultRecentColor", getControl(),
821:
822: "ComboBox.background", getControl(),
823: "ComboBox.buttonBackground", getControl(),
824: "ComboBox.buttonDarkShadow", getControlDarkShadow(),
825: "ComboBox.buttonHighlight", getControlHighlight(),
826: "ComboBox.buttonShadow", getControlShadow(),
827: "ComboBox.disabledBackground", getControl(),
828: "ComboBox.disabledForeground", getInactiveSystemTextColor(),
829: "ComboBox.font", new FontUIResource("Dialog", Font.BOLD, 12),
830: "ComboBox.foreground", getControlTextColor(),
831: "ComboBox.selectionBackground", getPrimaryControlShadow(),
832: "ComboBox.selectionForeground", getControlTextColor(),
833:
834: "Desktop.background", getDesktopColor(),
835:
836: "DesktopIcon.background", getControl(),
837: "DesktopIcon.foreground", getControlTextColor(),
838: "DesktopIcon.width", new Integer(160),
839: "DesktopIcon.border", MetalBorders.getDesktopIconBorder(),
840:
841: "EditorPane.background", getWindowBackground(),
842: "EditorPane.caretForeground", getUserTextColor(),
843: "EditorPane.font", new FontUIResource("Dialog", Font.PLAIN, 12),
844: "EditorPane.foreground", getUserTextColor(),
845: "EditorPane.inactiveForeground", getInactiveSystemTextColor(),
846: "EditorPane.selectionBackground", getTextHighlightColor(),
847: "EditorPane.selectionForeground", getHighlightedTextColor(),
848:
849: "FormattedTextField.background", getWindowBackground(),
850: "FormattedTextField.border",
851: new BorderUIResource(MetalBorders.getTextFieldBorder()),
852: "FormattedTextField.caretForeground", getUserTextColor(),
853: "FormattedTextField.font", new FontUIResource("Dialog", Font.PLAIN, 12),
854: "FormattedTextField.foreground", getUserTextColor(),
855: "FormattedTextField.inactiveBackground", getControl(),
856: "FormattedTextField.inactiveForeground", getInactiveSystemTextColor(),
857: "FormattedTextField.selectionBackground", getTextHighlightColor(),
858: "FormattedTextField.selectionForeground", getHighlightedTextColor(),
859:
860: "FileView.computerIcon", MetalIconFactory.getTreeComputerIcon(),
861: "FileView.directoryIcon", MetalIconFactory.getTreeFolderIcon(),
862: "FileView.fileIcon", MetalIconFactory.getTreeLeafIcon(),
863: "FileView.floppyDriveIcon", MetalIconFactory.getTreeFloppyDriveIcon(),
864: "FileView.hardDriveIcon", MetalIconFactory.getTreeHardDriveIcon(),
865:
866: "InternalFrame.activeTitleBackground", getWindowTitleBackground(),
867: "InternalFrame.activeTitleForeground", getWindowTitleForeground(),
868: "InternalFrame.border", new MetalBorders.InternalFrameBorder(),
869: "InternalFrame.borderColor", getControl(),
870: "InternalFrame.borderDarkShadow", getControlDarkShadow(),
871: "InternalFrame.borderHighlight", getControlHighlight(),
872: "InternalFrame.borderLight", getControlHighlight(),
873: "InternalFrame.borderShadow", getControlShadow(),
874: "InternalFrame.icon", MetalIconFactory.getInternalFrameDefaultMenuIcon(),
875: "InternalFrame.closeIcon",
876: MetalIconFactory.getInternalFrameCloseIcon(16),
877: "InternalFrame.inactiveTitleBackground", getWindowTitleInactiveBackground(),
878: "InternalFrame.inactiveTitleForeground", getWindowTitleInactiveForeground(),
879: "InternalFrame.maximizeIcon",
880: MetalIconFactory.getInternalFrameMaximizeIcon(16),
881: "InternalFrame.iconifyIcon",
882: MetalIconFactory.getInternalFrameMinimizeIcon(16),
883: "InternalFrame.paletteBorder", new MetalBorders.PaletteBorder(),
884: "InternalFrame.paletteCloseIcon", new MetalIconFactory.PaletteCloseIcon(),
885: "InternalFrame.paletteTitleHeight", new Integer(11),
886:
887: "Label.background", getControl(),
888: "Label.disabledForeground", getInactiveSystemTextColor(),
889: "Label.disabledShadow", getControlShadow(),
890: "Label.font", getControlTextFont(),
891: "Label.foreground", getSystemTextColor(),
892:
893: "List.font", getControlTextFont(),
894: "List.background", getWindowBackground(),
895: "List.foreground", getUserTextColor(),
896: "List.selectionBackground", getTextHighlightColor(),
897: "List.selectionForeground", getHighlightedTextColor(),
898: "List.focusCellHighlightBorder",
899: new LineBorderUIResource(MetalLookAndFeel.getFocusColor()),
900:
901: "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10),
902: "Menu.acceleratorForeground", getAcceleratorForeground(),
903: "Menu.acceleratorSelectionForeground", getAcceleratorSelectedForeground(),
904: "Menu.background", getMenuBackground(),
905: "Menu.border", new MetalBorders.MenuItemBorder(),
906: "Menu.borderPainted", Boolean.TRUE,
907: "Menu.disabledForeground", getMenuDisabledForeground(),
908: "Menu.font", getControlTextFont(),
909: "Menu.foreground", getMenuForeground(),
910: "Menu.selectionBackground", getMenuSelectedBackground(),
911: "Menu.selectionForeground", getMenuSelectedForeground(),
912:
913: "MenuBar.background", getMenuBackground(),
914: "MenuBar.border", new MetalBorders.MenuBarBorder(),
915: "MenuBar.font", getControlTextFont(),
916: "MenuBar.foreground", getMenuForeground(),
917: "MenuBar.highlight", getControlHighlight(),
918: "MenuBar.shadow", getControlShadow(),
919:
920: "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10),
921: "MenuItem.acceleratorForeground", getAcceleratorForeground(),
922: "MenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(),
923: "MenuItem.background", getMenuBackground(),
924: "MenuItem.border", new MetalBorders.MenuItemBorder(),
925: "MenuItem.disabledForeground", getMenuDisabledForeground(),
926: "MenuItem.font", getControlTextFont(),
927: "MenuItem.foreground", getMenuForeground(),
928: "MenuItem.selectionBackground", getMenuSelectedBackground(),
929: "MenuItem.selectionForeground", getMenuSelectedForeground(),
930:
931: "OptionPane.background", getControl(),
932: "OptionPane.errorDialog.border.background", new ColorUIResource(153, 51, 51),
933: "OptionPane.errorDialog.titlePane.background", new ColorUIResource(255, 153, 153),
934: "OptionPane.errorDialog.titlePane.foreground", new ColorUIResource(51, 0, 0),
935: "OptionPane.errorDialog.titlePane.shadow", new ColorUIResource(204, 102, 102),
936: "OptionPane.foreground", getControlTextColor(),
937: "OptionPane.messageForeground", getControlTextColor(),
938: "OptionPane.questionDialog.border.background", new ColorUIResource(51, 102, 51),
939: "OptionPane.questionDialog.titlePane.background", new ColorUIResource(153, 204, 153),
940: "OptionPane.questionDialog.titlePane.foreground", new ColorUIResource(0, 51, 0),
941: "OptionPane.questionDialog.titlePane.shadow", new ColorUIResource(102, 153, 102),
942: "OptionPane.warningDialog.border.background", new ColorUIResource(153, 102, 51),
943: "OptionPane.warningDialog.titlePane.background", new ColorUIResource(255, 204, 153),
944: "OptionPane.warningDialog.titlePane.foreground", new ColorUIResource(102, 51, 0),
945: "OptionPane.warningDialog.titlePane.shadow", new ColorUIResource(204, 153, 102),
946:
947: "Panel.background", getControl(),
948: "Panel.foreground", getUserTextColor(),
949:
950: "PasswordField.background", getWindowBackground(),
951: "PasswordField.border",
952: new BorderUIResource(MetalBorders.getTextFieldBorder()),
953: "PasswordField.caretForeground", getUserTextColor(),
954: "PasswordField.foreground", getUserTextColor(),
955: "PasswordField.inactiveBackground", getControl(),
956: "PasswordField.inactiveForeground", getInactiveSystemTextColor(),
957: "PasswordField.selectionBackground", getTextHighlightColor(),
958: "PasswordField.selectionForeground", getHighlightedTextColor(),
959:
960: "PopupMenu.background", getMenuBackground(),
961: "PopupMenu.border", new MetalBorders.PopupMenuBorder(),
962: "PopupMenu.font", new FontUIResource("Dialog", Font.BOLD, 12),
963: "PopupMenu.foreground", getMenuForeground(),
964:
965: "ProgressBar.background", getControl(),
966: "ProgressBar.border", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1),
967: "ProgressBar.font", new FontUIResource("Dialog", Font.BOLD, 12),
968: "ProgressBar.foreground", getPrimaryControlShadow(),
969: "ProgressBar.selectionBackground", getPrimaryControlDarkShadow(),
970: "ProgressBar.selectionForeground", getControl(),
971:
972: "RadioButton.background", getControl(),
973: "RadioButton.darkShadow", getControlDarkShadow(),
974: "RadioButton.disabledText", getInactiveControlTextColor(),
975: "RadioButton.icon",
976: new UIDefaults.LazyValue()
977: {
978: public Object createValue(UIDefaults def)
979: {
980: return MetalIconFactory.getRadioButtonIcon();
981: }
982: },
983: "RadioButton.focus", MetalLookAndFeel.getFocusColor(),
984: "RadioButton.font", MetalLookAndFeel.getControlTextFont(),
985: "RadioButton.foreground", getControlTextColor(),
986: "RadioButton.highlight", getControlHighlight(),
987: "RadioButton.light", getControlHighlight(),
988: "RadioButton.select", getControlShadow(),
989: "RadioButton.shadow", getControlShadow(),
990:
991: "RadioButtonMenuItem.acceleratorFont", new Font("Dialog", Font.PLAIN, 10),
992: "RadioButtonMenuItem.acceleratorForeground", getAcceleratorForeground(),
993: "RadioButtonMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(),
994: "RadioButtonMenuItem.background", getMenuBackground(),
995: "RadioButtonMenuItem.border", new MetalBorders.MenuItemBorder(),
996: "RadioButtonMenuItem.borderPainted", Boolean.TRUE,
997: "RadioButtonMenuItem.checkIcon",
998: MetalIconFactory.getRadioButtonMenuItemIcon(),
999: "RadioButtonMenuItem.disabledForeground", getMenuDisabledForeground(),
1000: "RadioButtonMenuItem.font", MetalLookAndFeel.getControlTextFont(),
1001: "RadioButtonMenuItem.foreground", getMenuForeground(),
1002: "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2),
1003: "RadioButtonMenuItem.selectionBackground",
1004: MetalLookAndFeel.getMenuSelectedBackground(),
1005: "RadioButtonMenuItem.selectionForeground",
1006: MetalLookAndFeel.getMenuSelectedForeground(),
1007:
1008: "ScrollBar.background", getControl(),
1009: "ScrollBar.darkShadow", getControlDarkShadow(),
1010: "ScrollBar.foreground", getControl(),
1011: "ScrollBar.highlight", getControlHighlight(),
1012: "ScrollBar.shadow", getControlShadow(),
1013: "ScrollBar.thumb", getPrimaryControlShadow(),
1014: "ScrollBar.thumbDarkShadow", getControlDarkShadow(),
1015: "ScrollBar.thumbHighlight", getPrimaryControl(),
1016: "ScrollBar.thumbShadow", getPrimaryControlDarkShadow(),
1017: "ScrollBar.track", getControl(),
1018: "ScrollBar.trackHighlight", getControlDarkShadow(),
1019: "ScrollBar.width", new Integer(17),
1020:
1021: "ScrollPane.background", getControl(),
1022: "ScrollPane.border", new MetalBorders.ScrollPaneBorder(),
1023: "ScrollPane.foreground", getControlTextColor(),
1024:
1025: "Separator.background", getSeparatorBackground(),
1026: "Separator.foreground", getSeparatorForeground(),
1027: "Separator.highlight", getControlHighlight(),
1028: "Separator.shadow", getControlShadow(),
1029:
1030: "Slider.background", getControl(),
1031: "Slider.focus", getFocusColor(),
1032: "Slider.focusInsets", new InsetsUIResource(0, 0, 0, 0),
1033: "Slider.foreground", getPrimaryControlShadow(),
1034: "Slider.highlight", getControlHighlight(),
1035: "Slider.horizontalThumbIcon",
1036: MetalIconFactory.getHorizontalSliderThumbIcon(),
1037: "Slider.majorTickLength", new Integer(6),
1038: "Slider.shadow", getControlShadow(),
1039: "Slider.trackWidth", new Integer(7),
1040: "Slider.verticalThumbIcon",
1041: MetalIconFactory.getVerticalSliderThumbIcon(),
1042:
1043: "Spinner.background", getControl(),
1044: "Spinner.font", new FontUIResource("Dialog", Font.BOLD, 12),
1045: "Spinner.foreground", getControl(),
1046:
1047: "SplitPane.background", getControl(),
1048: "SplitPane.darkShadow", getControlDarkShadow(),
1049: "SplitPane.dividerFocusColor", getPrimaryControl(),
1050: "SplitPane.highlight", getControlHighlight(),
1051: "SplitPane.shadow", getControlShadow(),
1052:
1053: "SplitPaneDivider.draggingColor", Color.DARK_GRAY,
1054:
1055: "TabbedPane.background", getControlShadow(),
1056: "TabbedPane.darkShadow", getControlDarkShadow(),
1057: "TabbedPane.focus", getPrimaryControlDarkShadow(),
1058: "TabbedPane.font", new FontUIResource("Dialog", Font.BOLD, 12),
1059: "TabbedPane.foreground", getControlTextColor(),
1060: "TabbedPane.highlight", getControlHighlight(),
1061: "TabbedPane.light", getControl(),
1062: "TabbedPane.selected", getControl(),
1063: "TabbedPane.selectHighlight", getControlHighlight(),
1064: "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1),
1065: "TabbedPane.shadow", getControlShadow(),
1066: "TabbedPane.tabAreaBackground", getControl(),
1067: "TabbedPane.tabAreaInsets", new InsetsUIResource(4, 2, 0, 6),
1068: "TabbedPane.tabInsets", new InsetsUIResource(0, 9, 1, 9),
1069:
1070: "Table.background", getWindowBackground(),
1071: "Table.focusCellBackground", getWindowBackground(),
1072: "Table.focusCellForeground", getControlTextColor(),
1073: "Table.foreground", getControlTextColor(),
1074: "Table.focusCellHighlightBorder",
1075: new BorderUIResource.LineBorderUIResource(getControlShadow()),
1076: "Table.focusCellBackground", getWindowBackground(),
1077: "Table.gridColor", getControlDarkShadow(),
1078: "Table.selectionBackground", new ColorUIResource(204, 204, 255),
1079: "Table.selectionForeground", new ColorUIResource(0, 0, 0),
1080:
1081: "TableHeader.background", getControl(),
1082: "TableHeader.cellBorder", new MetalBorders.TableHeaderBorder(),
1083: "TableHeader.foreground", getControlTextColor(),
1084:
1085: "TextArea.background", getWindowBackground(),
1086: "TextArea.caretForeground", getUserTextColor(),
1087: "TextArea.font", new FontUIResource("Dialog", Font.PLAIN, 12),
1088: "TextArea.foreground", getUserTextColor(),
1089: "TextArea.inactiveForeground", getInactiveSystemTextColor(),
1090: "TextArea.selectionBackground", getTextHighlightColor(),
1091: "TextArea.selectionForeground", getHighlightedTextColor(),
1092:
1093: "TextField.background", getWindowBackground(),
1094: "TextField.border",
1095: new BorderUIResource(MetalBorders.getTextFieldBorder()),
1096: "TextField.caretForeground", getUserTextColor(),
1097: "TextField.darkShadow", getControlDarkShadow(),
1098: "TextField.font", new FontUIResource("Dialog", Font.PLAIN, 12),
1099: "TextField.foreground", getUserTextColor(),
1100: "TextField.highlight", getControlHighlight(),
1101: "TextField.inactiveBackground", getControl(),
1102: "TextField.inactiveForeground", getInactiveSystemTextColor(),
1103: "TextField.light", getControlHighlight(),
1104: "TextField.selectionBackground", getTextHighlightColor(),
1105: "TextField.selectionForeground", getHighlightedTextColor(),
1106: "TextField.shadow", getControlShadow(),
1107:
1108: "TextPane.background", getWindowBackground(),
1109: "TextPane.caretForeground", getUserTextColor(),
1110: "TextPane.font", new FontUIResource("Dialog", Font.PLAIN, 12),
1111: "TextPane.foreground", getUserTextColor(),
1112: "TextPane.inactiveForeground", getInactiveSystemTextColor(),
1113: "TextPane.selectionBackground", getTextHighlightColor(),
1114: "TextPane.selectionForeground", getHighlightedTextColor(),
1115:
1116: "TitledBorder.font", new FontUIResource("Dialog", Font.BOLD, 12),
1117: "TitledBorder.titleColor", getSystemTextColor(),
1118:
1119: "ToggleButton.background", getControl(),
1120: "ToggleButton.border", MetalBorders.getToggleButtonBorder(),
1121: "ToggleButton.darkShadow", getControlDarkShadow(),
1122: "ToggleButton.disabledText", getInactiveControlTextColor(),
1123: "ToggleButton.focus", getFocusColor(),
1124: "ToggleButton.font", getControlTextFont(),
1125: "ToggleButton.foreground", getControlTextColor(),
1126: "ToggleButton.highlight", getControlHighlight(),
1127: "ToggleButton.light", getControlHighlight(),
1128: "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14),
1129: "ToggleButton.select", getControlShadow(),
1130: "ToggleButton.shadow", getControlShadow(),
1131:
1132: "ToolBar.background", getMenuBackground(),
1133: "ToolBar.darkShadow", getControlDarkShadow(),
1134: "ToolBar.dockingBackground", getMenuBackground(),
1135: "ToolBar.dockingForeground", getPrimaryControlDarkShadow(),
1136: "ToolBar.floatingBackground", getMenuBackground(),
1137: "ToolBar.floatingForeground", getPrimaryControl(),
1138: "ToolBar.font", new FontUIResource("Dialog", Font.BOLD, 12),
1139: "ToolBar.foreground", getMenuForeground(),
1140: "ToolBar.highlight", getControlHighlight(),
1141: "ToolBar.light", getControlHighlight(),
1142: "ToolBar.shadow", getControlShadow(),
1143: "ToolBar.border", new MetalBorders.ToolBarBorder(),
1144:
1145: "ToolTip.background", getPrimaryControl(),
1146: "ToolTip.backgroundInactive", getControl(),
1147: "ToolTip.border", new BorderUIResource.LineBorderUIResource(getPrimaryControlDarkShadow(), 1),
1148: "ToolTip.borderInactive", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1),
1149: "ToolTip.font", new FontUIResource("Dialog", Font.PLAIN, 12),
1150: "ToolTip.foreground", getPrimaryControlInfo(),
1151: "ToolTip.foregroundInactive", getControlDarkShadow(),
1152:
1153: "Tree.background", getWindowBackground(),
1154: "Tree.closedIcon", MetalIconFactory.getTreeFolderIcon(),
1155: "Tree.collapsedIcon", MetalIconFactory.getTreeControlIcon(true),
1156: "Tree.expandedIcon", MetalIconFactory.getTreeControlIcon(false),
1157: "Tree.font", new FontUIResource("Dialog", Font.PLAIN, 12),
1158: "Tree.foreground", getUserTextColor(),
1159: "Tree.hash", getPrimaryControl(),
1160: "Tree.leafIcon", MetalIconFactory.getTreeLeafIcon(),
1161: "Tree.leftChildIndent", new Integer(7),
1162: "Tree.line", getPrimaryControl(),
1163: "Tree.openIcon", MetalIconFactory.getTreeFolderIcon(),
1164: "Tree.rightChildIndent", new Integer(13),
1165: "Tree.rowHeight", new Integer(20),
1166: "Tree.scrollsOnExpand", Boolean.TRUE,
1167: "Tree.selectionBackground", getTextHighlightColor(),
1168: "Tree.selectionBorder", new BorderUIResource.LineBorderUIResource(new Color(102, 102, 153)),
1169: "Tree.selectionBorderColor", getFocusColor(),
1170: "Tree.selectionForeground", getHighlightedTextColor(),
1171: "Tree.textBackground", getWindowBackground(),
1172: "Tree.textForeground", getUserTextColor(),
1173:
1174: "Viewport.background", getControl(),
1175: "Viewport.foreground", getUserTextColor()
1176: };
1177: defaults.putDefaults(myDefaults);
1178: }
1179:
1180:
1193: protected void initSystemColorDefaults(UIDefaults defaults)
1194: {
1195: super.initSystemColorDefaults(defaults);
1196: Object[] uiDefaults;
1197: uiDefaults = new Object[] {
1198: "control", new ColorUIResource(getControl()),
1199: "desktop", new ColorUIResource(getDesktopColor())
1200: };
1201: defaults.putDefaults(uiDefaults);
1202: }
1203:
1204: }