com.explodingpixels.macwidgets
Class SourceListCountBadgeRenderer

java.lang.Object
  extended by com.explodingpixels.macwidgets.SourceListCountBadgeRenderer

public class SourceListCountBadgeRenderer
extends Object

Renders a rounded rectangle (i.e. a badge) with a given number in the center of the rectangle.


Constructor Summary
SourceListCountBadgeRenderer(Color selectedColor, Color activeUnselectedColor, Color inactiveUnselectedColor, Color textColor)
          Creates a badge renderer.
 
Method Summary
 JComponent getComponent()
          Gets the user interface component to representing this SourceListCountBadgeRenderer.
 void setState(int count, boolean selected)
          Sets the state to use when drawing the badge.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceListCountBadgeRenderer

public SourceListCountBadgeRenderer(Color selectedColor,
                                    Color activeUnselectedColor,
                                    Color inactiveUnselectedColor,
                                    Color textColor)
Creates a badge renderer.

Method Detail

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.

getComponent

public JComponent getComponent()
Gets the user interface component to representing this SourceListCountBadgeRenderer. The returned JComponent should be added to a container that will be displayed.

Returns:
the user interface component representing this SourceListCountBadgeRenderer.