TreePath path = treeState.getPathForRow(row);
prefSize = editingComponent.getPreferredSize(); int rowHeight = getRowHeight(); if (rowHeight > 0 && rowHeight != prefSize.height) prefSize.height = rowHeight; } else {  Component rend = currentCellRenderer.getTreeCellRendererComponent(tree, cell, tree.isRowSelected(row), expanded, treeModel.isLeaf(cell), row, false);  rendererPane.add(rend); rend.validate(); prefSize = rend.getPreferredSize(); } if (size != null) {
    public Rectangle getNodeDimensions(Object cell, int row, int depth,                                       boolean expanded, Rectangle size)    {      if (size == null || cell == null)      return null;      String s = cell.toString();      Font f = tree.getFont();      FontMetrics fm = tree.getToolkit().getFontMetrics(f);      if (s != null)        {          TreePath path = treeState.getPathForRow(row);          size.x = getRowX(row, depth);          size.width = SwingUtilities.computeStringWidth(fm, s);          size.width = size.width + getCurrentControlIcon(path).getIconWidth()                       + gap + getNodeIcon(path).getIconWidth();          size.height = getMaxHeight(tree);          size.y = size.height * row;        }      return size;    }