com.explodingpixels.macwidgets.plaf
public class EmphasizedLabelUI extends BasicLabelUI
A BasicLabelUI
that paints a shadow under the text using the given shadow color, which
helps emphasize the text. The UI delegate also provides a facility for drawing a different shadow
color when the corresponding label's containing Window
is unfocused.
JLabel
s, it is
recommended that you use the
MacWidgetFactory.createEmphasizedLabel(String)
or
MacWidgetFactory.makeEmphasizedLabel(JLabel, Color, Color, Color)
factory methods.
Here's a close-up of an emphasized label:
Modifier and Type | Field and Description |
---|---|
static Color |
DEFAULT_DISABLED_FONT_COLOR |
static Color |
DEFAULT_EMPHASIS_COLOR |
static Color |
DEFAULT_FOCUSED_FONT_COLOR |
static Color |
DEFAULT_UNFOCUSED_FONT_COLOR |
labelUI
Constructor and Description |
---|
EmphasizedLabelUI()
Creates an
EmphasizedLabelUI using the default colors. |
EmphasizedLabelUI(Color focusedTextColor,
Color unfocusedTextColor,
Color emphasisColor)
Creates an
EmphasizedLabelUI using the given colors. |
Modifier and Type | Method and Description |
---|---|
void |
installUI(JComponent c) |
protected void |
paintDisabledText(JLabel label,
Graphics g,
String s,
int textX,
int textY) |
protected void |
paintEnabledText(JLabel label,
Graphics g,
String s,
int textX,
int textY) |
void |
uninstallUI(JComponent c) |
createUI, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, installComponents, installDefaults, installKeyboardActions, installListeners, layoutCL, paint, propertyChange, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners
contains, getAccessibleChild, getAccessibleChildrenCount, update
public static final Color DEFAULT_EMPHASIS_COLOR
public static final Color DEFAULT_FOCUSED_FONT_COLOR
public static final Color DEFAULT_UNFOCUSED_FONT_COLOR
public static final Color DEFAULT_DISABLED_FONT_COLOR
public EmphasizedLabelUI()
EmphasizedLabelUI
using the default colors.public void installUI(JComponent c)
installUI
in class BasicLabelUI
public void uninstallUI(JComponent c)
uninstallUI
in class BasicLabelUI
protected void paintEnabledText(JLabel label, Graphics g, String s, int textX, int textY)
paintEnabledText
in class BasicLabelUI
protected void paintDisabledText(JLabel label, Graphics g, String s, int textX, int textY)
paintDisabledText
in class BasicLabelUI