Class ChicAttribute
- java.lang.Object
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
,Settable
public class ChicAttribute extends StringAttribute
An attribute that has a string value which is meant to be used as an interface in Chic. Use setExpression() to define the value, as in for exampleattribute.setExpression("xxx");
The default value of the string contained by this attribute is the empty string.
By default, an instance of this class is fully visible in a user interface and it is annotated with a TextStyle attribute. The visibility is indicated to the user interface when the user interface calls the getVisibility() method of this class and the value Settable.FULL is returned to the userInterface.
Note that the string value within ChicAttribute will not be parsed and you do not have to type a leading and a trailing double quote.
This class is an attribute that replaces any previously existing attribute of the same class in the container that has the same name.
- Since:
- Ptolemy II 3.0
- Version:
- $Id$
- Author:
- Eleftherios Matsikoudis
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Red (cxh)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
Nested classes/interfaces inherited from interface ptolemy.kernel.util.Settable
Settable.Visibility
-
-
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
-
Fields inherited from interface ptolemy.kernel.util.Settable
EXPERT, FULL, NONE, NOT_EDITABLE
-
-
Constructor Summary
Constructors Constructor Description ChicAttribute(NamedObj container, java.lang.String name)
Construct an attribute with the given name contained by the specified container and annotate it with a TextStyle attribute.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setContainer(NamedObj container)
Remove any previous ChicAttribute in the container that has the same name as this attribute, and then call the base class method to set the container.-
Methods inherited from class ptolemy.kernel.util.StringAttribute
_propagateValue, addValueListener, clone, exportMoML, getExpression, getVisibility, removeValueListener, setExpression, setVisibility, validate
-
Methods inherited from class ptolemy.kernel.util.AbstractSettableAttribute
getDefaultExpression, getValueAsString
-
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, 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, _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, 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
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getFullName, getName, getName, setName
-
Methods inherited from interface ptolemy.kernel.util.Settable
getDisplayName
-
-
-
-
Constructor Detail
-
ChicAttribute
public ChicAttribute(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Construct an attribute with the given name contained by the specified container and annotate it with a TextStyle attribute. The container argument must not be null, or a NullPointerException will be thrown. This attribute will use the workspace of the container for synchronization and version counts. If the name argument is null, then the name is set to the empty string. This attribute that replaces any previously existing attribute of the same class in the container that has the same name. The object is added to the directory of the workspace if the container is null. Increment the version of the workspace.- Parameters:
container
- The container.name
- The name of this attribute.- Throws:
IllegalActionException
- If the attribute is not of an acceptable class for the container, or if the name contains a period.NameDuplicationException
- If the name coincides with an attribute of different class already in the container.
-
-
Method Detail
-
setContainer
public void setContainer(NamedObj container) throws IllegalActionException, NameDuplicationException
Remove any previous ChicAttribute in the container that has the same name as this attribute, and then call the base class method to set the container. If the container has an attribute with the same name that is not an instance of this class, throw an exception. If the container is not in the same workspace as this attribute, throw an exception. If this attribute is already contained by the NamedObj, do nothing. If the attribute already has a container, remove this attribute from its attribute list first. Otherwise, remove it from the directory of the workspace, if it is there. If the argument is null, then remove this attribute from its container. It is not added to the workspace directory, so this could result in this object being garbage collected.Note that since an ChicAttribute is a NamedObj, it can itself have attributes. However, recursive containment is not allowed, where an attribute is an attribute of itself, or indirectly of any attribute it contains.
This method is write-synchronized on the workspace and increments its version number.
- Overrides:
setContainer
in classAttribute
- Parameters:
container
- The container to attach this attribute to.- Throws:
IllegalActionException
- If this attribute is not of the expected class for the container, or it has no name, or there is an attribute with the same name that is not an instance of this class, or the attribute and container are not in the same workspace, or the proposed container would result in recursive containment.NameDuplicationException
- If the container already has an attribute with the name of this attribute that is not of class ChicAttribute.- See Also:
Attribute.getContainer()
-
-