Package ptolemy.domains.metroII.kernel
Class MappingEditor
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.domains.metroII.kernel.MappingEditor
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class MappingEditor extends Attribute
MappingEditor is an attribute used to edit the mapping constraints.- Since:
- Ptolemy II 11.0
- Version:
- $Id$
- Author:
- Liangpeng Guo
- Pt.AcceptedRating:
- Red (glp)
- Pt.ProposedRating:
- Red (glp)
-
-
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 MappingEditor(NamedObj container, java.lang.String name)
Constructs a mapping editor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
actorNames()
Returns actors names on all hierarchies.java.io.File
getMappingFile()
Gets mapping file name.java.lang.String
readMapping()
Reads mapping constraints.void
saveMapping(java.lang.String content)
Saves content to mapping file.-
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
-
MappingEditor
public MappingEditor(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Constructs a mapping editor.- Parameters:
container
- Container of the director.name
- Name of this attribute.- Throws:
IllegalActionException
- If the director is not compatible with the specified container. May be thrown in a derived class.NameDuplicationException
- If the container is not a CompositeActor and the name collides with an entity in the container.
-
-
Method Detail
-
getMappingFile
public java.io.File getMappingFile() throws IllegalActionException
Gets mapping file name.- Returns:
- The name of the mapping file.
- Throws:
IllegalActionException
- If the director is not a MetroIIDirector.
-
readMapping
public java.lang.String readMapping() throws IllegalActionException
Reads mapping constraints.- Returns:
- The mapping constraints.
- Throws:
IllegalActionException
- If the mapping file cannot be read.
-
saveMapping
public void saveMapping(java.lang.String content) throws IllegalActionException
Saves content to mapping file.- Parameters:
content
- the content to save to the mapping file.- Throws:
IllegalActionException
- a failed or interrupted I/O operations has occurred.
-
actorNames
public java.lang.String actorNames() throws IllegalActionException
Returns actors names on all hierarchies.- Returns:
- actors names on all hierarchies.
- Throws:
IllegalActionException
-
-