diff options
Diffstat (limited to 'libjava/classpath/javax/swing/plaf/metal/MetalLookAndFeel.java')
-rw-r--r-- | libjava/classpath/javax/swing/plaf/metal/MetalLookAndFeel.java | 85 |
1 files changed, 80 insertions, 5 deletions
diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalLookAndFeel.java b/libjava/classpath/javax/swing/plaf/metal/MetalLookAndFeel.java index 46519fc3f78..d9cf7c6220c 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalLookAndFeel.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalLookAndFeel.java @@ -42,13 +42,14 @@ import java.awt.Color; import java.awt.Font; import java.awt.Insets; -import javax.swing.ImageIcon; import javax.swing.UIDefaults; +import javax.swing.plaf.BorderUIResource; import javax.swing.plaf.ColorUIResource; import javax.swing.plaf.FontUIResource; -import javax.swing.plaf.IconUIResource; +import javax.swing.plaf.InsetsUIResource; import javax.swing.plaf.basic.BasicLookAndFeel; + /** * A custom look and feel that is designed to look similar across different * operating systems. @@ -771,7 +772,15 @@ public class MetalLookAndFeel extends BasicLookAndFeel "Button.select", new ColorUIResource(getPrimaryControlShadow()), "Button.shadow", new ColorUIResource(getPrimaryControlShadow()), "CheckBox.background", new ColorUIResource(getControl()), + "CheckBox.border", MetalBorders.getButtonBorder(), + "CheckBox.icon", + new UIDefaults.ProxyLazyValue + ("javax.swing.plaf.metal.MetalCheckBoxIcon"), + "CheckBox.checkIcon", + new UIDefaults.ProxyLazyValue + ("javax.swing.plaf.metal.MetalCheckBoxIcon"), "CheckBoxMenuItem.background", new ColorUIResource(getControl()), + "CheckBoxMenuItem.checkIcon", MetalIconFactory.getCheckBoxMenuItemIcon(), "ToolBar.background", new ColorUIResource(getControl()), "Panel.background", new ColorUIResource(getControl()), "Slider.background", new ColorUIResource(getControl()), @@ -779,16 +788,53 @@ public class MetalLookAndFeel extends BasicLookAndFeel "ProgressBar.background", new ColorUIResource(getControl()), "ScrollPane.border", new MetalBorders.ScrollPaneBorder(), "TabbedPane.background", new ColorUIResource(getControl()), + "InternalFrame.border", new MetalBorders.InternalFrameBorder(), + "InternalFrame.icon", MetalIconFactory.getInternalFrameDefaultMenuIcon(), + "InternalFrame.closeIcon", + MetalIconFactory.getInternalFrameCloseIcon(16), + "InternalFrame.maximizeIcon", + MetalIconFactory.getInternalFrameMaximizeIcon(16), + "InternalFrame.iconifyIcon", + MetalIconFactory.getInternalFrameMinimizeIcon(16), "Label.background", new ColorUIResource(getControl()), "Label.font", getControlTextFont(), - "Label.disabledForeground", new ColorUIResource(getControlDisabled()), - "Label.foreground", new ColorUIResource(getSystemTextColor()), + "Label.disabledForeground", new ColorUIResource(getInactiveControlTextColor()), + "Label.foreground", new ColorUIResource(getControlTextColor()), "Menu.background", new ColorUIResource(getControl()), + "Menu.border", new MetalBorders.MenuItemBorder(), + "Menu.borderPainted", Boolean.TRUE, "Menu.font", getControlTextFont(), + "Menu.selectionBackground", getMenuSelectedBackground(), + "Menu.selectionForeground", getMenuSelectedForeground(), "MenuBar.background", new ColorUIResource(getControl()), + "MenuBar.border", new MetalBorders.MenuBarBorder(), "MenuBar.font", getControlTextFont(), "MenuItem.background", new ColorUIResource(getControl()), + "MenuItem.border", new MetalBorders.MenuItemBorder(), "MenuItem.font", getControlTextFont(), + "MenuItem.selectionBackground", getMenuSelectedBackground(), + "MenuItem.selectionForeground", getMenuSelectedForeground(), + "Panel.background", new ColorUIResource(getControl()), + "RadioButton.icon", + new UIDefaults.LazyValue() + { + public Object createValue(UIDefaults def) + { + return MetalIconFactory.getRadioButtonIcon(); + } + }, + + "RadioButtonMenuItem.border", new MetalBorders.MenuItemBorder(), + "RadioButtonMenuItem.borderPainted", Boolean.TRUE, + "RadioButtonMenuItem.checkIcon", + MetalIconFactory.getRadioButtonMenuItemIcon(), + "RadioButtonMenuItem.font", MetalLookAndFeel.getControlTextFont(), + "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), + "RadioButtonMenuItem.selectionBackground", + MetalLookAndFeel.getMenuSelectedBackground(), + "RadioButtonMenuItem.selectionForeground", + MetalLookAndFeel.getMenuSelectedForeground(), + "ScrollBar.background", new ColorUIResource(getControl()), "ScrollBar.shadow", new ColorUIResource(getControlShadow()), "ScrollBar.thumb", new ColorUIResource(getPrimaryControlShadow()), @@ -802,6 +848,32 @@ public class MetalLookAndFeel extends BasicLookAndFeel "SplitPane.highlight", new ColorUIResource(getControlHighlight()), + "Slider.focusInsets", new InsetsUIResource(0, 0, 0, 0), + "Slider.horizontalThumbIcon", + MetalIconFactory.getHorizontalSliderThumbIcon(), + "Slider.verticalThumbIcon", + MetalIconFactory.getVerticalSliderThumbIcon(), + "Slider.trackWidth", new Integer(7), + "Slider.majorTickLength", new Integer(6), + + "TabbedPane.font", new FontUIResource("Dialog", Font.BOLD, 12), + "TabbedPane.tabInsets", new InsetsUIResource(0, 9, 1, 9), + "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), + "TabbedPane.tabAreaInsets", new InsetsUIResource(4, 2, 0, 6), + + "ToggleButton.background", new ColorUIResource(getControl()), + "ToggleButton.border", MetalBorders.getButtonBorder(), + "ToggleButton.darkShadow", new ColorUIResource(getControlDarkShadow()), + "ToggleButton.disabledText", new ColorUIResource(getControlDisabled()), + "ToggleButton.focus", new ColorUIResource(getFocusColor()), + "ToggleButton.font", getControlTextFont(), + "ToggleButton.foreground", new ColorUIResource(getSystemTextColor()), + "ToggleButton.highlight", new ColorUIResource(getControlHighlight()), + "ToggleButton.light", new ColorUIResource(getControlHighlight()), + "ToggleButton.margin", new Insets(2, 14, 2, 14), + "ToggleButton.select", new ColorUIResource(getPrimaryControlShadow()), + "ToggleButton.shadow", new ColorUIResource(getPrimaryControlShadow()), + "Tree.openIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.closedIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.leafIcon", MetalIconFactory.getTreeLeafIcon(), @@ -818,6 +890,8 @@ public class MetalLookAndFeel extends BasicLookAndFeel "Tree.selectionBackground", new ColorUIResource(new Color(204, 204, 255)), "Tree.nonSelectionBackground", new ColorUIResource(Color.white), "Tree.selectionBorderColor", new ColorUIResource(new Color(102, 102, 153)), + "Tree.selectionBorder", new BorderUIResource.LineBorderUIResource(new Color(102, 102, 153)), + "Tree.nonSelectionBorder", new BorderUIResource.LineBorderUIResource(Color.white), "Tree.selectionForeground", new ColorUIResource(Color.black), "Tree.textBackground", new ColorUIResource(new Color(204, 204, 255)), "Tree.textForeground", new ColorUIResource(Color.black), @@ -845,7 +919,8 @@ public class MetalLookAndFeel extends BasicLookAndFeel super.initSystemColorDefaults(defaults); Object[] uiDefaults; uiDefaults = new Object[] { - "control", new ColorUIResource(getControl()) + "control", new ColorUIResource(getControl()), + "desktop", new ColorUIResource(getDesktopColor()) }; defaults.putDefaults(uiDefaults); } |