Package ptolemy.actor.gui
Class ModelDirectory
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.InstantiableNamedObj
-
- ptolemy.kernel.Entity<T>
-
- ptolemy.kernel.ComponentEntity
-
- ptolemy.kernel.CompositeEntity
-
- ptolemy.actor.gui.ModelDirectory
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Debuggable
,DebugListener
,Derivable
,Instantiable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class ModelDirectory extends CompositeEntity
A directory of open models. An instance of this class is contained by a Configuration. Each open model is represented by an instance of Effigy. An effigy represents the model data. It contains a string attribute named "identifier" with a string value that uniquely identifies the model. A typical choice (which depend on the configuration) is the canonical URL for a MoML file that describes the model. An effigy also contains all open instances of Tableau associated with the model.- Since:
- Ptolemy II 1.0
- Version:
- $Id$
- Author:
- Steve Neuendorffer and Edward A. Lee
- See Also:
Configuration
,Effigy
,Tableau
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Yellow (eal)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.CompositeEntity
CompositeEntity.ContainedObjectsIterator
-
-
Field Summary
-
Fields inherited from class ptolemy.kernel.CompositeEntity
_levelCrossingLinks
-
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 ModelDirectory(CompositeEntity container, java.lang.String name)
Construct a model directory with the specified container and name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_removeEntity(ComponentEntity entity)
Remove the specified entity, and if there are no more models in the directory, except possibly the configuration, then remove this directory from its container.Effigy
getEffigy(java.lang.String identifier)
Get the effigy of the model that corresponds to the specified identifier.-
Methods inherited from class ptolemy.kernel.CompositeEntity
_addEntity, _addRelation, _adjustDeferrals, _containedDecorators, _deepOpaqueEntityList, _description, _exportMoMLContents, _finishedAddEntity, _removeRelation, _validateSettables, allAtomicEntityList, allowLevelCrossingConnect, classDefinitionList, clone, connect, connect, containedObjectsIterator, deepCompositeEntityList, deepEntityList, deepGetEntities, deepNamedObjList, deepOpaqueEntityList, deepRelationSet, entityList, entityList, exportLinks, exportMoML, getAttribute, getEntities, getEntity, getPort, getRelation, getRelations, isAtomic, isOpaque, lazyAllAtomicEntityList, lazyAllCompositeEntityList, lazyAllCompositeTransparentAndOpaqueEntityList, lazyClassDefinitionList, lazyDeepEntityList, lazyEntityList, lazyRelationList, newRelation, numberOfEntities, numberOfRelations, numEntities, numRelations, relationList, removeAllEntities, removeAllRelations, setClassDefinition, setContainer, statistics, uniqueName
-
Methods inherited from class ptolemy.kernel.ComponentEntity
_checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, newPort, propagateExistence, setName
-
Methods inherited from class ptolemy.kernel.Entity
_addPort, _removePort, connectedPortList, connectedPorts, connectionsChanged, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts
-
Methods inherited from class ptolemy.kernel.InstantiableNamedObj
_setParent, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
-
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getDisplayName, getFullName, getName, getName
-
-
-
-
Constructor Detail
-
ModelDirectory
public ModelDirectory(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Construct a model directory with the specified container and name.- Parameters:
container
- The configuration that contains this directory.name
- The name of the directory.- Throws:
IllegalActionException
- If the entity cannot be contained by the proposed container. This should not be thrown.NameDuplicationException
- If the name coincides with an entity already in the container.
-
-
Method Detail
-
getEffigy
public Effigy getEffigy(java.lang.String identifier)
Get the effigy of the model that corresponds to the specified identifier.- Parameters:
identifier
- The identifier for the model, such as a URL.- Returns:
- The effigy for the model, or null if the model is not in the directory.
-
_removeEntity
protected void _removeEntity(ComponentEntity entity)
Remove the specified entity, and if there are no more models in the directory, except possibly the configuration, then remove this directory from its container. This method should not be used directly. Call the setContainer() method of the entity instead with a null argument. The entity is assumed to be contained by this composite (otherwise, nothing happens). This does not alter the entity in any way. This method is not synchronized on the workspace, so the caller should be. This class overrides the superclass to check if this composite is empty, and if so, calls system.exit- Overrides:
_removeEntity
in classCompositeEntity
- Parameters:
entity
- The entity to remove.
-
-