edu.mit.ai.psg.jevaESUI
Class JevaESGUI

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--edu.mit.ai.psg.jevaESUI.JevaESGUI

public class JevaESGUI
extends Applet
implements ActionListener

JevaESGUI is a graphical (windowed) user interface for the JevaES Java evaluator for expression & statements. JevaESGUI can be used as

In any situation, results can be explored in an outline tree using Jexa, and objects found in Jexa can become parameters of statements and expressions.

Author:
CarlManning, caroma@ai.mit.edu
Copyright (c) 1997, 1998, 1999 Massachusetts Institute of Technology
See Also:
edu.mit.ai.psg.jevaES, edu.mit.ai.psg.jexa, JevaESUI, Serialized Form

Field Summary
static PrintWriter err
          PrintWriter stream for printing errors to result pane.
static PrintWriter out
          PrintWriter stream for printing to result pane.
static PrintStream systemErr
          Saved system.err present when loaded
static PrintStream systemOut
          Saved system.out present when loaded
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
JevaESGUI()
           
 
Method Summary
 void actionPerformed(ActionEvent e)
          Start up window frame when applet button is pushed.
static Object awaitResult(Container container)
          Wait for a JevaESGUIFrame or JevaESGUIPanel to return a value.
 void init()
          Applet startup: Starts a window at which users can type top level expressions.
static void main(String[] arguments)
          Application Startup: Starts a window at which users can type top level expressions.
static Object repl()
          Read-Eval-Print-Loop: creates a new window in which user may type java expressions and statements, including return to return a value.
static Object repl(int options, String title, String initialMessage, Class returnClass, Class[] throwClasses, IEnv env)
          Read-Eval-Print-Loop: creates a new window in which user may type java expressions and statements, including return to return a value.
static void replTop()
          Top read-eval-print-loop: creates a new window in which user may type java expressions and statements.
static void replTop(int options, String title)
           
 
Methods inherited from class java.applet.Applet
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

out

public static PrintWriter out
PrintWriter stream for printing to result pane.

err

public static PrintWriter err
PrintWriter stream for printing errors to result pane.

systemOut

public static PrintStream systemOut
Saved system.out present when loaded

systemErr

public static PrintStream systemErr
Saved system.err present when loaded
Constructor Detail

JevaESGUI

public JevaESGUI()
Method Detail

main

public static void main(String[] arguments)
Application Startup: Starts a window at which users can type top level expressions.

init

public void init()
Applet startup: Starts a window at which users can type top level expressions.
Overrides:
init in class Applet

actionPerformed

public void actionPerformed(ActionEvent e)
Start up window frame when applet button is pushed.
Specified by:
actionPerformed in interface ActionListener

replTop

public static void replTop()
Top read-eval-print-loop: creates a new window in which user may type java expressions and statements. Returns when window is closed.

replTop

public static void replTop(int options,
                           String title)

repl

public static Object repl()
                   throws Throwable,
                          AWTException
Read-Eval-Print-Loop: creates a new window in which user may type java expressions and statements, including return to return a value.
Throws:
Throwable - --- throws anything user throws.
AWTException - if window is closed.

repl

public static Object repl(int options,
                          String title,
                          String initialMessage,
                          Class returnClass,
                          Class[] throwClasses,
                          IEnv env)
                   throws Throwable,
                          AWTException
Read-Eval-Print-Loop: creates a new window in which user may type java expressions and statements, including return to return a value.
Parameters:
options - Option flag bits or'ed together; 0 is default. Applets require JevaESUI.isSuppressingSystemOutAndErrRedirectionBit and JevaES.isSuppressingPackageNameChecksBit due to security sandbox,
title - Non-null text replaces window title; helps identify window if initialMessage has scrolled away.
initialMessage - Non-null text replaces herald; if called from a breakpoint, a good practice is to show user contents of env.
returnClass - user may only return a value of this class (like method return type); Object.class allows anything. Use void.class for void result. If null, never returns (like a top level loop).
throwClasses - user may only throw Throwables which are instances of these classes, or instances of Error or RuntimeException (like method throw declarations). If null, defaults to no declarations.
env - initial environment created with JevaES.makeDefaultEnv, JevaES.extendEnv(), or JevaES.parseEval..Statement If null, defaults to JevaES.makeDefaultEnv() .
Throws:
Throwable - --- throws anything user throws compatibile with throwClasses
AWTException - if window is closed.

awaitResult

public static Object awaitResult(Container container)
                          throws Throwable,
                                 AWTException
Wait for a JevaESGUIFrame or JevaESGUIPanel to return a value. Called by repl after constructing and showing a JevaESGUIFrame.
Parameters:
container - must be JevaESGUIFrame or JevaESGUIPanel

Copyright (c) 1996-1999
Massachusetts Institute of Technology

Feedback: jeva-bugs@ai.mit.edu