Package ptolemy.vergil.icon
Class BoxedValueIcon
- java.lang.Object
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Debuggable
,DebugListener
,Derivable
,IconAttribute
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
,ValueListener
- Direct Known Subclasses:
ActorNameIcon
,ConstraintMonitorIcon
public class BoxedValueIcon extends AttributeValueIcon
An icon that displays the value of an attribute of the container in a box that resizes according to the width of the attribute value.If the value is long, then the value is truncated and ends with "...". See
StringUtilities.truncateString(String, int, int)
. This is done so as to avoid Consts with overly long icons.The attribute is assumed to be an instance of Settable, and its name is given by the parameter attributeName.
- Since:
- Ptolemy II 2.0
- Version:
- $Id$
- Author:
- Edward A. Lee
- Pt.AcceptedRating:
- Red (johnr)
- Pt.ProposedRating:
- Yellow (eal)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description ColorAttribute
boxColor
Color of the box.-
Fields inherited from class ptolemy.vergil.icon.AttributeValueIcon
_labelFont, attributeName, displayHeight, displayWidth, entityName
-
Fields inherited from class ptolemy.vergil.icon.DynamicEditorIcon
_figures
-
Fields inherited from class ptolemy.vergil.icon.EditorIcon
_containerToBe, _iconCache
-
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 BoxedValueIcon(NamedObj container, java.lang.String name)
Create a new icon with the given name in the given container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Figure
createBackgroundFigure()
Create a new background figure.-
Methods inherited from class ptolemy.vergil.icon.AttributeValueIcon
_associatedAttribute, _attributeValueString, _displayString, createFigure
-
Methods inherited from class ptolemy.vergil.icon.XMLIcon
_description, _recreateFigure, clone, createIcon, getXMLIcon, getXMLIcon, paintedList, toString, valueChanged
-
Methods inherited from class ptolemy.vergil.icon.DynamicEditorIcon
_addLiveFigure, _liveFigureIterator, _trimLiveFigures
-
Methods inherited from class ptolemy.vergil.icon.EditorIcon
_createDefaultBackgroundFigure, _isPropertySet, getContainerOrContainerToBe, setContainerToBe
-
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, _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, uniqueName, validateSettables, workspace
-
-
-
-
Field Detail
-
boxColor
public ColorAttribute boxColor
Color of the box. This defaults to white.
-
-
Constructor Detail
-
BoxedValueIcon
public BoxedValueIcon(NamedObj container, java.lang.String name) throws NameDuplicationException, IllegalActionException
Create a new icon with the given name in the given container. The container is required to implement Settable, or an exception will be thrown.- Parameters:
container
- The container for this attribute.name
- The name of this attribute.- Throws:
IllegalActionException
- If thrown by the parent class or while setting an attributeNameDuplicationException
- If the name coincides with an attribute already in the container.
-
-
Method Detail
-
createBackgroundFigure
public Figure createBackgroundFigure()
Create a new background figure. This overrides the base class to draw a box around the value display, where the width of the box depends on the value.- Overrides:
createBackgroundFigure
in classXMLIcon
- Returns:
- A new figure.
-
-