1 2 25 26 package org.aspectj.ajde.ui.swing; 27 28 import java.util.*; 29 import javax.swing.*; 30 import javax.swing.tree.*; 31 import org.aspectj.asm.*; 32 import org.aspectj.ajde.ui.*; 33 34 37 public class SwingTreeViewNode extends DefaultMutableTreeNode implements StructureViewNode { 38 39 private StructureNode structureNode; 40 private AbstractIcon icon; 41 42 public SwingTreeViewNode(StructureNode structureNode, AbstractIcon icon, List children) { 43 super(structureNode, true); 44 this.structureNode = structureNode; 45 this.icon = icon; 46 47 if (children != null) { 48 for (Iterator it = children.iterator(); it.hasNext(); ) { 49 super.add((SwingTreeViewNode)it.next()); 50 } 51 } 52 } 53 54 public StructureNode getStructureNode() { 55 return structureNode; 56 } 57 58 public AbstractIcon getIcon() { 59 return icon; 60 } 61 62 public void add(StructureViewNode child) { 63 super.add((DefaultMutableTreeNode)child); 64 } 65 66 public void remove(StructureViewNode child) { 67 super.remove((DefaultMutableTreeNode)child); 68 } 69 70 public List getChildren() { 71 if (children == null) { 72 return new ArrayList(); 73 } else { 74 return children; 75 } 76 } 77 } 78 79 | Popular Tags |