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

Method createTreeModel

unused/javax/swing/JTree.java:544–556  ·  view source on GitHub ↗

Returns a TreeModel wrapping the specified object. If the object is: an array of Object s, a Hashtable , or a Vector then a new root node is created with each of the incoming objects as children. Otherwise, a new root is created

(Object value)

Source from the content-addressed store, hash-verified

542 * @return a <code>TreeModel</code> wrapping the specified object
543 */
544 protected static TreeModel createTreeModel(Object value) {
545 DefaultMutableTreeNode root;
546
547 if((value instanceof Object[]) || (value instanceof Hashtable) ||
548 (value instanceof Vector)) {
549 root = new DefaultMutableTreeNode("root");
550 DynamicUtilTreeNode.createChildren(root, value);
551 }
552 else {
553 root = new DynamicUtilTreeNode("root", value);
554 }
555 return new DefaultTreeModel(root, false);
556 }
557
558 /**
559 * Returns a <code>JTree</code> with a sample model.

Callers 1

JTreeMethod · 0.95

Calls 1

createChildrenMethod · 0.95

Tested by

no test coverage detected