|
|||||||||
| 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.OutlineMakerDefault
OutlineMakerDefault provides a default implementation of
OutlineMaker.
An object's most specific interface is found through depth first search;
see getMostSpecificInterfaceWithRenderers(java.lang.Object).
null is treated as the class of null.
Adds popup menu items to expand/collapse node, view a nested node as a top level node in its own window frame, or rerender a node with a choice of applicable renderers.
| Field Summary | |
Rectangle |
initialBounds
initials bounds for new window frames |
OutlineRenderer |
myNoteRenderer
renderer called to make text notes for messages, errors, etc. |
protected Map |
myRenderers
Map of stacks of OutlineRenderers keyed on interface or class
to which each applies. |
static Font |
noteFont
Default font for noteRenderer, italic system font: |
| Constructor Summary | |
OutlineMakerDefault()
|
|
| Method Summary | |
void |
addPopupMenuItems(PopupMenu menu,
OutlineNode outlineNode,
TreePath treePath,
JTree jTree)
addOutlinerPopUpMenuItems first adds menu items for "Collapse" or "Expand", then "Regenerate outline in own frame". |
void |
addRenderer(Class forInterface,
OutlineRenderer renderer)
Add an outline renderer for objects with this interface into this outliner's table. |
void |
addTreeListeners(JTree jTree)
Add mouse event listeners to JTree. |
List |
getAllInterfacesWithRenderers(Object obj)
Search class and its interfaces and superclasses for each class/interface which has a renderer, and return all classes/interfaces found. |
List |
getAllRenderers(Object obj)
Search class and its interfaces and superclasses for each class/interface which has a renderer, and return all renderers found. |
OutlineRenderer |
getExactRenderer(Class anInterface)
Get one renderer for exactly this interface or class (not super-interfaces or super-classes). |
List |
getExactRenderers(Class anInterface)
return a java.util.List of renderers for exactly this interface or class. |
JTree |
getFrameJTree(JFrame frame)
get JTree from JFrame returned by makeFrame |
Class |
getMostSpecificInterfaceWithRenderers(Object obj)
Search for outline renderers for object for the most specific class or interface of obj. |
OutlineRenderer |
getMostSpecificRenderer(Object obj)
Return outline renderer for most specific class or interface of obj. |
OutlineRenderer |
getNoteRenderer()
get renderer used for notes in an outline, such as section separators, error messages, etc. |
JTree |
getPaneJTree(Container pane)
get JTree from Container initialized with initializePane |
void |
initializePane(Container contentPane,
OutlineNode displayRoot)
initializes contentPane with a JScrollPane displaying the JTree from makeOutlineJTree(edu.mit.ai.psg.ui.outliner.OutlineNode). |
JFrame |
makeFrame(Object obj)
Convenience method, calls
this. |
JFrame |
makeFrame(String frameLabel,
OutlineNode displayRoot)
creates a JFrame with frameLabel, initializes its contentPane via initializePane(java.awt.Container, edu.mit.ai.psg.ui.outliner.OutlineNode), and displays it. |
String |
makeFrameTitle(Object obj)
overiddable method called by makeFrame(Object) |
JTree |
makeOutlineJTree(OutlineNode displayRoot)
creates and initializes a JTree for displaying outline tree. |
OutlineModel |
makeOutlineModel(OutlineNode displayRoot)
returns a new OutlineModel with hidden root of tree
(overrideable method called by makeOutlineJTree(edu.mit.ai.psg.ui.outliner.OutlineNode)) |
OutlineNode |
makeOutlineNode(Object obj)
|
OutlineNode |
makeOutlineNode(Object label,
Object obj)
(overrideable implementation method) |
JFrame |
outline(Object obj)
convenience method calls calls frame.show() before returning frame |
boolean |
removeRenderer(Class forInterface,
OutlineRenderer renderer)
Remove renderer from the renderers for this interface or class (not super-interfaces or super-classes). |
void |
setFrameJTree(JFrame frame,
JTree jTree)
set JTree in JFrame returned by makeFrame |
void |
setPaneJTree(Container pane,
JTree jTree)
set JTree in Container initialized with initializePane |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected Map myRenderers
OutlineRenderers keyed on interface or class
to which each applies. Top of stack is default chosen for that
interface or class.addRenderer(Class, OutlineRenderer),
getExactRenderer(Class)public OutlineRenderer myNoteRenderer
noteFont.public Rectangle initialBounds
public static Font noteFont
java.util.Map attributes = new java.util.HashMap(1); attributes.put(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE); defaultFont = java.awt.Font.getFont(attributes);(Initialization specifies only posture, since system default size will vary with locale, e.g., for Aisan languages.)
Font.getFont(Map)| Constructor Detail |
public OutlineMakerDefault()
| Method Detail |
public JFrame outline(Object obj)
makeFrame(Object)public JFrame makeFrame(Object obj)
this.makeFrame
(this.makeFrameTitle(obj), this.makeNode(obj));OutlineMaker.makeFrameTitle(java.lang.Object)
public JFrame makeFrame(String frameLabel,
OutlineNode displayRoot)
initializePane(java.awt.Container, edu.mit.ai.psg.ui.outliner.OutlineNode), and displays it.frameLabel - title of window framenewRoot - root node of outlineOutlineMaker.makeOutlineNode(Object)public String makeFrameTitle(Object obj)
makeFrame(Object)OutlineMaker.makeFrame(Object)public JTree getFrameJTree(JFrame frame)
public void setFrameJTree(JFrame frame,
JTree jTree)
public JTree getPaneJTree(Container pane)
public void setPaneJTree(Container pane,
JTree jTree)
public void initializePane(Container contentPane,
OutlineNode displayRoot)
makeOutlineJTree(edu.mit.ai.psg.ui.outliner.OutlineNode).public JTree makeOutlineJTree(OutlineNode displayRoot)
makeOutlineModel(edu.mit.ai.psg.ui.outliner.OutlineNode)(hiddenRoot)JTree.setRootVisible(boolean)public OutlineModel makeOutlineModel(OutlineNode displayRoot)
OutlineModel with hidden root of tree
(overrideable method called by makeOutlineJTree(edu.mit.ai.psg.ui.outliner.OutlineNode))public OutlineNode makeOutlineNode(Object obj)
OutlineMaker.makeOutlineNode(Object, Object)
public OutlineNode makeOutlineNode(Object label,
Object obj)
OutlineMaker.getMostSpecificRenderer(java.lang.Object)public void addTreeListeners(JTree jTree)
public OutlineRenderer getMostSpecificRenderer(Object obj)
getMostSpecificInterfaceWithRenderers(java.lang.Object),
getExactRenderer(java.lang.Class)public Class getMostSpecificInterfaceWithRenderers(Object obj)
I.e.:
. for (c = obj.getClass(); c != null; c = c.getSuperclass()) {
. if (null != getExactRenderer(c)) return c;
. interfacesStack = new Stack(c.getInterfaces());
. while(! interfacesStack.isEmpty()) {
. i = interfacesStack.pop();
. if (null != getExactRenderer(i)) return i;
. interfacesStack.addAll(0, i.getInterfaces());
. }
. }public List getAllRenderers(Object obj)
public List getAllInterfacesWithRenderers(Object obj)
public OutlineRenderer getExactRenderer(Class anInterface)
public List getExactRenderers(Class anInterface)
public void addRenderer(Class forInterface,
OutlineRenderer renderer)
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 boolean removeRenderer(Class forInterface,
OutlineRenderer renderer)
public OutlineRenderer getNoteRenderer()
public void addPopupMenuItems(PopupMenu menu,
OutlineNode outlineNode,
TreePath treePath,
JTree jTree)
OutlineCommand
|
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 | ||||||||