Class symantec.itools.multimedia.Animator
All Packages Class Hierarchy This Package Previous Next Index
Class symantec.itools.multimedia.Animator
Object
|
+----Component
|
+----Canvas
|
+----symantec.itools.multimedia.Animator
- public class Animator
- extends Canvas
- implements Runnable, PropertyChangeListener
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.
- Version:
- 1.0, Nov 26, 1996
- Author:
- Symantec
-
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.
-
symantec.itools.multimedia.Animator()
- Constructs a default Animator.
-
addImage(URL)
- Adds an image to the animation set.
-
addPropertyChangeListener(PropertyChangeListener)
- Adds a listener for all event changes.
-
addVetoableChangeListener(VetoableChangeListener)
- Adds a vetoable listener for all event changes.
-
getClearFrame()
-
-
getDelay()
- Returns the current delay between animation frames.
-
getImageList()
- Returns the image list.
-
getNumLoops()
- Returns the current animation set loop count.
-
getPreviewMode()
-
-
getRepeatMode()
-
-
isClearFrame()
- Gets the current clear frame setting.
-
isPreviewMode()
- Gets the preview mode flag.
-
isRepeatMode()
- 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.
-
propertyChange(PropertyChangeEvent)
- A method of the PropertyChangeListener interface.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes a listener for all event changes.
-
removeVetoableChangeListener(VetoableChangeListener)
- Removes a vetoable listener for all event changes.
-
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.
clearFrame
protected boolean clearFrame
- Clear frame between each image.
currentImage
protected transient java.awt.Image currentImage
- Image currently being shown.
delay
protected int delay
- Delay time between images, in milliseconds.
displayThread
protected transient java.lang.Thread displayThread
- Thread which runs the animation.
forever
protected boolean forever
- Run animation forever. If false, use numLoops.
images
protected java.util.Vector images
- Images to be displayed.
maxHeight
protected int maxHeight
- Dimension of largest image in sequence.
maxWidth
protected int maxWidth
- Dimension of largest image in sequence.
numLoops
protected int numLoops
- Number of times to show the animation sequence.
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.
addImage
public synchronized void addImage(URL url)
- Adds an image to the animation set.
- Parameters:
- url - URL of the image to add
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
- Adds a listener for all event changes.
- Parameters:
- PropertyChangeListener - listener the listener to add.
- See Also:
- removePropertyChangeListener
addVetoableChangeListener
public void addVetoableChangeListener(VetoableChangeListener listener)
- Adds a vetoable listener for all event changes.
- Parameters:
- VetoableChangeListener - listener the listener to add.
- See Also:
- removeVetoableChangeListener
getClearFrame
public boolean getClearFrame()
- Note: getClearFrame() is deprecated.
-
- See Also:
- isClearFrame
getDelay
public int getDelay()
- Returns the current delay between animation frames.
- Returns:
- current animation delay, in milliseconds
- See Also:
- setDelay
getImageList
public synchronized java.net.URL[] getImageList()
- Returns the image list.
- Returns:
- URL list of images
- See Also:
- setImageList
getNumLoops
public int getNumLoops()
- Returns the current animation set loop count.
- Returns:
- loop count
- See Also:
- setNumLoops
getPreviewMode
public boolean getPreviewMode()
- Note: getPreviewMode() is deprecated.
-
- See Also:
- setPreviewMode
getRepeatMode
public boolean getRepeatMode()
- Note: getRepeatMode() is deprecated.
-
- See Also:
- isRepeatMode
isClearFrame
public boolean isClearFrame()
- 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
isPreviewMode
public boolean isPreviewMode()
- Gets the preview mode flag. This flag is used by Visual Cafe to
determine if this component should be run during design time.
- See Also:
- setPreviewMode
isRepeatMode
public boolean isRepeatMode()
- Returns the current repeat mode setting.
- Returns:
- current repeat mode setting, true if repeat forever
- See Also:
- setRepeatMode
minimumSize
public java.awt.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
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
preferredSize
public java.awt.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
propertyChange
public void propertyChange(PropertyChangeEvent evt)
- A method of the PropertyChangeListener interface.
This method is called when a property of this component changes.
It starts the animation when the Repeat Mode property is set.
- Parameters:
- evt - the event
- See Also:
- PropertyChangeListener
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
- Removes a listener for all event changes.
- Parameters:
- PropertyChangeListener - listener the listener to remove.
- See Also:
- addPropertyChangeListener
removeVetoableChangeListener
public void removeVetoableChangeListener(VetoableChangeListener listener)
- Removes a vetoable listener for all event changes.
- Parameters:
- VetoableChangeListener - listener the listener to remove.
- See Also:
- addVetoableChangeListener
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.
setClearFrame
public void setClearFrame(boolean newClearFrame) throws PropertyVetoException
- Sets whether or not the animation frame area is cleared
between each frame.
- Parameters:
- newClearFrame - if true, the frame area is cleared between each
animation frame; if false, the frame area is not cleared.
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getClearFrame
setDelay
public void setDelay(int newDelay) throws PropertyVetoException
- Sets the delay between animation frames.
- Parameters:
- i - animation delay, in milliseconds
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getDelay
setImageList
public synchronized void setImageList(URL[] newImageList) throws PropertyVetoException
- Sets the image list. Images in this list are displayed in
sequence to form the animation.
- Parameters:
- list - array of image URLs
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getImageList
setNumLoops
public void setNumLoops(int newNumLoops) throws PropertyVetoException
- Sets the number of loops to perform when displaying
the animation set.
- Parameters:
- i - loop count
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getNumLoops
setPreviewMode
public void setPreviewMode(boolean newPreviewMode)
- Sets the preview mode flag. This flag is used by Visual Cafe to
determine if this component should be run during design time.
- Parameters:
- newPreviewMode - new preview mode
- See Also:
- getPreviewMode
setRepeatMode
public void setRepeatMode(boolean newRepeatMode) throws PropertyVetoException
- Sets the repeat mode setting.
- Parameters:
- b - repeat mode, repeats if true
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getRepeatMode
startAnimation
public void startAnimation()
- Starts the animation.
- See Also:
- stopAnimation
stopAnimation
public void stopAnimation()
- Stops the animation.
- See Also:
- startAnimation
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
All Packages Class Hierarchy This Package Previous Next Index