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.
-
FrameAnimator()
-
-
FrameAnimator(File[], double)
-
-
FrameAnimator(Image[], double)
-
-
FrameAnimator(int, int, Component)
- creates a demo FrameAnimator with the specfied attributes.
-
FrameAnimator(String[], double)
- Creates a FrameAnimator which uses the specified files and animates at the specified speed.
-
FrameAnimator(URL[], double)
-
-
addNotify()
-
-
adjustmentValueChanged(AdjustmentEvent)
-
-
demo(int, double, Component)
- runs a demo of the frameAnimator, with the specified number of frames and speed, in the
specified container.
-
getCurrentFrame()
-
-
getFrameRate()
-
-
getMinimumSize()
-
-
getNumberOfFrames()
-
-
getPreferredSize()
-
-
isRunning()
-
-
main(String[])
-
-
paint(Graphics)
-
-
removeNotify()
-
-
run()
- Use the start() method to run the FrameAnimator.
-
setCurrentFrame(int)
- sets the current frame.
-
setFrameRate(double)
- sets the frame rate to the specified speed (in frames per second).
-
setFrames(File[])
-
-
setFrames(Image[])
-
-
setFrames(String[])
- Stops the current animation and sets the frames to the specified string array.
-
setFrames(URL[])
-
-
setLayout(LayoutManager)
-
-
start()
- Starts the animation of the FrameAnimator.
-
stop()
- Stops the animation of the FrameAnimator.
-
update(Graphics)
-
FrameAnimator
public FrameAnimator(int frames,
int fps,
Component added)
- creates a demo FrameAnimator with the specfied attributes.
FrameAnimator
public FrameAnimator()
FrameAnimator
public FrameAnimator(String filenames[],
double fps)
- Creates a FrameAnimator which uses the specified files and animates at the specified speed.
FrameAnimator
public FrameAnimator(File files[],
double fps)
FrameAnimator
public FrameAnimator(URL urls[],
double fps)
FrameAnimator
public FrameAnimator(Image images[],
double fps)
setFrames
public void setFrames(String filename[])
- Stops the current animation and sets the frames to the specified string array.
setFrames
public void setFrames(File files[])
setFrames
public void setFrames(URL urls[])
setFrames
public void setFrames(Image images[])
getFrameRate
public double getFrameRate()
getCurrentFrame
public int getCurrentFrame()
getNumberOfFrames
public int getNumberOfFrames()
isRunning
public boolean isRunning()
getPreferredSize
public Dimension getPreferredSize()
- Overrides:
- getPreferredSize in class Component
getMinimumSize
public Dimension getMinimumSize()
- Overrides:
- getMinimumSize in class Component
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.
setCurrentFrame
public synchronized void setCurrentFrame(int n)
- sets the current frame. If the number given is out of bounds, nothing will happen.
setLayout
public void setLayout(LayoutManager l)
update
public void update(Graphics g)
- Overrides:
- update in class Component
paint
public void paint(Graphics g)
- Overrides:
- paint in class Component
run
public void run()
- Use the start() method to run the FrameAnimator.
start
public synchronized void start()
- Starts the animation of the FrameAnimator. If the animation was stopped, resumes it.
stop
public synchronized void stop()
- Stops the animation of the FrameAnimator.
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.
main
public static void main(String args[])
addNotify
public void addNotify()
- Overrides:
- addNotify in class Component
removeNotify
public void removeNotify()
- Overrides:
- removeNotify in class Component
adjustmentValueChanged
public void adjustmentValueChanged(AdjustmentEvent e)
All Packages Class Hierarchy This Package Previous Next Index