Package org.jdesktop.swingx.renderer
Class AbstractRenderer
java.lang.Object
org.jdesktop.swingx.renderer.AbstractRenderer
- All Implemented Interfaces:
Serializable,UIDependent,StringValue,RolloverRenderer
- Direct Known Subclasses:
DefaultListRenderer,DefaultTableRenderer,DefaultTreeRenderer
public abstract class AbstractRenderer
extends Object
implements RolloverRenderer, StringValue, Serializable, UIDependent
Convenience common ancestor for SwingX renderers. Concrete subclasses
should
- provide a bunch of convenience constructors as appropriate for the type of collection component
- create a reasonable default ComponentProvider if none is given
- implement the getXXCellRenderer by delegating to the ComponentProvider
- Author:
- Jeanette Winzenburg
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ComponentProvider<?>The default ComponentProvider to use if no special.voiddoClick()Same as AbstractButton.doClick().Returns the ComponentProvider used by this renderer.Returns a string representation of the given value.booleanvoidsetBackground(Color background) voidsetForeground(Color foreground) voidupdateUI()
-
Field Details
-
componentController
-
-
Constructor Details
-
AbstractRenderer
ctor- Parameters:
provider- ComponentProvider the componentController
-
-
Method Details
-
getComponentProvider
Returns the ComponentProvider used by this renderer.- Returns:
- the ComponentProvider used by this renderer
-
createDefaultComponentProvider
The default ComponentProvider to use if no special.- Returns:
- the default
ComponentProvider
-
getString
Returns a string representation of the given value.PENDING JW: forgot - why not null return guaranteed?
- Specified by:
getStringin interfaceStringValue- 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:
doClickin interfaceRolloverRenderer
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceRolloverRenderer- Returns:
- true if rollover effects are on and clickable.
-
updateUI
public void updateUI()- Specified by:
updateUIin interfaceUIDependent
-
setBackground
- Parameters:
background- Color for background
-
setForeground
- Parameters:
foreground- Color for foreground
-