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

Method getPathForIndexs

unused/javax/swing/JTree.java:3223–3246  ·  view source on GitHub ↗

Returns a TreePath created by obtaining the children for each of the indices in indexs . If indexs or the TreeModel is null , it will return null .

(int[] indexs)

Source from the content-addressed store, hash-verified

3221 * <code>null</code>.
3222 */
3223 private TreePath getPathForIndexs(int[] indexs) {
3224 if(indexs == null)
3225 return null;
3226
3227 TreeModel model = getModel();
3228
3229 if(model == null)
3230 return null;
3231
3232 int count = indexs.length;
3233 Object parent = model.getRoot();
3234 if (parent == null)
3235 return null;
3236
3237 TreePath parentPath = new TreePath(parent);
3238
3239 for(int counter = 0; counter < count; counter++) {
3240 parent = model.getChild(parent, indexs[counter]);
3241 if(parent == null)
3242 return null;
3243 parentPath = parentPath.pathByAddingChild(parent);
3244 }
3245 return parentPath;
3246 }
3247
3248 /**
3249 * <code>EmptySelectionModel</code> is a <code>TreeSelectionModel</code>

Callers 1

Calls 3

getModelMethod · 0.95
getRootMethod · 0.80
getChildMethod · 0.45

Tested by

no test coverage detected