Package ptolemy.domains.ca.lib.gui
Class CAViewer
- java.lang.Object
-
- All Implemented Interfaces:
java.lang.Cloneable
,Actor
,Executable
,FiringsRecordable
,Placeable
,Initializable
,TypedActor
,Changeable
,Debuggable
,DebugListener
,Derivable
,Instantiable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class CAViewer extends AbstractPlaceableActor
Cellular Automata Viewer.The CAViewer is a display actor to be used in conjunction with the CADirector. The CAViewer can be placed on the canvas and will render the grid as defined by the Director's parameters and possibly the output of the CA2DConvolution actor. This actor is the currently the only way to visualize cellular automata or other 2D grid based phenomena employing the CADirectory.
- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Zach Ezzell, Contributor: Christopher Brooks
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Red (cxh)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
_initialized
True if the actor has been initialized.protected double[][]
matrix
The matrix to be rendered as a grid.-
Fields inherited from class ptolemy.actor.gui.AbstractPlaceableActor
_frame, _paneSize, _windowClosingAdapter, _windowProperties
-
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 CAViewer(CompositeEntity entity, java.lang.String name)
Construct a new CAViewer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_openWindow()
Open the window, first initializing it if necessary.void
initialize()
Initialize the viewer.void
place(java.awt.Container container)
Specify the container in which the data should be displayed.boolean
postfire()
Show the tableau containing the visualization of the matrix.void
setMatrix(double[][] matrix)
Set the matrix to be rendered as a grid.-
Methods inherited from class ptolemy.actor.gui.AbstractPlaceableActor
_exportMoMLContents, cleanUp, clone, setFrame
-
Methods inherited from class ptolemy.actor.TypedAtomicActor
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, 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, _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
-
CAViewer
public CAViewer(CompositeEntity entity, java.lang.String name) throws IllegalActionException, NameDuplicationException
Construct a new CAViewer.- Parameters:
entity
- The containername
- The name of the CAViewer.- Throws:
IllegalActionException
- If the name has a period in it.NameDuplicationException
- If the container already contains an entity with the specified name.
-
-
Method Detail
-
initialize
public void initialize() throws IllegalActionException
Initialize the viewer.- Specified by:
initialize
in interfaceInitializable
- Overrides:
initialize
in classAtomicActor<TypedIOPort>
- Throws:
IllegalActionException
- If the superclass throws the exception.
-
place
public void place(java.awt.Container container)
Specify the container in which the data should be displayed.- Specified by:
place
in interfacePlaceable
- Specified by:
place
in classAbstractPlaceableActor
- Parameters:
container
- The container in which to place the pane that will contain the CATableau or null to specify no container.
-
postfire
public boolean postfire() throws IllegalActionException
Show the tableau containing the visualization of the matrix.- Specified by:
postfire
in interfaceExecutable
- Overrides:
postfire
in classAtomicActor<TypedIOPort>
- Returns:
- True if execution can continue into the next iteration.
- Throws:
IllegalActionException
- If the base class throws an exception.
-
setMatrix
public void setMatrix(double[][] matrix)
Set the matrix to be rendered as a grid.- Parameters:
matrix
- The matrix to be rendered.
-
_openWindow
protected void _openWindow() throws IllegalActionException
Open the window, first initializing it if necessary. It is modeled after _openWindow() is the Display actor.- Throws:
IllegalActionException
- If the top level effigy cannot be found or the token effigy cannot be created.
-
-