org.jzy3d.plot3d.text
Class DrawableTextWrapper

java.lang.Object
  extended by org.jzy3d.plot3d.primitives.AbstractDrawable
      extended by org.jzy3d.plot3d.text.DrawableTextWrapper
All Implemented Interfaces:
IGLRenderer, ISortableDraw
Direct Known Subclasses:
DrawableTextBillboard, DrawableTextBitmap

public class DrawableTextWrapper
extends AbstractDrawable

A DrawableTextWrapper wraps any text rendered by an ITextRenderer into an AbstractDrawable, meaning it can be injected in the scene graph, and be transformed.

Author:
Martin Pernollet

Field Summary
protected  Color color
           
protected  Halign halign
           
protected  Coord3d position
           
protected  ITextRenderer renderer
           
protected  String txt
           
protected  Valign valign
           
 
Fields inherited from class org.jzy3d.plot3d.primitives.AbstractDrawable
bbox, displayed, hasListeners, legend, legendDisplayed, listeners, transform
 
Constructor Summary
DrawableTextWrapper(ITextRenderer renderer)
           
DrawableTextWrapper(String txt, Coord3d position, Color color, ITextRenderer renderer)
           
 
Method Summary
 void configure(String txt, Coord3d position, Color color, Halign ha, Valign va)
           
 void draw(javax.media.opengl.GL2 gl, javax.media.opengl.glu.GLU glu, Camera cam)
          Call OpenGL2 routines for rendering the object.
 BoundingBox3d getBounds()
          Return the BoundingBox of this object.
 Halign getHalign()
           
 Coord3d getPosition()
           
 String getText()
           
 Valign getValign()
           
 void setColor(Color color)
           
 void setHalign(Halign halign)
           
 void setPosition(Coord3d position)
           
 void setText(String txt)
           
 void setValign(Valign valign)
           
 String toString()
           
 
Methods inherited from class org.jzy3d.plot3d.primitives.AbstractDrawable
addDrawableListener, call, call, callWithAlphaFactor, dispose, fireDrawableChanged, fireDrawableChanged, getBarycentre, getDistance, getLegend, getLongestDistance, getShortestDistance, getTransform, hasLegend, isDisplayed, isLegendDisplayed, negative, removeDrawableListener, setDisplayed, setLegend, setLegendDisplayed, setTransform, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

txt

protected String txt

position

protected Coord3d position

halign

protected Halign halign

valign

protected Valign valign

color

protected Color color

renderer

protected ITextRenderer renderer
Constructor Detail

DrawableTextWrapper

public DrawableTextWrapper(ITextRenderer renderer)

DrawableTextWrapper

public DrawableTextWrapper(String txt,
                           Coord3d position,
                           Color color,
                           ITextRenderer renderer)
Method Detail

draw

public void draw(javax.media.opengl.GL2 gl,
                 javax.media.opengl.glu.GLU glu,
                 Camera cam)
Description copied from class: AbstractDrawable
Call OpenGL2 routines for rendering the object.

Specified by:
draw in interface IGLRenderer
Specified by:
draw in class AbstractDrawable
Parameters:
gl - GL2 context
glu - GLU context
cam - a reference to a shooting Camera.

getBounds

public BoundingBox3d getBounds()
Description copied from class: AbstractDrawable
Return the BoundingBox of this object.

Overrides:
getBounds in class AbstractDrawable
Returns:
a bounding box

configure

public void configure(String txt,
                      Coord3d position,
                      Color color,
                      Halign ha,
                      Valign va)

getText

public String getText()

setText

public void setText(String txt)

setPosition

public void setPosition(Coord3d position)

getPosition

public Coord3d getPosition()

setColor

public void setColor(Color color)

getHalign

public Halign getHalign()

setHalign

public void setHalign(Halign halign)

getValign

public Valign getValign()

setValign

public void setValign(Valign valign)

toString

public String toString()
Overrides:
toString in class AbstractDrawable