java.beans.PropertyChangeListener, java.util.EventListener, Drawable, Interactive, Measurable, DrawableImage, InteractiveImage, Playable, Trackable, VideoGifVideo, ImageVideopublic class VideoAdapter extends java.lang.Object implements Video
| Modifier and Type | Field | Description |
|---|---|---|
protected DoubleArray |
aspects |
|
protected java.awt.image.BufferedImage |
bufferedImage |
|
protected java.awt.image.Raster |
clearRaster |
|
protected ImageCoordSystem |
coords |
|
protected int |
endFrameNumber |
|
protected java.awt.image.BufferedImage |
filteredImage |
|
protected FilterStack |
filterStack |
|
protected int |
frameCount |
|
protected int |
frameNumber |
|
protected boolean |
isMeasured |
|
protected boolean |
isValidFilteredImage |
|
protected boolean |
isValidImage |
|
protected boolean |
isValidMeasure |
|
protected boolean |
looping |
|
protected double |
maxX |
|
protected double |
maxY |
|
protected double |
minX |
|
protected double |
minY |
|
protected boolean |
mouseEnabled |
|
protected boolean |
playing |
|
protected java.util.HashMap<java.lang.String,java.lang.Object> |
properties |
|
protected double |
rate |
|
protected java.awt.Image |
rawImage |
|
protected java.awt.Dimension |
size |
|
protected int |
startFrameNumber |
|
protected java.beans.PropertyChangeSupport |
support |
|
protected boolean |
visible |
|
protected boolean |
widthDominates |
| Modifier | Constructor | Description |
|---|---|---|
protected |
VideoAdapter() |
Protected constructor creates an empty VideoAdapter
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener) |
Adds a PropertyChangeListener to this video.
|
void |
addPropertyChangeListener(java.lang.String property,
java.beans.PropertyChangeListener listener) |
Adds a PropertyChangeListener to this video.
|
void |
back() |
Steps the video back one frame.
|
void |
dispose() |
Disposes of this video.
|
void |
draw(DrawingPanel panel,
java.awt.Graphics g) |
Draws the video image on the panel.
|
protected void |
finalize() |
|
Interactive |
findInteractive(DrawingPanel panel,
int xpix,
int ypix) |
Returns this video if enabled.
|
protected void |
findMinMaxValues() |
Finds the min and max values of x and y.
|
protected void |
firePropertyChange(java.lang.String property,
java.lang.Object oldVal,
java.lang.Object newVal) |
Sends a PropertyChangeEvent to registered listeners.
|
double |
getAngle() |
Gets the angle in radians of the curent video frame measured ccw
from the world x-axis.
|
ImageCoordSystem |
getCoords() |
Gets the image coordinate system.
|
double |
getDuration() |
Gets the duration of the video.
|
int |
getEndFrameNumber() |
Gets the end frame number.
|
double |
getEndTime() |
Gets the end time in milliseconds.
|
FilterStack |
getFilterStack() |
Gets the filter stack.
|
int |
getFrameCount() |
Gets the total number of video frames.
|
double |
getFrameDuration(int n) |
Gets the duration of the specified frame in milliseconds.
|
int |
getFrameNumber() |
Gets the current video frame number.
|
double |
getFrameTime(int n) |
Gets the start time of the specified frame in milliseconds.
|
double |
getHeight() |
Gets the current height of the video frame.
|
java.awt.image.BufferedImage |
getImage() |
Gets the current video image after applying enabled filters.
|
java.lang.Object |
getProperty(java.lang.String name) |
Gets a user property of the video.
|
java.util.Collection<java.lang.String> |
getPropertyNames() |
Gets a collection of user property names for the video.
|
double |
getRate() |
Gets the relative play rate.
|
double |
getRelativeAspect() |
Gets the relative aspect of the current video frame.
|
int |
getStartFrameNumber() |
Gets the start frame number.
|
double |
getStartTime() |
Gets the start time in milliseconds.
|
double |
getTime() |
Gets the current video time in milliseconds.
|
double |
getWidth() |
Gets the current width of the video frame.
|
double |
getX() |
Gets x position of upper left corner of the current video frame
in world units.
|
double |
getXMax() |
Gets the maximum x needed to draw this object.
|
double |
getXMin() |
Gets the minimum x needed to draw this object.
|
double |
getY() |
Gets y position of upper left corner of the current video frame
in world units.
|
double |
getYMax() |
Gets the maximum y needed to draw this object.
|
double |
getYMin() |
Gets the minimum y needed to draw this object.
|
void |
goToEnd() |
Sets the frame number to the end frame.
|
void |
goToStart() |
Sets the frame number to the start frame.
|
protected void |
initialize() |
Initialize this video.
|
boolean |
isEnabled() |
Gets whether this responds to mouse hits.
|
boolean |
isLooping() |
Gets the looping state of the video.
|
boolean |
isMeasured() |
Reports whether information is available to set min/max values.
|
boolean |
isPlaying() |
Gets the playing state of this video.
|
boolean |
isVisible() |
Gets the visibility of the video.
|
void |
play() |
Plays the video at the current rate.
|
void |
propertyChange(java.beans.PropertyChangeEvent e) |
Responds to property change events.
|
protected void |
refreshBufferedImage() |
Refreshes the BufferedImage based on current size.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener) |
Removes a PropertyChangeListener from this video.
|
void |
removePropertyChangeListener(java.lang.String property,
java.beans.PropertyChangeListener listener) |
Removes a PropertyChangeListener for a specified property.
|
void |
reset() |
Stops the video and resets it to the start time.
|
void |
setAngle(double theta) |
Sets the angle in radians of all video frames measured ccw
from the world x-axis.
|
void |
setCoords(ImageCoordSystem coords) |
Sets the image coordinate system used to convert from
imagespace to worldspace.
|
void |
setEnabled(boolean enabled) |
Sets whether this responds to mouse hits.
|
void |
setEndFrameNumber(int n) |
Sets the end frame number.
|
void |
setEndTime(double millis) |
Sets the end time in milliseconds.
|
void |
setFilterStack(FilterStack stack) |
Sets the filter stack.
|
void |
setFrameAngle(int n,
double theta) |
Sets the angle in radians of the specified video frame measured ccw
from the world x-axis.
|
void |
setFrameHeight(int n,
double height) |
Sets the height of the specified video frame in world units.
|
void |
setFrameNumber(int n) |
Sets the video frame number.
|
void |
setFrameRelativeAspect(int n,
double relativeAspect) |
Sets the relative aspect of the specified video frame.
|
void |
setFrameWidth(int n,
double width) |
Sets the width of the specified video frame in world units.
|
void |
setFrameX(int n,
double x) |
Sets x position of upper left corner of the specified video frame
in world units.
|
void |
setFrameXY(int n,
double x,
double y) |
Sets the x and y position of the UL corner of the specified video
frame in world units.
|
void |
setFrameY(int n,
double y) |
Sets y position of upper left corner of the specified video frame
in world units.
|
void |
setHeight(double height) |
Sets the height of all video frames in world units.
|
void |
setLooping(boolean loops) |
Sets the looping state of this video.
|
void |
setPlaying(boolean playing) |
Starts and stops the video.
|
void |
setProperty(java.lang.String name,
java.lang.Object value) |
Sets a user property of the video.
|
void |
setRate(double rate) |
Sets the relative play rate.
|
void |
setRelativeAspect(double relativeAspect) |
Sets the relative aspect of all video frames.
|
void |
setStartFrameNumber(int n) |
Sets the start frame number.
|
void |
setStartTime(double millis) |
Sets the start time in milliseconds.
|
void |
setTime(double millis) |
Sets the video time in milliseconds.
|
void |
setVisible(boolean visible) |
Shows or hides the video.
|
void |
setWidth(double width) |
Sets the width of all video frames in world units.
|
void |
setX(double x) |
Sets x position of upper left corner of all video frames
in world units.
|
void |
setXY(double x,
double y) |
Sets the x and y position of the UL corner of all video frames
in world units.
|
void |
setY(double y) |
Sets y position of upper left corner of all video frames
in world units.
|
void |
step() |
Steps the video forward one frame.
|
void |
stop() |
Stops the video.
|
protected java.awt.Image rawImage
protected java.awt.Dimension size
protected java.awt.image.BufferedImage bufferedImage
protected java.awt.image.BufferedImage filteredImage
protected int frameCount
protected int frameNumber
protected int startFrameNumber
protected int endFrameNumber
protected double rate
protected boolean playing
protected boolean looping
protected double minX
protected double maxX
protected double minY
protected double maxY
protected boolean mouseEnabled
protected boolean visible
protected boolean isMeasured
protected boolean isValidMeasure
protected boolean widthDominates
protected boolean isValidImage
protected boolean isValidFilteredImage
protected ImageCoordSystem coords
protected DoubleArray aspects
protected java.beans.PropertyChangeSupport support
protected java.util.HashMap<java.lang.String,java.lang.Object> properties
protected FilterStack filterStack
protected java.awt.image.Raster clearRaster
protected VideoAdapter()
public void draw(DrawingPanel panel, java.awt.Graphics g)
public void setVisible(boolean visible)
setVisible in interface DrawableImagevisible - true to show the videopublic boolean isVisible()
isVisible in interface DrawableImagetrue if the video is visiblepublic double getXMin()
getXMin in interface Measurablepublic double getXMax()
getXMax in interface Measurablepublic double getYMin()
getYMin in interface Measurablepublic double getYMax()
getYMax in interface Measurablepublic boolean isMeasured()
isMeasured in interface Measurabletrue if min/max values are validpublic java.awt.image.BufferedImage getImage()
getImage in interface DrawableImagepublic Interactive findInteractive(DrawingPanel panel, int xpix, int ypix)
findInteractive in interface Interactivepanel - the drawing panelxpix - the x coordinate in pixelsypix - the y coordinate in pixelspublic void setEnabled(boolean enabled)
setEnabled in interface Interactiveenabled - true if this responds to mouse hits.public boolean isEnabled()
isEnabled in interface Interactivetrue if this responds to mouse hits.public void setFrameX(int n,
double x)
public void setX(double x)
setX in interface Interactivex - the world x positionpublic void setFrameY(int n,
double y)
public void setY(double y)
setY in interface Interactivey - the world y positionpublic double getX()
getX in interface Interactivepublic double getY()
getY in interface Interactivepublic void setFrameXY(int n,
double x,
double y)
setFrameXY in interface Videon - the video frame numberx - the world x positiony - the world y positionpublic void setXY(double x,
double y)
setXY in interface Interactivex - the world x positiony - the world y positionpublic void setFrameRelativeAspect(int n,
double relativeAspect)
setFrameRelativeAspect in interface Videon - the video frame numberrelativeAspect - the desired relative aspectpublic void setRelativeAspect(double relativeAspect)
setRelativeAspect in interface InteractiveImagerelativeAspect - the desired relative aspectpublic double getRelativeAspect()
getRelativeAspect in interface InteractiveImageInteractiveImage.setRelativeAspect(double)public void setFrameWidth(int n,
double width)
setFrameWidth in interface Videon - the video frame numberwidth - the width in world unitssetRelativeAspect(double)public void setWidth(double width)
setWidth in interface InteractiveImagewidth - the width in world unitssetRelativeAspect(double)public double getWidth()
getWidth in interface InteractiveImagepublic void setFrameHeight(int n,
double height)
setFrameHeight in interface Videon - the video frame numberheight - the height in world unitssetRelativeAspect(double)public void setHeight(double height)
setHeight in interface InteractiveImageheight - the height in world unitssetRelativeAspect(double)public double getHeight()
getHeight in interface InteractiveImagepublic void setFrameAngle(int n,
double theta)
setFrameAngle in interface Videon - the video frame numbertheta - the angle in radianspublic void setAngle(double theta)
setAngle in interface InteractiveImagetheta - the angle in radianspublic double getAngle()
getAngle in interface InteractiveImagepublic int getFrameCount()
getFrameCount in interface Videopublic int getFrameNumber()
getFrameNumber in interface Videopublic void setFrameNumber(int n)
setFrameNumber in interface Videon - the desired frame numberVideo.getStartFrameNumber(),
Video.getEndFrameNumber()public int getStartFrameNumber()
getStartFrameNumber in interface VideogetEndFrameNumber()public void setStartFrameNumber(int n)
setStartFrameNumber in interface Videon - the desired start frame numbersetEndFrameNumber(int)public int getEndFrameNumber()
getEndFrameNumber in interface VideogetStartFrameNumber()public void setEndFrameNumber(int n)
setEndFrameNumber in interface Videon - the desired end frame number,setStartFrameNumber(int)public double getFrameTime(int n)
getFrameTime in interface Videon - the frame numberpublic double getFrameDuration(int n)
getFrameDuration in interface Videon - the frame numberpublic void play()
public void reset()
public double getTime()
public void setTime(double millis)
public double getStartTime()
getStartTime in interface Playablepublic void setStartTime(double millis)
setStartTime in interface Playablemillis - the desired start time in millisecondspublic double getEndTime()
getEndTime in interface Playablepublic void setEndTime(double millis)
setEndTime in interface Playablemillis - the desired end time in millisecondspublic double getDuration()
getDuration in interface Playablepublic void goToStart()
public void goToEnd()
public void setPlaying(boolean playing)
setPlaying in interface Playableplaying - true starts the video, and
false stops itpublic boolean isPlaying()
public void setLooping(boolean loops)
setLooping in interface Playableloops - true if the video loopspublic boolean isLooping()
public void setRate(double rate)
public double getRate()
public void setCoords(ImageCoordSystem coords)
setCoords in interface InteractiveImagecoords - the image coordinate systempublic ImageCoordSystem getCoords()
getCoords in interface InteractiveImagepublic void setFilterStack(FilterStack stack)
setFilterStack in interface DrawableImagestack - the new filter stackpublic FilterStack getFilterStack()
getFilterStack in interface DrawableImagepublic void setProperty(java.lang.String name,
java.lang.Object value)
setProperty in interface DrawableImagename - the name of the propertyvalue - the value of the propertypublic java.lang.Object getProperty(java.lang.String name)
getProperty in interface DrawableImagename - the name of the propertypublic java.util.Collection<java.lang.String> getPropertyNames()
getPropertyNames in interface DrawableImagepublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener in interface Playablelistener - the object requesting property change notificationpublic void addPropertyChangeListener(java.lang.String property,
java.beans.PropertyChangeListener listener)
addPropertyChangeListener in interface Playableproperty - the name of the property of interest to the listenerlistener - the object requesting property change notificationpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener in interface Playablelistener - the listener requesting removalpublic void removePropertyChangeListener(java.lang.String property,
java.beans.PropertyChangeListener listener)
removePropertyChangeListener in interface Playableproperty - the name of the propertylistener - the listener to removepublic void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange in interface java.beans.PropertyChangeListenere - the property change eventprotected void firePropertyChange(java.lang.String property,
java.lang.Object oldVal,
java.lang.Object newVal)
property - the name of the property that has changedoldVal - the value of the property before the change (may be null)newVal - the value of the property after the change (may be null)protected void finalize()
finalize in class java.lang.Objectprotected void initialize()
protected void refreshBufferedImage()
protected void findMinMaxValues()