hades.models.stimuli
Class StimuliGenerator

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

public class StimuliGenerator
extends SimObject
implements Simulatable, ContextToolTip, java.io.Serializable

StimuliGenerator, a wrapper class to embed a StimuliParser into a Hades Design file.

See Also:
Serialized Form

Field Summary
protected  boolean enabled
           
protected  java.lang.String stimuliFileName
           
 
Fields inherited from class hades.simulator.SimObject
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible
 
Constructor Summary
StimuliGenerator()
           
 
Method Summary
 void configure()
          create and display a 'ConfigDialog' to set the parameters for a SimObject.
 SimObject copy()
          create a copy of the current StimuliGenerator
 void elaborate(java.lang.Object arg)
          elaborate: this method does all the work.
 boolean getEnabled()
           
 java.lang.String getStimuliFileName()
           
 java.lang.String getToolTip(java.awt.Point position, long millis)
          construct a (short) tool tip message including instance name, class name, and stimuli file name.
 boolean initialize(java.lang.String s)
          initialize a StimuliGenerator from a String that contains the integer version id, the enabled status (0=disabled, 1=enabled) and the Unicode-escaped stimuli file name '1001 1 /hades/models/stimuli/default.sti'
 void setEnabled(boolean b)
           
 void setEnabled(java.lang.String s)
           
 void setStimuliFileName(java.lang.String s)
           
 void write(java.io.PrintWriter ps)
          write versionId, the enabled status, and the Unicode-escaped stimuli file name, e.g.
 
Methods inherited from class hades.simulator.SimObject
constructDynamicSymbol, evaluate, getBindkey, getClassLoader, getDebug, getEditor, getExternalResources, getFullName, getName, getParent, getPort, getPorts, getPropertySheet, getResourceAsStream, getSimulator, getSymbol, getSymbolResourceName, getVersionId, isVisible, keyPressed, message, mousePressed, needsDynamicSymbol, needsExternalResources, setClassLoader, setConsole, setDebug, setEditor, setName, setParent, setPorts, setSimulator, setSymbol, setVersionId, setVisible, tearDown, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface hades.simulator.Simulatable
evaluate, message
 

Field Detail

stimuliFileName

protected java.lang.String stimuliFileName

enabled

protected boolean enabled
Constructor Detail

StimuliGenerator

public StimuliGenerator()
Method Detail

getStimuliFileName

public java.lang.String getStimuliFileName()

setStimuliFileName

public void setStimuliFileName(java.lang.String s)

getEnabled

public boolean getEnabled()

setEnabled

public void setEnabled(boolean b)

setEnabled

public void setEnabled(java.lang.String s)

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

initialize

public boolean initialize(java.lang.String s)
initialize a StimuliGenerator from a String that contains the integer version id, the enabled status (0=disabled, 1=enabled) and the Unicode-escaped stimuli file name '1001 1 /hades/models/stimuli/default.sti'

Overrides:
initialize in class SimObject

write

public void write(java.io.PrintWriter ps)
write versionId, the enabled status, and the Unicode-escaped stimuli file name, e.g. "1001 1 /hades/models/stimuli/default.sti"

Overrides:
write in class SimObject

elaborate

public void elaborate(java.lang.Object arg)
elaborate: this method does all the work. We first store a reference to the current simulator. Next, the enabled flag is check. If it is set, we try to open the stimuli file, parse it, and generate all simulation events specified in the stimuli file.

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

copy

public SimObject copy()
create a copy of the current StimuliGenerator

Overrides:
copy in class SimObject

getToolTip

public java.lang.String getToolTip(java.awt.Point position,
                                   long millis)
construct a (short) tool tip message including instance name, class name, and stimuli file name.

Specified by:
getToolTip in interface ContextToolTip
Overrides:
getToolTip in class SimObject