()
| 1051 | } |
| 1052 | |
| 1053 | void setVisible() { |
| 1054 | if (pFrame!=null && !pFrame.isVisible()) { |
| 1055 | restoreExpandedNodes(); |
| 1056 | if (defaultLocation!=null) pFrame.setLocation(defaultLocation); |
| 1057 | pFrame.setVisible(true); |
| 1058 | // close expanded path to this panel in its parent panel (if visible and if the path is expanded) |
| 1059 | DefaultMutableTreeNode parent = (DefaultMutableTreeNode)root.getParent(); |
| 1060 | if (parent!=null) { |
| 1061 | TreePanel pnl = pcp.getPanelForNode(parent); |
| 1062 | if (pnl!=null && pnl.isVisible()) { |
| 1063 | TreeNode[] rPath = root.getPath(); |
| 1064 | TreeNode[] pPath = pnl.getRootNode().getPath(); |
| 1065 | DefaultMutableTreeNode[] tPath = new DefaultMutableTreeNode[rPath.length-pPath.length+1]; |
| 1066 | for(int i=0; i<tPath.length; i++) |
| 1067 | tPath[i] = (DefaultMutableTreeNode)rPath[i+pPath.length-1]; |
| 1068 | //TreePath path = new TreePath(rPath); |
| 1069 | TreePath localPath = new TreePath(tPath); |
| 1070 | pnl.getTree().collapsePath(localPath); |
| 1071 | } |
| 1072 | } |
| 1073 | } |
| 1074 | if (pcp!=null) pcp.setPanelShowingProperty(getRootPath().toString()); |
| 1075 | } |
| 1076 | |
| 1077 | void setLocation(Point p) { |
| 1078 | if (p!=null) defaultLocation = p; |
no test coverage detected