com.sun.lwuit
Class StaticAnimation

java.lang.Object
  extended by com.sun.lwuit.Image
      extended by com.sun.lwuit.IndexedImage
          extended by com.sun.lwuit.StaticAnimation
All Implemented Interfaces:
Animation

Deprecated. this class shouldn't be referenced directly, use the Image base class for all functionality

public class StaticAnimation
extends IndexedImage
implements Animation

An animation with pre-existing


Method Summary
 boolean animate()
          Deprecated. Allows the animation to reduce "repaint" calls when it returns false.
static StaticAnimation createAnimation(java.io.DataInputStream data)
          Deprecated. Creates an animation from the given stream, this method is used internally by Resources normally you should not create static animations manually.
protected  void drawImage(Graphics g, java.lang.Object nativeGraphics, int x, int y)
          Deprecated. Callback invoked internally by LWUIT to draw the image/frame onto the display.
 int getFrameCount()
          Deprecated. Returns the number of frames in the animation including the initial frame
 int[] getFrameRGB(int frame)
          Deprecated. Returns the RGB for the given frame, this method is relatively slow and it is recommended that you do not use it for realtime animations.
 int getFrameTime(int frame)
          Deprecated. The time in which the given frame should appear
 int getTotalAnimationTime()
          Deprecated. Returns the duration for the entire animation used to determine when to loop
 boolean isAnimation()
          Deprecated. Returns true if this is an animated image
 boolean isLoop()
          Deprecated. Indicates whether the animation will run in a loop or run only once
 void paint(Graphics g)
          Deprecated. Draws the animation, within a component the standard paint method would be invoked since it bares the exact same signature.
 void restart()
          Deprecated. Restarts the animation
 void scale(int width, int height)
          Deprecated. Scale the image to the given width and height, this is a fast algorithm that preserves translucent information
 Image scaled(int width, int height)
          Deprecated. Returns a scaled version of this image image using the given width and height, this is a fast algorithm that preserves translucent information.
 void setLoop(boolean loop)
          Deprecated. Indicates whether the animation will run in a loop or run only once
 
Methods inherited from class com.sun.lwuit.IndexedImage
getGraphics, getHeight, getImageDataByte, getPalette, getWidth, load, modifyAlpha, pack, pack, pack, rotate, subImage, toByteArray
 
Methods inherited from class com.sun.lwuit.Image
applyMask, applyMask, createImage, createImage, createImage, createImage, createImage, createImage, createImage, createIndexed, createMask, createSVG, drawImage, getImage, getRGB, getRGBCached, getSVGDocument, isAlphaMutableImageSupported, isOpaque, isSVG, isSVGSupported, lock, modifyAlpha, modifyAlphaWithTranslucency, scaledHeight, scaledSmallerRatio, scaledWidth, toRGB, unlock
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFrameCount

public int getFrameCount()
Deprecated. 
Returns the number of frames in the animation including the initial frame

Returns:
number of frames in the animation

getFrameTime

public int getFrameTime(int frame)
Deprecated. 
The time in which the given frame should appear

Parameters:
frame - must be a number bigger than -1 and smaller than getFrameCount()
Returns:
the time in milliseconds for the frame to appear

getTotalAnimationTime

public int getTotalAnimationTime()
Deprecated. 
Returns the duration for the entire animation used to determine when to loop

Returns:
total animation time in milliseconds

getFrameRGB

public int[] getFrameRGB(int frame)
Deprecated. 
Returns the RGB for the given frame, this method is relatively slow and it is recommended that you do not use it for realtime animations.

Parameters:
frame - must be a number bigger than -1 and smaller than getFrameCount()
Returns:
ARGB pixels within the given frame

createAnimation

public static StaticAnimation createAnimation(java.io.DataInputStream data)
                                       throws java.io.IOException
Deprecated. 
Creates an animation from the given stream, this method is used internally by Resources normally you should not create static animations manually.

Parameters:
data - input stream from which the animation is loaded
Returns:
An instance of a static animation
Throws:
java.io.IOException - when the stream throws it

animate

public boolean animate()
Deprecated. 
Description copied from interface: Animation
Allows the animation to reduce "repaint" calls when it returns false. It is called once for every frame. Frames are defined by the Display class.

Specified by:
animate in interface Animation
Overrides:
animate in class Image
Returns:
true if a repaint is desired or false if no repaint is necessary

restart

public void restart()
Deprecated. 
Restarts the animation


paint

public void paint(Graphics g)
Deprecated. 
Description copied from interface: Animation
Draws the animation, within a component the standard paint method would be invoked since it bares the exact same signature.

Specified by:
paint in interface Animation
Parameters:
g - graphics context

isLoop

public boolean isLoop()
Deprecated. 
Indicates whether the animation will run in a loop or run only once

Returns:
true for a loop animation

setLoop

public void setLoop(boolean loop)
Deprecated. 
Indicates whether the animation will run in a loop or run only once

Parameters:
loop - true for looping the animation

drawImage

protected void drawImage(Graphics g,
                         java.lang.Object nativeGraphics,
                         int x,
                         int y)
Deprecated. 
Description copied from class: Image
Callback invoked internally by LWUIT to draw the image/frame onto the display. Image subclasses can override this method to perform drawing of custom image types.

Overrides:
drawImage in class IndexedImage
Parameters:
g - the graphics object
nativeGraphics - the underlying native graphics which might be essential for some image types
x - the x coordinate
y - the y coordinate

scale

public void scale(int width,
                  int height)
Deprecated. 
Description copied from class: Image
Scale the image to the given width and height, this is a fast algorithm that preserves translucent information

Overrides:
scale in class IndexedImage
Parameters:
width - width for the scaling
height - height of the scaled image

scaled

public Image scaled(int width,
                    int height)
Deprecated. 
Description copied from class: Image
Returns a scaled version of this image image using the given width and height, this is a fast algorithm that preserves translucent information. The method accepts -1 to preserve aspect ratio in the given axis.

Overrides:
scaled in class IndexedImage
Parameters:
width - width for the scaling
height - height of the scaled image
Returns:
new image instance scaled to the given height and width

isAnimation

public boolean isAnimation()
Deprecated. 
Description copied from class: Image
Returns true if this is an animated image

Overrides:
isAnimation in class Image
Returns:
true if this image represents an animation