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
ADrawableTextWrapperwraps any text rendered by anITextRendererinto 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 AxisLayoutaxisLayoutprotected Colorcolorprotected FontdefaultFontprotected Horizontalhalignprotected Coord3dpositionprotected ITextRendererrendererprotected floatrotationprotected Coord3dsceneOffsetprotected Coord2dscreenOffsetprotected Stringtxtprotected Verticalvalign-
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 voidapplyGeometryTransform(Transform transform)voidconfigure(String txt, Coord3d position, Color color, Horizontal ha, Vertical va)voiddraw(IPainter painter)Call OpenGL2 routines for rendering the object.AxisLayoutgetAxisLayout()BoundingBox3dgetBounds()Return the BoundingBox of this object.FontgetDefaultFont()HorizontalgetHalign()Coord3dgetPosition()floatgetRotation()Coord3dgetSceneOffset()Coord2dgetScreenOffset()StringgetText()VerticalgetValign()voidsetAxisLayout(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.voidsetColor(Color color)voidsetDefaultFont(Font defaultFont)voidsetHalign(Horizontal halign)voidsetPosition(Coord3d position)voidsetRotation(float rotation)voidsetSceneOffset(Coord3d sceneOffset)voidsetScreenOffset(Coord2d screenOffset)voidsetText(String txt)voidsetValign(Vertical valign)StringtoString()voidupdateBounds()-
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:DrawableCall OpenGL2 routines for rendering the object.- Specified by:
drawin interfaceIGLRenderer- Specified by:
drawin classDrawable
-
getBounds
public BoundingBox3d getBounds()
Description copied from class:DrawableReturn 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:
applyGeometryTransformin classDrawable
-
updateBounds
public void updateBounds()
- Specified by:
updateBoundsin classDrawable
-
-