summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/javax/swing/plaf/metal/MetalToggleButtonUI.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/javax/swing/plaf/metal/MetalToggleButtonUI.java')
-rw-r--r--libjava/classpath/javax/swing/plaf/metal/MetalToggleButtonUI.java51
1 files changed, 50 insertions, 1 deletions
diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalToggleButtonUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalToggleButtonUI.java
index 7913cdb83e9..be6d0c39ec8 100644
--- a/libjava/classpath/javax/swing/plaf/metal/MetalToggleButtonUI.java
+++ b/libjava/classpath/javax/swing/plaf/metal/MetalToggleButtonUI.java
@@ -38,7 +38,11 @@ exception statement from your version. */
package javax.swing.plaf.metal;
+import java.awt.Color;
+
import javax.swing.JComponent;
+import javax.swing.UIDefaults;
+import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicToggleButtonUI;
@@ -46,7 +50,15 @@ public class MetalToggleButtonUI
extends BasicToggleButtonUI
{
- // FIXME: maybe replace by a Map of instances when this becomes stateful
+ /** 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;
+
/** The shared UI instance for MetalToggleButtonUIs */
private static MetalToggleButtonUI instance = null;
@@ -56,6 +68,43 @@ public class MetalToggleButtonUI
public MetalToggleButtonUI()
{
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");
}
/**
OpenPOWER on IntegriCloud