TreeNode prev = null;
Object prev = null;
  TreeNode getPreviousVisibleNode(TreeNode node)   {    TreeNode prev = null;      TreePath current = null;      if (node != null)      prev = getPreviousNode(node);      if (prev != null)      {        current = new TreePath(getPathToRoot(prev, 0));         if (tree.isVisible(current))            return prev;         while (prev != null && !tree.isVisible(current))         {            prev = getPreviousNode(prev);            if (prev != null)              current = new TreePath(getPathToRoot(prev, 0));         }      }      return prev;   }