hades.models.meta
Class JythonScriptWrapper

java.lang.Object
  extended byhades.simulator.SimObject
      extended byhades.models.meta.JythonScriptWrapper
All Implemented Interfaces:
java.lang.Cloneable, ContextToolTip, java.io.Serializable, Simulatable

public class JythonScriptWrapper
extends SimObject
implements java.io.Serializable

JythonScriptWrapper - a dummy SimObject used to include Xfig/JavaFIG drawings into HADES designs.

See Also:
Serialized Form

Field Summary
(package private)  java.lang.String scriptname
           
 
Fields inherited from class hades.simulator.SimObject
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible
 
Constructor Summary
JythonScriptWrapper()
          Construct a JythonScriptWrapper object
 
Method Summary
 void configure()
          create and display a 'ConfigDialog' to set the parameters for a SimObject.
 void elaborate(java.lang.Object arg)
          elaborate(): This method is called by the simulation engine to initialize the simulation object.
 java.lang.String[] getExternalResources()
          return a String[] array of length 1 with our Jython script file name
 java.lang.String getScriptname()
           
 boolean initialize(java.lang.String s)
          initialize a JythonScriptWrapper from a String.
 boolean needsExternalResources()
          we use one external resource: the FIG file to initialize us.
 void setScriptname(java.lang.String s)
           
 java.lang.String toString()
          toString: generate a text description for this SimObject.
 void write(java.io.PrintWriter ps)
           
 
Methods inherited from class hades.simulator.SimObject
constructDynamicSymbol, copy, evaluate, getBindkey, getClassLoader, getDebug, getEditor, getFullName, getName, getParent, getPort, getPorts, getPropertySheet, getResourceAsStream, getSimulator, getSymbol, getSymbolResourceName, getToolTip, getVersionId, isVisible, keyPressed, message, mousePressed, needsDynamicSymbol, setClassLoader, setConsole, setDebug, setEditor, setName, setParent, setPorts, setSimulator, setSymbol, setVersionId, setVisible, tearDown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

scriptname

java.lang.String scriptname
Constructor Detail

JythonScriptWrapper

public JythonScriptWrapper()
Construct a JythonScriptWrapper object

Method Detail

getScriptname

public java.lang.String getScriptname()

setScriptname

public void setScriptname(java.lang.String s)

needsExternalResources

public boolean needsExternalResources()
we use one external resource: the FIG file to initialize us.

Overrides:
needsExternalResources in class SimObject

getExternalResources

public java.lang.String[] getExternalResources()
return a String[] array of length 1 with our Jython script file name

Overrides:
getExternalResources in class SimObject

initialize

public boolean initialize(java.lang.String s)
initialize a JythonScriptWrapper from a String. Currently, the String should contain the following things: the JythonScriptWrapper versionId, and the Java resource-name of the Jython script file to parse, e.g.
       1002 /hades/examples/tutorial/welcome.py
    

Overrides:
initialize in class SimObject

write

public void write(java.io.PrintWriter ps)
Overrides:
write in class SimObject

configure

public void configure()
Description copied from class: SimObject
create and display a 'ConfigDialog' to set the parameters for a SimObject. The default ConfigDialog for the base class (SimObject) itself is empty except for the 'instance name' of the SimObject.

Overrides:
configure in class SimObject

elaborate

public void elaborate(java.lang.Object arg)
Description copied from class: SimObject
elaborate(): This method is called by the simulation engine to initialize the simulation object.

Specified by:
elaborate in interface Simulatable
Overrides:
elaborate in class SimObject

toString

public java.lang.String toString()
Description copied from class: SimObject
toString: generate a text description for this SimObject. This method currently combines the class name for the SimObject (or subclass) and its full name in the current Hades Design, e.g. "hades.models.gates.And2: /uut/adder16/adder1/i3".

Overrides:
toString in class SimObject