com.sun.j3d.utils.geometry
Class Text2D

java.lang.Object
  |
  +--javax.media.j3d.SceneGraphObject
        |
        +--javax.media.j3d.Node
              |
              +--javax.media.j3d.Leaf
                    |
                    +--javax.media.j3d.Shape3D
                          |
                          +--com.sun.j3d.utils.geometry.Text2D

public class Text2D
extends Shape3D

This class creates a texture-mapped rectangle which displays the text string sent in by the user, given the appearance parameters also supplied by the user. The size of the rectangle (and its texture map) is determined by the font parameters passed in to the constructor. The resulting Shape3D object is a transparent (except for the text) rectangle located at (0, 0, 0) and extending up the positive y-axis and out the positive x-axis.


Fields inherited from class javax.media.j3d.Shape3D
ALLOW_APPEARANCE_OVERRIDE_READ, ALLOW_APPEARANCE_OVERRIDE_WRITE, ALLOW_APPEARANCE_READ, ALLOW_APPEARANCE_WRITE, ALLOW_COLLISION_BOUNDS_READ, ALLOW_COLLISION_BOUNDS_WRITE, ALLOW_GEOMETRY_READ, ALLOW_GEOMETRY_WRITE
 
Fields inherited from class javax.media.j3d.Node
ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
 
Constructor Summary
Text2D(java.lang.String text, Color3f color, java.lang.String fontName, int fontSize, int fontStyle)
          Creates a Shape3D object which holds a rectangle that is texture-mapped with an image that has the specified text written with the specified font parameters.
 
Method Summary
 float getRectangleScaleFactor()
          Gets the current scale factor being used in converting the image width/height to width/height values in 3D.
 void setRectangleScaleFactor(float newScaleFactor)
          Sets the scale factor used in converting the image width/height to width/height values in 3D.
 void setString(java.lang.String text)
           
 
Methods inherited from class javax.media.j3d.Shape3D
addGeometry, cloneNode, duplicateNode, getAllGeometries, getAppearance, getAppearanceOverrideEnable, getCollisionBounds, getGeometry, getGeometry, insertGeometry, intersect, intersect, numGeometries, removeGeometry, setAppearance, setAppearanceOverrideEnable, setCollisionBounds, setGeometry, setGeometry
 
Methods inherited from class javax.media.j3d.Node
cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, getBounds, getBoundsAutoCompute, getCollidable, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
 
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, duplicateSceneGraphObject, getCapability, getUserData, isCompiled, isLive, setCapability, setUserData, updateNodeReferences
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Text2D

public Text2D(java.lang.String text,
              Color3f color,
              java.lang.String fontName,
              int fontSize,
              int fontStyle)
Creates a Shape3D object which holds a rectangle that is texture-mapped with an image that has the specified text written with the specified font parameters.
Parameters:
text - The string to be written into the texture map.
color - The color of the text string.
fontName - The name of the Java font to be used for the text string.
fontSize - The size of the Java font to be used.
fontStyle - The style of the Java font to be used.
Method Detail

setString

public void setString(java.lang.String text)

setRectangleScaleFactor

public void setRectangleScaleFactor(float newScaleFactor)
Sets the scale factor used in converting the image width/height to width/height values in 3D.
Parameters:
newScaleFactor - The new scale factor.

getRectangleScaleFactor

public float getRectangleScaleFactor()
Gets the current scale factor being used in converting the image width/height to width/height values in 3D.
Returns:
The current scale factor.