|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbibliothek.extension.gui.dock.theme.bubble.BubbleColorAnimation
public class BubbleColorAnimation
A BubbleColorAnimation has the ability to convert one color smoothly into another.
The animation does not store colors directly, it uses a String
as a key to read the color from a BubbleTheme
using BubbleTheme.getColor(String)
.
The transformation takes duration
milliseconds,
a task
can be executed whenever the colors have
changed.
The animation can handle multiple color-pairs asynchronously.
Constructor Summary | |
---|---|
BubbleColorAnimation(BubbleTheme theme)
Creates a new animation. |
Method Summary | |
---|---|
void |
addTask(Runnable runnable)
Adds a task to this animation. |
Color |
getColor(String key)
Gets the current color of the pair key . |
int |
getDuration()
Gets the length of one transformation. |
protected void |
pulse()
Called when the animation has to perform another step. |
void |
putColor(String key,
String color)
Starts a new animation which will transform the color of the pair key to color . |
void |
putColors(String key,
String source,
String destination)
Sets a color-pair. |
void |
removeTask(Runnable runnable)
Removes a task which was earlier added to this animation. |
void |
setDuration(int duration)
Sets the length of one transformation. |
protected void |
start()
Starts the animation if it is not yet running. |
void |
stop()
Stops the animation immediately, possibly leaving the animation in an unfinished state. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BubbleColorAnimation(BubbleTheme theme)
theme
- the theme from which colors are readMethod Detail |
---|
public void putColors(String key, String source, String destination)
destination
is shown
after maximal duration
milliseconds. This
method does not start a new animation, but modifies currently running
animations.
key
- the key of the pairsource
- where the animation startsdestination
- the destination of the animationpublic void putColor(String key, String color)
key
to color
.
key
- the key of the paircolor
- the destination of the animationpublic Color getColor(String key)
key
.
key
- the key of the pair
null
public void addTask(Runnable runnable)
runnable
- the task to executepublic void removeTask(Runnable runnable)
runnable
- the task to removepublic void setDuration(int duration)
duration
- the duration in millisecondspublic int getDuration()
public void stop()
protected void start()
protected void pulse()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |