Package ptolemy.actor.lib.gui
Class MonitorValue
- java.lang.Object
-
- All Implemented Interfaces:
java.lang.Cloneable,Actor,Executable,FiringsRecordable,Initializable,PortablePlaceable,TypedActor,Changeable,Debuggable,DebugListener,Derivable,Instantiable,ModelErrorHandler,MoMLExportable,Moveable,Nameable
- Direct Known Subclasses:
TimedMonitorValue
public class MonitorValue extends Sink implements PortablePlaceable
Monitor inputs by setting the value parameter equal to each arriving token. This actor can be used with an icon that displays the value of a parameter to get on-screen display of values in a diagram. The value is updated only in postfire.Note that the icon for this actor is defined in
ptolemy/actor/lib/genericsinks.xml, which looks something like<entity name="MonitorValue" class="ptolemy.actor.lib.MonitorValue"> <doc>Monitor and display values</doc> <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="20"/> <property name="_icon" class="ptolemy.vergil.icon.UpdatedValueIcon"> <property name="attributeName" value="value"/> <property name="displayWidth" value="displayWidth"/> </property> </entity>- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Edward A. Lee
- Pt.AcceptedRating:
- Red (bilung)
- Pt.ProposedRating:
- Yellow (eal)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description ParameterinitialThe initial value to be displayed.ParametervalueThe most recently seen input value.-
Fields inherited from class ptolemy.actor.TypedAtomicActor
_typesValid
-
Fields inherited from class ptolemy.actor.AtomicActor
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
-
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.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
-
-
Constructor Summary
Constructors Constructor Description MonitorValue(CompositeEntity container, java.lang.String name)Construct an actor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Set<Inequality>_customTypeConstraints()Set the input port greater than or equal toBaseType.GENERALin case backward type inference is enabled and the input port has no type declared.protected Token_getInputToken(int i)Return a token from the named input channel.voidinitialize()Initialize the actor by clearing the display.voidplace(PortableContainer container)Place the visual representation of the actor into the specified container.booleanpostfire()Read at most one token from the input and record its value.-
Methods inherited from class ptolemy.actor.TypedAtomicActor
_containedTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints
-
Methods inherited from class ptolemy.actor.AtomicActor
_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, fire, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, prefire, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate, wrapup
-
Methods inherited from class ptolemy.kernel.ComponentEntity
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
-
Methods inherited from class ptolemy.kernel.Entity
_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
-
Methods inherited from class ptolemy.kernel.InstantiableNamedObj
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ptolemy.actor.Actor
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
-
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
-
Methods inherited from interface ptolemy.actor.Executable
fire, isFireFunctional, isStrict, iterate, prefire, stop, stopFire, terminate
-
Methods inherited from interface ptolemy.actor.Initializable
addInitializable, preinitialize, removeInitializable, wrapup
-
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
-
-
-
-
Constructor Detail
-
MonitorValue
public MonitorValue(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
Construct an actor.- Parameters:
container- The container.name- The name of this actor.- Throws:
IllegalActionException- If the entity cannot be contained by the proposed container.NameDuplicationException- If the container already has an actor with this name.
-
-
Method Detail
-
initialize
public void initialize() throws IllegalActionExceptionInitialize the actor by clearing the display.- Specified by:
initializein interfaceInitializable- Overrides:
initializein classAtomicActor<TypedIOPort>- Throws:
IllegalActionException- If a derived class throws it.
-
place
public void place(PortableContainer container)
Place the visual representation of the actor into the specified container.- Specified by:
placein interfacePortablePlaceable- Parameters:
container- The container in which to place the object, or null to specify that there is no current container.
-
postfire
public boolean postfire() throws IllegalActionExceptionRead at most one token from the input and record its value.- Specified by:
postfirein interfaceExecutable- Overrides:
postfirein classAtomicActor<TypedIOPort>- Returns:
- True.
- Throws:
IllegalActionException- If there is no director.
-
_customTypeConstraints
protected java.util.Set<Inequality> _customTypeConstraints()
Set the input port greater than or equal toBaseType.GENERALin case backward type inference is enabled and the input port has no type declared.- Overrides:
_customTypeConstraintsin classTypedAtomicActor- Returns:
- A set of inequalities.
-
_getInputToken
protected Token _getInputToken(int i) throws IllegalActionException
Return a token from the named input channel. This is a protected method to allow subclasses to override how inputs are observed.- Parameters:
i- The channel- Returns:
- A token from the input channel or null if there is nothing to display.
- Throws:
IllegalActionException- If reading the input fails.
-
-