Package ptolemy.domains.gr.lib
Class TextString3D
- java.lang.Object
-
- All Implemented Interfaces:
java.lang.Cloneable
,Actor
,Executable
,FiringsRecordable
,Initializable
,TypedActor
,Changeable
,Debuggable
,DebugListener
,Derivable
,Instantiable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class TextString3D extends GRShadedShape
An actor that encapsulates 3D text shapes in the GR domain. The text port/parameter gives the text to be displayed. The fontSize parameter gives the size of the font. The extrusionDepth parameter specifies how deep the 3-D rendering of the text should be. The alignment parameter gives the alignment of the text relative to the position of the object. The fontFamily parameter specifies the font family. The rest of the parameters are described in the base class.- Since:
- Ptolemy II 1.0
- Version:
- $Id$
- Author:
- C. Fong and Edward A. Lee
- Pt.AcceptedRating:
- Green (liuxj)
- Pt.ProposedRating:
- Green (eal)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description StringParameter
alignment
The alignment of the text.Parameter
extrusionDepth
The depth of the extrusion of the text.StringParameter
fontFamily
The font family.Parameter
fontSize
The font size.PortParameter
text
The text to display.-
Fields inherited from class ptolemy.domains.gr.lib.GRShadedShape
_appearance, _changesAllowedNow, _coloringAttributes, _material, _polygonAttributes, _transparencyAttributes, allowRuntimeChanges, diffuseColor, emissiveColor, flat, sceneGraphOut, shininess, specularColor, texture, transparency, wireFrame
-
Fields inherited from class ptolemy.domains.gr.kernel.GRActor3D
_viewScreen
-
Fields inherited from class ptolemy.domains.gr.kernel.GRActor
_allowAttributeChanges, _isSceneGraphInitialized
-
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 TextString3D(CompositeEntity container, java.lang.String name)
Construct an actor with the given container and name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_createModel()
Create the shape and appearance of the encapsulated text.protected javax.media.j3d.Node
_getNodeObject()
Return the encapsulated Java3D node of this 3D actor.void
attributeChanged(Attribute attribute)
If the attribute is text, then update the displayed text string.boolean
prefire()
Override the base class to update the text parameter from the value given at the port, if any.-
Methods inherited from class ptolemy.domains.gr.lib.GRShadedShape
_createAppearance, _makeSceneGraphConnection, _setViewScreen, clone, initialize, preinitialize, wrapup
-
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, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, postfire, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate
-
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, 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
isFireFunctional, isStrict, iterate, postfire, stop, stopFire, terminate
-
Methods inherited from interface ptolemy.actor.Initializable
addInitializable, removeInitializable
-
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
-
-
-
-
Field Detail
-
alignment
public StringParameter alignment
The alignment of the text. This is a string that defaults to "center". The recognized values are "center", "first", and "last". A value of "first" means that the first character is put on the position of the object, whereas "last" means that the last character is put on the position. Note that "left" and "right" would make no sense, since the orientation is arbitrary.
-
extrusionDepth
public Parameter extrusionDepth
The depth of the extrusion of the text. This is a double that defaults to 0.2.
-
fontFamily
public StringParameter fontFamily
The font family. This is a string that defaults to "SansSerif", a font that is guaranteed by Java to always be present.
-
fontSize
public Parameter fontSize
The font size. This is a double that defaults to 1.0.
-
text
public PortParameter text
The text to display.
-
-
Constructor Detail
-
TextString3D
public TextString3D(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Construct an actor with the given container and name.- Parameters:
container
- The container.name
- The name of this actor.- Throws:
IllegalActionException
- If the actor cannot be contained by the proposed container.NameDuplicationException
- If the container already has an actor with this name.
-
-
Method Detail
-
attributeChanged
public void attributeChanged(Attribute attribute) throws IllegalActionException
If the attribute is text, then update the displayed text string.- Overrides:
attributeChanged
in classGRShadedShape
- Parameters:
attribute
- The attribute.- Throws:
IllegalActionException
- If thrown by the parent class.
-
prefire
public boolean prefire() throws IllegalActionException
Override the base class to update the text parameter from the value given at the port, if any.- Specified by:
prefire
in interfaceExecutable
- Overrides:
prefire
in classGRShadedShape
- Returns:
- False if the scene graph has already been initialized.
- Throws:
IllegalActionException
- If thrown by the parent class.
-
_createModel
protected void _createModel() throws IllegalActionException
Create the shape and appearance of the encapsulated text.- Overrides:
_createModel
in classGRShadedShape
- Throws:
IllegalActionException
- If the value of some parameters can't be obtained.
-
_getNodeObject
protected javax.media.j3d.Node _getNodeObject()
Return the encapsulated Java3D node of this 3D actor. The encapsulated node for this actor is a Java3D Text3D- Specified by:
_getNodeObject
in classGRActor3D
- Returns:
- the Java3D Text3D
-
-