com.jgoodies.animation.renderer

Class BasicTextRenderer

Implemented Interfaces:
AnimationRenderer

public final class BasicTextRenderer
extends AbstractTextRenderer

Renders a text with modifiable scaling, color, glyph spacing and position.
Version:
$Revision: 1.1 $
Author:
Karsten Lentzsch

Field Summary

Fields inherited from class com.jgoodies.animation.renderer.AbstractTextRenderer

cachedGlyphShapes, cachedGlyphVector, cachedTextAscent, cachedTextHeight, cachedTextWidth, capitalMAscent

Constructor Summary

BasicTextRenderer(String text)
Constructs a renderer for a text that can be scaled, moved, and change inter-glyph space.

Method Summary

float
getOffsetX()
float
getOffsetY()
float
getScaleX()
float
getScaleY()
float
getSpace()
void
render(Graphics2D g2, int width, int height)
Renders the text.
void
setOffsetX(float offsetX)
void
setOffsetY(float offsetY)
void
setScaleX(float scaleX)
void
setScaleY(float scaleY)
void
setSpace(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

Constructor Details

BasicTextRenderer

public BasicTextRenderer(String text)
Constructs a renderer for a text that can be scaled, moved, and change inter-glyph space.
Parameters:
text - the text to be displayed

Method Details

getOffsetX

public float getOffsetX()

getOffsetY

public float getOffsetY()

getScaleX

public float getScaleX()

getScaleY

public float getScaleY()

getSpace

public float getSpace()

render

public void render(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.
Specified by:
render in interface AnimationRenderer
Parameters:
g2 - the graphics context to render on
width - the width of the drawing surface
height - the height of the drawing surface

setOffsetX

public void setOffsetX(float offsetX)

setOffsetY

public void setOffsetY(float offsetY)

setScaleX

public void setScaleX(float scaleX)

setScaleY

public void setScaleY(float scaleY)

setSpace

public void setSpace(float space)

Copyright © 2001-2006 JGoodies Karsten Lentzsch. All Rights Reserved.