Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jdesktop.swingx.renderer
Class AbstractRenderer

    java.lang.Object
      org.jdesktop.swingx.renderer.AbstractRenderer

All Implemented Interfaces:
  java.io.Serializable, UIDependent, StringValue, RolloverRenderer

Direct Known Subclasses:
  DefaultListRenderer, DefaultTableRenderer, DefaultTreeRenderer

    public abstract class AbstractRenderer

extends java.lang.Object
implements RolloverRenderer, StringValue, java.io.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:
  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.
`java.lang.String` | `getString(java.lang.Object value)` Returns a string representation of the given value.
`boolean` | `isEnabled()`
`void` | `setBackground(java.awt.Color background)`
`void` | `setForeground(java.awt.Color foreground)`
`void` | `updateUI()` Updates all internal visuals after changing a UI-delegate.

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 java.lang.String getString(java.lang.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.

### updateUI

    public void updateUI()

  Updates all internal visuals after changing a UI-delegate.

  Specified by:
    `updateUI` in interface `UIDependent`
  See Also:
    `JComponent.updateUI()`

### setBackground

    public void setBackground(java.awt.Color background)

  Parameters:
    `background` -

### setForeground

    public void setForeground(java.awt.Color foreground)

  Parameters:
    `foreground` -

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2010. All Rights Reserved.