Package ptolemy.vergil.icon
Class ConstraintMonitorIcon
- java.lang.Object
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Debuggable
,DebugListener
,Derivable
,IconAttribute
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
,ValueListener
public class ConstraintMonitorIcon extends BoxedValueIcon
An icon providing visual indication when constraints are violated. This works specifically withConstraintMonitor
.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Edward A. Lee
- Pt.AcceptedRating:
- Red (celaine)
- 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
closeColor
Color of the box to use when the constraint is close to the threshold.Parameter
closeFraction
Fraction of the threshold that is to be considered close to the threshold.ColorAttribute
highColor
Color of the box to use when the constraint is above the threshold.ColorAttribute
okColor
Color of the box to use when the constraint is satisfied.-
Fields inherited from class ptolemy.vergil.icon.BoxedValueIcon
boxColor
-
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 ConstraintMonitorIcon(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()
Override the base class to modify the background color, if appropriate.void
setContainer(NamedObj container)
Override the base class to throw an exception if the container is not an instance ofConstraintMonitor
.-
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, 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
-
closeColor
public ColorAttribute closeColor
Color of the box to use when the constraint is close to the threshold. This defaults to yellow.
-
closeFraction
public Parameter closeFraction
Fraction of the threshold that is to be considered close to the threshold. This is a double that defaults to 0.1.
-
highColor
public ColorAttribute highColor
Color of the box to use when the constraint is above the threshold. This defaults to pink.
-
okColor
public ColorAttribute okColor
Color of the box to use when the constraint is satisfied. This defaults to a light green.
-
-
Constructor Detail
-
ConstraintMonitorIcon
public ConstraintMonitorIcon(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()
Override the base class to modify the background color, if appropriate.- Overrides:
createBackgroundFigure
in classBoxedValueIcon
- Returns:
- A new figure.
-
setContainer
public void setContainer(NamedObj container) throws IllegalActionException, NameDuplicationException
Override the base class to throw an exception if the container is not an instance ofConstraintMonitor
.- 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 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.- See Also:
Attribute.getContainer()
-
-