javax.media.j3d
Class Text3DRetained

java.lang.Object
  extended by javax.media.j3d.IndexedObject
      extended by javax.media.j3d.SceneGraphObjectRetained
          extended by javax.media.j3d.NodeComponentRetained
              extended by javax.media.j3d.GeometryRetained
                  extended by javax.media.j3d.Text3DRetained
All Implemented Interfaces:
java.lang.Cloneable

 class Text3DRetained
extends GeometryRetained

Implements Text3D class.


Field Summary
(package private)  int alignment
           
(package private)  float charSpacing
           
(package private)  Transform3D[] charTransforms
          The temporary transforms for this Text3D
(package private)  Transform3D drawTransform
           
(package private)  Font3D font3D
          Packaged scope variables needed for implementation
(package private)  GeometryArrayRetained[] geometryList
          A cached list of geometry arrays for the current settings
(package private)  java.awt.font.GlyphVector[] glyphVecs
           
(package private)  Point3d lower
          Bounding box data for this text string.
(package private)  java.util.ArrayList newGeometryAtomList
          An Array list used for messages
(package private)  int numChars
           
(package private)  java.util.ArrayList oldGeometryAtomList
           
(package private)  int path
           
(package private)  Point3f position
           
(package private)  java.lang.String string
           
(package private) static int targetThreads
           
(package private)  Point3d upper
           
(package private)  Transform3D vpcToEc
          temporary model view matrix for immediate mode only
 
Fields inherited from class javax.media.j3d.GeometryRetained
boundsDirty, cachedChangedFrequent, centroid, COMPRESS_TYPE, computeGeoBounds, EPSILON, GEO_TYPE_COMPRESSED, GEO_TYPE_GEOMETRYARRAY, GEO_TYPE_INDEXED_LINE_SET, GEO_TYPE_INDEXED_LINE_STRIP_SET, GEO_TYPE_INDEXED_POINT_SET, GEO_TYPE_INDEXED_QUAD_SET, GEO_TYPE_INDEXED_TRI_FAN_SET, GEO_TYPE_INDEXED_TRI_SET, GEO_TYPE_INDEXED_TRI_STRIP_SET, GEO_TYPE_LINE_SET, GEO_TYPE_LINE_STRIP_SET, GEO_TYPE_NONE, GEO_TYPE_POINT_SET, GEO_TYPE_QUAD_SET, GEO_TYPE_RASTER, GEO_TYPE_TEXT3D, GEO_TYPE_TOTAL, GEO_TYPE_TRI_FAN_SET, GEO_TYPE_TRI_SET, GEO_TYPE_TRI_STRIP_SET, geoBounds, geomLock, geoType, isDirty, isEditable, LINE_TYPE, liveStateLock, mirrorGeometry, nativeId, noAlpha, POINT_TYPE, QUAD_TYPE, RASTER_TYPE, recompCentroid, TEXT3D_TYPE, TRIANGLE_TYPE, universeList, userLists
 
Fields inherited from class javax.media.j3d.NodeComponentRetained
changedFrequent, compChanged, duplicateOnCloneTree, mirror, refCnt, refCount, users
 
Fields inherited from class javax.media.j3d.SceneGraphObjectRetained
DONT_MERGE, inBackgroundGroup, inSetLive, MERGE, MERGE_DONE, mergeFlag, onUpdateList, source
 
Fields inherited from class javax.media.j3d.IndexedObject
listIdx
 
Constructor Summary
Text3DRetained()
           
 
Method Summary
(package private)  void computeBoundingBox()
           
(package private)  void execute(Canvas3D cv, RenderAtom ra, boolean isNonUniformScale, boolean updateAlpha, float alpha, int screen, boolean ignoreVertexColors)
           
(package private)  int getAlignment()
          Retrieves the text alignment policy for this Text3D NodeComponent object.
(package private)  void getBoundingBox(BoundingBox bounds)
          Retrieves the 3D bounding box that encloses this Text3D object.
(package private)  float getCharacterSpacing()
          Retrieves the character spacing used to construct the Text3D string.
(package private)  int getClassType()
           
(package private)  Font3D getFont3D()
          Returns the Font3D objects used by this Text3D NodeComponent object.
(package private)  int getPath()
          Retrieves the node's path field.
(package private)  void getPosition(Point3f position)
          Copies the node's position field into the supplied parameter.
(package private)  java.lang.String getString()
          Copies the character string used in the construction of the Text3D node into the supplied parameter.
(package private)  java.util.ArrayList getUniqueSource(java.util.ArrayList shapeList)
           
(package private)  boolean intersect(Bounds targetBound)
           
(package private)  boolean intersect(PickShape pickShape, PickInfo pickInfo, int flags, Point3d iPnt, GeometryRetained geom, int geomIndex)
           
(package private)  boolean intersect(Point3d[] pnts)
           
(package private)  boolean intersect(Transform3D thisToOtherVworld, GeometryRetained geom)
           
(package private)  void sendDataChangedMessage()
           
(package private)  void sendTransformChangedMessage()
           
(package private)  void setAlignment(int alignment)
          Sets the text alignment policy for this Text3D NodeComponent object.
(package private)  void setCharacterSpacing(float characterSpacing)
          Sets the character spacing used hwne constructing the Text3D string.
(package private)  void setFont3D(Font3D font3d)
          Sets the Font3D object used by this Text3D NodeComponent object.
(package private)  void setLive(boolean inBackgroundGroup, int refCount)
          This method is called when the SceneGraph becomes live.
(package private)  void setModelViewMatrix(Transform3D vpcToEc, Transform3D drawTransform)
           
(package private)  void setPath(int path)
          Sets the node's path field.
(package private)  void setPosition(Point3f position)
          Sets the node's position field to the supplied parameter.
(package private)  void setString(java.lang.String string)
          Copies the character string from the supplied parameter into Tex3D node.
(package private)  void update()
           
(package private)  void updateCharacterData()
          Update internal reprsentation of tranform matrices and geometry.
(package private)  void updateTransformData()
          Update per character transform based on Text3D location, per character size and path.
 
Methods inherited from class javax.media.j3d.GeometryRetained
addUser, canBeInDisplayList, computeCentroid, decrComputeGeoBounds, doSetLive, getVertexFormat, incrComputeGeoBounds, intersect, intersect, isEquivalenceClass, removeUser, storeInterestData, updateObject
 
Methods inherited from class javax.media.j3d.NodeComponentRetained
addAMirrorUser, addUser, clearLive, clone, copyMirrorUsers, createMirrorObject, decRefCnt, getDuplicateOnCloneTree, getInImmCtx, incRefCnt, initMirrorObject, notifyUsers, removeAMirrorUser, removeMirrorUsers, removeUser, set, setDuplicateOnCloneTree, setFrequencyChangeMask, setInImmCtx, updateMirrorObject
 
Methods inherited from class javax.media.j3d.SceneGraphObjectRetained
clearLive, clearLive, compile, doSetLive, doSetLive, getSource, getVirtualUniverse, handleFrequencyChange, isInSetLive, isStatic, markAsLive, merge, mergeTransform, setCompiled, setLive, setLive, setSource, traverse
 
Methods inherited from class javax.media.j3d.IndexedObject
getIdxUsed, incIdxUsed
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

font3D

Font3D font3D
Packaged scope variables needed for implementation


string

java.lang.String string

position

Point3f position

alignment

int alignment

path

int path

charSpacing

float charSpacing

numChars

int numChars

targetThreads

static final int targetThreads
See Also:
Constant Field Values

charTransforms

Transform3D[] charTransforms
The temporary transforms for this Text3D


geometryList

GeometryArrayRetained[] geometryList
A cached list of geometry arrays for the current settings


glyphVecs

java.awt.font.GlyphVector[] glyphVecs

lower

Point3d lower
Bounding box data for this text string.


upper

Point3d upper

newGeometryAtomList

java.util.ArrayList newGeometryAtomList
An Array list used for messages


oldGeometryAtomList

java.util.ArrayList oldGeometryAtomList

vpcToEc

Transform3D vpcToEc
temporary model view matrix for immediate mode only


drawTransform

Transform3D drawTransform
Constructor Detail

Text3DRetained

Text3DRetained()
Method Detail

computeBoundingBox

void computeBoundingBox()
Specified by:
computeBoundingBox in class GeometryRetained

update

void update()
Specified by:
update in class GeometryRetained

getFont3D

final Font3D getFont3D()
Returns the Font3D objects used by this Text3D NodeComponent object.

Returns:
the Font3D object of this Text3D node - null if no Font3D has been associated with this node.
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

setFont3D

final void setFont3D(Font3D font3d)
Sets the Font3D object used by this Text3D NodeComponent object.

Parameters:
font3d - the Font3D object to associate with this Text3D node.
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

getString

final java.lang.String getString()
Copies the character string used in the construction of the Text3D node into the supplied parameter.

Returns:
a copy of the String object in this Text3D node.
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

setString

final void setString(java.lang.String string)
Copies the character string from the supplied parameter into Tex3D node.

Parameters:
string - the String object to recieve the Text3D node's string.
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

getPosition

final void getPosition(Point3f position)
Copies the node's position field into the supplied parameter. The position is used to determine the initial placement of the Text3D string. The position, combined with the path and alignment control how the text is displayed.

Parameters:
position - the point to position the text.
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
See Also:
getAlignment(), getPath()

setPosition

final void setPosition(Point3f position)
Sets the node's position field to the supplied parameter. The position is used to determine the initial placement of the Text3D string. The position, combined with the path and alignment control how the text is displayed.

Parameters:
position - the point to position the text.
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
See Also:
getAlignment(), getPath()

getAlignment

final int getAlignment()
Retrieves the text alignment policy for this Text3D NodeComponent object. The alignment is used to specify how glyphs in the string are placed in relation to the position field. Valid values for this field are: The default value of this field is ALIGN_FIRST.

Returns:
the current alingment policy for this node.
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
See Also:
getPosition(javax.vecmath.Point3f)

setAlignment

final void setAlignment(int alignment)
Sets the text alignment policy for this Text3D NodeComponent object. The alignment is used to specify how glyphs in the string are placed in relation to the position field. Valid values for this field are: The default value of this field is ALIGN_FIRST.

Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
See Also:
getPosition(javax.vecmath.Point3f)

getPath

final int getPath()
Retrieves the node's path field. This field is used to specify how succeeding glyphs in the string are placed in relation to the previous glyph. Valid values for this field are: The default value of this field is PATH_RIGHT.

Returns:
the current alingment policy for this node.
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

setPath

final void setPath(int path)
Sets the node's path field. This field is used to specify how succeeding glyphs in the string are placed in relation to the previous glyph. Valid values for this field are: The default value of this field is PATH_RIGHT.

Parameters:
path - the value to set the path to.
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

getBoundingBox

final void getBoundingBox(BoundingBox bounds)
Retrieves the 3D bounding box that encloses this Text3D object.

Parameters:
bounds - the object to copy the bounding information to.
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
See Also:
BoundingBox

getCharacterSpacing

final float getCharacterSpacing()
Retrieves the character spacing used to construct the Text3D string. This spacing is in addition to the regular spacing between glyphs as defined in the Font object. 1.0 in this space is measured as the width of the largest glyph in the 2D Font. The default value is 0.0.

Returns:
the current character spacing value
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

setCharacterSpacing

final void setCharacterSpacing(float characterSpacing)
Sets the character spacing used hwne constructing the Text3D string. This spacing is in addition to the regular spacing between glyphs as defined in the Font object. 1.0 in this space is measured as the width of the largest glyph in the 2D Font. The default value is 0.0.

Parameters:
characterSpacing - the new character spacing value
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

sendDataChangedMessage

final void sendDataChangedMessage()

sendTransformChangedMessage

final void sendTransformChangedMessage()

updateCharacterData

final void updateCharacterData()
Update internal reprsentation of tranform matrices and geometry. This method will be called whenever string or font3D change.


updateTransformData

final void updateTransformData()
Update per character transform based on Text3D location, per character size and path. WARNING: Caller of this method must make sure SceneGraph is live, else exceptions may be thrown.


setLive

void setLive(boolean inBackgroundGroup,
             int refCount)
This method is called when the SceneGraph becomes live. All characters used by this.string are tesselated in this method, to avoid wait during traversal and rendering.

Overrides:
setLive in class GeometryRetained

intersect

boolean intersect(PickShape pickShape,
                  PickInfo pickInfo,
                  int flags,
                  Point3d iPnt,
                  GeometryRetained geom,
                  int geomIndex)
Specified by:
intersect in class GeometryRetained

intersect

boolean intersect(Point3d[] pnts)
Specified by:
intersect in class GeometryRetained

intersect

boolean intersect(Transform3D thisToOtherVworld,
                  GeometryRetained geom)
Specified by:
intersect in class GeometryRetained

intersect

boolean intersect(Bounds targetBound)
Specified by:
intersect in class GeometryRetained

setModelViewMatrix

void setModelViewMatrix(Transform3D vpcToEc,
                        Transform3D drawTransform)

execute

void execute(Canvas3D cv,
             RenderAtom ra,
             boolean isNonUniformScale,
             boolean updateAlpha,
             float alpha,
             int screen,
             boolean ignoreVertexColors)
Specified by:
execute in class GeometryRetained

getClassType

int getClassType()
Specified by:
getClassType in class GeometryRetained

getUniqueSource

java.util.ArrayList getUniqueSource(java.util.ArrayList shapeList)


Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.