org.jdesktop.swingx
Class JXTree.DelegatingRenderer
java.lang.Object
org.jdesktop.swingx.JXTree.DelegatingRenderer
- All Implemented Interfaces:
- TreeCellRenderer, RolloverRenderer
- Enclosing class:
- JXTree
public class JXTree.DelegatingRenderer
- extends Object
- implements TreeCellRenderer, RolloverRenderer
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JXTree.DelegatingRenderer
public JXTree.DelegatingRenderer()
setDelegateRenderer
public void setDelegateRenderer(TreeCellRenderer delegate)
- Set the delegate renderer.
Updates the folder/leaf icons.
THINK: how to update? always override with this.icons, only
if renderer's icons are null, update this icons if they are not,
update all if only one is != null.... ??
- Parameters:
delegate
-
setClosedIcon
public void setClosedIcon(Icon closedIcon)
setOpenIcon
public void setOpenIcon(Icon openIcon)
setLeafIcon
public void setLeafIcon(Icon leafIcon)
getDelegateRenderer
public TreeCellRenderer getDelegateRenderer()
getTreeCellRendererComponent
public Component getTreeCellRendererComponent(JTree tree,
Object value,
boolean selected,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus)
- Description copied from interface:
javax.swing.tree.TreeCellRenderer
- Sets the value of the current tree cell to
value
.
If selected
is true, the cell will be drawn as if
selected. If expanded
is true the node is currently
expanded and if leaf
is true the node represets a
leaf and if hasFocus
is true the node currently has
focus. tree
is the JTree
the receiver is being
configured for. Returns the Component
that the renderer
uses to draw the value.
- Specified by:
getTreeCellRendererComponent
in interface TreeCellRenderer
- Returns:
- the
Component
that the renderer uses to draw the value
isEnabled
public boolean isEnabled()
- Specified by:
isEnabled
in interface RolloverRenderer
- Returns:
- true if rollover effects are on and clickable.
doClick
public void doClick()
- Description copied from interface:
RolloverRenderer
- 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