Interpreter.AppletInterpreter
Class InterpreterApplet

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--javax.swing.JApplet
                                |
                                +--Interpreter.AppletInterpreter.InterpreterApplet

public class InterpreterApplet
extends javax.swing.JApplet

Applet che implementa l'interfaccia grafica per gli interpreti.
Si può richiamare da un file html oppure utilizzare per costruire una applicazione standalone.
In questo ultimo caso è opportuno invocare il metodo setFrame(Frame) per permettere all'applet di utilizzare le forme Dialog con i corretti parametri.

Gli interpreti lisp e prolog sono quelli di default. Se si vuole utilizzare una versione estesa degli interpreti bisogna invocare i metodi setExtendedLisp(Class) e setExtendedProlog(Class,Class). È possibile estendere anche solo uno dei due interpreti.
Se si vuole estendere anche l'help si possono utilizzare i metodi addLisp(String,String) e addProlog(String,String).

See Also:
setFrame(Frame), setExtendedLisp(Class), setExtendedProlog(Class,Class), addLisp(String,String), addProlog(String,String), Serialized Form

Inner classes inherited from class javax.swing.JApplet
javax.swing.JApplet.AccessibleJApplet
 
Fields inherited from class javax.swing.JApplet
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
InterpreterApplet()
          Costruttore dell'applet.
 
Method Summary
 void addLisp(java.lang.String command, java.lang.String comment)
          Per aggiungere all'help del lisp i commenti dei nuovi comandi.
 void addProlog(java.lang.String command, java.lang.String comment)
          Per aggiungere all'help del prolog i commenti dei nuovi comandi.
 java.lang.String getAppletInfo()
          Restituice le informazioni sugli autori.
 java.lang.String getParameter(java.lang.String key, java.lang.String def)
          Returns the value of the named parameter in the HTML tag.
 void init()
          Called by the browser or applet viewer to inform this applet that it has been loaded into the system.
 void setExtendedLisp(java.lang.Class eval)
          Per settare un interprete lisp diverso da quello di default.
 void setExtendedProlog(java.lang.Class engine, java.lang.Class eval)
          Per settare un interprete prolog diverso da quello di default.
 void setFrame(java.awt.Frame f)
          Deve essere invocato dal main: serve per i dialoghi.
 void start()
          Deve essere invocata dal browser o dal main per far partire l'applet.
 
Methods inherited from class javax.swing.JApplet
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.applet.Applet
destroy, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, stop
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, 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, 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
 

Constructor Detail

InterpreterApplet

public InterpreterApplet()
Costruttore dell'applet.
Method Detail

getParameter

public java.lang.String getParameter(java.lang.String key,
                                     java.lang.String def)
Returns the value of the named parameter in the HTML tag. If it's a standalone gets the system property indicated by the specified key.
Parameters:
key - the name of the property.
def - a default value.

setFrame

public void setFrame(java.awt.Frame f)
Deve essere invocato dal main: serve per i dialoghi.
Parameters:
f - il frame che lancia l'applet.

setExtendedLisp

public void setExtendedLisp(java.lang.Class eval)
                     throws InterpreterException
Per settare un interprete lisp diverso da quello di default.
Parameters:
eval - la classe estesa da EvalSexpVisitor.
Throws:
InterpreterException - se uno dei parametri è nullo.
See Also:
EvalSexpVisitor

setExtendedProlog

public void setExtendedProlog(java.lang.Class engine,
                              java.lang.Class eval)
                       throws InterpreterException
Per settare un interprete prolog diverso da quello di default.
Parameters:
engine - la classe estesa da EngineSexpVisitor.
eval - la classe estesa da EvalVisitor.
Throws:
InterpreterException - se uno dei parametri è nullo.
See Also:
EngineSexpVisitor, EvalVisitor

addLisp

public void addLisp(java.lang.String command,
                    java.lang.String comment)
Per aggiungere all'help del lisp i commenti dei nuovi comandi.
Parameters:
command - il nome del comando.
comment - la spiegazione del comando e del suo utilizzo.

addProlog

public void addProlog(java.lang.String command,
                      java.lang.String comment)
Per aggiungere all'help del prolog i commenti dei nuovi comandi.
Parameters:
command - il nome del comando.
comment - la spiegazione del comando e del suo utilizzo.

init

public void init()
Called by the browser or applet viewer to inform this applet that it has been loaded into the system. It is always called before the first time that the start method is called.
Overrides:
init in class java.applet.Applet

getAppletInfo

public java.lang.String getAppletInfo()
Restituice le informazioni sugli autori.
Returns:
le informazioni.
Overrides:
getAppletInfo in class java.applet.Applet

start

public void start()
Deve essere invocata dal browser o dal main per far partire l'applet.
All'invocazione di questo metodo l'applet deve essere già stata inizializzata tramite il metodo init().
Overrides:
start in class java.applet.Applet
See Also:
init()


Codice realizzato da Francesco Geri & Marco Tamanti