1 4 package com.tc.admin.dso; 5 6 import java.util.Enumeration ; 7 import java.util.Vector ; 8 9 import treemap.TMModelNode; 10 import treemap.TMModelUpdater; 11 12 import com.tc.admin.common.XTreeNode; 13 14 public class ClassesModelNode implements TMModelNode { 15 private ClassTreeModel treeModel; 16 17 public ClassesModelNode(ClassTreeModel treeModel) { 18 this.treeModel = treeModel; 19 } 20 21 public Object getRoot() { 22 return treeModel.getRoot(); 23 } 24 25 public Enumeration children(Object node) { 26 Vector children = new Vector (); 27 28 if(node instanceof XTreeNode) { 29 XTreeNode treeNode = (XTreeNode)node; 30 int childCount = treeNode.getChildCount(); 31 32 for(int i = 0; i < childCount; i++) { 33 children.add(treeNode.getChildAt(i)); 34 } 35 } 36 37 return children.elements(); 38 } 39 40 public boolean isLeaf(Object node) { 41 return node instanceof ClassTreeLeaf; 42 } 43 44 public void setUpdater(TMModelUpdater updater) {} 45 } 46 | Popular Tags |