org.jdesktop.swingx.renderer
Class AbstractRenderer

java.lang.Object
  extended by org.jdesktop.swingx.renderer.AbstractRenderer
All Implemented Interfaces:
Serializable, StringValue, RolloverRenderer
Direct Known Subclasses:
DefaultListRenderer, DefaultTableRenderer, DefaultTreeRenderer

public abstract class AbstractRenderer
extends Object
implements RolloverRenderer, StringValue, Serializable

Convience common ancestor for SwingX renderers.

See Also:
Serialized Form

Field Summary
protected  ComponentProvider<?> componentController
           
 
Constructor Summary
AbstractRenderer(ComponentProvider<?> provider)
           
 
Method Summary
protected abstract  ComponentProvider<?> createDefaultComponentProvider()
          The default ComponentProvider to use if no special.
 void doClick()
          Same as AbstractButton.doClick().
 ComponentProvider<?> getComponentProvider()
          Returns the ComponentProvider used by this renderer.
 String getString(Object value)
          Returns a string representation of the given value.
 boolean isEnabled()
          
 void setBackground(Color background)
           
 void setForeground(Color foreground)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

componentController

protected ComponentProvider<?> componentController
Constructor Detail

AbstractRenderer

public AbstractRenderer(ComponentProvider<?> provider)
Method Detail

getComponentProvider

public ComponentProvider<?> getComponentProvider()
Returns the ComponentProvider used by this renderer.

Returns:
the ComponentProvider used by this renderer

createDefaultComponentProvider

protected abstract ComponentProvider<?> createDefaultComponentProvider()
The default ComponentProvider to use if no special.

Returns:
the default ComponentProvider

getString

public String getString(Object value)
Returns a string representation of the given value.

PENDING JW: forgot - why not null return guaranteed?

Specified by:
getString in interface StringValue
Parameters:
value - the object to present as a string
Returns:
a string representation of the given value, guaranteed to be not null

doClick

public void doClick()
Same as AbstractButton.doClick(). It's up to client code to prepare the renderer's component before calling this method.

Specified by:
doClick in interface RolloverRenderer

isEnabled

public boolean isEnabled()

Specified by:
isEnabled in interface RolloverRenderer
Returns:
true if rollover effects are on and clickable.

setBackground

public void setBackground(Color background)
Parameters:
background -

setForeground

public void setForeground(Color foreground)
Parameters:
foreground -