Package org.jzy3d.plot3d.text.drawable
Class DrawableTextWrapper
- java.lang.Object
-
- org.jzy3d.plot3d.primitives.Drawable
-
- org.jzy3d.plot3d.text.drawable.DrawableTextWrapper
-
- All Implemented Interfaces:
IGLRenderer
,ISortableDraw
- Direct Known Subclasses:
DrawableText
,DrawableTextBillboard
public class DrawableTextWrapper extends Drawable
ADrawableTextWrapper
wraps any text rendered by anITextRenderer
into anDrawable
, meaning it can be injected in the scene graph, and be transformed.- Author:
- Martin Pernollet
-
-
Field Summary
Fields Modifier and Type Field Description protected AxisLayout
axisLayout
protected Color
color
protected Font
defaultFont
protected Horizontal
halign
protected Coord3d
position
protected ITextRenderer
renderer
protected float
rotation
protected Coord3d
sceneOffset
protected Coord2d
screenOffset
protected String
txt
protected Vertical
valign
-
Fields inherited from class org.jzy3d.plot3d.primitives.Drawable
bbox, boundingBoxColor, boundingBoxDisplayed, displayed, hasListeners, legend, legendDisplayed, listeners, spaceTransformer, transform, transformBefore
-
-
Constructor Summary
Constructors Constructor Description DrawableTextWrapper(String txt, Coord3d position, Color color, ITextRenderer renderer)
DrawableTextWrapper(ITextRenderer renderer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyGeometryTransform(Transform transform)
void
configure(String txt, Coord3d position, Color color, Horizontal ha, Vertical va)
void
draw(IPainter painter)
Call OpenGL2 routines for rendering the object.AxisLayout
getAxisLayout()
BoundingBox3d
getBounds()
Return the BoundingBox of this object.Font
getDefaultFont()
Horizontal
getHalign()
Coord3d
getPosition()
float
getRotation()
Coord3d
getSceneOffset()
Coord2d
getScreenOffset()
String
getText()
Vertical
getValign()
void
setAxisLayout(AxisLayout axisLayout)
The axis layout acts as main font provider, to allow all text renderer to use the same current font than the one selected for axis and colorbar texts.void
setColor(Color color)
void
setDefaultFont(Font defaultFont)
void
setHalign(Horizontal halign)
void
setPosition(Coord3d position)
void
setRotation(float rotation)
void
setSceneOffset(Coord3d sceneOffset)
void
setScreenOffset(Coord2d screenOffset)
void
setText(String txt)
void
setValign(Vertical valign)
String
toString()
void
updateBounds()
-
Methods inherited from class org.jzy3d.plot3d.primitives.Drawable
addDrawableListener, asWireframeable, dispose, doDrawBoundsIfDisplayed, doTransform, fireDrawableChanged, fireDrawableChanged, getBarycentre, getBoundingBoxColor, getDistance, getLegend, getLongestDistance, getShortestDistance, getSpaceTransformer, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setSpaceTransformer, setTransform, setTransformBefore, toString
-
-
-
-
Field Detail
-
txt
protected String txt
-
position
protected Coord3d position
-
halign
protected Horizontal halign
-
valign
protected Vertical valign
-
color
protected Color color
-
screenOffset
protected Coord2d screenOffset
-
sceneOffset
protected Coord3d sceneOffset
-
rotation
protected float rotation
-
renderer
protected ITextRenderer renderer
-
axisLayout
protected AxisLayout axisLayout
-
defaultFont
protected Font defaultFont
-
-
Constructor Detail
-
DrawableTextWrapper
public DrawableTextWrapper(ITextRenderer renderer)
-
DrawableTextWrapper
public DrawableTextWrapper(String txt, Coord3d position, Color color, ITextRenderer renderer)
-
-
Method Detail
-
draw
public void draw(IPainter painter)
Description copied from class:Drawable
Call OpenGL2 routines for rendering the object.- Specified by:
draw
in interfaceIGLRenderer
- Specified by:
draw
in classDrawable
-
getBounds
public BoundingBox3d getBounds()
Description copied from class:Drawable
Return the BoundingBox of this object.
-
configure
public void configure(String txt, Coord3d position, Color color, Horizontal ha, Vertical 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 Horizontal getHalign()
-
setHalign
public void setHalign(Horizontal halign)
-
getValign
public Vertical getValign()
-
setValign
public void setValign(Vertical valign)
-
getScreenOffset
public Coord2d getScreenOffset()
-
setScreenOffset
public void setScreenOffset(Coord2d screenOffset)
-
getSceneOffset
public Coord3d getSceneOffset()
-
setSceneOffset
public void setSceneOffset(Coord3d sceneOffset)
-
getRotation
public float getRotation()
-
setRotation
public void setRotation(float rotation)
-
getAxisLayout
public AxisLayout getAxisLayout()
-
setAxisLayout
public void setAxisLayout(AxisLayout axisLayout)
The axis layout acts as main font provider, to allow all text renderer to use the same current font than the one selected for axis and colorbar texts. To for this drawable text to use a given font, set this to null and configuresetDefaultFont(Font)
-
getDefaultFont
public Font getDefaultFont()
-
setDefaultFont
public void setDefaultFont(Font defaultFont)
-
applyGeometryTransform
public void applyGeometryTransform(Transform transform)
- Specified by:
applyGeometryTransform
in classDrawable
-
updateBounds
public void updateBounds()
- Specified by:
updateBounds
in classDrawable
-
-