All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----edu.mit.ai.psg.ui.outlines.OutlineTree
See method generateChildren() for instructions on how to add children.
Derived classes may tailor the behavior to generate children when item is expanded. See method actionPerformed() for how to do this.
Derived classes may tailor the popup menu provided with for their instances by adding an appropriate title string identifying the moused object at the top of its pop-up menu by overriding method addPopupMenuTitle(), or by adding additional popup menu items specific to the derived outline by overriding method addPopupMenuItems().
public OutlineTree(Component component)
public Component getRootComponent()
public boolean isExpanded()
public void setExpanded(boolean isExpanded)
public boolean hasChildren()
public void generateChildren()
To add children, for each child, call this from subclass method:
. this.add(Outliner.makeOutlineComponent(childObject),
. makeLabelComponent("childLabel"));
Or if children are not labeled, then call this instead:. this.add(Outliner.makeOutlineComponent(obj));
public Component makeLabelComponent(String string)
public void addPopupMenuTitle(PopupMenu menu)
public void addPopupMenuItems(PopupMenu menu)
public void actionPerformed(ActionEvent e)
. public void actionPerformed(ActionEvent e) {
. if (! isExpanded() && ! hasChildren())
. generateChildren();
. super.actionPerformed(e)
. }
public void invalidateAndRepaintTree()
public void addImpl(Component comp,
Object label,
int index)
public void doLayout()
public Dimension getPreferredSize()
public Dimension getMinimumSize()
All Packages Class Hierarchy This Package Previous Next Index