public interface LabelColorScheme
JSelectableLabel class. The implementation must
not return null for any of these methods. Additionally,
the implementation should be sure to respond to the
updateUI() method so that the look-and-feel of the
color scheme changes property when requested.
A separate class for the color scheme is necessary so that the
JLabeledCheckBox class can be reused in parts of the
UI that are not CustomJTrees. The color scheme used by
the JSelectableLabel is the only part of its implementation
that ties it to a particular Swing component, so by abstracting out
the color scheme into a separate class, the JLabeledCheckBox
and JSelectableLabel classes are more easily reused.
| Modifier and Type | Method and Description |
|---|---|
java.awt.Color |
getBackgroundNonSelectionColor()
Returns the
Color to be used for the background when
the label is not selected. |
java.awt.Color |
getBackgroundSelectionColor()
Returns the
Color to be used for the background when
the label is selected. |
java.awt.Color |
getBorderSelectionColor()
Returns the
Color to be used for the border around
the selection when the label is selected. |
java.awt.Color |
getTextNonSelectionColor()
Returns the
Color to be used for text when the label
is not selected. |
java.awt.Color |
getTextSelectionColor()
Returns the
Color to be used for text when the label
is selected. |
void |
updateUI()
The
JComponent subclass that uses the
LabelColorScheme should call this updateUI()
method when its own updateUI() method is called. |
java.awt.Color getTextSelectionColor()
Color to be used for text when the label
is selected.java.awt.Color getTextNonSelectionColor()
Color to be used for text when the label
is not selected.java.awt.Color getBackgroundSelectionColor()
Color to be used for the background when
the label is selected.java.awt.Color getBackgroundNonSelectionColor()
Color to be used for the background when
the label is not selected.java.awt.Color getBorderSelectionColor()
Color to be used for the border around
the selection when the label is selected.void updateUI()
JComponent subclass that uses the
LabelColorScheme should call this updateUI()
method when its own updateUI() method is called. This
is so that the color scheme can be updated when the user changes the
look-and-feel.