public class PlotterBase extends TypedAtomicActor implements Configurable, PortablePlaceable
PlotBox
Green (cxh) |
Green (eal) |
Entity.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
protected java.net.URL |
_base
The base specified in configure().
|
protected java.lang.String |
_source
The source specified in configure().
|
protected java.lang.String |
_text
The text specified in configure().
|
Parameter |
automaticRescale
If true, the plot will automatically rescale if necessary.
|
Parameter |
fillOnWrapup
If true, fill the plot when wrapup is called.
|
StringAttribute |
legend
A comma-separated list of labels to attach to each data set.
|
PlotBoxInterface |
plot
The plot object.
|
_typesValid
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
PlotterBase(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_exportMoMLContents(java.io.Writer output,
int depth)
Write a MoML description of the contents of this object, which
in this class is the configuration information.
|
protected PlotterBaseInterface |
_getImplementation()
Get the right instance of the implementation depending upon the
of the dependency specified through dependency injection.
|
protected void |
_implementDeferredConfigurations()
If configurations have been deferred, implement them now.
|
protected boolean |
_isMoMLSuppressed(int depth)
Override the base class to ensure that MoML is produced
if there is configuration information to export.
|
protected PlotBoxInterface |
_newPlot()
Create a new plot.
|
protected void |
_propagateValue(NamedObj destination)
Propagate the value of this object to the
specified object.
|
void |
attributeChanged(Attribute attribute)
If the attribute is legend, then parse the string
and set the legend.
|
void |
cleanUp()
Free up memory when closing.
|
java.lang.Object |
clone(Workspace workspace)
Clone the actor into the specified workspace.
|
void |
configure(java.net.URL base,
java.lang.String source,
java.lang.String text)
Configure the object with data from the specified input source
(a URL) and/or textual data, assumed to be in PlotML format.
|
java.lang.String |
getConfigureSource()
Return the input source that was specified the last time the configure
method was called.
|
java.lang.String |
getConfigureText()
Return the text string that represents the current configuration of
this object.
|
void |
place(PortableContainer container)
Specify the container into which this plot should be placed.
|
void |
preinitialize()
Clear the plot, if there is one.
|
void |
setContainer(CompositeEntity container)
Override the base class to remove the plot from its graphical
container if the argument is null.
|
void |
setDisplayName(java.lang.String name)
Set a name to present to the user.
|
void |
setFrame(java.lang.Object frame)
Specify the associated frame and set its properties (size, etc.)
|
void |
setName(java.lang.String name)
Set or change the name.
|
void |
wrapup()
If the fillOnWrapup parameter is true, rescale the
plot so that all the data is visible.
|
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints
_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, fire, getCausalityInterface, getDirector, getExecutiveDirector, getManager, initialize, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, postfire, prefire, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, stop, stopFire, terminate
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence
_addPort, _description, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, 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, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
fire, isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
addInitializable, initialize, removeInitializable
description, getContainer, getDisplayName, getFullName, getName, getName
getDerivedLevel, getDerivedList, propagateValue
public Parameter automaticRescale
public transient PlotBoxInterface plot
public Parameter fillOnWrapup
public StringAttribute legend
protected java.net.URL _base
protected java.lang.String _source
protected java.lang.String _text
public PlotterBase(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name of this actor.IllegalActionException
- If the actor cannot be contained
by the proposed container.NameDuplicationException
- If the container already has an
actor with this name.public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class NamedObj
attribute
- The attribute that changed.IllegalActionException
- If the superclass throws it.public void cleanUp()
public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class TypedAtomicActor
workspace
- The workspace for the new object.java.lang.CloneNotSupportedException
- If a derived class has an
attribute that cannot be cloned.NamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
public void configure(java.net.URL base, java.lang.String source, java.lang.String text) throws java.lang.Exception
configure
in interface Configurable
base
- The base relative to which references within the input
are found, or null if this is not known, or there is none.source
- The input source, which specifies a URL.text
- Configuration information given as text.java.lang.Exception
- If the configuration source cannot be read
or if the configuration information is incorrect.public java.lang.String getConfigureSource()
getConfigureSource
in interface Configurable
public java.lang.String getConfigureText()
getConfigureText
in interface Configurable
public void place(PortableContainer container)
If configure() has been called (prior to the plot getting created), then the configurations that it specified have been deferred. Those configurations are performed at this time.
place
in interface PortablePlaceable
container
- The container into which to place the plot, or
null to specify that a new plot should be created.public void preinitialize() throws IllegalActionException
preinitialize
in interface Initializable
preinitialize
in class AtomicActor<TypedIOPort>
IllegalActionException
- If the parent class throws it.AtomicActor.initialize()
public void setContainer(CompositeEntity container) throws IllegalActionException, NameDuplicationException
setContainer
in class AtomicActor<TypedIOPort>
container
- The proposed container.IllegalActionException
- If the base class throws it.NameDuplicationException
- If the base class throws it.ComponentEntity.getContainer()
public void setFrame(java.lang.Object frame)
frame
- The associated frame.public void setDisplayName(java.lang.String name)
If the Plot window has been rendered, then the title of the Plot window will be updated to the value of the name parameter.
setDisplayName
in class NamedObj
name
- A name to present to the user.NamedObj.getDisplayName()
public void setName(java.lang.String name) throws IllegalActionException, NameDuplicationException
If the Plot window has been rendered, then the title of the Plot window will be updated to the value of the name parameter.
setName
in interface Nameable
setName
in class ComponentEntity<TypedIOPort>
name
- The new name.IllegalActionException
- If the name contains a period
or if the object is a derived object and the name argument does
not match the current name.NameDuplicationException
- Not thrown in this base class.
May be thrown by derived classes if the container already contains
an object with this name.NamedObj.getName()
,
NamedObj.getName(NamedObj)
public void wrapup() throws IllegalActionException
wrapup
in interface Initializable
wrapup
in class AtomicActor<TypedIOPort>
IllegalActionException
- If the superclass throws it.protected void _exportMoMLContents(java.io.Writer output, int depth) throws java.io.IOException
_exportMoMLContents
in class Entity<TypedIOPort>
output
- The output stream to write to.depth
- The depth in the hierarchy, to determine indenting.java.io.IOException
- If an I/O error occurs.NamedObj.exportMoML(Writer, int)
protected PlotterBaseInterface _getImplementation()
This code is used as part of the dependency injection needed for the
HandSimDroid project, see $PTII/ptserver. This code uses dependency
inject to determine what implementation to use at runtime.
This method eventually reads ptolemy/actor/ActorModule.properties.
ActorModuleInitializer.initializeInjector()
should be called before this method is called. If it is not
called, then a message is printed and initializeInjector() is called.
protected void _implementDeferredConfigurations()
protected boolean _isMoMLSuppressed(int depth)
_isMoMLSuppressed
in class NamedObj
depth
- The depth.protected PlotBoxInterface _newPlot()
protected void _propagateValue(NamedObj destination) throws IllegalActionException
_propagateValue
in class NamedObj
destination
- Object to which to propagate the
value.IllegalActionException
- If the value cannot
be propagated.