The configuration of an application that uses Ptolemy II classes.
An instance of this class is in charge of the user interface,
and coordinates multiple views of multiple models. One of its
functions, for example, is to manage the opening of new models,
ensuring that an appropriate view is used. It also makes sure that
if a model is opened that is already open, then existing views are
shown rather than creating new views.
<p>
The applications <i>vergil</i> and <i>moml</i> (at least) use
configurations defined in MoML files, typically located in
ptII/ptolemy/configs. The <i>moml</i> application takes as
command line arguments a list of MoML files, the first of which
is expected to define an instance of Configuration and its contents.
That configuration is then used to open subsequent MoML files on the
command line, and to manage the user interface.
<p>
Rather than performing all these functions itself, this class
is a container for a model directory, effigy factories, and tableau
factories that actually realize these functions. An application
is configured by populating an instance of this class with
a suitable set of these other classes. A minimal configuration
defined in MoML is shown below:
<pre>
<?xml version="1.0" standalone="no"?>
<!DOCTYPE entity PUBLIC "-//UC Berkeley//DTD MoML 1//EN"
"http://ptolemy.eecs.berkeley.edu/xml/dtd/MoML_1.dtd">
<entity name="configuration" class="ptolemy.actor.gui.Configuration">
<doc>Configuration to run but not edit Ptolemy II models</doc>
<entity name="directory" class="ptolemy.actor.gui.ModelDirectory"/>
<entity name="effigyFactory" class="ptolemy.actor.gui.PtolemyEffigy$Factory"/>
<property name="tableauFactory" class="ptolemy.actor.gui.RunTableau$Factory"/>
</entity>
</pre>
<p>
It must contain, at a minimum, an instance of ModelDirectory, named
"directory", and an instance of EffigyFactory, named "effigyFactory".
The openModel() method delegates to the effigy factory the opening of a model.
It may also contain an instance of TextEditorTableauFactory, named "tableauFactory".
A tableau is a visual representation of the model in a top-level window.
The above minimal configuration can be used to run Ptolemy II models
by opening a run panel only.
<p>
When the directory becomes empty (all models have been closed),
it removes itself from the configuration. When this happens, the
configuration calls System.exit() to exit the application.
<p>To access the configuration from a random place, if you have a
NamedObj <code>foo</code>, then you can call:
<pre>
Effigy effigy = Configuration.findEffigy(foo.toplevel());
Configuration configuration = effigy.toplevel();
</pre>
Steve Neuendorffer and Edward A. Lee
$Id: Configuration.java 70402 2014-10-23 00:52:20Z cxh $
Ptolemy II 1.0
Green (eal)
Yellow (celaine)
A Parameter that is an array of Strings where each element
names a class to be removed. The initial default value is
an array with an empty element.
<p> Kepler uses this parameter to remove certain classes:
<pre>
<property name="_classesToRemove" class="ptolemy.data.expr.Parameter"
value="{"ptolemy.codegen.kernel.StaticSchedulingCodeGenerator","ptolemy.codegen.c.kernel.CCodeGenerator"}">
<doc>An array of Strings, where each element names a class
to removed by the MoMLFilter.</doc>
>/property>
</pre>
A Parameter that if set to true adds <a href="../../../ptolemy/moml/filter/RemoveGraphicalClasses.xml">ptolemy.moml.filter.RemoveGraphicalClasses</a> to the list of
MoMLFilters. Use this to run non-graphical classes. Note that
setting this parameter and using MoMLApplication is not likely
to work as MoMLApplication sets the look and feel which invokes
the graphical system. The initial value is a boolean with the
value false, indicating that RemoveGraphicalClasses should not
be added to the filter list.