Class EmphasizedLabelUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.LabelUI
javax.swing.plaf.basic.BasicLabelUI
com.explodingpixels.macwidgets.plaf.EmphasizedLabelUI
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Color
static final Color
static final Color
static final Color
Fields inherited from class javax.swing.plaf.basic.BasicLabelUI
labelUI
-
Constructor Summary
ConstructorsConstructorDescriptionCreates anEmphasizedLabelUI
using the default colors.EmphasizedLabelUI
(Color focusedTextColor, Color unfocusedTextColor, Color emphasisColor) Creates anEmphasizedLabelUI
using the given colors. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
Methods inherited from class javax.swing.plaf.basic.BasicLabelUI
createUI, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, installComponents, installDefaults, installKeyboardActions, installListeners, layoutCL, paint, propertyChange, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
-
Field Details
-
DEFAULT_EMPHASIS_COLOR
-
DEFAULT_FOCUSED_FONT_COLOR
-
DEFAULT_UNFOCUSED_FONT_COLOR
-
DEFAULT_DISABLED_FONT_COLOR
-
-
Constructor Details
-
EmphasizedLabelUI
public EmphasizedLabelUI()Creates anEmphasizedLabelUI
using the default colors. -
EmphasizedLabelUI
Creates anEmphasizedLabelUI
using the given colors.
-
-
Method Details
-
installUI
- Overrides:
installUI
in classBasicLabelUI
-
uninstallUI
- Overrides:
uninstallUI
in classBasicLabelUI
-
paintEnabledText
- Overrides:
paintEnabledText
in classBasicLabelUI
-
paintDisabledText
- Overrides:
paintDisabledText
in classBasicLabelUI
-