public class VergilApplication extends MoMLApplication
The exact facilities that are available are determined by an optional command line argument that names a directory in ptolemy/configs that contains a configuration.xml file. For example, if we call vergil -ptiny, then we will use ptolemy/configs/ptiny/configuration.xml and ptolemy/configs/ptiny/intro.htm. The default configuration is ptolemy/configs/full/configuration.xml, which is loaded before any other command-line arguments are processed.
This application also takes an optional command line argument pair
-configuration configurationFile.xml
that names a configuration
to be read. For example,
$PTII/bin/vergil -configuration ptolemy/configs/ptiny/configuration.xmland
$PTII/bin/vergil -ptinyare equivalent
If there are no command-line arguments at all, then the configuration file is augmented by the MoML file ptolemy/configs/full/welcomeWindow.xml
Note that if the configuration starts with "ptiny", then
RemoveNonPtinyClasses
is used to remove classes
such as code generators that might be present in the model but are not part
of the Ptiny configuration.
ModelFrame
,
RunTableau
,
PtExecuteApplication
ConfigurationApplication.IgnoreErrorHandler
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String[][] |
_commandOptions
The command-line options that take arguments.
|
_basePath, _commandFlagsWithDescriptions, _commandTemplate, _configuration, _exit, _parser, _printPDF, _run, _run20x, _statistics, _test
Constructor and Description |
---|
VergilApplication(java.lang.String[] args)
Parse the specified command-line arguments, creating models
and frames to interact with them.
|
VergilApplication(java.lang.String basePath,
java.lang.String[] args)
Parse the specified command-line arguments, creating models
and frames to interact with them.
|
Modifier and Type | Method and Description |
---|---|
protected Configuration |
_createDefaultConfiguration()
Return a default Configuration.
|
protected Configuration |
_createEmptyConfiguration()
Return a default Configuration to use when there are no command-line
arguments.
|
protected void |
_parseArgs(java.lang.String[] args)
Parse the command-line arguments.
|
protected java.lang.String |
_usage()
Return a string summarizing the command-line arguments.
|
static void |
errorAndExit(java.lang.String message,
java.lang.String[] args,
java.lang.Throwable throwable)
Print out an error message and stack trace on stderr and then
display a dialog box.
|
static void |
main(java.lang.String[] args)
Create a new instance of this application, passing it the
command-line arguments.
|
static void |
openLibrary(Configuration configuration,
java.io.File file)
Deprecated.
|
_initializeApplication
_configurationUsage, _configurationUsage, _openModel, _openModel, _parseArg, _printPDF, _readConfiguration, closeModelWithoutSavingOrExiting, configurationDirectories, configurationDirectoryFullOrFirst, executionError, executionFinished, getActiveCount, managerStateChanged, models, openModel, openModelOrEntity, readConfiguration, runModels, setActiveCount, specToURL, throwArgsException, waitForFinish
protected static java.lang.String[][] _commandOptions
public VergilApplication(java.lang.String[] args) throws java.lang.Exception
args
- The command-line arguments.java.lang.Exception
- If command line arguments have problems.public VergilApplication(java.lang.String basePath, java.lang.String[] args) throws java.lang.Exception
basePath
- The basePath to look for configurations
in, usually "ptolemy/configs", but other tools might
have other configurations in other directoriesargs
- The command-line arguments.java.lang.Exception
- If command line arguments have problems.public static void errorAndExit(java.lang.String message, java.lang.String[] args, java.lang.Throwable throwable)
message
- The message to be displayedargs
- The arguments to be displayedthrowable
- The Throwable that caused the problem.public static void main(java.lang.String[] args)
args
- The command-line arguments.@Deprecated public static void openLibrary(Configuration configuration, java.io.File file) throws java.lang.Exception
UserActorLibrary.openLibrary(Configuration, File)
configuration
- The configuration where we look for the
actor library.file
- The MoML file to open.java.lang.Exception
- If there is a problem opening the configuration,
opening the MoML file, or opening the MoML file as a new library.protected Configuration _createDefaultConfiguration() throws java.lang.Exception
StringUtilities.preferencesDirectory()
If the configuration contains a top level Parameter named
_hideUserLibrary, then we do not open the user library._createDefaultConfiguration
in class ConfigurationApplication
java.lang.Exception
- If the configuration cannot be opened.protected Configuration _createEmptyConfiguration() throws java.lang.Exception
_createEmptyConfiguration
in class ConfigurationApplication
java.lang.Exception
- If the configuration cannot be opened.protected void _parseArgs(java.lang.String[] args) throws java.lang.Exception
_parseArgs
in class ConfigurationApplication
args
- The command-line arguments to be parsed.java.lang.Exception
- If an argument is not understood or triggers
an error.protected java.lang.String _usage()
_usage
in class ConfigurationApplication