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 DefaultTreeRenderer

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

All Implemented Interfaces:
  java.io.Serializable, javax.swing.tree.TreeCellRenderer, UIDependent, StringValue, RolloverRenderer

    public class DefaultTreeRenderer

extends AbstractRenderer
implements javax.swing.tree.TreeCellRenderer

Adapter to glue SwingX renderer support to core api.

Author:
  Jeanette Winzenburg
See Also:
  Serialized Form

Field Summary

Fields inherited from class org.jdesktop.swingx.renderer.AbstractRenderer
`componentController`

Constructor Summary
`DefaultTreeRenderer()` Instantiates a default tree renderer with the default component provider.
`DefaultTreeRenderer(ComponentProvider<?> componentProvider)` Instantiates a default tree renderer with the given component provider.
`DefaultTreeRenderer(IconValue iv)` Instantiates a default tree renderer with the default wrapping provider, using the given IconValue for customizing the icons.
`DefaultTreeRenderer(IconValue iv, StringValue sv)` Instantiates a default tree renderer with the default wrapping provider, using the given IconValue for customizing the icons and the given StringValue for node content.
`DefaultTreeRenderer(IconValue iv, StringValue sv, boolean unwrapUserObject)` Instantiates a default tree renderer with the default wrapping provider, using the given IconValue for customizing the icons and the given StringValue for node content.
`DefaultTreeRenderer(StringValue sv)` Instantiates a default tree renderer with a default component provider using the given converter.

Method Summary
`protected ComponentProvider<?>` | `createDefaultComponentProvider()` The default ComponentProvider to use if no special.
`java.awt.Component` | `getTreeCellRendererComponent(javax.swing.JTree tree, java.lang.Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)` Returns a configured component, appropriate to render the given tree cell.

Methods inherited from class org.jdesktop.swingx.renderer.AbstractRenderer
`doClick, getComponentProvider, getString, isEnabled, setBackground, setForeground, updateUI`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DefaultTreeRenderer

    public DefaultTreeRenderer()

  Instantiates a default tree renderer with the default component provider.

### DefaultTreeRenderer

    public DefaultTreeRenderer(ComponentProvider<?> componentProvider)

  Instantiates a default tree renderer with the given component provider. If the controller is null, creates and uses a default. The default controller is of type `WrappingProvider`.

  Parameters:
    `componentProvider` - the provider of the configured component to use for cell rendering

### DefaultTreeRenderer

    public DefaultTreeRenderer(IconValue iv)

  Instantiates a default tree renderer with the default wrapping provider, using the given IconValue for customizing the icons.

  Parameters:
    `iv` - the IconValue to use for mapping a custom icon for a given value

### DefaultTreeRenderer

    public DefaultTreeRenderer(StringValue sv)

  Instantiates a default tree renderer with a default component provider using the given converter.

  Parameters:
    `sv` - the converter to use for mapping the content value to a String representation.

### DefaultTreeRenderer

    public DefaultTreeRenderer(IconValue iv,
                               StringValue sv)

  Instantiates a default tree renderer with the default wrapping provider, using the given IconValue for customizing the icons and the given StringValue for node content.

  Parameters:
    `iv` - the IconValue to use for mapping a custom icon for a given value
    `sv` - the converter to use for mapping the content value to a String representation.

### DefaultTreeRenderer

    public DefaultTreeRenderer(IconValue iv,
                               StringValue sv,
                               boolean unwrapUserObject)

  Instantiates a default tree renderer with the default wrapping provider, using the given IconValue for customizing the icons and the given StringValue for node content.

  Parameters:
    `iv` - the IconValue to use for mapping a custom icon for a given value
    `sv` - the converter to use for mapping the content value to a String representation.
    `unwrapUserObject` - a flag indicating whether this provider should auto-unwrap the userObject from the context value.

Method Detail

### getTreeCellRendererComponent

    public java.awt.Component getTreeCellRendererComponent(javax.swing.JTree tree,
                                                           java.lang.Object value,
                                                           boolean selected,
                                                           boolean expanded,
                                                           boolean leaf,
                                                           int row,
                                                           boolean hasFocus)

  Returns a configured component, appropriate to render the given tree cell.

  Specified by:
    `getTreeCellRendererComponent` in interface `javax.swing.tree.TreeCellRenderer`
  Parameters:
    `tree` - the `JTree`
    `value` - the value to assign to the cell
    `selected` - true if cell is selected
    `expanded` - true if the cell is expanded
    `leaf` - true if the cell is a leaf
    `hasFocus` - true if cell has focus
    `row` - the row of the cell to render
  Returns:
    a component to render the given list cell.

### createDefaultComponentProvider

    protected ComponentProvider<?> createDefaultComponentProvider()

  The default ComponentProvider to use if no special.

  Specified by:
    `createDefaultComponentProvider` in class `AbstractRenderer`
  Returns:
    the default `ComponentProvider`

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.