Jexa: Java Examiner applet
This applet uses Jexa to illustrate how Outliner can be used to explore a
heterogeneous net of objects by invoking different renderers
for different kinds of objects. Different renderers can also be used
to view an object in multiple ways through alternative
renderings.
Applet: If you're viewing this page in a
Java Plug-in 1.2.2 capable
browser (such as, on Microsoft Windows,
Communicator 3.00 or later, or IE 3.02 or
later, or on Solaris, Communicator 4.05 or later), you should be able
to try out Jexa below. (It may take a few minutes to download the
plug-in if necessary; starting the plug-in the first time may also take a
few dozen seconds. Once the plug-in loads ~142KB of Jexa and applet jar files
over the network, the applet should run quickly.)
If your browser does not yet support a
Java 1.2.2 plug-in, you can point the Sun's JDK appletviewer at the URL
of this page to run the applet button:
appletviewer http://www.ai.mit.edu/people/caroma/tools/1999-10-11/JexaApplet.html
Appletviewer won't display this surrounding text.
|
|
|
|
|
|
At the right, SamplePanesApplet illustrates a hierarchy of panels
and buttons. At the left, JexaApplet displays a Vector
containing all the applets on this page. The vector has two elements,
SimplePanesApplet and JexaApplet.
Heterogeneity
- Explore the java.awt.Container hierarchy:
In JexaApplet, expanding the SamplePanesApplet node reveals its
components, two panels and a label. Expanding the panels reveals their
components, the buttons.
- Introspect buttons as JavaBeans: Expand a node for a button to
reveal its JavaBean properties (which java.beans.Introspector found from
getXXX() methods and isXXXmethods()).
This outline is made of different kinds of
objects: a Vector, Containers, Buttons, Labels. The objects in it
are rendered with three different renderers. The Vector is diplayed
with a ListRenderer, the Containers are displayed with
ContainerChildRenderer, and the buttons and labels are displayed with
the default, BeanRenderer. The different renderers here differ in how
they generate children, though renderers can also differ in how they
display the object itself.
Alternative Renderings
- Mouse-R on any object (click the right mouse button, or do what
your platform designates for popup menus, e.g., shift-click).
A popup appears, describing which renderer has displayed this
object, and a list of available operations. Click outside the
menu to remove the menu.
- Mouse-R on the Vector node in the outline, and select "Rerender
with..." then "BeanRenderer". The Vector is now displayed showing
its introspected Java Bean properties, found from the "getClass()"
method and "isEmpty()" method.
- Mouse-R on the Vector node again, and select "Rerender with ..."
then "CollectionRenderer", and the elements are displayed again (without
indices).
- Explore alternative renderers for a panel to see other
relationships besides just its components. If the applet window
is too small, try "Rerender in own frame". (Note that
when running in an applet security sandbox,
ObjectRenderer can only display public fields.)
Different renderers can be used to give alternative renderings of an
object, important for hiding complexity and focusing on the issue at
hand.
Jexa is particularly useful in conjuction with a source evaluator such
as JevaES, so you can explore objects by
invoking methods as well as through defined renderers. You can try a
JevaESGUI
applet as well.
This page describes research done at the Artificial
Intelligence Laboratory of the Massachusetts Institute of Technology. Support
for this research was provided in part by the Advanced Research Projects
Agency of the Department of Defense under contracts MDA972-95-1-0018 (North
East Regional Consortium Grant) and N66001-95-C-8611 (Computer Aided Education
and Training Initiative), and the MIT Department of Electrical Engineering
and Computer Science. Support for this research has also been received
from IBM, which has generously donated Thinkpad pen computers, and from
Microsoft, which has generously donated software.