Class AbstractInterpreter

java.lang.Object
bsh.Interpreter
VASSAL.script.AbstractInterpreter
All Implemented Interfaces:
bsh.ConsoleInterface, Serializable, Runnable
Direct Known Subclasses:
ExpressionInterpreter, ScriptInterpreter

public abstract class AbstractInterpreter extends bsh.Interpreter
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected bsh.NameSpace
     
    protected static final String
     
    protected static final String
     

    Fields inherited from class bsh.Interpreter

    DEBUG, evalOnly, interactive, LOCALSCOPING, TRACE, VERSION
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    alert(Object message)
    Alert(message) Display a message in a dialog box/
    alert(Object message, Object closeAfterDelay)
    Display a message in a Dialog box and optionally close the dialog after the specified delay
    findMap(String mapName)
    Return a proxy reference to the named map as long as it is accessible to us.
    Get a module level property value.
    void
    Fire off a Global Hot Key
    protected boolean
    Is a map accessible to us?
    void
    Set the value of a module level property
    protected void
    setVar(String name, boolean value)
     
    protected void
    setVar(String name, float value)
     
    protected void
    setVar(String name, int value)
     
    protected void
    setVar(String name, Class<?> cl, Object value)
     
    protected void
    setVar(String name, Object value)
    Set a variable and handle exceptions

    Methods inherited from class bsh.Interpreter

    debug, error, eval, eval, eval, eval, get, getClassManager, getErr, getIn, getInterface, getNameSpace, getOut, getParent, getShowResults, getSourceFileInfo, getStrictJava, invokeMain, main, pathToFile, print, println, redirectOutputToFile, run, set, set, set, set, set, set, setClassLoader, setConsole, setErr, setExitOnEOF, setNameSpace, setOut, setShowResults, setStrictJava, source, source, unset

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • AbstractInterpreter

      public AbstractInterpreter()
  • Method Details

    • setVar

      protected void setVar(String name, Object value)
      Set a variable and handle exceptions
      Parameters:
      name - Variable name
      value - Variable value
    • setVar

      protected void setVar(String name, int value)
    • setVar

      protected void setVar(String name, float value)
    • setVar

      protected void setVar(String name, boolean value)
    • setVar

      protected void setVar(String name, Class<?> cl, Object value)
    • alert

      public Object alert(Object message)
      Alert(message) Display a message in a dialog box/
      Parameters:
      message - message to display
    • alert

      public Object alert(Object message, Object closeAfterDelay)
      Display a message in a Dialog box and optionally close the dialog after the specified delay
      Parameters:
      message - Message to display
      closeAfterDelay - Delay in milliseconds before automaticalltclosing (0 to not close)
      Returns:
      blank string
    • getModuleProperty

      public Object getModuleProperty(String name)
      Get a module level property value.
      Parameters:
      name - Property Name
      Returns:
      Property value
    • setModuleProperty

      public void setModuleProperty(String name, String value)
      Set the value of a module level property
      Parameters:
      name - Property name
      value - new value
    • findMap

      public Map findMap(String mapName)
      Return a proxy reference to the named map as long as it is accessible to us.
      Parameters:
      mapName - Map Name
      Returns:
      Map proxy
    • isAccessible

      protected boolean isAccessible(Map m)
      Is a map accessible to us?
      Parameters:
      m - Map
      Returns:
      true if accessible
    • globalHotKey

      public void globalHotKey(KeyStroke stroke)
      Fire off a Global Hot Key
      Parameters:
      stroke - Keystroke