599 |
{ |
{ |
600 |
DefaultMutableTreeNode node = ((DefaultMutableTreeNode) (tree |
DefaultMutableTreeNode node = ((DefaultMutableTreeNode) (tree |
601 |
.getModel()).getRoot()); |
.getModel()).getRoot()); |
|
TreePath current = null; |
|
602 |
|
|
603 |
for (int i = 0; i < row; i++) |
for (int i = 0; i < row; i++) |
604 |
{ |
node = getNextVisibleNode(node); |
|
current = new TreePath(node.getPath()); |
|
|
if (tree.isExpanded(current)) |
|
|
node = getNextVisibleNode(node); |
|
|
else if (tree.isVisible(current)) |
|
|
{ |
|
|
DefaultMutableTreeNode next = getNextVisibleNode(node); |
|
|
node = node.getNextSibling(); |
|
|
|
|
|
// if there is no next sibling, check if any nodes are left |
|
|
if (node == null) |
|
|
if (next == null) |
|
|
break; |
|
|
else |
|
|
node = next; |
|
|
} |
|
|
} |
|
605 |
|
|
606 |
// in case nothing was found |
// in case nothing was found |
607 |
if (node == null) |
if (node == null) |