Class symantec.itools.multimedia.MovingAnimation
All Packages Class Hierarchy This Package Previous Next Index
Class symantec.itools.multimedia.MovingAnimation
Object
|
+----Component
|
+----Canvas
|
+----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.
- Version:
- 1.0, Nov 26, 1996
- Author:
- Symantec
- See Also:
- Animator
-
loopslot
- Index of the image to draw.
-
shiftOffset
- The amount each image is shifted horizontally from the previous image.
-
symantec.itools.multimedia.MovingAnimation()
- Constructs a default MovingAnimation.
-
addPropertyChangeListener(PropertyChangeListener)
- Adds a listener for all event changes.
-
addVetoableChangeListener(VetoableChangeListener)
- Adds a vetoable listener for all event changes.
-
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.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes a listener for all event changes.
-
removeVetoableChangeListener(VetoableChangeListener)
- Removes a vetoable listener for all event changes.
-
run()
- Body of MovingAnimation Thread.
-
setShiftOffset(int)
- Sets the animation shift offset.
loopslot
protected transient int loopslot
- Index of the image to draw. A loop counter.
shiftOffset
protected int shiftOffset
- The amount each image is shifted horizontally from the previous image.
The offset may be positive
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.
MovingAnimation
public MovingAnimation()
- Constructs a default MovingAnimation.
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
- Adds a listener for all event changes.
- Parameters:
- PropertyChangeListener - listener the listener to add.
- Overrides:
- addPropertyChangeListener in class Animator
- See Also:
- removePropertyChangeListener
addVetoableChangeListener
public void addVetoableChangeListener(VetoableChangeListener listener)
- Adds a vetoable listener for all event changes.
- Parameters:
- VetoableChangeListener - listener the listener to add.
- Overrides:
- addVetoableChangeListener in class Animator
- See Also:
- removeVetoableChangeListener
getShiftOffset
public int getShiftOffset()
- Gets the animation shift offset.
- Returns:
- int current shift offset amount, in pixels
- See Also:
- setShiftOffset
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
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
- Removes a listener for all event changes.
- Parameters:
- PropertyChangeListener - listener the listener to remove.
- Overrides:
- removePropertyChangeListener in class Animator
- See Also:
- addPropertyChangeListener
removeVetoableChangeListener
public void removeVetoableChangeListener(VetoableChangeListener listener)
- Removes a vetoable listener for all event changes.
- Parameters:
- VetoableChangeListener - listener the listener to remove.
- Overrides:
- removeVetoableChangeListener in class Animator
- See Also:
- addVetoableChangeListener
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
setShiftOffset
public void setShiftOffset(int newShiftOffset) throws PropertyVetoException
- Sets the animation shift offset. Each image is shifted horizontally
from the previous image by the specified offset. Offset may be positive
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:
- newShiftOffset - shift offset amount, in pixels
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getShiftOffset
All Packages Class Hierarchy This Package Previous Next Index