|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensourcephysics.media.core.VideoAdapter
org.opensourcephysics.media.gif.GifVideo
public class GifVideo
This is a video that wraps an animated gif image.
| Field Summary | |
|---|---|
protected GifDecoder |
decoder
|
protected int[] |
startTimes
|
| Fields inherited from class org.opensourcephysics.media.core.VideoAdapter |
|---|
aspects, bufferedImage, clearRaster, coords, endFrameNumber, filteredImage, filterStack, frameCount, frameNumber, isMeasured, isValidFilteredImage, isValidImage, isValidMeasure, looping, maxX, maxY, minX, minY, mouseEnabled, playing, properties, rate, rawImage, size, startFrameNumber, support, visible, widthDominates |
| Constructor Summary | |
|---|---|
GifVideo(java.lang.String gifName)
Creates a GifVideo and loads a gif image specified by name |
|
| Method Summary | |
|---|---|
void |
draw(DrawingPanel panel,
java.awt.Graphics g)
Draws the video image on the panel. |
protected void |
finalize()
Called by the garbage collector when this video is no longer in use. |
double |
getDuration()
Gets the duration of the video. |
double |
getEndTime()
Gets the end time in milliseconds. |
double |
getFrameTime(int n)
Gets the start time of the specified frame in milliseconds. |
static XML.ObjectLoader |
getLoader()
Returns an XML.ObjectLoader to save and load GifVideo data. |
double |
getStartTime()
Gets the start time in milliseconds. |
double |
getTime()
Gets the current video time in milliseconds. |
protected void |
load(java.lang.String gifName)
Loads a gif image specified by name. |
void |
play()
Plays the video at the current rate. |
void |
setEndTime(double millis)
Sets the end time in milliseconds. |
void |
setFrameNumber(int n)
Overrides ImageVideo setFrameNumber method. |
void |
setStartTime(double millis)
Sets the start time in milliseconds. |
void |
setTime(double millis)
Sets the video time in milliseconds. |
void |
stop()
Stops the video. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected GifDecoder decoder
protected int[] startTimes
| Constructor Detail |
|---|
public GifVideo(java.lang.String gifName)
throws java.io.IOException
gifName - the name of the image file
java.io.IOException| Method Detail |
|---|
public void draw(DrawingPanel panel,
java.awt.Graphics g)
draw in interface Drawabledraw in class VideoAdapterpanel - the drawing panel requesting the drawingg - the graphics context on which to drawprotected void finalize()
finalize in class VideoAdapterpublic void play()
play in interface Playableplay in class VideoAdapterpublic void stop()
stop in interface Playablestop in class VideoAdapterpublic void setFrameNumber(int n)
setFrameNumber in interface VideosetFrameNumber in class VideoAdaptern - the desired frame numberVideo.getStartFrameNumber(),
Video.getEndFrameNumber()public double getFrameTime(int n)
getFrameTime in interface VideogetFrameTime in class VideoAdaptern - the frame number
public double getTime()
getTime in interface PlayablegetTime in class VideoAdapterpublic void setTime(double millis)
setTime in interface PlayablesetTime in class VideoAdaptermillis - the desired time in millisecondspublic double getStartTime()
getStartTime in interface PlayablegetStartTime in class VideoAdapterpublic void setStartTime(double millis)
setStartTime in interface PlayablesetStartTime in class VideoAdaptermillis - the desired start time in millisecondspublic double getEndTime()
getEndTime in interface PlayablegetEndTime in class VideoAdapterpublic void setEndTime(double millis)
setEndTime in interface PlayablesetEndTime in class VideoAdaptermillis - the desired end time in millisecondspublic double getDuration()
getDuration in interface PlayablegetDuration in class VideoAdapter
protected void load(java.lang.String gifName)
throws java.io.IOException
gifName - the gif image name
java.io.IOExceptionpublic static XML.ObjectLoader getLoader()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||