diff options
Diffstat (limited to 'libjava/classpath/javax/swing/plaf/metal/MetalButtonUI.java')
-rw-r--r-- | libjava/classpath/javax/swing/plaf/metal/MetalButtonUI.java | 50 |
1 files changed, 47 insertions, 3 deletions
diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalButtonUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalButtonUI.java index a7b53c4b430..0dac5ec3953 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalButtonUI.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalButtonUI.java @@ -38,6 +38,8 @@ exception statement from your version. */ package javax.swing.plaf.metal; +import java.awt.Color; + import javax.swing.AbstractButton; import javax.swing.JComponent; import javax.swing.JToolBar; @@ -56,18 +58,60 @@ public class MetalButtonUI extends BasicButtonUI { - // FIXME: probably substitute with a Map in the future in the case - // that this UI becomes stateful - /** The cached MetalButtonUI instance. */ private static MetalButtonUI instance = null; + /** The color for the focus border. */ + protected Color focusColor; + + /** The color that indicates a selected button. */ + protected Color selectColor; + + /** The color for disabled button labels. */ + protected Color disabledTextColor; + /** * Creates a new instance of MetalButtonUI. */ public MetalButtonUI() { super(); + focusColor = getFocusColor(); + selectColor = getSelectColor(); + disabledTextColor = getDisabledTextColor(); + } + + /** + * Returns the color for the focus border. + * + * @return the color for the focus border + */ + protected Color getFocusColor() + { + UIDefaults def = UIManager.getLookAndFeelDefaults(); + return def.getColor(getPropertyPrefix() + ".focus"); + } + + /** + * Returns the color that indicates a selected button. + * + * @return the color that indicates a selected button + */ + protected Color getSelectColor() + { + UIDefaults def = UIManager.getLookAndFeelDefaults(); + return def.getColor(getPropertyPrefix() + ".select"); + } + + /** + * Returns the color for the text label of disabled buttons. + * + * @return the color for the text label of disabled buttons + */ + protected Color getDisabledTextColor() + { + UIDefaults def = UIManager.getLookAndFeelDefaults(); + return def.getColor(getPropertyPrefix() + ".disabledText"); } /** |