Package com.jgoodies.animation.renderer
Class BasicTextRenderer
- java.lang.Object
-
- com.jgoodies.animation.renderer.AbstractTextRenderer
-
- com.jgoodies.animation.renderer.BasicTextRenderer
-
- All Implemented Interfaces:
AnimationRenderer
public final class BasicTextRenderer extends AbstractTextRenderer
Renders a text with modifiable scaling, color, glyph spacing and position.- Version:
- $Revision: 1.6 $
-
-
Field Summary
Fields Modifier and Type Field Description private floatoffsetXprivate floatoffsetYprivate floatscaleXprivate floatscaleYprivate floatspace-
Fields inherited from class com.jgoodies.animation.renderer.AbstractTextRenderer
cachedGlyphShapes, cachedGlyphVector, cachedTextAscent, cachedTextHeight, cachedTextWidth, capitalMAscent
-
-
Constructor Summary
Constructors Constructor Description BasicTextRenderer(java.lang.String text)Constructs a renderer for a text that can be scaled, moved, and change inter-glyph space.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description floatgetOffsetX()floatgetOffsetY()floatgetScaleX()floatgetScaleY()floatgetSpace()voidrender(java.awt.Graphics2D g2, int width, int height)Renders the text.voidsetOffsetX(float offsetX)voidsetOffsetY(float offsetY)voidsetScaleX(float scaleX)voidsetScaleY(float scaleY)voidsetSpace(float space)-
Methods inherited from class com.jgoodies.animation.renderer.AbstractTextRenderer
ensureValidCache, getAdjustedAscent, getAdjustedDescent, getColor, getFont, getHeightMode, getText, invalidateCache, isCacheValid, setCacheValid, setColor, setFont, setHeightMode, setText, validateCache
-
-
-
-
Method Detail
-
getOffsetX
public float getOffsetX()
-
getOffsetY
public float getOffsetY()
-
getSpace
public float getSpace()
-
setOffsetX
public void setOffsetX(float offsetX)
-
setOffsetY
public void setOffsetY(float offsetY)
-
setSpace
public void setSpace(float space)
-
getScaleX
public float getScaleX()
-
getScaleY
public float getScaleY()
-
setScaleX
public void setScaleX(float scaleX)
-
setScaleY
public void setScaleY(float scaleY)
-
render
public void render(java.awt.Graphics2D g2, int width, int height)Renders the text. Firstly ensures a valid cache, then sets the color, and finally paints the cached glyph shapes.- Parameters:
g2- the graphics context to render onwidth- the width of the drawing surfaceheight- the height of the drawing surface
-
-