All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ejmf.toolkit.gui.multiimage.MultiImageRenderer

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.sun.java.swing.JLabel
                                   |
                                   +----ejmf.toolkit.gui.multiimage.MultiImageRenderer

public class MultiImageRenderer
extends JLabel
implements Runnable
Displays a series of MultiImageFrames. This could be used to display a slideshow, animation, etc.

See Also:
MultiImageFrames

Variable Index

 o MILLI_TO_NANO
The number of nanoseconds in a millisecond.
 o SEC_TO_NANO
The number of nanoseconds in a second.

Constructor Index

 o MultiImageRenderer()
Constructs a MultiImageRenderer.
 o MultiImageRenderer(MultiImageFrame[])
Constructs a MultiImageRenderer for the given MultiImageFrames.

Method Index

 o calculatePreferredSize()
Set the preferred size to be the max width x max height of all of the ImageIcons
 o endOfMedia()
Checks to see if the end of the video has been reached.
 o getDuration()
Gets the duration of the video in nanoseconds.
 o getNanoseconds()
Gets the current video time in nanoseconds.
 o getPreferredSize()
Return the dimension of the largest image.
 o getRate()
Gets the current rate.
 o getSeconds()
Gets the current video time in seconds.
 o reset()
Sets initial values for time and rate
 o run()
Run by the thread that displays the video.
 o setFrames(MultiImageFrame[])
Sets the images to display in this MultiImageRenderer.
 o setImageSize(Dimension)
Sets the preferred size of the video component.
 o setMediaTime(long)
Sets the offset in nanoseconds from the beginning of the video.
 o setRate(float)
Sets the rate of the video.
 o setSeconds(double)
Sets the offset in seconds from the beginning of the video.
 o start()
Starts the display of the video.
 o stop()
Stops the display of the video.

Variables

 o SEC_TO_NANO
 public static long SEC_TO_NANO
The number of nanoseconds in a second.

 o MILLI_TO_NANO
 public static long MILLI_TO_NANO
The number of nanoseconds in a millisecond.

Constructors

 o MultiImageRenderer
 public MultiImageRenderer()
Constructs a MultiImageRenderer. setFrames() must be called before this MultiImageRenderer will display any images.

 o MultiImageRenderer
 public MultiImageRenderer(MultiImageFrame frames[])
Constructs a MultiImageRenderer for the given MultiImageFrames.

Parameters:
frames - The images to display

Methods

 o setFrames
 public void setFrames(MultiImageFrame frames[])
Sets the images to display in this MultiImageRenderer.

 o reset
 public void reset()
Sets initial values for time and rate

 o calculatePreferredSize
 public void calculatePreferredSize()
Set the preferred size to be the max width x max height of all of the ImageIcons

 o setMediaTime
 public void setMediaTime(long nanoseconds)
Sets the offset in nanoseconds from the beginning of the video. If the video is started, the player is stopped and restarted.

 o getNanoseconds
 public long getNanoseconds()
Gets the current video time in nanoseconds.

 o setSeconds
 public void setSeconds(double seconds)
Sets the offset in seconds from the beginning of the video. If the video is started, the player is stopped and restarted.

 o getSeconds
 public double getSeconds()
Gets the current video time in seconds.

 o getDuration
 public long getDuration()
Gets the duration of the video in nanoseconds.

 o start
 public synchronized void start()
Starts the display of the video.

 o setRate
 public float setRate(float rate)
Sets the rate of the video.

Parameters:
rate - The desired rate
Returns:
The actual rate set. This will not be different from the desired rate unless the desired rate is zero. In that case no new rate is set and setRate() returns the current rate.
 o getRate
 public float getRate()
Gets the current rate.

 o stop
 public synchronized void stop()
Stops the display of the video.

 o run
 public void run()
Run by the thread that displays the video.

 o endOfMedia
 public boolean endOfMedia()
Checks to see if the end of the video has been reached. If the rate is negative, the end of the video is at the beginning (0).

 o getPreferredSize
 public Dimension getPreferredSize()
Return the dimension of the largest image.

Overrides:
getPreferredSize in class JComponent
 o setImageSize
 public void setImageSize(Dimension d)
Sets the preferred size of the video component. Call calculatePreferredSize() to reset the preferred size based on the size of the images displayed.


All Packages  Class Hierarchy  This Package  Previous  Next  Index