|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--java.awt.Panel
|
+--java.applet.Applet
|
+--edu.mit.ai.psg.ui.patches.FrameableApplet
|
+--edu.mit.ai.psg.jevaESUI.JevaESGUI
JevaESGUI is a graphical (windowed) user interface for the JevaES Java evaluator for expression & statements. JevaESGUI can be used as
main(java.lang.String[]).
FrameableApplet.init()).
May be initialized with localApplet, imports, etc.;
see getParameterInfo().
repl(..)
providing an environment of current names, and a repl window
appears in which the user can evaluate Java expression and
statements in that environment, including calling other stubs
(which create new windows), returning values, and throwing exceptions.
See
DemoInspectPoint.java and
DemoStubAppointmentCalendar.java for examples.
. localResults.get(n)Local streams
localOut, localErr can be used in place of
System.out, System.err.
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.
JevaESUI,
JevaESCLI, Serialized Form| Field Summary | |
static Font |
defaultFont
Default font for new windows, e.g., |
static int |
leftmostOptionBit
|
protected static Dimension |
minSizeAsButton
default: 200x30 |
protected static Dimension |
minSizeInPlace
default: 300x300 |
protected static String |
pkBindLocalApplet
|
protected static String |
pkHerald
|
protected static String |
pkInitStatements
|
protected static String |
pkMessage
|
static int |
redirectStreamsBit
The option bit redirectStreamsBit tells JevaESGUI to redirecting System#out and System#err to its output pane. |
static PrintStream |
systemErr
Saved system.err present when loaded |
static PrintStream |
systemOut
Saved system.out present when loaded |
| Fields inherited from class edu.mit.ai.psg.ui.patches.FrameableApplet |
pkBgColor,
pkTextColor,
pkTitle,
titleFont |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
| Constructor Summary | |
JevaESGUI()
|
|
| Method Summary | |
static Object |
awaitResult(Container container)
Wait for a JevaESGUIFrame or JevaESGUIPanel to return a value. |
protected IEnv |
bindAppletEnv(int options)
if "bindApplet" parameter is set, make env binding "localApplet" to this applet with its class as type |
String |
getAppletInfo()
returns default herald |
String |
getAppletTitle()
default applet title: getParameter(pkTitle) or "" |
protected String |
getButtonStartedText()
default: JevaESUI.getJevaESUIBundleString( JevaESGUIAppletStarted ) |
protected String |
getButtonStartingText()
default: JevaESUI.getJevaESUIBundleString( JevaESGUIAppletStarting ) |
protected String |
getButtonStartText()
default: JevaESUI.getJevaESUIBundleString( JevaESGUIAppletStart ) |
protected Dimension |
getMinSizeAsButton()
default: minSizeAsButton |
protected Dimension |
getMinSizeInPlace()
default: minSizeInPlace |
String[][] |
getParameterInfo()
Applet parameters: message: text to display after herald herald: text to display text in place of herald bindLocalApplet: if "true", binds "localApplet" to this applet (for debugging applets); other applets on same page can then be accessed through localApplet.. |
Frame |
initFrameApplet()
creates a new JevaESGUIFrame |
void |
initPanelInPlaceApplet()
Display applet in place on page. |
static boolean |
isRedirectingStreams(int options)
|
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[] throwsClasses,
IEnv env)
|
static Object |
repl(int options,
String title,
String initialMessage,
Class returnClass,
Class[] throwsClasses,
IEnv env,
String initStatements)
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,
String initStatements)
|
static void |
replTop(int options,
String title,
String initialMessage,
String initStatements)
|
| Methods inherited from class edu.mit.ai.psg.ui.patches.FrameableApplet |
getAppletList,
getParameter,
getTitleIcon,
init,
initAppletColors,
initButtonForFrameApplet,
makeButtonForFrame |
| Methods inherited from class java.applet.Applet |
destroy,
getAppletContext,
getAudioClip,
getAudioClip,
getCodeBase,
getDocumentBase,
getImage,
getImage,
getLocale,
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,
setCursor,
setFont,
setLayout,
update,
validate,
validateTree |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
protected static Dimension minSizeInPlace
protected static Dimension minSizeAsButton
protected static final String pkHerald
protected static final String pkMessage
protected static final String pkBindLocalApplet
protected static final String pkInitStatements
public static PrintStream systemOut
public static PrintStream systemErr
public static Font defaultFont
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.)
Font.getFont(Map)public static final int redirectStreamsBit
System#out and System#err to its output pane.
This bit should not be set unless the JevaESGUI window will remain
available for the remainder of the time the java program is running
(e.g., top level application loop), and permission to set System.out
and System.err is available, (e.g., not in applet security sandbox).
Options are specified at startup in calls to
replTop(int, String, String) or
repl(int, String, String, Class, Class[], IEnv).
Option bits are |'ed together into a 32 bit int. 0 is default for
each option. See JevaES for additional options (JevaES
options are used by JevaESGUI only if no env is supplied.)
public static final int leftmostOptionBit
| Constructor Detail |
public JevaESGUI()
| Method Detail |
public static void main(String[] arguments)
usage: java edu.mit.ai.psg.jevaESUI.JevaESGUI [-noredirect] [-title "title"] [-font ["name"] [size]] options: -noredirect Don't redirect System.out and System.err to pane -title "title" Use "title" for window title. -font "name" Use named font (default:(Note: -font usesdefaultFont) -font "size" Use font point size (default:defaultFont) -font "name" "size" Use font and size. -initStatements "statements" run statements before start (e.g., imports) -message "text" display text after herald -herald "text" display text in place of herald
Font.Font(String, int, int)
to create fonts, which returns a default font if there are problems.
It also doesn't work well for non-logical fonts in the first release
of Java 1.2 on NT)protected Dimension getMinSizeInPlace()
minSizeInPlaceFrameableApplet.init()protected Dimension getMinSizeAsButton()
minSizeAsButtonFrameableApplet.init()public String getAppletTitle()
public void initPanelInPlaceApplet()
FrameableApplet.initPanelInPlaceApplet(),
getParameterInfo()protected String getButtonStartText()
protected String getButtonStartingText()
protected String getButtonStartedText()
public Frame initFrameApplet()
getParameterInfo()protected IEnv bindAppletEnv(int options)
public String[][] getParameterInfo()
localApplet.FrameableApplet.getAppletList()().
FrameableApplet.getParameterInfo()public String getAppletInfo()
public static boolean isRedirectingStreams(int options)
public static void replTop()
public static void replTop(int options,
String title,
String initStatements)
public static void replTop(int options,
String title,
String initialMessage,
String initStatements)
public static Object repl()
throws Throwable,
AWTException
public static Object repl(int options,
String title,
String initialMessage,
Class returnClass,
Class[] throwsClasses,
IEnv env)
throws Throwable,
AWTException
public static Object repl(int options,
String title,
String initialMessage,
Class returnClass,
Class[] throwsClasses,
IEnv env,
String initStatements)
throws Throwable,
AWTException
options - Option flag bits or'ed together; 0 is default. Applets
need JevaES.suppressPackageNameChecksBit 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).throwsClasses - 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() .initStatements - initial statements to run. (Convenience feature
for extending env from command line or applet parameter, e.g.,
to specify default imports for user input.)
If null, defaults to no statements.
public static Object awaitResult(Container container)
throws Throwable,
AWTException
container - must be JevaESGUIFrame or JevaESGUIPanel
|
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 | ||||||||