java.beans.PropertyChangeListener, java.util.EventListener, Drawable, Interactive, Measurable, DrawableImage, InteractiveImage, Playable, Trackable, Videopublic class ImageVideo extends VideoAdapter
| Modifier and Type | Field | Description |
|---|---|---|
protected double |
deltaT |
|
protected java.awt.image.BufferedImage[] |
images |
|
protected java.awt.Component |
observer |
|
protected java.lang.String[] |
paths |
|
protected boolean |
readOnly |
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 | Description |
|---|---|
ImageVideo(java.awt.Image image) |
Creates an ImageVideo from an image.
|
ImageVideo(java.awt.Image[] images) |
Creates an ImageVideo from an image array.
|
ImageVideo(java.lang.String imageName) |
Creates an ImageVideo and loads a named image or image sequence.
|
ImageVideo(java.lang.String imageName,
boolean sequence) |
Creates an ImageVideo and loads a named image or image sequence.
|
ImageVideo(java.lang.String imageName,
boolean sequence,
boolean fileBased) |
Creates an ImageVideo and loads a named image or image sequence.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
append(java.lang.String imageName) |
Appends the named image or image sequence to the end of this video.
|
void |
append(java.lang.String imageName,
boolean sequence) |
Appends the named image or image sequence to the end of this video.
|
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.
|
java.awt.Image[] |
getImages() |
Gets the image array.
|
static XML.ObjectLoader |
getLoader() |
Returns an XML.ObjectLoader to save and load ImageVideo data.
|
java.awt.Dimension |
getSize() |
Gets the size of this video.
|
double |
getStartTime() |
Gets the start time in milliseconds.
|
double |
getTime() |
Gets the current video time in milliseconds.
|
java.lang.String[] |
getValidPaths() |
Returns the valid paths (i.e., those that are not "").
|
protected java.lang.String[] |
getValidPathsRelativeTo(java.lang.String base) |
Returns the valid paths (i.e., those that are not "") relative to a bae path.
|
protected void |
insert(java.awt.Image[] newImages,
int index,
java.lang.String[] imagePaths) |
Inserts images starting at the specified index.
|
void |
insert(java.awt.Image image,
int index) |
Inserts an image at the specified index.
|
void |
insert(java.lang.String imageName,
int index) |
Inserts the named image or image sequence at the specified index.
|
void |
insert(java.lang.String imageName,
int index,
boolean sequence) |
Inserts the named image or image sequence at the specified index.
|
boolean |
isEditable() |
Returns true if all images are loaded into memory.
|
boolean |
isFileBased() |
Returns true if all of the images are associated with files.
|
java.lang.String |
remove(int index) |
Removes the image at the specified index.
|
boolean |
saveInvalidImages() |
Allows user to save invalid images, if any.
|
void |
setEditable(boolean edit) |
Sets the editable property.
|
void |
setEndTime(double millis) |
Sets the end time in milliseconds.
|
void |
setFrameDuration(double millis) |
Sets the frame duration in milliseconds.
|
void |
setFrameNumber(int n) |
Overrides VideoAdapter setFrameNumber method.
|
void |
setStartTime(double millis) |
Sets the start time in milliseconds.
|
void |
setTime(double millis) |
Sets the video time in milliseconds.
|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddPropertyChangeListener, addPropertyChangeListener, back, dispose, draw, finalize, findInteractive, findMinMaxValues, firePropertyChange, getAngle, getCoords, getEndFrameNumber, getFilterStack, getFrameCount, getFrameDuration, getFrameNumber, getHeight, getImage, getProperty, getPropertyNames, getRate, getRelativeAspect, getStartFrameNumber, getWidth, getX, getXMax, getXMin, getY, getYMax, getYMin, goToEnd, goToStart, initialize, isEnabled, isLooping, isMeasured, isPlaying, isVisible, play, propertyChange, refreshBufferedImage, removePropertyChangeListener, removePropertyChangeListener, reset, setAngle, setCoords, setEnabled, setEndFrameNumber, setFilterStack, setFrameAngle, setFrameHeight, setFrameRelativeAspect, setFrameWidth, setFrameX, setFrameXY, setFrameY, setHeight, setLooping, setPlaying, setProperty, setRate, setRelativeAspect, setStartFrameNumber, setVisible, setWidth, setX, setXY, setY, step, stopprotected java.awt.Component observer
protected java.awt.image.BufferedImage[] images
protected java.lang.String[] paths
protected boolean readOnly
protected double deltaT
public ImageVideo(java.lang.String imageName)
throws java.io.IOException
imageName - the name of the image filejava.io.IOExceptionpublic ImageVideo(java.lang.String imageName,
boolean sequence)
throws java.io.IOException
imageName - the name of the image filesequence - true to automatically load image sequence, if anyjava.io.IOExceptionpublic ImageVideo(java.lang.String imageName,
boolean sequence,
boolean fileBased)
throws java.io.IOException
imageName - the name of the image filesequence - true to automatically load image sequence, if anyfileBased - true if images will be loaded from files only as neededjava.io.IOExceptionpublic ImageVideo(java.awt.Image image)
image - the imagepublic ImageVideo(java.awt.Image[] images)
images - the image arraypublic void setFrameNumber(int n)
setFrameNumber in interface VideosetFrameNumber in class VideoAdaptern - the desired frame numberVideo.getStartFrameNumber(),
Video.getEndFrameNumber()public double getTime()
getTime in interface PlayablegetTime in class VideoAdapterpublic void setFrameDuration(double millis)
millis - the desired frame duration in millisecondspublic 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 VideoAdapterpublic double getFrameTime(int n)
getFrameTime in interface VideogetFrameTime in class VideoAdaptern - the frame numberpublic java.awt.Image[] getImages()
public void append(java.lang.String imageName)
throws java.io.IOException
imageName - the image namejava.io.IOExceptionpublic void append(java.lang.String imageName,
boolean sequence)
throws java.io.IOException
imageName - the image namesequence - true to automatically load image sequence, if anyjava.io.IOExceptionpublic void insert(java.lang.String imageName,
int index)
throws java.io.IOException
imageName - the image nameindex - the indexjava.io.IOExceptionpublic void insert(java.lang.String imageName,
int index,
boolean sequence)
throws java.io.IOException
imageName - the image nameindex - the indexsequence - true to automatically load image sequence, if anyjava.io.IOExceptionpublic void insert(java.awt.Image image,
int index)
image - the imageindex - the indexpublic java.lang.String remove(int index)
index - the indexpublic java.awt.Dimension getSize()
public boolean isFileBased()
public boolean isEditable()
public void setEditable(boolean edit)
throws java.io.IOException
edit - true to editjava.io.IOExceptionpublic boolean saveInvalidImages()
public java.lang.String[] getValidPaths()
protected java.lang.String[] getValidPathsRelativeTo(java.lang.String base)
base - a base pathprotected void insert(java.awt.Image[] newImages,
int index,
java.lang.String[] imagePaths)
newImages - an array of imagesindex - the insertion indeximagePaths - array of image file paths.public static XML.ObjectLoader getLoader()