public abstract class Animation
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static Animation |
EMPTY
An 'animation' that renders nothing, effectively
hiding the object it is applied to.
|
private boolean |
finished
When true indicates that the animation has no frames remaining.
|
Constructor and Description |
---|
Animation() |
Modifier and Type | Method and Description |
---|---|
void |
end()
Forcefully ends this animation.
|
protected abstract boolean |
render(java.awt.Graphics2D g)
Renders the next frame of this animation.
|
boolean |
run(java.awt.Graphics2D g)
Renders the next frame of the animation.
|
void |
waitFor()
Blocks the current thread until this animation has finished.
|
public static final Animation EMPTY
private volatile boolean finished
public final boolean run(java.awt.Graphics2D g)
g
- The graphics instance to use.public void end()
public void waitFor() throws java.lang.InterruptedException
java.lang.InterruptedException
- When the current thread is interrupted.protected abstract boolean render(java.awt.Graphics2D g)
g
- The graphics context to use.