Package org.ptolemy.ssm
Class MirrorDecoratorAttributes
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.kernel.util.DecoratorAttributes
-
- org.ptolemy.ssm.MirrorDecoratorAttributes
-
- All Implemented Interfaces:
java.lang.Cloneable
,MirrorDecoratorListener
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
- Direct Known Subclasses:
MeasurementModelAttributes
public class MirrorDecoratorAttributes extends DecoratorAttributes implements MirrorDecoratorListener
Attribute generator class for the MirrorDecorator.- Since:
- Ptolemy II 11.0
- Version:
- $Id$
- Author:
- Ilge Akkaya
- See Also:
MirrorDecorator
- Pt.AcceptedRating:
- Red (ilgea)
- Pt.ProposedRating:
- Red (ilgea)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
Nested classes/interfaces inherited from interface org.ptolemy.ssm.MirrorDecoratorListener
MirrorDecoratorListener.DecoratorEvent
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,Parameter>
_cachedDecoratorPortParameters
Cached list of decorator parameters that are added to the container by this class.protected java.util.Map<java.lang.String,Port>
_cachedDecoratorPorts
Cached list of decorator ports that are added to the container by this class.protected boolean
_enabled
Boolean indicating enable status of the decorator.Parameter
enable
The enable parameter specifies whether the decorated actor uses the resource scheduler decorator.-
Fields inherited from class ptolemy.kernel.util.DecoratorAttributes
_decorator, decoratorName
-
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 MirrorDecoratorAttributes(NamedObj target, java.lang.String name)
Construct a MirroDecoratorAttributesMirrorDecoratorAttributes(NamedObj target, Decorator decorator)
Constructor to use when editing a model.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
attributeChanged(Attribute attribute)
React to a change in an attribute.java.lang.Object
clone(Workspace workspace)
Clone the object into the specified workspace.void
decorateContainer()
Add all decorated ports and necessary parameters to the container.boolean
enabled()
Return whether the decorator associated with this attribute is enabled.void
event(MirrorDecorator ssm, MirrorDecoratorListener.DecoratorEvent eventType, java.lang.String portName)
Send out an event.void
event(MirrorDecorator ssm, MirrorDecoratorListener.DecoratorEvent eventType, Parameter p)
The event that is sent by the mirror decorator and processed by the listener.void
removeDecorationsFromContainer()
Remove all decorated ports from the container.-
Methods inherited from class ptolemy.kernel.util.DecoratorAttributes
exportMoML, getDecorator
-
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, 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, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, 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
-
-
-
-
Field Detail
-
enable
public Parameter enable
The enable parameter specifies whether the decorated actor uses the resource scheduler decorator. This is a boolean that defaults to false.
-
_enabled
protected boolean _enabled
Boolean indicating enable status of the decorator.
-
_cachedDecoratorPorts
protected java.util.Map<java.lang.String,Port> _cachedDecoratorPorts
Cached list of decorator ports that are added to the container by this class.
-
_cachedDecoratorPortParameters
protected java.util.Map<java.lang.String,Parameter> _cachedDecoratorPortParameters
Cached list of decorator parameters that are added to the container by this class.
-
-
Constructor Detail
-
MirrorDecoratorAttributes
public MirrorDecoratorAttributes(NamedObj target, Decorator decorator) throws IllegalActionException, NameDuplicationException
Constructor to use when editing a model.- Parameters:
target
- The object being decorated.decorator
- The decorator.- Throws:
IllegalActionException
- If the superclass throws it.NameDuplicationException
- If the superclass throws it.
-
MirrorDecoratorAttributes
public MirrorDecoratorAttributes(NamedObj target, java.lang.String name) throws IllegalActionException, NameDuplicationException
Construct a MirroDecoratorAttributes- Parameters:
target
- The object being decorated.name
- The name.- Throws:
IllegalActionException
- If the superclass throws it.NameDuplicationException
- If the superclass throws it.
-
-
Method Detail
-
attributeChanged
public void attributeChanged(Attribute attribute) throws IllegalActionException
React to a change in an attribute. If the attribute is enable, remember the value.- Overrides:
attributeChanged
in classDecoratorAttributes
- Parameters:
attribute
- The attribute that changed.- Throws:
IllegalActionException
- If the change is not acceptable to this container (not thrown in this base class).
-
clone
public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
Description copied from class:DecoratorAttributes
Clone the object into the specified workspace.- Overrides:
clone
in classDecoratorAttributes
- Parameters:
workspace
- The workspace for the cloned object.- Returns:
- The new Attribute.
- Throws:
java.lang.CloneNotSupportedException
- Not thrown in this base class- See Also:
NamedObj.exportMoML(Writer, int, String)
,NamedObj.setDeferringChangeRequests(boolean)
-
enabled
public boolean enabled()
Return whether the decorator associated with this attribute is enabled.- Returns:
- True if enabled.
-
event
public void event(MirrorDecorator ssm, MirrorDecoratorListener.DecoratorEvent eventType, Parameter p)
Description copied from interface:MirrorDecoratorListener
The event that is sent by the mirror decorator and processed by the listener.- Specified by:
event
in interfaceMirrorDecoratorListener
eventType
- The type of the event.p
- The parameter subject to change.
-
event
public void event(MirrorDecorator ssm, MirrorDecoratorListener.DecoratorEvent eventType, java.lang.String portName)
Send out an event.- Specified by:
event
in interfaceMirrorDecoratorListener
eventType
- The type of the event.portName
- Name of changing port.
-
decorateContainer
public void decorateContainer()
Add all decorated ports and necessary parameters to the container.
-
removeDecorationsFromContainer
public void removeDecorationsFromContainer() throws IllegalActionException, NameDuplicationException
Remove all decorated ports from the container.
-
-