All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class edu.mit.ai.psg.ui.outlines.Outliner

java.lang.Object
   |
   +----edu.mit.ai.psg.ui.outlines.Outliner

public class Outliner
extends Object
Outliner --- expandable/collapsible outlines. (Similar to trees in many UI toolkits, but elements can be labeled.)

Standard call to start Outliner is Outliner.makeOutlineFrame(Object);

Outline elements may be expanded/collapsed by clicking on the -/+ button, or double clicking on the object.

Outline created depends on class of object examined. The default ToStringComponentGenerator just creates a component based on the print string of the object and does not create any children. To use Outliner a program must initialize it with domain specific outline generators by calling Outliner.putOutlineGenerator

A component outline generator implements IOutlineComponentGenerator. When invoked, it returns a java.awt.Component, usually a subclass of OutlineTree so the component can be expanded to have children itself.

Author:
CarlManning, caroma@ai.mit.edu
Copyright (c) 1997, 1998 Massachusetts Institute of Technology

Variable Index

 o defaultGenerator
Default IOutlineComponentGenerator called if no generator found in generators
 o generators
Dictionary of IOutlineComponentGenerators keyed on interface or class to which each applies
 o outliner
outliner: an instance through which static methods indirectly invoke their implementation methods.

Constructor Index

 o Outliner()

Method Index

 o addListeners(Object, Component)
initialize object's outline Component by adding mouse event listeners.
 o addPopupMenuItems(PopupMenu, Object, Component)
addPopUpMenuItems, adds menu items to every components in outline, such as "Display item in own frame".
 o getAllGenerators(Object)
Search class and its interfaces and superclasses for a class/interface which has a generator, and return the first generator found (most specific).
 o getExactOutlineGenerator(Class)
Get the generator for exactly this interface or class (not super-interfaces or super-classes)
 o getMostSpecificGenerator(Object)
Search class and its interfaces and superclasses for a class/interface which has a generator, and return the first generator found (most specific).
 o getMostSpecificGeneratorImpl(Object)
(overrideable implementation method)
 o makeOutlineComponent(Object)
Generate a new AWT Component for obj to add to an outline.
 o makeOutlineComponentImpl(Object)
(overrideable implementation method)
 o makeOutlineFrame(Object)
Create a Frame window with an outline for obj (static method for other tools to call)
 o makeOutlineFrame(Object, String)
 o makeOutlineFrameImpl(Object)
overrideable/extendable implementation method
 o makeOutlineFrameImpl(Object, String)
 o putOutlineGenerator(Class, IOutlineComponentGenerator)
Put a outline component generator for objects with this interface in table.
 o removeOutlineGenerator(Class)
Remove the generator specific for this interface or class (not super-interfaces or super-classes)

Variables

 o outliner
 public static Outliner outliner
outliner: an instance through which static methods indirectly invoke their implementation methods. Allows implementations of these methods to be overridden in a subclass, yet other tools can still invoke them through the static methods of this class. If overriding, initialize this with instance of subclass.

 o generators
 public static Dictionary generators
Dictionary of IOutlineComponentGenerators keyed on interface or class to which each applies

 o defaultGenerator
 public static IOutlineComponentGenerator defaultGenerator
Default IOutlineComponentGenerator called if no generator found in generators

Constructors

 o Outliner
 public Outliner()

Methods

 o makeOutlineFrame
 public static Frame makeOutlineFrame(Object obj)
Create a Frame window with an outline for obj (static method for other tools to call)

 o makeOutlineFrame
 public static Frame makeOutlineFrame(Object obj,
                                      String frameLabel)
 o makeOutlineFrameImpl
 public Frame makeOutlineFrameImpl(Object obj)
overrideable/extendable implementation method

 o makeOutlineFrameImpl
 public Frame makeOutlineFrameImpl(Object obj,
                                   String frameLabel)
 o makeOutlineComponent
 public static Component makeOutlineComponent(Object obj)
Generate a new AWT Component for obj to add to an outline. Uses generator for obj's most specific class or interface. (static method for other tools to call)

 o makeOutlineComponentImpl
 public Component makeOutlineComponentImpl(Object obj)
(overrideable implementation method)

 o addListeners
 public void addListeners(Object object,
                          Component newComponent)
initialize object's outline Component by adding mouse event listeners. Called by makeOutlineComponentImpl; may be extended/overridden to add other listeners if needed

 o getMostSpecificGenerator
 public IOutlineComponentGenerator getMostSpecificGenerator(Object obj)
Search class and its interfaces and superclasses for a class/interface which has a generator, and return the first generator found (most specific).

 o getMostSpecificGeneratorImpl
 public IOutlineComponentGenerator getMostSpecificGeneratorImpl(Object obj)
(overrideable implementation method)

 o getAllGenerators
 public Vector getAllGenerators(Object obj)
Search class and its interfaces and superclasses for a class/interface which has a generator, and return the first generator found (most specific).

 o getExactOutlineGenerator
 public IOutlineComponentGenerator getExactOutlineGenerator(Class anInterface)
Get the generator for exactly this interface or class (not super-interfaces or super-classes)

 o putOutlineGenerator
 public static void putOutlineGenerator(Class forInterface,
                                        IOutlineComponentGenerator generator)
Put a outline component generator for objects with this interface in table.

Parameters:
forInterface - Objects with this interface or class will be outlined with this function (unless a more specific one applies)
generator - should return a java.awt.Component, typically an OutlineTree or a subclass.
 o removeOutlineGenerator
 public static void removeOutlineGenerator(Class forInterface)
Remove the generator specific for this interface or class (not super-interfaces or super-classes)

 o addPopupMenuItems
 public void addPopupMenuItems(PopupMenu menu,
                               Object obj,
                               Component component)
addPopUpMenuItems, adds menu items to every components in outline, such as "Display item in own frame". If there are any alternate applicable outline component generators, for each it adds a menu item to regenerate outline with that generator


All Packages  Class Hierarchy  This Package  Previous  Next  Index