public class NodeRenderer extends Object implements TreeCellRenderer, ListCellRenderer
Node
Constructor and Description |
---|
NodeRenderer()
Creates default renderer.
|
NodeRenderer(boolean bigIcons)
Deprecated.
bigIcons was only used by IconView, and not used by that
anymore. NodeRenderer will automatically detect if the view it's
rendering for is an instance of IconView.
|
Modifier and Type | Method and Description |
---|---|
Component |
getListCellRendererComponent(JList list,
Object value,
int index,
boolean sel,
boolean cellHasFocus)
This is the only method defined by
ListCellRenderer . |
Component |
getTreeCellRendererComponent(JTree tree,
Object value,
boolean sel,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus)
Finds the component that is capable of drawing the cell in a tree.
|
boolean |
isShowIcons() |
void |
setShowIcons(boolean showIcons) |
static NodeRenderer |
sharedInstance()
Deprecated.
This method no longer returns a shared instance, as it
caused problems with one view setting properties (such as enabled
state) on the renderer and the renderer then being used in its altered
state by a different view. Views should create their own instance of
NodeRenderer instead.
|
public NodeRenderer()
@Deprecated public NodeRenderer(boolean bigIcons)
bigIcons
- use big icons if possible@Deprecated public static NodeRenderer sharedInstance()
public final void setShowIcons(boolean showIcons)
public final boolean isShowIcons()
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus)
getTreeCellRendererComponent
in interface TreeCellRenderer
value
- value can be either Node
or a VisualizerNode
.public Component getListCellRendererComponent(JList list, Object value, int index, boolean sel, boolean cellHasFocus)
ListCellRenderer
. We just
reconfigure the Jlabel
each time we're called.getListCellRendererComponent
in interface ListCellRenderer