Package ptolemy.actor.gui
Class TableauFactory
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.actor.gui.TableauFactory
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Configurable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
- Direct Known Subclasses:
ActorGraphTableau.Factory
,BrowserTableau.Factory
,CaseGraphTableau.Factory
,Console.Factory
,DocBuilderTableau.Factory
,DocTableau.Factory
,EditIconTableau.Factory
,ExecShellTableau.Factory
,ExpressionShellTableau.Factory
,FileEditorTableauFactory
,FmvAutomatonGraphTableau.Factory
,FSMGraphTableau.Factory
,GeneratorTableau.Factory
,GTTableau.Factory
,GTTableau.ModalTableauFactory
,HTMLViewerTableau.Factory
,ImageTableau.Factory
,InterfaceAutomatonGraphTableau.Factory
,InterfaceTableau.Factory
,JVMTableau.Factory
,LevelSkippingTableauFactory
,MatchResultTableau.Factory
,MatrixTokenTableau.Factory
,ModalTableauFactory
,OntologyGraphTableau.Factory
,OntologySolverTableau.Factory
,PlotTableau.Factory
,PteraGraphTableau.Factory
,PtolemyTableauFactory
,PythonShellTableau.Factory
,RunTableau.Factory
,SCRGraphTableau.Factory
,SCRTableauFactory
,SimpleTableau.Factory
,TclShellTableau.Factory
,TdlTableauFactory
,TdlTaskTableauFactory
,TextEditorTableau.Factory
,TextEditorTableauFactory
,TokenTableau.Factory
,TreeTableau.Factory
,VisualModelReference.LookInside
public class TableauFactory extends Attribute implements Configurable
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$
- Author:
- Steve Neuendorffer and Edward A. Lee
- See Also:
Configuration
,Effigy
,Tableau
- Pt.AcceptedRating:
- Yellow (celaine)
- Pt.ProposedRating:
- Green (eal)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
-
Field Summary
-
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
-
-
Constructor Summary
Constructors Constructor Description TableauFactory(NamedObj container, java.lang.String name)
Create a factory with the given name and container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_configureTableau(Tableau tableau)
Configure the given tableau with the configuration data attached to this tableau factory, if any.void
configure(java.net.URL base, java.lang.String source, java.lang.String text)
Configure the tableau factory with data from the specified input source (a URL) and/or textual data.Tableau
createTableau(Effigy effigy)
Create a tableau for the specified effigy.java.lang.String
getConfigureSource()
Return the input source that was specified the last time the configure method was called.java.lang.String
getConfigureText()
Return the text string that represents the current configuration of this object.-
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, clone, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setContainer, setName, updateContent
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
-
-
-
-
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.
-
configure
public void configure(java.net.URL base, java.lang.String source, java.lang.String text) throws java.lang.Exception
Configure the tableau factory with data from the specified input source (a URL) and/or textual data. The data is recorded locally without parsing.- Specified by:
configure
in interfaceConfigurable
- Parameters:
base
- The base relative to which references within the input are found, or null if this is not known, or there is none.source
- The input source, which specifies a URL, or null if none.text
- Configuration information given as text, or null if none.- Throws:
java.lang.Exception
- If something goes wrong. No thrown in this class.
-
getConfigureSource
public java.lang.String getConfigureSource()
Return the input source that was specified the last time the configure method was called.- Specified by:
getConfigureSource
in interfaceConfigurable
- Returns:
- The string representation of the input URL, or null if the no source has been used to configure this object, or null if no external source need be used to configure this object.
-
getConfigureText
public java.lang.String getConfigureText()
Return the text string that represents the current configuration of this object. Note that any configuration that was previously specified using the source attribute need not be represented here as well.- Specified by:
getConfigureText
in interfaceConfigurable
- Returns:
- A configuration string, or null if no configuration has been used to configure this object, or null if no configuration string need be used to configure this object.
-
_configureTableau
protected void _configureTableau(Tableau tableau)
Configure the given tableau with the configuration data attached to this tableau factory, if any.- Parameters:
tableau
- The tableau to be configured.
-
-