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 {@link ptolemy.moml.MoMLSimpleApplication}.

The {@link ptolemy.actor.gui.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 {@link ptolemy.actor.gui.ModelDirectory}, which is a directory of open models. Each open model is represented by an instance of an {@link ptolemy.actor.gui.Effigy}.

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

Each open model has an Effigy. The Effigy contains a {@link ptolemy.actor.gui.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 {@link ptolemy.actor.gui.Tableau#getFrame()}.

How a file is opened using the Configuration class

The {@link ptolemy.actor.gui.ConfigurationApplication} uses the {@link ptolemy.actor.gui.Configuration} class to open a model. ConfigurationApplication uses these steps
  1. Set up {@link ptolemy.moml.MoMLFilter}s.
  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: {@link ptolemy.actor.gui.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 {@link ptolemy.actor.gui.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 {@link ptolemy.actor.gui.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 {@link ptolemy.actor.gui.Configuration}?
Class Name Optionally reads parameters from the command line? Calls {@link ptolemy.moml.filter.RemoveGraphicalClasses}?
{@link ptolemy.actor.gui.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
{@link ptolemy.actor.gui.CompositeActorSimpleApplication} is similar to CompositeActorApplication but this class does not handle {@link ptolemy.actor.gui.Placeable} classes. This class is not often used. No No No
{@link ptolemy.moml.MoMLSimpleApplication} is a simple example of how to invoke a model No No Yes
{@link ptolemy.actor.gui.MoMLSimpleStatisticalApplication} extends MoMLSimpleApplication and prints out statistics about the run. See also {@link ptolemy.kernel.CompositeEntity#statistics(String)}. This class is not often used. No No Yes
{@link ptolemy.moml.MoMLCommandLineApplication} extends MoMLSimpleApplication and optionally sets parameters from the command line. No Yes Yes
{@link ptolemy.actor.gui.ConfigurationApplication} Yes Yes Optionally, by setting _removeGraphicalClasses
{@link ptolemy.actor.gui.MoMLApplication} Yes Yes No, this class sets the Look and Feel, which invokes Java's UI code
{@link ptolemy.actor.gui.PtolemyApplication} extends MoMLApplication and opens a {@link ptolemy.actor.gui.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
{@link ptolemy.actor.gui.PtExecuteApplication} extends MoMLApplication and in the default opens a {@link ptolemy.actor.gui.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
{@link ptolemy.vergil.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