if (isLeaf(row)) { bounds.x -= rightChildIndent - 4; bounds.width += rightChildIndent + 4; } else if (tree.isExpanded(path) && expandedIcon != null) bounds.width += expandedIcon.getIconWidth() + 4; else if (collapsedIcon != null) bounds.width += collapsedIcon.getIconWidth() + 4;
boolean isLeaf = isLeaf(row); if (isLeaf) bounds.width += rightChildIndent + gap; else if (hasControlIcons()) bounds.width += getCurrentControlIcon(path).getIconWidth() + gap;
    public void mousePressed(MouseEvent e)    {      Point click = e.getPoint();      TreePath path = getClosestPathForLocation(tree, click.x, click.y);      if (path != null)        {          bounds = getPathBounds(tree, path);          int row = getRowForPath(tree, path);          boolean cntlClick = isLocationInExpandControl(path, click.x, click.y);                    if (isLeaf(row))            {              bounds.x -= rightChildIndent - 4;              bounds.width += rightChildIndent + 4;            }          else if (tree.isExpanded(path) && expandedIcon != null)              bounds.width += expandedIcon.getIconWidth() + 4;          else if (collapsedIcon != null)              bounds.width += collapsedIcon.getIconWidth() + 4;          boolean inBounds = bounds.contains(click.x, click.y);          if ((inBounds || cntlClick) && tree.isVisible(path))            {              selectPath(tree, path);              if (inBounds && e.getClickCount() == 2 && !isLeaf(row))                  toggleExpandState(path);                            if (cntlClick)                {                  handleExpandControlClick(path, click.x, click.y);                  if (cellEditor != null)                    cellEditor.cancelCellEditing();                }              else if (tree.isEditable())                startEditing(path, e);            }        }    }