edu.mit.ai.psg.jexa
Class ObjectRenderer

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--edu.mit.ai.psg.ui.outliner.OutlineRendererDefault
                          |
                          +--edu.mit.ai.psg.ui.outliner.OutlineRendererCaching
                                |
                                +--edu.mit.ai.psg.jexa.ObjectRenderer
Direct Known Subclasses:
BeanRenderer, ClassRenderer, CollectionRenderer, ContainerRenderer, ListRenderer, MapRenderer, NodeRenderer, NodeRenderer, TravelerActivityRenderer, TravelerBiographyRenderer, TreeNodeRenderer

public class ObjectRenderer
extends OutlineRendererCaching

ObjectRenderer: displays fields of objects and elements of arrays (uncovered using java.lang.reflect and Class methods). If ReflectPermission is not available, then only includes public fields. For collapsed object description, uses method Stringify.printToString(Object) instead of Object.toString() to print up to Stringify.printLength elements of arrays. Generates children for all elements of arrays when expanded.

See Also:
Serialized Form

Inner classes inherited from class edu.mit.ai.psg.ui.outliner.OutlineRendererDefault
OutlineRendererDefault.OutlineText
 
Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Field Summary
static Font defaultFont
          Default font for new renderers, e.g.,
 
Fields inherited from class edu.mit.ai.psg.ui.outliner.OutlineRendererDefault
defaultToolTipText, labelComponent, myOutlineMaker, objectComponent
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
ObjectRenderer(OutlineMaker outlineMaker)
           
 
Method Summary
protected  void addFieldOutlineNodes(Vector childNodes, Object object, Class objClass, boolean addStatics)
          if add statics is false, only adds nodes for instance fields; if add statics is true, only adds nodes for static fields.
 void addPopupMenuTitle(PopupMenu menu, OutlineNode outlineNode, TreePath treePath, JTree jtree)
          Uses Stringify.printToString(outlineNode.getObject()) in title.
 String computeLabelText(OutlineNode outlineNode)
          if not null or string, override to Prettify.string(Stringify.printToString(label))
 String computeObjectText(OutlineNode outlineNode)
          Override to Prettify.string(Stringify.printToString(object))
static void initialize(OutlineMaker outlineMaker)
          Call initialize to install instance in outlineMaker for any instance of java.lang.Object (not called by Jexa())
static boolean isPublicToTopLevel(Class aClassOrInterface)
          return true if aClassOrInterface and and all its enclosing classes or interfaces are public
 List makeChildOutlineNodes(OutlineNode outlineNode)
          Generate children for fields of objects (discovered through reflection methods of java.lang.Class and java.lang.reflect) and elements of arrays
 OutlineNode makeOutlineNode(Object label, Object object)
          makes a OutlineNodeDefault
 
Methods inherited from class edu.mit.ai.psg.ui.outliner.OutlineRendererCaching
decacheLabelText, decacheObjectText, decacheToolTipText, getLabelText, getLabelTextCacheKey, getObjectText, getObjectTextCacheKey, getToolTipText, getToolTipTextCacheKey, makeLabelTextCache, makeObjectTextCache, makeToolTipTextCache, notifyInserted
 
Methods inherited from class edu.mit.ai.psg.ui.outliner.OutlineRendererDefault
addPopupMenuItems, computeLabelText, computeObjectText, computeToolTipText, equals, getLabelComponent, getObjectComponent, getOutlineMaker, getTreeCellRendererComponent, isShowing, makeNoteOutlineNode, makeOutlineNode, notifyRemoving, paint, toString
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getUIClassID, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setCursor, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

defaultFont

public static Font defaultFont
Default font for new renderers, e.g.,
java.util.Map attributes = new java.util.HashMap(1);
attributes.put(java.awt.font.TextAttribute.FAMILY, "Monospaced");
defaultFont = java.awt.Font.getFont(attributes);
(Initialization specifies only logical font family, since system default size will vary with locale, e.g., for Aisan languages.)
See Also:
Font.getFont(Map)
Constructor Detail

ObjectRenderer

public ObjectRenderer(OutlineMaker outlineMaker)
Method Detail

makeOutlineNode

public OutlineNode makeOutlineNode(Object label,
                                   Object object)
Description copied from class: OutlineRendererDefault
makes a OutlineNodeDefault
Overrides:
makeOutlineNode in class OutlineRendererDefault
Tags copied from interface: OutlineRenderer
Parameters:
label - Object to use for rendering label, or null if no label.
object - Object for the tree node.

makeChildOutlineNodes

public List makeChildOutlineNodes(OutlineNode outlineNode)
Generate children for fields of objects (discovered through reflection methods of java.lang.Class and java.lang.reflect) and elements of arrays
Overrides:
makeChildOutlineNodes in class OutlineRendererDefault

addFieldOutlineNodes

protected void addFieldOutlineNodes(Vector childNodes,
                                    Object object,
                                    Class objClass,
                                    boolean addStatics)
if add statics is false, only adds nodes for instance fields; if add statics is true, only adds nodes for static fields.

isPublicToTopLevel

public static boolean isPublicToTopLevel(Class aClassOrInterface)
return true if aClassOrInterface and and all its enclosing classes or interfaces are public

addPopupMenuTitle

public void addPopupMenuTitle(PopupMenu menu,
                              OutlineNode outlineNode,
                              TreePath treePath,
                              JTree jtree)
Uses Stringify.printToString(outlineNode.getObject()) in title.
Overrides:
addPopupMenuTitle in class OutlineRendererDefault
See Also:
Stringify.printToString(Object)

computeObjectText

public String computeObjectText(OutlineNode outlineNode)
Override to Prettify.string(Stringify.printToString(object))
Overrides:
computeObjectText in class OutlineRendererDefault

computeLabelText

public String computeLabelText(OutlineNode outlineNode)
if not null or string, override to Prettify.string(Stringify.printToString(label))
Overrides:
computeLabelText in class OutlineRendererDefault

initialize

public static void initialize(OutlineMaker outlineMaker)
Call initialize to install instance in outlineMaker for any instance of java.lang.Object (not called by Jexa())

Copyright (c) 1996-1999
Massachusetts Institute of Technology

Feedback: jeva-feedback@ai.mit.edu