|
Java DTV API 1.3 18-Nov-2009 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.dtv.lwuit.Image
com.sun.dtv.lwuit.StaticAnimation
public class StaticAnimation
An Image capable of animation.
Field Summary |
---|
Fields inherited from interface com.sun.dtv.ui.Animated |
---|
ALTERNATING, LOOP, REPEATING |
Method Summary | |
---|---|
boolean |
animate()
Allows the animation to reduce "repaint" calls when it returns false. |
static StaticAnimation |
createAnimation(DataInputStream data)
Creates an animation from the given stream, this method is used internally by Resources normally you should not create static animations manually. |
int |
getAnimationMode()
Obtains the animation mode for this animation. |
int |
getDelay()
Obtains the delay after every image for this animation when running. |
int |
getFrameCount()
Returns the number of frames in the animation including the initial frame. |
int |
getFrameTime(int frame)
The time in which the given frame should appear. |
int |
getPosition()
Obtains the current position the animation is at the point of time of th method call. |
int |
getRepetitionMode()
Returns the repetition mode of this animation in form of a number. |
int |
getTotalAnimationTime()
Returns the duration for the entire animation used to determine when to loop. |
boolean |
isAnimation()
Returns true if this is an animated image. |
boolean |
isLoop()
Indicates whether the animation will run in a loop or run only once. |
boolean |
isRunning()
Obtains the running mode of an animation. |
void |
jumpTo(int position)
Forces an animation to jump to the position indicated by the parameter. |
void |
paint(Graphics g)
Draws the animation, within a component the standard paint method would be invoked since it bares the exact same signature. |
void |
restart()
Restarts the animation. |
Image |
scaled(int width,
int height)
Returns a scaled version of this image using the given width and height, this is a fast algorithm that preserves translucent information. |
void |
setAnimationMode(int mode)
Sets the animation mode for this animation. |
void |
setDelay(int n)
Determines the delay after every image when running this animation. |
void |
setLoop(boolean loop)
Indicates whether the animation will run in a loop or run only once. |
void |
setRepetitionMode(int n)
Determines how often the animation is repeated once it has been started. |
void |
start()
Starts an animation. |
void |
stop()
Stops an animation. |
Methods inherited from class com.sun.dtv.lwuit.Image |
---|
createImage, createImage, createImage, createImage, createImage, createImage, getAWTImage, getGraphics, getHeight, getRGB, getWidth, isOpaque, modifyAlpha, modifyAlpha, rotate, scaledHeight, scaledSmallerRatio, scaledWidth, subImage |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public int getFrameCount()
public int getFrameTime(int frame)
frame
- must be a number bigger than -1 and smaller than getFrameCount()
public int getTotalAnimationTime()
public static StaticAnimation createAnimation(DataInputStream data) throws IOException
data
- input stream from which the animation is loaded
IOException
- if stream cannot be openedpublic boolean animate()
Animation
animate
in interface Animation
public void restart()
public void paint(Graphics g)
Animation
paint
in interface Animation
public boolean isLoop()
public void setLoop(boolean loop)
loop
- indicates whether animation should run in loop or notpublic Image scaled(int width, int height)
scaled
in class Image
width
- width for the scalingheight
- height of the scaled image
public boolean isAnimation()
isAnimation
in class Image
public void start()
start()
causes a restart of the animation.
start
in interface Animated
public void stop()
stop()
has no effect.
stop
in interface Animated
public boolean isRunning()
isRunning
in interface Animated
public void jumpTo(int position)
jumpTo
in interface Animated
position
- the index in the row of images building the animation to which
the animation is forced to jumppublic int getPosition()
getPosition
in interface Animated
public void setRepetitionMode(int n)
setRepetitionMode
in interface Animated
n
- number of repetitions to be determined. This can be any number
larger than zero or LOOP
alternatively.
LOOP means that the animation runs in an endless loop until the stop()
method has been called.getRepetitionMode()
public int getRepetitionMode()
getRepetitionMode
in interface Animated
LOOP
which means the animation runs in an
endless loop until the stop()
method has
been called.setRepetitionMode(int)
public void setDelay(int n)
setDelay
in interface Animated
n
- delay in millisecondsgetDelay()
public int getDelay()
getDelay
in interface Animated
setDelay(int)
public void setAnimationMode(int mode)
setAnimationMode
in interface Animated
mode
- the animation mode. Possible values are: REPEATING
and ALTERNATING
.getAnimationMode()
public int getAnimationMode()
getAnimationMode
in interface Animated
REPEATING
and ALTERNATING
.setAnimationMode(int)
|
Java DTV API 1.3 18-Nov-2009 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |