MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / getArchivableExpandedState

Method getArchivableExpandedState

unused/javax/swing/JTree.java:3142–3169  ·  view source on GitHub ↗

Returns an object that can be archived indicating what nodes are expanded and what aren't. The objects from the model are NOT written out.

()

Source from the content-addressed store, hash-verified

3140 * written out.
3141 */
3142 private Object getArchivableExpandedState() {
3143 TreeModel model = getModel();
3144
3145 if(model != null) {
3146 Enumeration<TreePath> paths = expandedState.keys();
3147
3148 if(paths != null) {
3149 Vector<Object> state = new Vector<Object>();
3150
3151 while(paths.hasMoreElements()) {
3152 TreePath path = paths.nextElement();
3153 Object archivePath;
3154
3155 try {
3156 archivePath = getModelIndexsForPath(path);
3157 } catch (Error error) {
3158 archivePath = null;
3159 }
3160 if(archivePath != null) {
3161 state.addElement(archivePath);
3162 state.addElement(expandedState.get(path));
3163 }
3164 }
3165 return state;
3166 }
3167 }
3168 return null;
3169 }
3170
3171 /**
3172 * Updates the expanded state of nodes in the tree based on the

Callers 1

writeObjectMethod · 0.95

Calls 4

getModelMethod · 0.95
getModelIndexsForPathMethod · 0.95
addElementMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected