42 |
import java.awt.Font; |
import java.awt.Font; |
43 |
import java.awt.Insets; |
import java.awt.Insets; |
44 |
|
|
|
import javax.swing.ImageIcon; |
|
45 |
import javax.swing.UIDefaults; |
import javax.swing.UIDefaults; |
|
import javax.swing.border.Border; |
|
46 |
import javax.swing.plaf.BorderUIResource; |
import javax.swing.plaf.BorderUIResource; |
47 |
import javax.swing.plaf.ColorUIResource; |
import javax.swing.plaf.ColorUIResource; |
48 |
import javax.swing.plaf.FontUIResource; |
import javax.swing.plaf.FontUIResource; |
|
import javax.swing.plaf.IconUIResource; |
|
49 |
import javax.swing.plaf.InsetsUIResource; |
import javax.swing.plaf.InsetsUIResource; |
50 |
import javax.swing.plaf.basic.BasicLookAndFeel; |
import javax.swing.plaf.basic.BasicLookAndFeel; |
51 |
|
|
52 |
|
|
53 |
/** |
/** |
54 |
* A custom look and feel that is designed to look similar across different |
* A custom look and feel that is designed to look similar across different |
55 |
* operating systems. |
* operating systems. |
780 |
new UIDefaults.ProxyLazyValue |
new UIDefaults.ProxyLazyValue |
781 |
("javax.swing.plaf.metal.MetalCheckBoxIcon"), |
("javax.swing.plaf.metal.MetalCheckBoxIcon"), |
782 |
"CheckBoxMenuItem.background", new ColorUIResource(getControl()), |
"CheckBoxMenuItem.background", new ColorUIResource(getControl()), |
783 |
|
"CheckBoxMenuItem.checkIcon", MetalIconFactory.getCheckBoxMenuItemIcon(), |
784 |
"ToolBar.background", new ColorUIResource(getControl()), |
"ToolBar.background", new ColorUIResource(getControl()), |
785 |
"Panel.background", new ColorUIResource(getControl()), |
"Panel.background", new ColorUIResource(getControl()), |
786 |
"Slider.background", new ColorUIResource(getControl()), |
"Slider.background", new ColorUIResource(getControl()), |
788 |
"ProgressBar.background", new ColorUIResource(getControl()), |
"ProgressBar.background", new ColorUIResource(getControl()), |
789 |
"ScrollPane.border", new MetalBorders.ScrollPaneBorder(), |
"ScrollPane.border", new MetalBorders.ScrollPaneBorder(), |
790 |
"TabbedPane.background", new ColorUIResource(getControl()), |
"TabbedPane.background", new ColorUIResource(getControl()), |
791 |
|
"InternalFrame.border", new MetalBorders.InternalFrameBorder(), |
792 |
|
"InternalFrame.icon", MetalIconFactory.getInternalFrameDefaultMenuIcon(), |
793 |
|
"InternalFrame.closeIcon", |
794 |
|
MetalIconFactory.getInternalFrameCloseIcon(16), |
795 |
|
"InternalFrame.maximizeIcon", |
796 |
|
MetalIconFactory.getInternalFrameMaximizeIcon(16), |
797 |
|
"InternalFrame.iconifyIcon", |
798 |
|
MetalIconFactory.getInternalFrameMinimizeIcon(16), |
799 |
"Label.background", new ColorUIResource(getControl()), |
"Label.background", new ColorUIResource(getControl()), |
800 |
"Label.font", getControlTextFont(), |
"Label.font", getControlTextFont(), |
801 |
"Label.disabledForeground", new ColorUIResource(getControlDisabled()), |
"Label.disabledForeground", new ColorUIResource(getInactiveControlTextColor()), |
802 |
"Label.foreground", new ColorUIResource(getSystemTextColor()), |
"Label.foreground", new ColorUIResource(getControlTextColor()), |
803 |
"Menu.background", new ColorUIResource(getControl()), |
"Menu.background", new ColorUIResource(getControl()), |
804 |
"Menu.border", new MetalBorders.MenuItemBorder(), |
"Menu.border", new MetalBorders.MenuItemBorder(), |
805 |
"Menu.borderPainted", Boolean.TRUE, |
"Menu.borderPainted", Boolean.TRUE, |
815 |
"MenuItem.selectionBackground", getMenuSelectedBackground(), |
"MenuItem.selectionBackground", getMenuSelectedBackground(), |
816 |
"MenuItem.selectionForeground", getMenuSelectedForeground(), |
"MenuItem.selectionForeground", getMenuSelectedForeground(), |
817 |
"Panel.background", new ColorUIResource(getControl()), |
"Panel.background", new ColorUIResource(getControl()), |
818 |
|
"RadioButton.disabledText", |
819 |
|
MetalLookAndFeel.getInactiveControlTextColor(), |
820 |
"RadioButton.icon", |
"RadioButton.icon", |
821 |
new UIDefaults.LazyValue() |
new UIDefaults.LazyValue() |
822 |
{ |
{ |
825 |
return MetalIconFactory.getRadioButtonIcon(); |
return MetalIconFactory.getRadioButtonIcon(); |
826 |
} |
} |
827 |
}, |
}, |
828 |
|
"RadioButton.focus", MetalLookAndFeel.getFocusColor(), |
829 |
|
"RadioButton.font", MetalLookAndFeel.getControlTextFont(), |
830 |
|
"RadioButton.select", MetalLookAndFeel.getControlShadow(), |
831 |
|
"RadioButtonMenuItem.border", new MetalBorders.MenuItemBorder(), |
832 |
|
"RadioButtonMenuItem.borderPainted", Boolean.TRUE, |
833 |
|
"RadioButtonMenuItem.checkIcon", |
834 |
|
MetalIconFactory.getRadioButtonMenuItemIcon(), |
835 |
|
"RadioButtonMenuItem.font", MetalLookAndFeel.getControlTextFont(), |
836 |
|
"RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), |
837 |
|
"RadioButtonMenuItem.selectionBackground", |
838 |
|
MetalLookAndFeel.getMenuSelectedBackground(), |
839 |
|
"RadioButtonMenuItem.selectionForeground", |
840 |
|
MetalLookAndFeel.getMenuSelectedForeground(), |
841 |
|
|
842 |
"ScrollBar.background", new ColorUIResource(getControl()), |
"ScrollBar.background", new ColorUIResource(getControl()), |
843 |
"ScrollBar.shadow", new ColorUIResource(getControlShadow()), |
"ScrollBar.shadow", new ColorUIResource(getControlShadow()), |
844 |
"ScrollBar.thumb", new ColorUIResource(getPrimaryControlShadow()), |
"ScrollBar.thumb", new ColorUIResource(getPrimaryControlShadow()), |
860 |
"Slider.trackWidth", new Integer(7), |
"Slider.trackWidth", new Integer(7), |
861 |
"Slider.majorTickLength", new Integer(6), |
"Slider.majorTickLength", new Integer(6), |
862 |
|
|
863 |
|
"TabbedPane.font", new FontUIResource("Dialog", Font.BOLD, 12), |
864 |
|
"TabbedPane.tabInsets", new InsetsUIResource(0, 9, 1, 9), |
865 |
|
"TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), |
866 |
|
"TabbedPane.tabAreaInsets", new InsetsUIResource(4, 2, 0, 6), |
867 |
|
|
868 |
"ToggleButton.background", new ColorUIResource(getControl()), |
"ToggleButton.background", new ColorUIResource(getControl()), |
869 |
"ToggleButton.border", MetalBorders.getButtonBorder(), |
"ToggleButton.border", MetalBorders.getButtonBorder(), |
870 |
"ToggleButton.darkShadow", new ColorUIResource(getControlDarkShadow()), |
"ToggleButton.darkShadow", new ColorUIResource(getControlDarkShadow()), |
923 |
super.initSystemColorDefaults(defaults); |
super.initSystemColorDefaults(defaults); |
924 |
Object[] uiDefaults; |
Object[] uiDefaults; |
925 |
uiDefaults = new Object[] { |
uiDefaults = new Object[] { |
926 |
"control", new ColorUIResource(getControl()) |
"control", new ColorUIResource(getControl()), |
927 |
|
"desktop", new ColorUIResource(getDesktopColor()) |
928 |
}; |
}; |
929 |
defaults.putDefaults(uiDefaults); |
defaults.putDefaults(uiDefaults); |
930 |
} |
} |