Rectangle (Object value, int row, int depth, boolean expanded, Rectangle bounds) { JTree tree = getTree(); if (tree == null) { return null; } boolean leaf = isLeaf(value); Dimension size = null; // TODO: editingComponent, editingRow ??? if (editingComponent != null && editingRow == row) { size = editingComponent.getPreferredSize(); } else { boolean selected = tree.isRowSelected(row); Component component = getRenderer(tree, value, selected, expanded, leaf, row, false); if (component != null) { component.validate(); size = component.getPreferredSize(); removeCachedRenderers(); } } if (size == null) { return null; } int x = getPainter(tree).getRendererOffset(myDefaultControl, depth + TreeUtil.getDepthOffset(tree), leaf); int height = getRowHeight(); if (height <= 0) { height = size.height; } if (bounds == null) { return new Rectangle(x, 0, size.width, height); } bounds.x = x; bounds.y = 0; bounds.width = size.width; bounds.height = height; return bounds; }