ptolemy.actor.gui
Class TableauFactory

java.lang.Object
  extended byptolemy.kernel.util.NamedObj
      extended byptolemy.kernel.util.Attribute
          extended byptolemy.actor.gui.TableauFactory
All Implemented Interfaces:
Changeable, java.lang.Cloneable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Nameable, java.io.Serializable
Direct Known Subclasses:
ActorGraphTableau.Factory, BrowserTableau.Factory, EditIconTableau.Factory, ExpressionShellTableau.Factory, FileEditorTableauFactory, FSMGraphTableau.Factory, GeneratorTableau.Factory, HTMLViewerTableau.Factory, InterfaceAutomatonGraphTableau.Factory, JVMTableau.Factory, LevelSkippingTableauFactory, MatrixTokenTableau.Factory, ModalTableauFactory, NavigableActorGraphTableau.Factory, PlotTableau.Factory, PtolemyTableauFactory, RunTableau.Factory, SingleWindowHTMLViewerTableau.Factory, TextEditorTableau.Factory, TextEditorTableauFactory, ThalesGraphTableau.Factory, TokenTableau.Factory, TreeTableau.Factory

public class TableauFactory
extends Attribute

This class is an attribute that creates a tableau to view a specified effigy. When a model is opened, if the top-level of that model contains this attribute or a subclass, then that attribute handles constructing a tableau. Otherwise, the configuration specifies which tableau is used. A configuration contains an instance of this class, and uses it to create a tableau for a model represented by an effigy. This base class assumes that it contains other tableau factories. Its createTableau() method defers to each contained factory, in the order in which they were added, until one is capable of creating a tableau for the specified effigy. Subclasses of this class will usually be inner classes of a Tableau, and will create the Tableau, or might themselves be aggregates of instances of TextEditorTableauFactory.

When there are multiple distinct TableauFactory classes that are capable of providing views on the same effigy, then instances of these factories should be aggregated into a single factory contained herein. Those instances can be presented as alternative views of the data when any single view is opened.

There is a significant subtlety with respect to how Ptolemy II classes are dealt with. Normally, when one looks inside an instance of a class, what is opened is the class definition, not the instance. However, if the instance contains an instance of TableauFactory, then what is opened is the instance, not the class definition. This is used, for example, when the look inside behavior is customized on a per instance basis.

Since:
Ptolemy II 1.0
Version:
$Id: TableauFactory.java,v 1.22.2.1 2004/06/18 00:48:52 cxh Exp $
Author:
Steve Neuendorffer and Edward A. Lee
See Also:
Configuration, Effigy, Tableau, Serialized Form
Accepted Rating:
Yellow (celaine)
Proposed Rating:
Green (eal)

Nested Class Summary
 
Nested classes inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
 
Field Summary
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Constructor Summary
TableauFactory(NamedObj container, java.lang.String name)
          Create a factory with the given name and container.
 
Method Summary
 Tableau createTableau(Effigy effigy)
          Create a tableau for the specified effigy.
 
Methods inherited from class ptolemy.kernel.util.Attribute
_getContainedObject, _propagateExistence, clone, getContainer, setContainer, setName
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _description, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDerivedLevel, getDerivedList, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, message, propagateExistence, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setModelErrorHandler, setPersistent, setSource, toplevel, toString, uniqueName, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TableauFactory

public TableauFactory(NamedObj container,
                      java.lang.String name)
               throws IllegalActionException,
                      NameDuplicationException
Create a factory with the given name and container.

Parameters:
container - The container.
name - The name.
Throws:
IllegalActionException - If the container is incompatible with this attribute.
NameDuplicationException - If the name coincides with an attribute already in the container.
Method Detail

createTableau

public Tableau createTableau(Effigy effigy)
                      throws java.lang.Exception
Create a tableau for the specified effigy. The tableau will be created with a new unique name with the specified effigy as its container. If this factory cannot create a tableau for the given effigy (perhaps because the effigy is not of the appropriate subclass), then return null. This base class assumes that it contains other tableau factories. This method defers to each contained factory in order until one is capable of creating a tableau for the specified effigy. As with all attributes, the order is simply the order of creation. Subclasses of this class will usually be inner classes of a Tableau, and will create the Tableau. A subclass that actually creates a tableau is responsible for setting the container of the tableau to the specified effigy, and for naming the tableau. Subclasses should not call show() in createTableau(), it is the responsibility of the caller to check the return value and call show() after doing things like adjusting the size.

Parameters:
effigy - The model effigy.
Returns:
A tableau for the effigy, or null if one cannot be created.
Throws:
java.lang.Exception - If the factory should be able to create a Tableau for the effigy, but something goes wrong.