org.omegahat.Environment.Console
Class omega

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--org.omegahat.Environment.Console.omega
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class omega
extends java.applet.Applet
implements java.awt.event.ActionListener

This is the standard entry point/application for the command-line version of the Omegahat language. This is the simplest way to get an Omegahat session started and basically defers most of the initialization computations to scripts. It creates an EvaluatorManager and then reads the startup script from the property OmegaInit

See Also:
Serialized Form

Inner classes inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Inner classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
protected  java.lang.String[] command_line
          The command line arguments passed to this Java application.
static java.lang.String DefaultUserThreadName
          The name of the Thread variable that can be created in the initialization script on which we will join to ensure that we don't just exit at the end of the script.
protected  Evaluator evaluator
          The default evaluator that we create as part of the initialization via the EvaluatorManager.
protected  InputReader reader
          An input reader used to read lines from the user's input on the standard input device and then notifies the evaluator of input pending.
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
omega()
           
omega(java.lang.String[] argv)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ev)
           
 java.lang.String[] args()
          Retrieve the command line arguments associated with running this instance of the class as an application.
 java.lang.String[] args(java.lang.String[] a)
          Set the command line arguments.
 InputReader defaultReaderThread(Evaluator evaluator)
           
 void init()
          Initialization of this class and, typically, of the Omegahat interactive session.
static void main(java.lang.String[] argv)
          The entry point called by the Java Virtual Machine when using this class as an application.
 
Methods inherited from class java.applet.Applet
destroy, getAccessibleContext, 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, getListeners, 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, addHierarchyBoundsListener, addHierarchyListener, 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, getGraphicsConfiguration, 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, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, 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

DefaultUserThreadName

public static java.lang.String DefaultUserThreadName
The name of the Thread variable that can be created in the initialization script on which we will join to ensure that we don't just exit at the end of the script. If no such variable exists, we terminate at the end of the initialization script.

command_line

protected java.lang.String[] command_line
The command line arguments passed to this Java application.

evaluator

protected Evaluator evaluator
The default evaluator that we create as part of the initialization via the EvaluatorManager.

reader

protected InputReader reader
An input reader used to read lines from the user's input on the standard input device and then notifies the evaluator of input pending.
Constructor Detail

omega

public omega(java.lang.String[] argv)

omega

public omega()
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ev)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

main

public static void main(java.lang.String[] argv)
The entry point called by the Java Virtual Machine when using this class as an application.
Parameters:
argv - command line arguments passed from the Java virtual machine initialization to this class.

init

public void init()
Initialization of this class and, typically, of the Omegahat interactive session. Called either automatically (if the session is being run as an applet) or from the main() method.

The Java-level initialization is essentially just a bootstrap that evaluates an initialization script in the Omegahat language. The name of the file containing this script is passed to the Java virtual machine when it starts up as the property "OmegaInit". The init() method creates a bootstrap evaluator manager to parse and evaluate the corresponding file (by invoking the bootstrap evaluator's source() method).

The initialization script will typically create a thread in which further user interaction takes place (such as reading and evaluating user-typed expressions). If this thread is assigned to the name in field DefaultUserThreadName, the init() method will join on that thread.

The init() method also assigns the this object as ".applet" in the default database.

Overrides:
init in class java.applet.Applet

args

public java.lang.String[] args()
Retrieve the command line arguments associated with running this instance of the class as an application.

args

public java.lang.String[] args(java.lang.String[] a)
Set the command line arguments.

defaultReaderThread

public InputReader defaultReaderThread(Evaluator evaluator)