All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class datarep.common.FrameAnimator

java.lang.Object
   |
   +----java.awt.Component
           |
           +----datarep.common.FrameAnimator

public class FrameAnimator
extends Component
implements Runnable, AdjustmentListener
The FrameAnimator class provides an easy to set up a simple but powerful form of animation in Java. This takes a series of images and displaces them sequentially at a specified frame rate. Start and stop the animation using the start() and stop() methods.

Version:
1.2
Author:
Data Representations, Inc.

Constructor Index

 o FrameAnimator()
 o FrameAnimator(File[], double)
 o FrameAnimator(Image[], double)
 o FrameAnimator(int, int, Component)
creates a demo FrameAnimator with the specfied attributes.
 o FrameAnimator(String[], double)
Creates a FrameAnimator which uses the specified files and animates at the specified speed.
 o FrameAnimator(URL[], double)

Method Index

 o addNotify()
 o adjustmentValueChanged(AdjustmentEvent)
 o demo(int, double, Component)
runs a demo of the frameAnimator, with the specified number of frames and speed, in the specified container.
 o getCurrentFrame()
 o getFrameRate()
 o getMinimumSize()
 o getNumberOfFrames()
 o getPreferredSize()
 o isRunning()
 o main(String[])
 o paint(Graphics)
 o removeNotify()
 o run()
Use the start() method to run the FrameAnimator.
 o setCurrentFrame(int)
sets the current frame.
 o setFrameRate(double)
sets the frame rate to the specified speed (in frames per second).
 o setFrames(File[])
 o setFrames(Image[])
 o setFrames(String[])
Stops the current animation and sets the frames to the specified string array.
 o setFrames(URL[])
 o setLayout(LayoutManager)
 o start()
Starts the animation of the FrameAnimator.
 o stop()
Stops the animation of the FrameAnimator.
 o update(Graphics)

Constructors

 o FrameAnimator
 public FrameAnimator(int frames,
                      int fps,
                      Component added)
creates a demo FrameAnimator with the specfied attributes.

 o FrameAnimator
 public FrameAnimator()
 o FrameAnimator
 public FrameAnimator(String filenames[],
                      double fps)
Creates a FrameAnimator which uses the specified files and animates at the specified speed.

 o FrameAnimator
 public FrameAnimator(File files[],
                      double fps)
 o FrameAnimator
 public FrameAnimator(URL urls[],
                      double fps)
 o FrameAnimator
 public FrameAnimator(Image images[],
                      double fps)

Methods

 o setFrames
 public void setFrames(String filename[])
Stops the current animation and sets the frames to the specified string array.

 o setFrames
 public void setFrames(File files[])
 o setFrames
 public void setFrames(URL urls[])
 o setFrames
 public void setFrames(Image images[])
 o getFrameRate
 public double getFrameRate()
 o getCurrentFrame
 public int getCurrentFrame()
 o getNumberOfFrames
 public int getNumberOfFrames()
 o isRunning
 public boolean isRunning()
 o getPreferredSize
 public Dimension getPreferredSize()
Overrides:
getPreferredSize in class Component
 o getMinimumSize
 public Dimension getMinimumSize()
Overrides:
getMinimumSize in class Component
 o setFrameRate
 public synchronized void setFrameRate(double fps)
sets the frame rate to the specified speed (in frames per second). Note that the actual frame rate might be limited by the hardware which is being used.

 o setCurrentFrame
 public synchronized void setCurrentFrame(int n)
sets the current frame. If the number given is out of bounds, nothing will happen.

 o setLayout
 public void setLayout(LayoutManager l)
 o update
 public void update(Graphics g)
Overrides:
update in class Component
 o paint
 public void paint(Graphics g)
Overrides:
paint in class Component
 o run
 public void run()
Use the start() method to run the FrameAnimator.

 o start
 public synchronized void start()
Starts the animation of the FrameAnimator. If the animation was stopped, resumes it.

 o stop
 public synchronized void stop()
Stops the animation of the FrameAnimator.

 o demo
 public void demo(int frames,
                  double fps,
                  Component added)
runs a demo of the frameAnimator, with the specified number of frames and speed, in the specified container.

 o main
 public static void main(String args[])
 o addNotify
 public void addNotify()
Overrides:
addNotify in class Component
 o removeNotify
 public void removeNotify()
Overrides:
removeNotify in class Component
 o adjustmentValueChanged
 public void adjustmentValueChanged(AdjustmentEvent e)

All Packages  Class Hierarchy  This Package  Previous  Next  Index