DefaultMutableTreeNode (Object element) { if (element == null) return null; DefaultMutableTreeNode node = getNodeForElement(element, false); if (node == null) return null; return myTree.isRootVisible() || node != getRootNode() ? node : null; }