1480 |
updateUI(); |
updateUI(); |
1481 |
setRootVisible(true); |
setRootVisible(true); |
1482 |
setModel(model); |
setModel(model); |
1483 |
setSelectionModel(EmptySelectionModel.sharedInstance()); |
setSelectionModel(new EmptySelectionModel()); |
1484 |
} |
} |
1485 |
|
|
1486 |
/** |
/** |
2065 |
} |
} |
2066 |
Rectangle rect = getPathBounds(path); |
Rectangle rect = getPathBounds(path); |
2067 |
scrollRectToVisible(rect); |
scrollRectToVisible(rect); |
2068 |
setSelectionPath(temp); |
revalidate(); |
2069 |
|
repaint(); |
2070 |
} |
} |
2071 |
|
|
2072 |
public void scrollRowToVisible(int row) |
public void scrollRowToVisible(int row) |
2364 |
|
|
2365 |
public void expandPath(TreePath path) |
public void expandPath(TreePath path) |
2366 |
{ |
{ |
2367 |
// Don't expand if last path component is a leaf node. |
// Don't expand if path is null |
2368 |
if ((path == null) || (treeModel.isLeaf(path.getLastPathComponent()))) |
if (path == null) |
2369 |
return; |
return; |
2370 |
|
|
2371 |
try |
try |
2589 |
|
|
2590 |
if (!isExpanded(parent) && parent != null) |
if (!isExpanded(parent) && parent != null) |
2591 |
doExpandParents(parent, false); |
doExpandParents(parent, false); |
2592 |
|
|
2593 |
nodeStates.put(path, state ? EXPANDED : COLLAPSED); |
nodeStates.put(path, state ? EXPANDED : COLLAPSED); |
2594 |
} |
} |
2595 |
|
|
2597 |
{ |
{ |
2598 |
if (path == null) |
if (path == null) |
2599 |
return; |
return; |
|
TreePath parent = path.getParentPath(); |
|
2600 |
|
|
2601 |
doExpandParents(path, state); |
doExpandParents(path, state); |
2602 |
} |
} |
2650 |
{ |
{ |
2651 |
if (path == null) |
if (path == null) |
2652 |
return; |
return; |
2653 |
|
|
2654 |
expandPath(path.getParentPath()); |
expandPath(path.getParentPath()); |
2655 |
} |
} |
2656 |
|
|