com.jgoodies.animation.components

Class GlyphLabel


public final class GlyphLabel
extends JComponent

A Swing component that can transform a text's individual glyphs.
Version:
$Revision: 1.1 $
Author:
Karsten Lentzsch

Field Summary

static String
PROPERTYNAME_HEIGHT_MODE
static String
PROPERTYNAME_TEXT
static String
PROPERTYNAME_TIME

Constructor Summary

GlyphLabel(String text, long duration, long glyphDelay)
Creates a GlyphLabel for the given text, duration and delay between the individual glyphs.
GlyphLabel(String text, long duration, long glyphDelay, Color baseColor)
Creates a GlyphLabel for the given text, duration, base color and delay between the individual glyphs.

Method Summary

static AnimationFunction
defaultColorFunction(long duration, Color baseColor)
Creates and returns the default color function for the given duration and base color.
static AnimationFunction
defaultScaleFunction(long duration)
Creates and returns the default scale function for the given duration.
HeightMode
getHeightMode()
String
getText()
long
getTime()
void
paintComponent(Graphics g)
Paints the component.
void
setHeightMode(HeightMode newHeightMode)
void
setText(String newText)
void
setTime(long newTime)

Field Details

PROPERTYNAME_HEIGHT_MODE

public static final String PROPERTYNAME_HEIGHT_MODE

PROPERTYNAME_TEXT

public static final String PROPERTYNAME_TEXT

PROPERTYNAME_TIME

public static final String PROPERTYNAME_TIME

Constructor Details

GlyphLabel

public GlyphLabel(String text,
                  long duration,
                  long glyphDelay)
Creates a GlyphLabel for the given text, duration and delay between the individual glyphs.
Parameters:
text - the initial text
duration - the duration of the whole animation
glyphDelay - a delay between the animation of the individual glyphs

GlyphLabel

public GlyphLabel(String text,
                  long duration,
                  long glyphDelay,
                  Color baseColor)
Creates a GlyphLabel for the given text, duration, base color and delay between the individual glyphs.
Parameters:
text - the initial text
duration - the duration of the whole animation
glyphDelay - a delay between the animation of the individual glyphs
baseColor - the color used as a basis for the translucent glyph foreground colors

Method Details

defaultColorFunction

public static AnimationFunction defaultColorFunction(long duration,
                                                     Color baseColor)
Creates and returns the default color function for the given duration and base color.
Parameters:
duration - the duration of the animation
baseColor - the color used as a basis for the translucent colors
Returns:
an animation function that maps times to translucent glyph colors

defaultScaleFunction

public static AnimationFunction defaultScaleFunction(long duration)
Creates and returns the default scale function for the given duration.
Parameters:
duration - the duration of the whole animation
Returns:
an animation function that maps times to glyph scales

getHeightMode

public HeightMode getHeightMode()

getText

public String getText()

getTime

public long getTime()

paintComponent

public void paintComponent(Graphics g)
Paints the component. Sets high-fidelity rendering hints, then invoke the renderer to render the glyphs.
Parameters:
g - the Graphics object to render on

setHeightMode

public void setHeightMode(HeightMode newHeightMode)

setText

public void setText(String newText)

setTime

public void setTime(long newTime)

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