|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.util.Attribute
ptolemy.vergil.kernel.attributes.VisibleAttribute
ptolemy.vergil.kernel.attributes.AbstractTextAttribute
ptolemy.vergil.kernel.attributes.AttributeValueAttribute
public class AttributeValueAttribute
This is a text attribute whose text string shows the value of a parameter.
Red (cxh) |
Yellow (eal) |
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 | |
---|---|
protected Settable |
_attribute
The associated attribute. |
private boolean |
_deferred
Flag indicating that we have already tried deferring evaluation. |
protected int |
_displayWidth
Most recent value of the rounding parameter. |
StringAttribute |
attributeName
The name of the attribute of the container whose value to display. |
Parameter |
displayWidth
The number of characters to display. |
Fields inherited from class ptolemy.vergil.kernel.attributes.AbstractTextAttribute |
---|
_icon, bold, center, fontFamily, italic, textColor, textSize |
Fields inherited from class ptolemy.kernel.util.NamedObj |
---|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _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 | |
---|---|
AttributeValueAttribute(NamedObj container,
java.lang.String name)
Construct an attribute with the given name contained by the specified container. |
Method Summary | |
---|---|
protected java.lang.String |
_getText()
Return a new string that contains the expression of the referred to attribute. |
protected void |
_setAttributeName(java.lang.String attributeName)
Set the attribute name. |
void |
addValueListener(ValueListener listener)
Add a listener to be notified when the value of this settable object changes. |
void |
attributeChanged(Attribute attribute)
React to a changes in the attributes by changing the icon. |
java.lang.String |
getDefaultExpression()
Return the default value of this attribute, if there is one, or null if there is none. |
java.lang.String |
getDisplayName()
Return a name to present to the user, which is the same as the name returned by getName(). |
java.lang.String |
getExpression()
Get the value of the attribute that has been set by setExpression(), or null if there is none. |
java.lang.String |
getValueAsString()
Get the value of the attribute, which is the evaluated expression. |
Settable.Visibility |
getVisibility()
Get the visibility of this Settable, as set by setVisibility(). |
void |
removeValueListener(ValueListener listener)
Remove a listener from the list of listeners that are notified when the value of this variable changes. |
void |
setExpression(java.lang.String expression)
Set the value of the attribute by giving some expression. |
void |
setVisibility(Settable.Visibility visibility)
Set the visibility of this Settable. |
java.util.Collection |
validate()
Set the attribute name to match the current expression. |
void |
valueChanged(Settable settable)
React to a change in the value of the associated attribute. |
Methods inherited from class ptolemy.vergil.kernel.attributes.AbstractTextAttribute |
---|
clone |
Methods inherited from class ptolemy.vergil.kernel.attributes.VisibleAttribute |
---|
moveToFirst, moveToLast |
Methods inherited from class ptolemy.kernel.util.Attribute |
---|
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToIndex, moveUp, setContainer, setName, updateContent |
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 |
Field Detail |
---|
public StringAttribute attributeName
public Parameter displayWidth
protected int _displayWidth
protected Settable _attribute
private boolean _deferred
Constructor Detail |
---|
public AttributeValueAttribute(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name of this attribute.
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 already in the container.Method Detail |
---|
public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class AbstractTextAttribute
attribute
- The attribute that changed.
IllegalActionException
- If the change is not acceptable
to this container (should not be thrown).public void valueChanged(Settable settable)
valueChanged
in interface ValueListener
settable
- The object that has changed value.public void addValueListener(ValueListener listener)
addValueListener
in interface Settable
listener
- The listener to add.removeValueListener(ValueListener)
public java.lang.String getDefaultExpression()
getDefaultExpression
in interface Settable
public java.lang.String getDisplayName()
getDisplayName
in interface Nameable
getDisplayName
in interface Settable
getDisplayName
in class NamedObj
NamedObj.setDisplayName(String)
public java.lang.String getExpression()
getExpression
in interface Settable
setExpression(String)
public java.lang.String getValueAsString()
getValueAsString
in interface Settable
getExpression()
public Settable.Visibility getVisibility()
getVisibility
in interface Settable
setVisibility(Settable.Visibility)
public void removeValueListener(ValueListener listener)
removeValueListener
in interface Settable
listener
- The listener to remove.addValueListener(ValueListener)
public void setExpression(java.lang.String expression) throws IllegalActionException
setExpression
in interface Settable
expression
- The value of the attribute, which is ignored.
IllegalActionException
- If the expression is invalid.getExpression()
public void setVisibility(Settable.Visibility visibility)
setVisibility
in interface Settable
visibility
- The visibility of this Settable.getVisibility()
public java.util.Collection validate() throws IllegalActionException
validate
in interface Settable
IllegalActionException
- If the expression is not valid, or
its value is not acceptable to the container or the listeners.protected void _setAttributeName(java.lang.String attributeName)
attributeName
- The attribute name.protected java.lang.String _getText()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |