public java.awt.Component | getTreeCellRendererComponent(javax.swing.JTree tree, java.lang.Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus)
super.getTreeCellRendererComponent(
tree, value, sel,
expanded, leaf, row,
hasFocus);
if (value instanceof NodeWrapper)
{
NodeWrapper node = (NodeWrapper)value;
String targetUrl = node.getIconUrl ();
ImageIcon img = (ImageIcon)cache.get( targetUrl );
if (img != null)
{
setIcon (img);
}
else
{
URL target = null;
try { target = new URL(this.ctx.localizeUrl(targetUrl)); } catch (Exception ignored) {}
if (target != null)
{
try
{
img = new ImageIcon(target);
cache.put (targetUrl, img);
setIcon (img);
}
catch (Exception tobad) {}
}
}
String desc = node.getDescription ();
if (desc != null)
{
setToolTipText (desc);
}
}
return this;
|