All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class symantec.itools.multimedia.MovingAnimation

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----symantec.itools.multimedia.Animator
                           |
                           +----symantec.itools.multimedia.MovingAnimation

public class MovingAnimation
extends Animator
implements Runnable
MovingAnimation component. Draws a series of images at sequential horizontal positions within the component area. Each frame is drawn at a given offset from the previous frame.

See Also:
Animator

Constructor Index

 o MovingAnimation()
Constructs a default MovingAnimation.

Method Index

 o getShiftOffset()
Gets the animation shift offset.
 o imageUpdate(Image, int, int, int, int, int)
Incrementally updates an image as image data becomes available.
 o paint(Graphics)
Paints this component using the given graphics context.
 o run()
Body of MovingAnimation Thread.
 o setShiftOffset(int)
Sets the animation shift offset.

Constructors

 o MovingAnimation
  public MovingAnimation()
Constructs a default MovingAnimation.

Methods

 o setShiftOffset
  public void setShiftOffset(int offset)
Sets the animation shift offset. Each image is shifted horizontally from the previous image by the specified offset. Offset may be position or negative. If the offset is positive, the first image is drawn on the left side of the component and subsequent images are drawn to the right of the first image by offset pixels. If the offset is negative, the first image is drawn at the right side of the component area.

Parameters:
offset - shift offset amount, in pixels
See Also:
getShiftOffset
 o getShiftOffset
  public int getShiftOffset()
Gets the animation shift offset.

Returns:
int current shift offset amount, in pixels
See Also:
setShiftOffset
 o run
  public void run()
Body of MovingAnimation Thread. This method is called by the Java Virtual Machine in response to a call to the start method of this object.

Overrides:
run in class Animator
 o imageUpdate
  public boolean imageUpdate(Image img,
                             int flags,
                             int x,
                             int y,
                             int w,
                             int h)
Incrementally updates an image as image data becomes available. This is a standard Java AWT method which gets called by the AWT to incrementally draw an image as more image data becomes available.

Parameters:
img - the image being drawn
flags - image update flags (see class ImageObserver)
x - horizontal position
y - vertical position
w - width
h - height
Returns:
true if image has been completely loaded
Overrides:
imageUpdate in class Component
See Also:
ImageObserver, imageUpdate
 o paint
  public void paint(Graphics g)
Paints this component using the given graphics context. This is a standard Java AWT method which typically gets called by the AWT to handle painting this component. It paints this component using the given graphics context. The graphics context clipping region is set to the bounding rectangle of this component and its <0,0> coordinate is this component's top-left corner. The horizontal position of the image is shifted according to the current offset.

Parameters:
g - the graphics context used for painting
Overrides:
paint in class Animator
See Also:
repaint, update

All Packages  Class Hierarchy  This Package  Previous  Next  Index