/** Utility method which performs configuration which is common to all of the renderer * implementations - sets the icon and focus properties on the renderer * from the VisualizerNode. * */ private int configureFrom (HtmlRenderer.Renderer ren, Container target, boolean useOpenedIcon, boolean sel, VisualizerNode vis) { Icon icon = vis.getIcon(useOpenedIcon, bigIcons); if (icon.getIconWidth() > 0) { //Max annotated icon width is 24, so to have all the text and all //the icons come out aligned, set the icon text gap to the difference //plus a two pixel margin ren.setIconTextGap (24 - icon.getIconWidth()); } else { //If the icon width is 0, fill the space and add in //the extra two pixels so the node names are aligned (btw, this //does seem to waste a frightful amount of horizontal space in //a tree that can use all it can get) ren.setIndent (26); } ren.setIcon (icon); if (target instanceof TreeTable.TreeTableCellRenderer) { TreeTable tt = ((TreeTable.TreeTableCellRenderer) target).getTreeTable(); ren.setParentFocused (tt.hasFocus() || tt.isEditing()); } return icon.getIconWidth() == 0 ? 24 : icon.getIconWidth(); }
/** Utility method which performs configuration which is common to all of the renderer * implementations - sets the icon and focus properties on the renderer * from the VisualizerNode. * */ private int configureFrom (HtmlRenderer.Renderer ren, Container target, boolean useOpenedIcon, boolean sel, VisualizerNode vis) { Icon icon = vis.getIcon(useOpenedIcon, bigIcons); if (icon.getIconWidth() > 0) { //Max annotated icon width is 24, so to have all the text and all //the icons come out aligned, set the icon text gap to the difference //plus a two pixel margin ren.setIconTextGap (24 - icon.getIconWidth()); } else { //If the icon width is 0, fill the space and add in //the extra two pixels so the node names are aligned (btw, this //does seem to waste a frightful amount of horizontal space in //a tree that can use all it can get) ren.setIndent (26); } ren.setIcon (icon); if (target instanceof TreeTable.TreeTableCellRenderer) { TreeTable tt = ((TreeTable.TreeTableCellRenderer) target).getTreeTable(); ren.setParentFocused (tt.hasFocus() || tt.isEditing()); } return icon.getIconWidth() == 0 ? 24 : icon.getIconWidth(); }
TreeTable tt = ttRen.getTreeTable(); ren.setParentFocused(ttRen.treeTableHasFocus() || tt.isEditing());