public class CompositeActorSimpleApplication
extends java.lang.Object
The model is not displayed, models that have actors that extend
Placeable should instead use
CompositeActorApplication
.
The command-line arguments can also set parameter values for any parameter in the models, with the name given relative to the top-level entity. For example, to specify the iteration count in an SDF model, you can invoke this on the command line as follows:
java -classpath $PTII ptolemy.actor.gui.CompositeActorSimpleApplication \ -director.iterations 1000 \ -class ptolemy.actor.gui.test.TestModel
This assumes that the model given by the specified class name has a director named "director" with a parameter named "iterations". If more than one model is given on the command line, then the parameter values will be set for all models that have such a parameter.
CompositeActorApplication
Red (vogel) |
Red (cxh) |
Modifier and Type | Field and Description |
---|---|
protected java.lang.String[] |
_commandFlags
The command-line options that are either present or not.
|
protected java.lang.String[][] |
_commandOptions
The command-line options that take arguments.
|
protected java.lang.String |
_commandTemplate
The form of the command line.
|
protected java.util.List<CompositeActor> |
_models
The list of all the models.
|
protected int |
_openCount
The count of currently open windows.
|
protected static boolean |
_test
If true, then auto exit after a few seconds.
|
Constructor and Description |
---|
CompositeActorSimpleApplication() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
_parseArg(java.lang.String arg)
Parse a command-line argument.
|
protected void |
_parseArgs(java.lang.String[] args)
Parse the command-line arguments.
|
protected static void |
_run(CompositeActorSimpleApplication application,
java.lang.String[] args)
Run the application.
|
protected java.lang.String |
_usage()
Return a string summarizing the command-line arguments.
|
static void |
main(java.lang.String[] args)
Create a new application with the specified command-line arguments.
|
java.util.List<CompositeActor> |
models()
Return the list of models.
|
void |
processArgs(java.lang.String[] args)
Parse the command-line arguments, creating models as specified.
|
void |
report(java.lang.Exception ex)
Report an exception.
|
void |
report(java.lang.String message)
Report a message to the user.
|
void |
report(java.lang.String message,
java.lang.Exception ex)
Report an exception with an additional message.
|
java.lang.Object |
startRun(CompositeActor model)
If the specified model has a manager and is not already running,
then execute the model in a new thread.
|
void |
stopRun(CompositeActor model)
If the specified model has a manager and is executing, then
stop execution by calling the stop() method of the manager.
|
void |
waitForFinish()
Wait for all windows to close.
|
protected java.lang.String[] _commandFlags
protected java.lang.String[][] _commandOptions
protected java.lang.String _commandTemplate
protected java.util.List<CompositeActor> _models
protected int _openCount
protected static boolean _test
public static void main(java.lang.String[] args)
args
- The command-line arguments.public java.util.List<CompositeActor> models()
public void processArgs(java.lang.String[] args) throws java.lang.Exception
args
- The command-line arguments.java.lang.Exception
- If something goes wrong.public void report(java.lang.Exception ex)
ex
- The exception to report.public void report(java.lang.String message)
message
- The message to report.public void report(java.lang.String message, java.lang.Exception ex)
message
- The message.ex
- The exception to report.public java.lang.Object startRun(CompositeActor model) throws IllegalActionException
We then start the model running.
model
- The model to execute.IllegalActionException
- If the model contains Placeables.
or does not have a manager.Manager.startRun()
public void stopRun(CompositeActor model)
model
- The model to stop.public void waitForFinish()
protected boolean _parseArg(java.lang.String arg) throws java.lang.Exception
arg
- The argument to be parse.java.lang.Exception
- If something goes wrong.protected void _parseArgs(java.lang.String[] args) throws java.lang.Exception
args
- The arguments to be parsed.java.lang.Exception
- If an argument is not understood or triggers
an error.protected static void _run(CompositeActorSimpleApplication application, java.lang.String[] args)
application
- The application.args
- The arguments to be passed to the application.protected java.lang.String _usage()