Skip navigation links

Package ptolemy.actor.gui

Ptolemy GUI components for actors and configurations.

See: Description

Package ptolemy.actor.gui Description

Ptolemy GUI components for actors and configurations.

This package consists of several types of classes:

  1. Classes that manage the editors
  2. Graphical User Interface (GUI) classes that render specific editors.
  3. Classes that invoke models

Classes that manage editors

A ptolemy application has a configuration which is a xml file found in $PTII/ptolemy/configs. For example, the "Full" configuration is found in $PTII/ptolemy/configs/full/configuration.xml.

The configuration.xml file defines a set of properties and entities that determine what editors are available to view a model.

It is possible to invoke Ptolemy models without using the configuration system, see MoMLSimpleApplication.

The Configuration class is in charge of the user interface, it coordinates views of multiple models. The Configuration class manages the opening of new models by ensuring that the appropriate viewer is used.

The Configuration class contains a ModelDirectory, which is a directory of open models. Each open model is represented by an instance of an Effigy.

An Effigy represents model metadata, such as the location from which the model originated, whether the model has been modified. See Effigy for a discussion about why the class is called "Effigy".

Each open model has an Effigy. The Effigy contains a Tableau that is a visual representation of the model in a top-level window. The Tableau contains a javax.swing.JFrame, which may be accessed via Tableau.getFrame().

How a file is opened using the Configuration class

The ConfigurationApplication uses the Configuration class to open a model. ConfigurationApplication uses these steps
  1. Set up MoMLFilters.
  2. Parse arguments, look for a configuration file and parse the configuration file.
  3. For each model, parse the xml and then open each model with: Configuration.openModel(NamedObj).
  4. openModel() checks with the ModelDirectory to see if the model is already open. If the model is open, then the Tableau that contains a reference to the JFrame is returned.
  5. If openModel() does not find an open model, then we look for a EffigyFactory and then ask the EffigyFactory to create an Effigy for our model.
  6. The EffigyFactory loops through its contained factories and calls EffigyFactory.createEffigy(CompositeEntity, URL, URL) for each factory.
  7. The createEffigy() method determines if it should create an Effigy for the container and urls. If createEffigy() for a particular viewer does not want to create an Effigy for a particular model, then it returns null and then next factory gets to try. Eventually, a createEffigy() method is found that creates an Effigy, or an error is thrown.
  8. Once Configuration.openModel() gets an effigy, then Configuration.createPrimaryTableau(Effigy) is called, which returns a Tableau. The Tableau contains a reference to the javax.swing.JFrame that is a view on the model.

Graphical User Interface (GUI) classes that render specific editors.

In general, each view on a model has a corresponding Effigy and Tableau class. Some viewers also have Viewer and/or Frame classes.

Overview of classes used to invoke models

Uses Configuration?
Class Name Optionally reads parameters from the command line? Calls RemoveGraphicalClasses?
CompositeActorApplication instantiates a Java class named as an argument. The Java class should extend TypedCompositeActor and have a director. This class is not often used. No No No
CompositeActorSimpleApplication is similar to CompositeActorApplication but this class does not handle Placeable classes. This class is not often used. No No No
MoMLSimpleApplication is a simple example of how to invoke a model No No Yes
MoMLSimpleStatisticalApplication extends MoMLSimpleApplication and prints out statistics about the run. See also CompositeEntity.statistics(String). This class is not often used. No No Yes
MoMLCommandLineApplication extends MoMLSimpleApplication and optionally sets parameters from the command line. No Yes Yes
ConfigurationApplication Yes Yes Optionally, by setting _removeGraphicalClasses
MoMLApplication Yes Yes No, this class sets the Look and Feel, which invokes Java's UI code
PtolemyApplication extends MoMLApplication and opens a RunTableau for the specified models. This class is not often used. Yes Yes No, this class sets the Look and Feel, which invokes Java's UI code
PtExecuteApplication extends MoMLApplication and in the default opens a RunTableau for the specified models and then executes the models. This class is not often used. Yes Yes No, this class sets the Look and Feel, which invokes Java's UI code
VergilApplication extends MoMLApplication and opens the Vergil graphical editor Yes Yes No, this class sets the Look and Feel, which invokes Java's UI code

Since:
Ptolemy II 0.2
Skip navigation links