|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 Drawable
draw
in class VideoAdapter
panel
- the drawing panel requesting the drawingg
- the graphics context on which to drawprotected void finalize()
finalize
in class VideoAdapter
public void play()
play
in interface Playable
play
in class VideoAdapter
public void stop()
stop
in interface Playable
stop
in class VideoAdapter
public void setFrameNumber(int n)
setFrameNumber
in interface Video
setFrameNumber
in class VideoAdapter
n
- the desired frame numberVideo.getStartFrameNumber()
,
Video.getEndFrameNumber()
public double getFrameTime(int n)
getFrameTime
in interface Video
getFrameTime
in class VideoAdapter
n
- the frame number
public double getTime()
getTime
in interface Playable
getTime
in class VideoAdapter
public void setTime(double millis)
setTime
in interface Playable
setTime
in class VideoAdapter
millis
- the desired time in millisecondspublic double getStartTime()
getStartTime
in interface Playable
getStartTime
in class VideoAdapter
public void setStartTime(double millis)
setStartTime
in interface Playable
setStartTime
in class VideoAdapter
millis
- the desired start time in millisecondspublic double getEndTime()
getEndTime
in interface Playable
getEndTime
in class VideoAdapter
public void setEndTime(double millis)
setEndTime
in interface Playable
setEndTime
in class VideoAdapter
millis
- the desired end time in millisecondspublic double getDuration()
getDuration
in interface Playable
getDuration
in class VideoAdapter
protected void load(java.lang.String gifName) throws java.io.IOException
gifName
- the gif image name
java.io.IOException
public static XML.ObjectLoader getLoader()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |