com.jme.widget.text
Class WidgetText

java.lang.Object
  extended bycom.jme.scene.Spatial
      extended bycom.jme.widget.WidgetAbstractImpl
          extended bycom.jme.widget.text.WidgetText
All Implemented Interfaces:
java.io.Serializable, Widget, WidgetMouseHandlerInterface

public class WidgetText
extends WidgetAbstractImpl

Author:
Gregg Patton To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and Comments
See Also:
Serialized Form

Field Summary
protected  AlphaState alphaState
           
protected  TextureState textureState
           
 
Fields inherited from class com.jme.widget.WidgetAbstractImpl
alignment, bgColor, border, cantOwnMouse, DEFAULT_BORDER_SIZE, DEFAULT_COMP_HEIGHT, DEFAULT_COMP_WIDTH, defaultBgColor, defaultFgColor, fgColor, localBound, notifierMouseButtonDown, notifierMouseButtonUp, notifierMouseDrag, notifierMouseEnter, notifierMouseExit, notifierMouseMove, opaque, preferredSize, textureCoords, viewRectangle, visible, zOrder
 
Fields inherited from class com.jme.scene.Spatial
currentStates, defaultStateList, forceCull, forceView, frustrumIntersects, geometricalControllers, lightCombineMode, localRotation, localScale, localTranslation, name, parent, queueDistance, renderQueueMode, renderStateList, textureCombineMode, worldBound, worldRotation, worldScale, worldTranslation
 
Constructor Summary
WidgetText()
           
WidgetText(java.lang.String text)
           
WidgetText(java.lang.String text, WidgetAlignmentType alignment)
           
 
Method Summary
protected  void applyRenderState(java.util.Stack[] states)
          Called during updateRenderState(Stack[]), this function determines how the render states are actually applied to the spatial and any children it may have.
 void applyStates()
          setStates applies all the render states for this particular geometry.
 void doMouseButtonDown()
          doMouseButtonDown
 void doMouseButtonUp()
          doMouseButtonUp
 void draw(Renderer r)
          draw abstract method that handles drawing data to the renderer if it is geometry and passing the call to it's children if it is a node.
 void drawBounds(Renderer r)
          drawBounds abstract method that handles drawing bounds data to the renderer if it is geometry and passing the call to it's children if it is a node.
 void findCollisions(Spatial scene, CollisionResults results)
          checks this spatial against a second spatial, any collisions are stored in the results object.
 void findPick(Ray toTest, PickResults results)
           
 WidgetFont getFont()
           
 java.lang.String getFontName()
           
 float getScale()
           
 java.lang.String getText()
           
 boolean hasCollision(Spatial scene, boolean checkTriangles)
           
 void initWidgetRenderer()
          initWidgetRenderer
 void onDraw(Renderer r)
          onDraw checks the node with the camera to see if it should be culled, if not, the node's draw method is called.
 void setFont(WidgetFont font)
           
 void setForceView(boolean value)
          setForceView will force the node to be rendered whether it's in the camera frustum or not.
 void setLocation(int x, int y)
          setLocation
 void setLocation(Vector2f at)
          setLocation
 void setPreferredSize(Vector2f size)
          setPreferredSize
 void setScale(float f)
           
 void setSize(int width, int height)
          setSize
 void setSize(Vector2f size)
          setSize
 void setText(java.lang.String string)
           
 void setX(int x)
          setX
 void setY(int y)
          setY
 java.lang.String toString()
          Returns the Spatial's name followed by the class of the spatial
Example: "MyNode (com.jme.scene.Spatial)
 
Methods inherited from class com.jme.widget.WidgetAbstractImpl
addMouseButtonDownObserver, addMouseButtonUpObserver, addMouseDragObserver, addMouseEnterObserver, addMouseExitObserver, addMouseMoveObserver, alignCenter, alignEast, alignNorth, alignSouth, alignWest, canClose, close, deleteMouseButtonDownObserver, deleteMouseButtonDownObservers, deleteMouseButtonUpObserver, deleteMouseButtonUpObservers, deleteMouseDragObserver, deleteMouseDragObservers, deleteMouseEnterObserver, deleteMouseEnterObservers, deleteMouseExitObserver, deleteMouseExitObservers, deleteMouseMoveObserver, deleteMouseMoveObservers, doAlignment, doMouseDrag, doMouseEnter, doMouseExit, doMouseMove, doParentLayout, getAbsoluteLocation, getAlignment, getBgColor, getBorder, getExtents, getFgColor, getHeight, getInputHandler, getLastWidgetUnderMouse, getLocation, getMouseInput, getMouseOwner, getNotifierMouseButtonDown, getNotifierMouseButtonUp, getNotifierMouseDrag, getNotifierMouseEnter, getNotifierMouseExit, getNotifierMouseMove, getOwner, getPreferredSize, getSize, getTextureCoords, getTopLevelComponent, getViewRectangle, getWidgetParent, getWidgetRenderer, getWidgetUnderMouse, getWidth, getX, getXOffset, getY, getYOffset, getZOrder, handleMouseButtonDown, handleMouseButtonUp, handleMouseDrag, handleMouseEnter, handleMouseExit, handleMouseMove, isApplyOffsetX, isApplyOffsetY, isCantOwnMouse, isCulled, isMouseInWidget, isOpaque, isTopLevel, isVisible, setAlignment, setApplyOffsetX, setApplyOffsetY, setBgColor, setBorder, setCantOwnMouse, setFgColor, setHeight, setInputHandler, setLastWidgetUnderMouse, setMouseOwner, setOwner, setPreferredSize, setTextureCoords, setViewRectangle, setVisible, setWidgetParent, setWidgetRenderer, setWidgetUnderMouse, setWidth, setZOrder, updateWorldBound
 
Methods inherited from class com.jme.scene.Spatial
addController, applyDefaultStates, calculateCollisions, calculatePick, clearCurrentState, clearCurrentStates, clearRenderState, getController, getControllers, getCurrentState, getLastFrustumIntersection, getLightCombineMode, getLocalRotation, getLocalScale, getLocalTranslation, getName, getParent, getRenderQueueMode, getRenderStateList, getTextureCombineMode, getWorldBound, getWorldRotation, getWorldScale, getWorldTranslation, isForceCulled, isForceView, onDrawBounds, propagateBoundToRoot, propagateStatesFromRoot, putClone, removeController, removeFromParent, setForceCull, setLightCombineMode, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalTranslation, setName, setParent, setRenderQueueMode, setRenderState, setTextureCombineMode, setWorldBound, updateCollisionTree, updateGeometricState, updateRenderState, updateRenderState, updateWorldData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

textureState

protected TextureState textureState

alphaState

protected AlphaState alphaState
Constructor Detail

WidgetText

public WidgetText()

WidgetText

public WidgetText(java.lang.String text)

WidgetText

public WidgetText(java.lang.String text,
                  WidgetAlignmentType alignment)
Method Detail

toString

public java.lang.String toString()
Description copied from class: Spatial
Returns the Spatial's name followed by the class of the spatial
Example: "MyNode (com.jme.scene.Spatial)

Overrides:
toString in class WidgetAbstractImpl

getText

public java.lang.String getText()

setText

public void setText(java.lang.String string)

onDraw

public void onDraw(Renderer r)
Description copied from class: Spatial
onDraw checks the node with the camera to see if it should be culled, if not, the node's draw method is called.

Overrides:
onDraw in class WidgetAbstractImpl
See Also:
Spatial.onDraw(com.jme.renderer.Renderer)

applyStates

public void applyStates()
setStates applies all the render states for this particular geometry.


draw

public void draw(Renderer r)
Description copied from class: Spatial
draw abstract method that handles drawing data to the renderer if it is geometry and passing the call to it's children if it is a node.

Overrides:
draw in class WidgetAbstractImpl
See Also:
Spatial.draw(com.jme.renderer.Renderer)

drawBounds

public void drawBounds(Renderer r)
Description copied from class: Spatial
drawBounds abstract method that handles drawing bounds data to the renderer if it is geometry and passing the call to it's children if it is a node.

Specified by:
drawBounds in class Spatial
Parameters:
r - the renderer used for display.

getScale

public float getScale()

setScale

public void setScale(float f)

doMouseButtonDown

public void doMouseButtonDown()
Description copied from interface: WidgetMouseHandlerInterface
doMouseButtonDown

Specified by:
doMouseButtonDown in interface WidgetMouseHandlerInterface
Overrides:
doMouseButtonDown in class WidgetAbstractImpl

doMouseButtonUp

public void doMouseButtonUp()
Description copied from interface: WidgetMouseHandlerInterface
doMouseButtonUp

Specified by:
doMouseButtonUp in interface WidgetMouseHandlerInterface
Overrides:
doMouseButtonUp in class WidgetAbstractImpl

setSize

public void setSize(Vector2f size)
Description copied from interface: Widget
setSize

Specified by:
setSize in interface Widget
Overrides:
setSize in class WidgetAbstractImpl

setSize

public void setSize(int width,
                    int height)
Description copied from interface: Widget
setSize

Specified by:
setSize in interface Widget
Overrides:
setSize in class WidgetAbstractImpl

setPreferredSize

public void setPreferredSize(Vector2f size)
Description copied from interface: Widget
setPreferredSize

Specified by:
setPreferredSize in interface Widget
Overrides:
setPreferredSize in class WidgetAbstractImpl

getFontName

public java.lang.String getFontName()

setLocation

public void setLocation(int x,
                        int y)
Description copied from interface: Widget
setLocation

Specified by:
setLocation in interface Widget
Overrides:
setLocation in class WidgetAbstractImpl

setLocation

public void setLocation(Vector2f at)
Description copied from interface: Widget
setLocation

Specified by:
setLocation in interface Widget
Overrides:
setLocation in class WidgetAbstractImpl

setX

public void setX(int x)
Description copied from interface: Widget
setX

Specified by:
setX in interface Widget
Overrides:
setX in class WidgetAbstractImpl

setY

public void setY(int y)
Description copied from interface: Widget
setY

Specified by:
setY in interface Widget
Overrides:
setY in class WidgetAbstractImpl

getFont

public WidgetFont getFont()

setFont

public void setFont(WidgetFont font)

initWidgetRenderer

public void initWidgetRenderer()
initWidgetRenderer

See Also:
Widget.initWidgetRenderer()

setForceView

public void setForceView(boolean value)
Description copied from class: Spatial
setForceView will force the node to be rendered whether it's in the camera frustum or not.

Specified by:
setForceView in class Spatial
Parameters:
value - true to force viewing, false otherwise.

applyRenderState

protected void applyRenderState(java.util.Stack[] states)
Description copied from class: Spatial
Called during updateRenderState(Stack[]), this function determines how the render states are actually applied to the spatial and any children it may have. By default, this function does nothing.

Overrides:
applyRenderState in class Spatial
Parameters:
states - An array of stacks for each state.

findCollisions

public void findCollisions(Spatial scene,
                           CollisionResults results)
Description copied from class: Spatial
checks this spatial against a second spatial, any collisions are stored in the results object.

Specified by:
findCollisions in class Spatial
Parameters:
scene - the scene to test against.
results - the results of the collisions.

hasCollision

public boolean hasCollision(Spatial scene,
                            boolean checkTriangles)
Specified by:
hasCollision in class Spatial

findPick

public void findPick(Ray toTest,
                     PickResults results)
Specified by:
findPick in class Spatial