org.xith3d.ui.text2d
Class Character2D

java.lang.Object
  extended by org.xith3d.scenegraph.SceneGraphObject
      extended by org.xith3d.scenegraph.Node
          extended by org.xith3d.scenegraph.Leaf
              extended by org.xith3d.scenegraph.Shape3D
                  extended by org.xith3d.ui.text2d.Character2D
All Implemented Interfaces:
org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, org.openmali.spatial.SpatialNode

public class Character2D
extends Shape3D

Represents a character in 3D space. This class is part of the DynamicText toolkit for Xith3d.

See Also:
org.xith3d.text.Text2D

Field Summary
 
Fields inherited from class org.xith3d.scenegraph.Node
bounds, boundsAutoCompute, boundsDirty, globalIgnoreBounds, instanceBoundsTypeHint, transformGroup, untransformedBounds
 
Fields inherited from class org.xith3d.scenegraph.SceneGraphObject
XITH3D_USERDATAKEY_OLDUSERDATA
 
Method Summary
 char getChar()
           
 org.openmali.vecmath2.Colorf getColor()
           
static float getFontStretchFactor()
           
 float getHeight()
           
 org.openmali.vecmath2.Tuple2f getSize()
           
 float getWidth()
           
static Character2D loadCharacter(char character, org.openmali.vecmath2.Colorf color, java.awt.Font font)
          Creates a new Character with all attributes.
protected static Character2D loadCharacter(char character, org.openmali.vecmath2.Colorf color, java.lang.String charId)
          Creates a new Character by charId.
static Character2D loadCharacter(char character, org.openmali.vecmath2.Colorf color, java.lang.String fontName, int resolution, int fontFlags)
           
static Character2D loadCharacter(char character, float r, float g, float b, java.awt.Font font)
          Creates a new Character with all attributes.
protected static Character2D loadCharacter(char character, float r, float g, float b, java.lang.String charId)
          Creates a new Character by charId.
static Character2D loadCharacter(char character, float r, float g, float b, java.lang.String fontName, int resolution, int fontFlags)
          Creates a new Character with all attributes.
static int numberOfLoadedChars()
          For debuging purposes:
Returns the number of currently loaded chars
 void setColor(org.openmali.vecmath2.Colorf color)
          Sets the color of this char.
 void setColor(float r, float g, float b)
          Sets the color of this char.
static void setFontStretchFactor(float factor)
           
 java.lang.String toString()
          
 
Methods inherited from class org.xith3d.scenegraph.Shape3D
absorbDetails, copy, freeOpenGLResources, getAppearance, getAppearance, getCustomComparable, getGeometry, isBumpMappingEnabled, isShadowReceiver, isVisible, newAppearance, newInstance, setAppearance, setBounds, setBumpMappingEnabled, setBumpMappingEnabled, setCustomComparable, setGeometry, setIsShadowReceiver, setModListener, setVisible, sharedCopy, sharedCopy, traverse, updateBounds, updateBoundsCheap, updateWorldTransform, verifyAppChange
 
Methods inherited from class org.xith3d.scenegraph.Leaf
dump, getPickHost, setPickHost
 
Methods inherited from class org.xith3d.scenegraph.Node
cloneNode, detach, duplicateNode, freeOpenGLResources, getBounds, getBoundsAutoCompute, getBoundsType, getBoundsTypeHint, getDefaultPickable, getIndentString, getInheritedNodeAttributes, getModListener, getOrderedChild, getOrderedState, getParent, getRoot, getShadowAttachment, getShowBounds, getTransformGroup, getTreeCell, getWorldBounds, getWorldTransform, getWorldTransform, isBillboard, isIgnoreBounds, isOccluder, isPickable, isRenderable, isUpdatableNode, mergeInheritedClipper, mergeInheritedNodes, mergeInheritedScissorRect, popGlobalIgnoreBounds, printBounds, pushGlobalIgnoreBounds, setBoundsAutoCompute, setBoundsDirty, setBoundsDirtyUpward, setBoundsTypeHint, setDefaultPickable, setGlobalIgnoreBounds, setIgnoreBounds, setIsOccluder, setOrderedChild, setParent, setPickable, setPickableRecursive, setPickableRecursive, setRenderable, setShadowAttachment, setShowBounds, setTransformGroup, setTreeCell, traverse, unmergeInheritedFog, unmergeInheritedLight, unmergeInheritedNodes, updateOrderedChild, updateTransformGroup
 
Methods inherited from class org.xith3d.scenegraph.SceneGraphObject
getName, getUserData, getUserData, getUserDataMap, isLive, setLive, setName, setUserData, setUserData, setUserDataRecursive, setUserDataRecursive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

setFontStretchFactor

public static void setFontStretchFactor(float factor)

getFontStretchFactor

public static float getFontStretchFactor()

getChar

public char getChar()
Returns:
the char this Character2D represents

numberOfLoadedChars

public static int numberOfLoadedChars()
For debuging purposes:
Returns the number of currently loaded chars

Returns:
number of chars

setColor

public void setColor(float r,
                     float g,
                     float b)
Sets the color of this char.

Parameters:
r - new Color
g - new Color
b - new Color

setColor

public void setColor(org.openmali.vecmath2.Colorf color)
Sets the color of this char.

Parameters:
color - new Color

getColor

public org.openmali.vecmath2.Colorf getColor()
Returns:
the current color of this Character

getSize

public org.openmali.vecmath2.Tuple2f getSize()

getWidth

public float getWidth()

getHeight

public float getHeight()

toString

public java.lang.String toString()

Overrides:
toString in class SceneGraphObject

loadCharacter

public static Character2D loadCharacter(char character,
                                        float r,
                                        float g,
                                        float b,
                                        java.awt.Font font)
Creates a new Character with all attributes.

Parameters:
character - new character
r - the red value of the color
g - the green value of the color
b - the blue value of the color
font - the font to use
Returns:
returns a Node (should be casted to Character)

loadCharacter

public static Character2D loadCharacter(char character,
                                        org.openmali.vecmath2.Colorf color,
                                        java.awt.Font font)
Creates a new Character with all attributes.

Parameters:
character - new character
color - new Color
font - the font to use
Returns:
returns a Node (should be casted to Character)

loadCharacter

public static Character2D loadCharacter(char character,
                                        float r,
                                        float g,
                                        float b,
                                        java.lang.String fontName,
                                        int resolution,
                                        int fontFlags)
Creates a new Character with all attributes.

Parameters:
character - new character
r - new Color
g - new Color
b - new Color
fontName - the font to use
resolution - resolution to use
fontFlags - fontflags to use
Returns:
returns a Node (should be casted to Character)

loadCharacter

public static Character2D loadCharacter(char character,
                                        org.openmali.vecmath2.Colorf color,
                                        java.lang.String fontName,
                                        int resolution,
                                        int fontFlags)

loadCharacter

protected static Character2D loadCharacter(char character,
                                           float r,
                                           float g,
                                           float b,
                                           java.lang.String charId)
Creates a new Character by charId.

Parameters:
character - new character
r - new Color
g - new Color
b - new Color
charId - new charId
Returns:
returns a Node (should be casted to Character)

loadCharacter

protected static Character2D loadCharacter(char character,
                                           org.openmali.vecmath2.Colorf color,
                                           java.lang.String charId)
Creates a new Character by charId.

Parameters:
character - new character
color - new Color
charId - new charId
Returns:
returns a Node (should be casted to Character)