|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.lwuit.Image com.sun.lwuit.animations.Timeline
public final class Timeline
A timeline represents the motions of animation objects
Method Summary | |
---|---|
void |
addAnimation(AnimationObject o)
Adds an animation object to show using this timeline |
boolean |
animate()
Allows the animation to reduce "repaint" calls when it returns false. |
static Timeline |
createTimeline(int duration,
AnimationObject[] animations,
Dimension size)
Create a new timeline animation |
protected void |
drawImage(Graphics g,
java.lang.Object nativeGraphics,
int x,
int y)
Callback invoked internally by LWUIT to draw the image/frame onto the display. |
AnimationObject |
getAnimation(int i)
Returns the animation object in the given offset |
AnimationObject |
getAnimationAt(int x,
int y)
Returns the animation object at the given X/Y coordinate in the timeline for the current frame. |
int |
getAnimationCount()
Returns the number of animation objects in this timeline |
int |
getAnimationDelay()
Inidicates the minimal delay between animation frames allowing the CPU to rest. |
int |
getDuration()
Returns the duration of the entire timeline in milliseconds |
int |
getHeight()
Returns the height of the image |
int[] |
getRGB()
Returns the content of this image as a newly created ARGB array. |
int[] |
getRGBCached()
Returns the content of this image as a newly created ARGB array or a cached instance if possible. |
Dimension |
getSize()
Returns the pixel based unscaled dimentions of this timeline |
int |
getTime()
Returns the time of the timeline |
int |
getWidth()
Returns the width of the image |
boolean |
isAnimation()
Returns true if this is an animated image |
boolean |
isLoop()
Indicates if the image should loop |
boolean |
isPause()
Returns true when the timeline is paused |
void |
lock()
This callback indicates that a component pointing at this image is initialized, this allows an image to make performance sensitive considerations e.g. an encoded image might choose to cache itself in RAM. |
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 |
paint(Graphics g,
Rectangle rect)
Draws inside the given rectangle clipping area. |
Image |
scaled(int width,
int height)
Returns a scaled version of this image image using the given width and height, this is a fast algorithm that preserves translucent information. |
void |
setAnimationDelay(int animationDelay)
Inidicates the minimal delay between animation frames allowing the CPU to rest. |
void |
setLoop(boolean loop)
Indicates if the image should loop |
void |
setPause(boolean pause)
Indicate that the application is paused |
void |
setTime(int time)
Set the time of the timeline |
void |
unlock()
This callback indicates that a component pointing at this image is now deinitilized This method may be invoked multiple times. |
Methods inherited from class com.sun.lwuit.Image |
---|
applyMask, applyMask, createImage, createImage, createImage, createImage, createImage, createImage, createImage, createIndexed, createMask, createSVG, drawImage, getGraphics, getImage, getSVGDocument, isAlphaMutableImageSupported, isOpaque, isSVG, isSVGSupported, modifyAlpha, modifyAlpha, modifyAlphaWithTranslucency, rotate, scale, scaledHeight, scaledSmallerRatio, scaledWidth, subImage, toRGB |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void lock()
Image
lock
in class Image
public void unlock()
Image
unlock
in class Image
public int[] getRGB()
Image
getRGB
in class Image
public int[] getRGBCached()
Image
getRGBCached
in class Image
public static Timeline createTimeline(int duration, AnimationObject[] animations, Dimension size)
duration
- the duration of the animation in millisecondsanimations
- the animation objects that are part of this timelinesize
- size of the animation in virtual pixels, if the size differs the animation would be
scaled on the fly
public void addAnimation(AnimationObject o)
o
- animation object featured in this timelinepublic void setTime(int time)
time
- the time of the timeline in ms starting from 0public int getTime()
public boolean isAnimation()
Image
isAnimation
in class Image
public boolean animate()
Animation
Display
class.
animate
in interface Animation
animate
in class Image
public void paint(Graphics g)
Animation
paint
in interface Animation
g
- graphics contextpublic void paint(Graphics g, Rectangle rect)
Painter
paint
in interface Painter
g
- the Graphics
objectrect
- the given rectangle cliping areapublic int getAnimationDelay()
public void setAnimationDelay(int animationDelay)
animationDelay
- the animationDelay to setprotected void drawImage(Graphics g, java.lang.Object nativeGraphics, int x, int y)
Image
drawImage
in class Image
g
- the graphics objectnativeGraphics
- the underlying native graphics which might be essential for some image typesx
- the x coordinatey
- the y coordinatepublic int getWidth()
Image
getWidth
in class Image
public int getHeight()
Image
getHeight
in class Image
public Image scaled(int width, int height)
Image
scaled
in class Image
width
- width for the scalingheight
- height of the scaled image
public boolean isPause()
public void setPause(boolean pause)
pause
- true to pause the applicationpublic int getDuration()
public Dimension getSize()
public int getAnimationCount()
public AnimationObject getAnimation(int i)
i
- the offset of the animation
public AnimationObject getAnimationAt(int x, int y)
x
- the x location in the timeliney
- the y location in the timeline
public boolean isLoop()
public void setLoop(boolean loop)
loop
- the loop to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |