public class JXTree.DelegatingRenderer extends Object implements TreeCellRenderer, RolloverRenderer
PENDING JW: formally implement UIDependent? PENDING JW: missing updateUI anyway (got lost when c&p from JXList ;-) PENDING JW: missing override of updateUI in xtree ...
Modifier and Type | Field and Description |
---|---|
private Icon |
closedIcon |
private TreeCellRenderer |
delegate |
private Icon |
leafIcon |
private Icon |
openIcon |
Constructor and Description |
---|
DelegatingRenderer()
Instantiates a DelegatingRenderer with tree's default renderer as delegate.
|
DelegatingRenderer(TreeCellRenderer delegate)
Instantiates a DelegatingRenderer with the given delegate.
|
Modifier and Type | Method and Description |
---|---|
void |
doClick()
Same as AbstractButton.doClick().
|
TreeCellRenderer |
getDelegateRenderer()
Returns the delegate.
|
Component |
getTreeCellRendererComponent(JTree tree,
Object value,
boolean selected,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus)
Overridden to apply the highlighters, if any, after calling the delegate.
|
private void |
initIcons(DefaultTreeCellRenderer renderer)
initially sets the icons to the defaults as given
by a DefaultTreeCellRenderer.
|
boolean |
isEnabled() |
void |
setClosedIcon(Icon closedIcon) |
void |
setDelegateRenderer(TreeCellRenderer delegate)
Sets the delegate.
|
void |
setLeafIcon(Icon leafIcon) |
void |
setOpenIcon(Icon openIcon) |
private void |
updateIcons()
tries to set the renderers icons.
|
private Icon closedIcon
private TreeCellRenderer delegate
public DelegatingRenderer()
public DelegatingRenderer(TreeCellRenderer delegate)
delegate
- the delegate to use, if null the tree's default is
created and used.private void initIcons(DefaultTreeCellRenderer renderer)
renderer
- public void setDelegateRenderer(TreeCellRenderer delegate)
delegate
- the delegate to use, if null the list's default is
created and used.private void updateIcons()
public void setClosedIcon(Icon closedIcon)
public void setOpenIcon(Icon openIcon)
public void setLeafIcon(Icon leafIcon)
public TreeCellRenderer getDelegateRenderer()
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
Overridden to apply the highlighters, if any, after calling the delegate. The decorators are not applied if the row is invalid.
getTreeCellRendererComponent
in interface TreeCellRenderer
public boolean isEnabled()
isEnabled
in interface RolloverRenderer
public void doClick()
RolloverRenderer
doClick
in interface RolloverRenderer
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses