Package com.explodingpixels.macwidgets
Class MacBadgeRenderer
java.lang.Object
com.explodingpixels.macwidgets.MacBadgeRenderer
- Direct Known Subclasses:
SourceListCountBadgeRenderer
Renders a rounded rectangle (i.e. a badge) with a given number in the center of the rectangle.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMacBadgeRenderer
(Color selectedColor, Color activeUnselectedColor, Color inactiveUnselectedColor, Color textColor) Creates a badge renderer. -
Method Summary
Modifier and TypeMethodDescriptionGets the user interface component to representing thisSourceListCountBadgeRenderer
.void
setState
(int count, boolean selected) Sets the state to use when drawing the badge.void
Sets the state to use when drawing the badge.
-
Field Details
-
fLabel
protected com.explodingpixels.macwidgets.MacBadgeRenderer.CustomJLabel fLabel -
fSelected
protected boolean fSelected -
BADGE_FONT
-
fSelectedColor
-
fActiveUnselectedColor
-
fInactiveUnselectedColor
-
fTextColor
-
-
Constructor Details
-
Method Details
-
setState
public void setState(int count, boolean selected) Sets the state to use when drawing the badge.- Parameters:
count
- the count value to draw in the center of the badge.selected
- true if the badge should be rendered in a selected state.
-
setState
Sets the state to use when drawing the badge.- Parameters:
value
- the text value to draw in the center of the badge.selected
- true if the badge should be rendered in a selected state.
-
getComponent
Gets the user interface component to representing thisSourceListCountBadgeRenderer
. The returnedJComponent
should be added to a container that will be displayed.- Returns:
- the user interface component representing this
SourceListCountBadgeRenderer
.
-