ptolemy.domains.gr.lib
Class TextString3D
java.lang.Object
ptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
ptolemy.domains.gr.kernel.GRActor
ptolemy.domains.gr.kernel.GRActor3D
ptolemy.domains.gr.lib.GRShadedShape
ptolemy.domains.gr.lib.TextString3D
- All Implemented Interfaces:
- java.io.Serializable, 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: TextString3D.java 57040 2010-01-27 20:52:32Z cxh $
- Author:
- C. Fong and Edward A. Lee
- See Also:
- Serialized Form
- Accepted Rating:
- Proposed Rating:
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.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Constructor Summary |
TextString3D(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name. |
Method Summary |
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.kernel.GRActor |
fire |
Methods inherited from class ptolemy.actor.AtomicActor |
_actorFiring, _actorFiring, 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 |
_description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName |
Methods inherited from class ptolemy.kernel.util.NamedObj |
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeList, attributeList, 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, propagateValue, propagateValues, removeChangeListener, removeDebugListener, 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 |
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.
_containedNode
private javax.media.j3d.Node _containedNode
- The node.
_scaleTransform
private javax.media.j3d.Transform3D _scaleTransform
- If changes to the font size are allowed, this is the transform
that applies them.
_textGeometry
private javax.media.j3d.Text3D _textGeometry
- The text geometry.
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.
attributeChanged
public void attributeChanged(Attribute attribute)
throws IllegalActionException
- If the attribute is text, then update the displayed
text string.
- Overrides:
attributeChanged
in class GRShadedShape
- 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 interface Executable
- Overrides:
prefire
in class GRShadedShape
- 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 class GRShadedShape
- 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 class GRActor3D
- Returns:
- the Java3D Text3D