MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / setVisible

Method setVisible

ij/src/main/java/ij/plugin/ControlPanel.java:1053–1075  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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;

Callers 3

buildTreePanelMethod · 0.95
actionPerformedMethod · 0.95
tearOffMethod · 0.95

Calls 11

isVisibleMethod · 0.95
restoreExpandedNodesMethod · 0.95
getRootNodeMethod · 0.95
getTreeMethod · 0.95
getRootPathMethod · 0.95
getParentMethod · 0.80
getPanelForNodeMethod · 0.80
setLocationMethod · 0.45
getPathMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected