|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.extension.gui.dock.theme.bubble.BubbleColorAnimation
public class BubbleColorAnimation
A BubbleColorAnimation
has the ability to convert one or many color-pairs smoothly from source
to destination color. It basically is a map storing String
-Color
pairs.
Clients have to call putColor(String, Color)
to start an animation. They
can call getColor(String)
any time to get the current intermediate color. Adding a task
will allow a client to be informed whenever the colors change.
The animation itself takes duration
milliseconds.
Constructor Summary | |
---|---|
BubbleColorAnimation()
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. |
void |
kick()
Immediately puts all colors to their final state and stops the animation. |
protected void |
pulse()
Called when the animation has to perform another step. |
void |
putColor(String key,
Color color)
If there is already a color stored under key , then a new animation
is started that smoothly changes the color key from its current value
to color . |
void |
putColors(String key,
Color source,
Color 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()
Method Detail |
---|
public void putColors(String key, Color source, Color destination)
destination
is shown
after maximal duration
milliseconds. This method
does not start an animation, it just modifies an existing transition.
key
- the key of the pairsource
- where the animation startsdestination
- the destination of the animationpublic void putColor(String key, Color color)
key
, then a new animation
is started that smoothly changes the color key
from its current value
to color
. If no color is stored, then color
is just set
without starting an animation.
key
- the key of the paircolor
- the destination of the animation, can be null
public 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()
public void kick()
protected void start()
protected void pulse()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |