Class PtolemyApplication

  • All Implemented Interfaces:
    ExecutionListener

    public class PtolemyApplication
    extends MoMLApplication
    This application opens run control panels for models specified on the command line. The exact facilities that are available are determined by the configuration file ptolemy/configs/runPanelConfiguration.xml, which is loaded before any command-line arguments are processed. If there are no command-line arguments at all, then the file ptolemy/configs/runBlankConfiguration.xml is read instead.
    Since:
    Ptolemy II 0.4
    Version:
    $Id$
    Author:
    Edward A. Lee and Steve Neuendorffer
    See Also:
    ModelFrame, RunTableau
    Pt.AcceptedRating:
    Red (eal)
    Pt.ProposedRating:
    Yellow (eal)
    • Constructor Detail

      • PtolemyApplication

        public PtolemyApplication​(java.lang.String[] args)
                           throws java.lang.Exception
        Parse the specified command-line arguments, creating models and frames to interact with them.
        Parameters:
        args - The command-line arguments. See ConfigurationApplication for a description of the command-line arguments.
        Throws:
        java.lang.Exception - If command line arguments have problems.
      • PtolemyApplication

        public PtolemyApplication​(java.lang.String arg)
                           throws java.lang.Exception
        Parse the specified command-line arguments, creating models and frames to interact with them.
        Parameters:
        arg - The command-line argument, typically the name of the model to open. See ConfigurationApplication for a description of the command-line arguments.
        Throws:
        java.lang.Exception - If command line arguments have problems.
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
        Create a new instance of this application, passing it the command-line arguments.
        Parameters:
        args - The command-line arguments.
      • _createDefaultConfiguration

        protected Configuration _createDefaultConfiguration()
                                                     throws java.lang.Exception
        Return a default Configuration, which in this case is given by the MoML file ptolemy/configs/runPanelConfiguration.xml. That configuration supports executing, but not editing, Ptolemy models.
        Overrides:
        _createDefaultConfiguration in class ConfigurationApplication
        Returns:
        A default configuration.
        Throws:
        java.lang.Exception - If the configuration cannot be opened.
      • _createEmptyConfiguration

        protected Configuration _createEmptyConfiguration()
                                                   throws java.lang.Exception
        Return a default Configuration to use when there are no command-line arguments, which in this case is the same as the default configuration given by _createDefaultConfiguration, but with the additional contents of the file ptolemy/configs/runWelcomeWindow.xml.
        Overrides:
        _createEmptyConfiguration in class ConfigurationApplication
        Returns:
        A configuration for when there no command-line arguments.
        Throws:
        java.lang.Exception - If the configuration cannot be opened.
      • _parseArgs

        protected void _parseArgs​(java.lang.String[] args)
                           throws java.lang.Exception
        Parse the command-line arguments. This overrides the base class only to set the usage information.
        Overrides:
        _parseArgs in class ConfigurationApplication
        Parameters:
        args - The command-line arguments to be parsed.
        Throws:
        java.lang.Exception - If an argument is not understood or triggers an error.