|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--edu.mit.ai.psg.ui.outliner.Outliner
Outliner creates expandable/collapsible outline views of objects, where each node may have different renderings, and alternate renderings.
Standard call to start Outliner is outline(Object);
Outliner is a class for static convenience methods and parameters.
It keeps outlineMaker which does all the real work.
The outline created for an object by an OutlineMaker depends
on the class of the object. An OutlineMaker holds a table of
OutlineRenderers indexed by classes and interfaces. When there
are several applicable renderers, OutlineMakerDefault chooses the
one for the most specific class or interface of the object is used. An
object can be redisplayed with an alternate applicable renderer invoked
through a pop-up menu (mouse-2 or shift-click).
The OutlineMakerDefault starts out with just a single renderer for
the root class, Object. OutlineRendererDefault renders
an object by printing the object's Object.toString() and does not
create any children.
To use Outliner, a program must initialize its outlineMaker with domain
specific renderers that do create children, by calling
addRenderer(Class,OutlineRenderer). Each renderer must
implement OutlineRenderer.
This design allows other tools to invoke a system-wide outliner through
convenient static methods. Many uses will simply involve adding new
OutlineRenderers to the default OutlineMaker.
Yet, if necessary, the behavior of the system outline maker can be
extended by initializing outlineMaker to some other instance of
OutlineMaker, e.g., one that overrides some methods of
OutlineMakerDefault. (An instance of OutlineMaker can also
be used directly without Outliner.)
| Field Summary | |
static OutlineMaker |
outlineMaker
outlineMaker: the single instance through which static methods indirectly invoke their implementation methods. |
protected static String |
outlinerResourceName
|
| Constructor Summary | |
protected |
Outliner()
|
| Method Summary | |
static void |
addRenderer(Class forInterface,
OutlineRenderer renderer)
Add an outline renderer for objects with this interface into outlineMaker's table. |
static List |
getAllRenderers(Object obj)
Search class and its interfaces and superclasses for each class/interface which has a renderer, and return all renderers found. |
static String |
getCopyright()
|
static String |
getHomepage()
|
static OutlineRenderer |
getMostSpecificRenderer(Object obj)
Search class and its interfaces and superclasses for a class/interface which has a renderer, and return the most specific renderer found. |
static OutlineRenderer |
getNoteRenderer()
get renderer used for notes in an outline, such as section separators, error messages, etc. |
static String |
getNoWarranty()
|
protected static String |
getOutlinerBundleString(String resourceKey)
|
static String |
getVersion()
|
static JFrame |
makeFrame(Object obj)
Make a new window frame displaying an outline of this object. |
static JFrame |
makeFrame(String frameLabel,
OutlineNode newRoot)
Make a new window frame displaying outline. |
static OutlineNode |
makeOutlineNode(Object obj)
|
static OutlineNode |
makeOutlineNode(Object label,
Object obj)
Make a new OutlineNode for obj to add to an outline. |
static JFrame |
outline(Object obj)
Make a new window frame outlining obj, show frame, and return it. |
static boolean |
removeRenderer(Class forInterface,
OutlineRenderer renderer)
Remove renderer from the renderers for this interface or class (not super-interfaces or super-classes). |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static OutlineMaker outlineMaker
protected static final String outlinerResourceName
| Constructor Detail |
protected Outliner()
| Method Detail |
public static String getCopyright()
public static String getNoWarranty()
public static String getVersion()
public static String getHomepage()
public static JFrame outline(Object obj)
public static JFrame makeFrame(Object obj)
public static JFrame makeFrame(String frameLabel,
OutlineNode newRoot)
frameLabel - title of window framenewRoot - root node of outlinemakeOutlineNode(Object)public static OutlineNode makeOutlineNode(Object obj)
makeOutlineNode(Object, Object)
public static OutlineNode makeOutlineNode(Object label,
Object obj)
getMostSpecificRenderer(java.lang.Object)public static OutlineRenderer getMostSpecificRenderer(Object obj)
public static List getAllRenderers(Object obj)
public static void addRenderer(Class forInterface,
OutlineRenderer renderer)
outlineMaker's table. Most recently added renderer is
default for an interface, so adding a renderer it already has makes
it the default.forInterface - Objects with this interface or class will be
outlined with this function (unless a more specific one applies).
If forInterface is null, then it will be used to render null.renderer - must be a non-null OutlineRenderer
public static boolean removeRenderer(Class forInterface,
OutlineRenderer renderer)
public static OutlineRenderer getNoteRenderer()
protected static String getOutlinerBundleString(String resourceKey)
|
Copyright (c) 1996-1999 Massachusetts Institute of Technology Feedback: jeva-feedback@ai.mit.edu |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||