edu.mit.ai.psg.ui.outliner
Interface OutlineRenderer

All Known Subinterfaces:
CallOutlineRenderer
All Known Implementing Classes:
OutlineRendererDefault

public interface OutlineRenderer
extends TreeCellRenderer

An OutlineRenderer is used by an OutlineMaker to specialize tree behavior for the heterogeneous nodes in outlines. They specialize how to

  1. create an OutlineNode for the object in the tree
  2. render the object (TreeCellRenderer)
  3. generate children the first time node is expanded
  4. customize popup menu for node
This behavior is separate from OutlineNode so that it can be changed without modifying the parent of a tree node (which would require replacing the TreeModel in the case of the root).

See Also:
Outliner, OutlineMaker, OutlineNode

Method Summary
 void addPopupMenuItems(PopupMenu menu, OutlineNode node, TreePath treePath, JTree jTree)
          add to popup menu any commands specific to objects handled by this generator.
 void addPopupMenuTitle(PopupMenu menu, OutlineNode node, TreePath treePath, JTree jTree)
          add to popup menu a title identifying object of outlineNode
 OutlineMaker getOutlineMaker()
          return the outline maker of which this renderer is part
 List makeChildOutlineNodes(OutlineNode parent)
          Make List of outlineNodes, one for each child.
 OutlineNode makeNoteOutlineNode(String note)
          Creates an outline tree node for a note such as errors or messages
 OutlineNode makeOutlineNode(Object object)
          Creates an outline tree node with no label.
 OutlineNode makeOutlineNode(Object label, Object object)
          Creates an outline tree node with itself as renderer.
 void notifyInserted(OutlineModel model, OutlineNode child, int index)
          notify after node with this renderer is after successfully inserted into node's parent
 void notifyRemoving(OutlineModel model, OutlineNode child)
          notify before node with this renderer is removed from node's parent
 
Methods inherited from interface javax.swing.tree.TreeCellRenderer
getTreeCellRendererComponent
 

Method Detail

makeOutlineNode

public OutlineNode makeOutlineNode(Object label,
                                   Object object)
Creates an outline tree node with itself as renderer. Usually called via Outliner.makeOutlineNode.
Parameters:
label - Object to use for rendering label, or null if no label.
object - Object for the tree node.

makeOutlineNode

public OutlineNode makeOutlineNode(Object object)
Creates an outline tree node with no label.
See Also:
makeOutlineNode(Object, Object)

notifyInserted

public void notifyInserted(OutlineModel model,
                           OutlineNode child,
                           int index)
notify after node with this renderer is after successfully inserted into node's parent

notifyRemoving

public void notifyRemoving(OutlineModel model,
                           OutlineNode child)
notify before node with this renderer is removed from node's parent

makeNoteOutlineNode

public OutlineNode makeNoteOutlineNode(String note)
Creates an outline tree node for a note such as errors or messages

makeChildOutlineNodes

public List makeChildOutlineNodes(OutlineNode parent)
Make List of outlineNodes, one for each child. Different renderers may list different children. May call getOutlineMaker()().Outliner.makeOutlineNode(java.lang.Object)(child) or ...Outliner.makeOutlineNode(java.lang.Object)(label, child) Parent node should not be modified directly; resulting list of nodes will be safely added by AWT thread.

addPopupMenuTitle

public void addPopupMenuTitle(PopupMenu menu,
                              OutlineNode node,
                              TreePath treePath,
                              JTree jTree)
add to popup menu a title identifying object of outlineNode

addPopupMenuItems

public void addPopupMenuItems(PopupMenu menu,
                              OutlineNode node,
                              TreePath treePath,
                              JTree jTree)
add to popup menu any commands specific to objects handled by this generator. (Separate from adding title so generators which inherit title behavior can add more specific menu commands first before adding superclass commands).
See Also:
OutlineCommand

getOutlineMaker

public OutlineMaker getOutlineMaker()
return the outline maker of which this renderer is part

Copyright (c) 1996-1999
Massachusetts Institute of Technology

Feedback: jeva-feedback@ai.mit.edu