|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
ptolemy.actor.lib.Sink
ptolemy.actor.lib.gui.Display
Display the values of the tokens arriving on the input channels in a text area on the screen. Each input token is written on a separate line. The input type can be of any type. If the input happens to be a StringToken, then the surrounding quotation marks are stripped before printing the value of the token. Thus, string-valued tokens can be used to generate arbitrary textual output, at one token per line. Tokens are read from the input only in the postfire() method, to allow them to settle in domains where they converge to a fixed point.
Note that because of complexities in Swing, if you resize the display window, then, unlike the plotters, the new size will not be persistent. That is, if you save the model and then re-open it, the new size is forgotten. To control the size, you should set the rowsDisplayed and columnsDisplayed parameters.
Note that this actor internally uses JTextArea, a Java Swing object that is known to consume large amounts of memory. It is not advisable to use this actor to log large output streams.
| Yellow (vogel) |
| Yellow (yuhong) |
| Nested Class Summary |
| Nested classes inherited from class ptolemy.kernel.Entity |
Entity.ContainedObjectsIterator |
| Field Summary | |
Parameter |
columnsDisplayed
The horizontal size of the display, in columns. |
Parameter |
rowsDisplayed
The vertical size of the display, in rows. |
javax.swing.JTextArea |
textArea
The text area in which the data will be displayed. |
StringAttribute |
title
The title to put on top. |
| Fields inherited from class ptolemy.actor.lib.Sink |
input |
| Fields inherited from class ptolemy.actor.AtomicActor |
_stopRequested |
| Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
| Fields inherited from interface ptolemy.actor.Executable |
COMPLETED, NOT_READY, STOP_ITERATING |
| Constructor Summary | |
Display(CompositeEntity container,
java.lang.String name)
Construct an actor with an input multiport of type GENERAL. |
|
| Method Summary | |
protected void |
_exportMoMLContents(java.io.Writer output,
int depth)
Write a MoML description of the contents of this object. |
void |
attributeChanged(Attribute attribute)
If the specified attribute is rowsDisplayed, then set the desired number of rows of the textArea, if there is one. |
java.lang.Object |
clone(Workspace workspace)
Clone the actor into the specified workspace. |
java.awt.Color |
getBackground()
Get the background color. |
void |
initialize()
Initialize this display. |
void |
place(java.awt.Container container)
Specify the container in which the data should be displayed. |
boolean |
postfire()
Read at most one token from each input channel and display its string value on the screen. |
void |
setBackground(java.awt.Color background)
Set the background |
void |
setContainer(CompositeEntity container)
Override the base class to remove the display from its graphical container if the argument is null. |
| Methods inherited from class ptolemy.actor.TypedAtomicActor |
_addPort, attributeTypeChanged, clone, newPort, typeConstraintList |
| Methods inherited from class ptolemy.actor.AtomicActor |
_createReceivers, connectionsChanged, fire, getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, iterate, newReceiver, outputPortList, prefire, preinitialize, pruneDependencies, removeDependency, stop, stopFire, terminate, wrapup |
| Methods inherited from class ptolemy.kernel.ComponentEntity |
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, propagateExistence, setName |
| Methods inherited from class ptolemy.kernel.Entity |
_description, _removePort, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName, validateSettables |
| Methods inherited from class ptolemy.kernel.InstantiableNamedObj |
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ptolemy.actor.Actor |
getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, newReceiver, outputPortList |
| Methods inherited from interface ptolemy.actor.Executable |
fire, iterate, prefire, preinitialize, stop, stopFire, terminate, wrapup |
| Methods inherited from interface ptolemy.kernel.util.Derivable |
getDerivedLevel, getDerivedList, propagateValue |
| Methods inherited from interface ptolemy.kernel.util.Nameable |
description, getFullName, getName, getName |
| Field Detail |
public Parameter columnsDisplayed
public Parameter rowsDisplayed
public transient javax.swing.JTextArea textArea
public StringAttribute title
| Constructor Detail |
public Display(CompositeEntity container,
java.lang.String name)
throws IllegalActionException,
NameDuplicationException
container - The container.name - The name of this actor.
IllegalActionException - If the entity cannot be contained
by the proposed container.
NameDuplicationException - If the container already has an
actor with this name.| Method Detail |
public void attributeChanged(Attribute attribute)
throws IllegalActionException
attributeChanged in class NamedObjattribute - The attribute that has changed.
IllegalActionException - If the specified attribute
is rowsDisplayed and its value is not positive.
public java.lang.Object clone(Workspace workspace)
throws java.lang.CloneNotSupportedException
clone in class AtomicActorworkspace - The workspace for the new object.
java.lang.CloneNotSupportedException - If a derived class contains
an attribute that cannot be cloned.public java.awt.Color getBackground()
public void initialize()
throws IllegalActionException
initialize in interface Executableinitialize in class AtomicActorIllegalActionException - If the parent class throws it,
or if the numRows or numColumns parameters are incorrect, or
if there is no effigy for the top level container, or if a problem
occurs creating the effigy and tableau.public void place(java.awt.Container container)
place in interface Placeablecontainer - The container into which to place the text area, or
null to specify that there is no current container.
public boolean postfire()
throws IllegalActionException
postfire in interface Executablepostfire in class AtomicActorIllegalActionException - If there is no director.public void setBackground(java.awt.Color background)
public void setContainer(CompositeEntity container)
throws IllegalActionException,
NameDuplicationException
setContainer in class AtomicActorcontainer - The proposed container.
IllegalActionException - If the base class throws it.
NameDuplicationException - If the base class throws it.
protected void _exportMoMLContents(java.io.Writer output,
int depth)
throws java.io.IOException
_exportMoMLContents in class Entityoutput - The output stream to write to.depth - The depth in the hierarchy, to determine indenting.
java.io.IOException - If an I/O error occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||