Package org.jdesktop.swingx.renderer
Class DefaultTreeRenderer
java.lang.Object
org.jdesktop.swingx.renderer.AbstractRenderer
org.jdesktop.swingx.renderer.DefaultTreeRenderer
- All Implemented Interfaces:
Serializable
,TreeCellRenderer
,UIDependent
,StringValue
,RolloverRenderer
- Direct Known Subclasses:
JXTree.DelegatingRenderer
Adapter to glue SwingX renderer support to core api
which implements TreeCellRenderer
- Author:
- Jeanette Winzenburg
- See Also:
-
Field Summary
Fields inherited from class org.jdesktop.swingx.renderer.AbstractRenderer
componentController
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a default tree renderer with the default component provider.DefaultTreeRenderer
(ComponentProvider<?> componentProvider) Instantiates a default tree renderer with the given component provider.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.Instantiates a default tree renderer with a default component provider using the given converter. -
Method Summary
Modifier and TypeMethodDescriptionprotected ComponentProvider<?>
The default ComponentProvider to use if no special.getTreeCellRendererComponent
(JTree tree, 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
-
Constructor Details
-
DefaultTreeRenderer
public DefaultTreeRenderer()Instantiates a default tree renderer with the default component provider. -
DefaultTreeRenderer
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 typeWrappingProvider
.- Parameters:
componentProvider
- the provider of the configured component to use for cell rendering
-
DefaultTreeRenderer
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
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
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 valuesv
- the converter to use for mapping the content value to a String representation.
-
DefaultTreeRenderer
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 valuesv
- 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 Details
-
getTreeCellRendererComponent
public Component getTreeCellRendererComponent(JTree tree, 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 interfaceTreeCellRenderer
- Parameters:
tree
- theJTree
, might be nullvalue
- the value to assign to the cellselected
- true if cell is selectedexpanded
- true if the cell is expandedleaf
- true if the cell is a leafhasFocus
- true if cell has focusrow
- the row of the cell to render- Returns:
- a component to render the given list cell.
-
createDefaultComponentProvider
The default ComponentProvider to use if no special.- Specified by:
createDefaultComponentProvider
in classAbstractRenderer
- Returns:
- the default
ComponentProvider
-