com.jgoodies.animation.renderer
Class GlyphRenderer

java.lang.Object
  extended by com.jgoodies.animation.renderer.AbstractTextRenderer
      extended by com.jgoodies.animation.renderer.GlyphRenderer
All Implemented Interfaces:
AnimationRenderer

public final class GlyphRenderer
extends AbstractTextRenderer

Renders the glyphs of a string with individual scaling, transform, and color.

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
GlyphRenderer(java.lang.String text, AnimationFunction scaleFunction, AnimationFunction translateFunction, AnimationFunction colorFunction, long glyphDelay)
          Constructs a GlyphRenderer that paints individual glyphs with different transforms.
 
Method Summary
 long getTime()
           
 void render(java.awt.Graphics2D g2, int width, int height)
          Renders the text.
 void setTime(long time)
           
 
Methods inherited from class com.jgoodies.animation.renderer.AbstractTextRenderer
ensureValidCache, getAdjustedAscent, getAdjustedDescent, getColor, getFont, getHeightMode, getText, invalidateCache, isCacheValid, setCacheValid, setColor, setFont, setHeightMode, setText, validateCache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlyphRenderer

public GlyphRenderer(java.lang.String text,
                     AnimationFunction scaleFunction,
                     AnimationFunction translateFunction,
                     AnimationFunction colorFunction,
                     long glyphDelay)
Constructs a GlyphRenderer that paints individual glyphs with different transforms.

Parameters:
text - the initial text
scaleFunction - maps times to glyph scales
translateFunction - maps times to glyph translations
colorFunction - maps times to colors
glyphDelay - a time delay between the glyph animations
Method Detail

getTime

public long getTime()

setTime

public void setTime(long time)

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 shaped, using individual transforms.

Parameters:
g2 - the graphics object to render on
width - the width of the graphics area
height - the height of the graphics area


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