public class JHelpAnimatedImage
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
JHelpAnimatedImage.AnimationFrame
Represents a frame of the animation
|
static class |
JHelpAnimatedImage.AnimationMode
Animation mode
|
Modifier and Type | Field and Description |
---|---|
private JHelpAnimatedImage.AnimationMode |
animationMode
Actual mode
|
private java.util.ArrayList<JHelpAnimatedImage.AnimationFrame> |
frames
Frames
|
private JHelpImage |
imageToRefresh
Image where draw the animation
|
private int |
index
Actual frame index
|
private int |
timePass
Time passed in the current frame
|
private int |
way
Actual way for changing frames
|
Constructor and Description |
---|
JHelpAnimatedImage(JHelpImage imageToRefresh,
JHelpAnimatedImage.AnimationMode animationMode)
Create a new instance of JHelpAnimatedImage
|
Modifier and Type | Method and Description |
---|---|
void |
addFrame(JHelpAnimatedImage.AnimationFrame animationFrame)
Add a frame to the animation
|
void |
addFrame(JHelpImage image,
int x,
int y,
int time)
Add a frame
|
java.util.List<JHelpAnimatedImage.AnimationFrame> |
getAnimationFrames()
List of animations
|
JHelpAnimatedImage.AnimationMode |
getAnimatonMode()
Animation mode
|
void |
nextTime()
Signal to animation that one unit of time passed, and refresh the image if need
|
private void |
refreshImage()
Refresh the image
|
void |
start()
Start the animation, or restart the animation from the start
|
private final JHelpAnimatedImage.AnimationMode animationMode
private final java.util.ArrayList<JHelpAnimatedImage.AnimationFrame> frames
private final JHelpImage imageToRefresh
private int index
private int timePass
private int way
public JHelpAnimatedImage(JHelpImage imageToRefresh, JHelpAnimatedImage.AnimationMode animationMode)
imageToRefresh
- Image where draw animationanimationMode
- Mode to useprivate void refreshImage()
public void addFrame(JHelpAnimatedImage.AnimationFrame animationFrame)
animationFrame
- Frame to addpublic void addFrame(JHelpImage image, int x, int y, int time)
image
- Image to drawx
- X positiony
- Y positiontime
- Time durationpublic java.util.List<JHelpAnimatedImage.AnimationFrame> getAnimationFrames()
public JHelpAnimatedImage.AnimationMode getAnimatonMode()
public void nextTime()
public void start()