package NET.worlds.console; import java.awt.List; import java.util.Vector; abstract class StatMan { protected Vector _children; protected List _grabbedList; protected Tree _tree; void createList() { this.updateList(); } abstract void updateList(); void releaseList(boolean terminalCallback) { this._grabbedList = null; } void grabList(List list) { assert this._grabbedList == null; this._grabbedList = list; this._grabbedList.removeAll(); this.createList(); } void setTree(Tree tree) { this._tree = tree; if (this._children != null) { for (int i = this._children.size() - 1; i >= 0; i--) { StatMan child = (StatMan)this._children.elementAt(i); child.setTree(this._tree); } } } Vector getChildren() { return this._children; } void addChild(StatMan child) { assert child != null; if (this._children == null) { this._children = new Vector(); } assert this._children.indexOf(child) == -1; this._children.addElement(child); if (this._tree != null) { child.setTree(this._tree); this._tree.update(); } } }