|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.media.j3d.SceneGraphObject
javax.media.j3d.Node
javax.media.j3d.Leaf
javax.media.j3d.Shape3D
com.sun.j3d.utils.geometry.Text2D
public class Text2D
A Text2D object is a representation of a string as a texture mapped rectangle. The texture for the rectangle shows the string as rendered in the specified color with a transparent background. The appearance of the characters is specified using the font indicated by the font name, size and style (see java.awt.Font). The approximate height of the rendered string will be the font size times the rectangle scale factor, which has a default value of 1/256. For example, a 12 point font will produce characters that are about 12/256 = 0.047 meters tall. The lower left corner of the rectangle is located at (0,0,0) with the height extending along the positive y-axis and the width extending along the positive x-axis.
Field Summary |
---|
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 |
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 | |
---|---|
Node |
cloneNode(boolean forceDuplicate)
Used to create a new instance of the node. |
Color3f |
getColor()
Returns the color of the text |
java.lang.String |
getFontName()
Returns the font |
int |
getFontSize()
Returns the font size |
int |
getFontStyle()
Returns the font style |
float |
getRectangleScaleFactor()
Gets the current scale factor being used in converting the image width/height to width/height values in 3D. |
java.lang.String |
getString()
Returns the text string |
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, duplicateNode, getAllGeometries, getAppearance, getAppearanceOverrideEnable, getBounds, getCollisionBounds, getGeometry, getGeometry, indexOfGeometry, insertGeometry, intersect, intersect, intersect, numGeometries, removeAllGeometries, removeGeometry, removeGeometry, setAppearance, setAppearanceOverrideEnable, setCollisionBounds, setGeometry, setGeometry |
Methods inherited from class javax.media.j3d.Node |
---|
cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable |
Methods inherited from class javax.media.j3d.SceneGraphObject |
---|
clearCapability, clearCapabilityIsFrequent, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString, updateNodeReferences |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Text2D(java.lang.String text, Color3f color, java.lang.String fontName, int fontSize, int fontStyle)
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 |
---|
public Node cloneNode(boolean forceDuplicate)
Shape3D
cloneTree
to duplicate the current node.
cloneNode
should be overridden by any user subclassed
objects. All subclasses must have their cloneNode
method consist of the following lines:
public Node cloneNode(boolean forceDuplicate) { UserSubClass usc = new UserSubClass(); usc.duplicateNode(this, forceDuplicate); return usc; }
cloneNode
in class Shape3D
forceDuplicate
- when set to true
, causes the
duplicateOnCloneTree
flag to be ignored. When
false
, the value of each node's
duplicateOnCloneTree
variable determines whether
NodeComponent data is duplicated or copied.Node.cloneTree()
,
Node.duplicateNode(javax.media.j3d.Node, boolean)
,
NodeComponent.setDuplicateOnCloneTree(boolean)
public void setString(java.lang.String text)
public void setRectangleScaleFactor(float newScaleFactor)
newScaleFactor
- The new scale factor.public float getRectangleScaleFactor()
public java.lang.String getString()
public Color3f getColor()
public java.lang.String getFontName()
public int getFontSize()
public int getFontStyle()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |