All Packages Class Hierarchy This Package Previous Next Index
Class symantec.itools.multimedia.Animator
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----symantec.itools.multimedia.Animator
- public class Animator
- extends Canvas
- implements Runnable
This is a simple animation component.
It creates an animation by displaying a series of images in sequence.
The programmer can specify the delay between frames in milliseconds.
The animation can loop for a specific
number of iterations or can run forever.
-
clearFrame
- Clear frame between each image.
-
currentImage
- Image currently being shown.
-
delay
- Delay time between images, in milliseconds.
-
displayThread
- Thread which runs the animation.
-
forever
- Run animation forever.
-
images
- Images to be displayed.
-
maxHeight
- Dimension of largest image in sequence.
-
maxWidth
- Dimension of largest image in sequence.
-
numLoops
- Number of times to show the animation sequence.
-
previewMode
- Preview this component at design time.
-
Animator()
- Constructs a default Animator.
-
addImage(URL)
- Adds an image to the animation set.
-
getClearFrame()
- Gets the current clear frame setting.
-
getDelay()
- Returns the current delay between animation frames.
-
getImageList()
- Returns the image list.
-
getNumLoops()
- Returns the current animation set loop count.
-
getPreviewMode()
- Gets the preview mode flag.
-
getRepeatMode()
- Returns the current repeat mode setting.
-
minimumSize()
- Returns the minimum dimensions to properly display this component.
-
paint(Graphics)
- Paints this component using the given graphics context.
-
preferredSize()
- Returns the recommended dimensions to properly display this component.
-
run()
- Body of Animation Thread.
-
setClearFrame(boolean)
- Sets whether or not the animation frame area is cleared
between each frame.
-
setDelay(int)
- Sets the delay between animation frames.
-
setImageList(URL[])
- Sets the image list.
-
setNumLoops(int)
- Sets the number of loops to perform when displaying
the animation set.
-
setPreviewMode(boolean)
- Sets the preview mode flag.
-
setRepeatMode(boolean)
- Sets the repeat mode setting.
-
startAnimation()
- Starts the animation.
-
stopAnimation()
- Stops the animation.
-
update(Graphics)
- Handles redrawing of this component on the screen.
delay
protected int delay
- Delay time between images, in milliseconds.
numLoops
protected int numLoops
- Number of times to show the animation sequence.
forever
protected boolean forever
- Run animation forever. If false, use numLoops.
images
protected Vector images
- Images to be displayed.
currentImage
protected Image currentImage
- Image currently being shown.
displayThread
protected Thread displayThread
- Thread which runs the animation.
maxWidth
protected int maxWidth
- Dimension of largest image in sequence.
maxHeight
protected int maxHeight
- Dimension of largest image in sequence.
clearFrame
protected boolean clearFrame
- Clear frame between each image.
previewMode
protected boolean previewMode
- Preview this component at design time.
Animator
public Animator()
- Constructs a default Animator. The animator defaults to a 500 millisecond delay, and loops forever.
setDelay
public void setDelay(int i)
- Sets the delay between animation frames.
- Parameters:
- i - animation delay, in milliseconds
- See Also:
- getDelay
getDelay
public int getDelay()
- Returns the current delay between animation frames.
- Returns:
- current animation delay, in milliseconds
- See Also:
- setDelay
setNumLoops
public void setNumLoops(int i)
- Sets the number of loops to perform when displaying
the animation set.
- Parameters:
- i - loop count
- See Also:
- getNumLoops
getNumLoops
public int getNumLoops()
- Returns the current animation set loop count.
- Returns:
- loop count
- See Also:
- setNumLoops
setRepeatMode
public void setRepeatMode(boolean b)
- Sets the repeat mode setting.
- Parameters:
- b - repeat mode, repeats if true
- See Also:
- getRepeatMode
getRepeatMode
public boolean getRepeatMode()
- Returns the current repeat mode setting.
- Returns:
- current repeat mode setting, true if repeat forever
- See Also:
- setRepeatMode
addImage
public synchronized void addImage(URL url)
- Adds an image to the animation set.
- Parameters:
- url - URL of the image to add
setImageList
public synchronized void setImageList(URL list[])
- Sets the image list. Images in this list are displayed in
sequence to form the animation.
- Parameters:
- list - array of image URLs
- See Also:
- getImageList
getImageList
public synchronized URL[] getImageList()
- Returns the image list.
- Returns:
- URL list of images
- See Also:
- setImageList
setClearFrame
public void setClearFrame(boolean b)
- Sets whether or not the animation frame area is cleared
between each frame.
- Parameters:
- b - if true, the frame area is cleared between each
animation frame; if false, the frame area is not cleared.
- See Also:
- getClearFrame
getClearFrame
public boolean getClearFrame()
- Gets the current clear frame setting.
- Returns:
- boolean - if true, the frame area is cleared
between each animation frame; if false, the frame area
is not cleared.
- See Also:
- setClearFrame
startAnimation
public void startAnimation()
- Starts the animation.
- See Also:
- stopAnimation
stopAnimation
public void stopAnimation()
- Stops the animation.
- See Also:
- startAnimation
setPreviewMode
public void setPreviewMode(boolean f)
- Sets the preview mode flag. This flag is used by Visual Cafe to
determine if this component should be run during design time.
- Parameters:
- f - new preview mode
- See Also:
- getPreviewMode
getPreviewMode
public boolean getPreviewMode()
- Gets the preview mode flag. This flag is used by Visual Cafe to
determine if this component should be run during design time.
- Parameters:
- f - new preview mode
- See Also:
- setPreviewMode
run
public synchronized void run()
- Body of Animation Thread. This method is called by the Java Virtual Machine
in response to a call to the start method of this object.
paint
public synchronized 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.
- Parameters:
- g - the graphics context used for painting
- Overrides:
- paint in class Canvas
- See Also:
- repaint, update
update
public void update(Graphics g)
- Handles redrawing of this component on the screen.
This is a standard Java AWT method which gets called by the Java
AWT (repaint()) to handle repainting this component on the screen.
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.
Typically this method paints the background color to clear the
component's drawing space, sets graphics context to be the foreground
color, and then calls paint() to draw the component.
It is overridden here to make clearing the background before painting
optional. If the clearFrame flag is true the background will be erased
before painting begins.
- Parameters:
- g - the graphics context
- Overrides:
- update in class Component
- See Also:
- repaint, paint
preferredSize
public Dimension preferredSize()
- Returns the recommended dimensions to properly display this component.
This is a standard Java AWT method which gets called to determine
the recommended size of this component.
- Returns:
- If no images have been loaded, a dimension of 10 by 10 is returned.
If one or more images have been loaded, the largest height and the
largest width of any image is returned.
- Overrides:
- preferredSize in class Component
- See Also:
- minimumSize
minimumSize
public Dimension minimumSize()
- Returns the minimum dimensions to properly display this component.
This is a standard Java AWT method which gets called to determine
the minimum size of this component.
- Returns:
- If no images have been loaded, a dimension of 10 by 10 is returned.
If one or more images have been loaded, the largest height and the
largest width of any image is returned.
- Overrides:
- minimumSize in class Component
- See Also:
- preferredSize
All Packages Class Hierarchy This Package Previous Next Index