Modifier and Type | Method and Description |
---|---|
void |
addAnimation(AnimationObject o)
Adds an animation object to show using this timeline
|
boolean |
animate() |
static Timeline |
createTimeline(int duration,
AnimationObject[] animations,
Dimension size)
Create a new timeline animation
|
protected void |
drawImage(Graphics g,
Object nativeGraphics,
int x,
int y)
Callback invoked internally by Codename One to draw the image/frame onto the display.
|
protected void |
drawImage(Graphics g,
Object nativeGraphics,
int x,
int y,
int w,
int h)
Callback invoked internally by Codename One 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.
|
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.
|
boolean |
requiresDrawImage()
New label optimizations don't invoke drawImage and instead just pass the native image directly to
the underlying renderer.
|
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.
|
addActionListener, applyMask, applyMask, applyMaskAutoScale, asyncLock, createImage, createImage, createImage, createImage, createImage, createImage, createImage, createIndexed, createMask, createSVG, dispose, exifRotation, exifRotation, exifRotation, fill, fireChangedEvent, flipHorizontally, flipVertically, getExifOrientationTag, getExifOrientationTag, getGraphics, getImage, getImageName, getRGB, getSVGDocument, isAlphaMutableImageSupported, isJPEG, isLocked, isOpaque, isPNG, isSVG, isSVGSupported, mirror, modifyAlpha, modifyAlpha, modifyAlphaWithTranslucency, removeActionListener, rotate, rotate180Degrees, rotate270Degrees, rotate90Degrees, scale, scaledHeight, scaledLargerRatio, scaledSmallerRatio, scaledWidth, setImageName, subImage, toRGB
public void lock()
public void unlock()
public int[] getRGB()
public int[] getRGBCached()
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 flypublic 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()
isAnimation
in class Image
public boolean animate()
public void paint(Graphics g)
public int getAnimationDelay()
public void setAnimationDelay(int animationDelay)
animationDelay
- the animationDelay to setprotected void drawImage(Graphics g, Object nativeGraphics, int x, int y)
protected void drawImage(Graphics g, Object nativeGraphics, int x, int y, int w, int h)
public int getWidth()
public int getHeight()
public Image scaled(int width, int height)
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 animationpublic AnimationObject getAnimationAt(int x, int y)
x
- the x location in the timeliney
- the y location in the timelinepublic boolean isLoop()
public void setLoop(boolean loop)
loop
- the loop to setpublic boolean requiresDrawImage()
requiresDrawImage
in class Image