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
-
MovingAnimation()
- Constructs a default MovingAnimation.
-
getShiftOffset()
- Gets the animation shift offset.
-
imageUpdate(Image, int, int, int, int, int)
- Incrementally updates an image as image data becomes available.
-
paint(Graphics)
- Paints this component using the given graphics context.
-
run()
- Body of MovingAnimation Thread.
-
setShiftOffset(int)
- Sets the animation shift offset.
MovingAnimation
public MovingAnimation()
- Constructs a default MovingAnimation.
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
getShiftOffset
public int getShiftOffset()
- Gets the animation shift offset.
- Returns:
- int current shift offset amount, in pixels
- See Also:
- setShiftOffset
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
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
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