com.jgoodies.animation.components
Class AnimatedLabel
JPanel
com.jgoodies.animation.components.AnimatedLabel
public final class AnimatedLabel
extends JPanel
An anti-aliased text label that can animate text changes
using a blend over effect.
Note: This is preview code that is not supported.
It is more raw than other classes that you have downloaded
from JGoodies.com in the past and contains known bugs.
AnimatedLabel() - Constructs an
AnimatedLabel with default base color,
default font extra size, and an empty text.
|
AnimatedLabel(Color baseColor, int fontExtraSize, String text) - Constructs an
AnimatedLabel with the given initial text
using a left oriented label.
|
AnimatedLabel(Color baseColor, int fontExtraSize, String text, int orientation) - Constructs an
AnimatedLabel with the given initial text
and orientation.
|
AnimatedLabel(Color baseColor, int fontExtraSize, String text, int orientation, int duration, int frames_per_second) - Constructs an
AnimatedLabel with the given properties.
|
long | getDuration() - Returns the duration of the blend over animation.
|
Color | getForeground() - Returns the label's foreground base color.
|
String | getText() - Returns the text of the foreground label.
|
boolean | isAnimated() - Answers whether the animation is currently enabled.
|
void | setAnimated(boolean animated) - Enables or disables the blend over effect.
|
void | setDuration(long newDuration) - Sets the animation's duration and invalidates the animation cache.
|
void | setForeground(Color newForeground) - Sets a new foreground base color.
|
void | setText(String newText) - Sets a new text.
|
void | setTextImmediately(String newText) - Sets a new text without using the blend over animation.
|
CENTER
public static final int CENTER
DEFAULT_BASE_COLOR
public static final Color DEFAULT_BASE_COLOR
DEFAULT_FONT_EXTRA_SIZE
public static final int DEFAULT_FONT_EXTRA_SIZE
LEFT
public static final int LEFT
PROPERTYNAME_ANIMATED
public static final String PROPERTYNAME_ANIMATED
PROPERTYNAME_DURATION
public static final String PROPERTYNAME_DURATION
PROPERTYNAME_FOREGROUND
public static final String PROPERTYNAME_FOREGROUND
PROPERTYNAME_TEXT
public static final String PROPERTYNAME_TEXT
RIGHT
public static final int RIGHT
AnimatedLabel
public AnimatedLabel()
Constructs an AnimatedLabel
with default base color,
default font extra size, and an empty text.
AnimatedLabel
public AnimatedLabel(Color baseColor,
int fontExtraSize,
String text)
Constructs an AnimatedLabel
with the given initial text
using a left oriented label.
baseColor
- the color used as a basis for the text colorfontExtraSize
- pixels that are added to the dialog font sizetext
- the initial text to be displayed
AnimatedLabel
public AnimatedLabel(Color baseColor,
int fontExtraSize,
String text,
int orientation)
Constructs an AnimatedLabel
with the given initial text
and orientation.
baseColor
- the color used as a basis for the text colorfontExtraSize
- pixels that are added to the dialog font sizetext
- the initial text to be displayedorientation
- the label's orientation
AnimatedLabel
public AnimatedLabel(Color baseColor,
int fontExtraSize,
String text,
int orientation,
int duration,
int frames_per_second)
Constructs an AnimatedLabel
with the given properties.
baseColor
- the color used as a basis for the text colorfontExtraSize
- pixels that are added to the dialog font sizetext
- the initial text to be displayedorientation
- the label's orientationduration
- the duration of the blend over animationframes_per_second
- the blend over animation's frame rate
getDuration
public long getDuration()
Returns the duration of the blend over animation.
- the duration of the blend over animaton
getForeground
public Color getForeground()
Returns the label's foreground base color.
- this label's foreground base color
getText
public String getText()
Returns the text of the foreground label.
- the text of the foreground label
isAnimated
public boolean isAnimated()
Answers whether the animation is currently enabled.
- true if the animation is enabled, false if disabled
setAnimated
public void setAnimated(boolean animated)
Enables or disables the blend over effect. This can be useful in
environments with a poor rendering performance or if the user disables
all kinds of animations. You can still use this class but enable and
disable the animations.
animated
- true to enable the blend over effect, false to disable it
setDuration
public void setDuration(long newDuration)
Sets the animation's duration and invalidates the animation cache.
newDuration
- the duration to be set
setForeground
public void setForeground(Color newForeground)
Sets a new foreground base color.
newForeground
- the color to be set as new foreground base color
setText
public void setText(String newText)
Sets a new text. If the animation is disabled the text will
be set immediately otherwise a blend over animation is used.
newText
- the new text to be displayed
setTextImmediately
public void setTextImmediately(String newText)
Sets a new text without using the blend over animation.
newText
- the text to be set
Copyright © 2001-2006 JGoodies Karsten Lentzsch. All Rights Reserved.