org.opensourcephysics.media.core
Class VideoClip

java.lang.Object
  extended by org.opensourcephysics.media.core.VideoClip

public class VideoClip
extends java.lang.Object

This defines a subset of video frames called steps.

Version:
1.0
Author:
Douglas Brown

Field Summary
 boolean playAllSteps
           
protected  Video video
           
 
Constructor Summary
VideoClip(Video video)
          Constructs a VideoClip.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a PropertyChangeListener to this video clip.
 void addPropertyChangeListener(java.lang.String property, java.beans.PropertyChangeListener listener)
          Adds a PropertyChangeListener to this video clip.
 int frameToStep(int n)
          Converts frame number to step number.
 ClipInspector getClipInspector()
          Gets the clip inspector.
 ClipInspector getClipInspector(ClipControl control, java.awt.Frame frame)
          Gets the clip inspector with access to the specified ClipControl.
 ClipInspector getClipInspector(java.awt.Frame frame)
          Gets the clip inspector.
 int getEndFrameNumber()
          Gets the end frame number.
static XML.ObjectLoader getLoader()
          Returns an XML.ObjectLoader to save and load data for this class.
 int getStartFrameNumber()
          Gets the start frame number.
 double getStartTime()
          Gets the start time.
 int getStepCount()
          Gets the step count.
 int getStepSize()
          Gets the step size.
 Video getVideo()
          Gets the video.
 void hideClipInspector()
          Hides the clip inspector.
 boolean includesFrame(int n)
          Determines whether the specified frame is a step frame.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a PropertyChangeListener from this video clip.
 void removePropertyChangeListener(java.lang.String property, java.beans.PropertyChangeListener listener)
          Removes a PropertyChangeListener for a specified property.
 void setEndFrameNumber(int end)
          Sets the end frame number.
 void setStartFrameNumber(int start)
          Sets the start frame number.
 void setStartTime(double t0)
          Sets the start time.
 void setStepCount(int count)
          Sets the step count.
 void setStepSize(int size)
          Sets the step size.
 int stepToFrame(int stepNumber)
          Converts step number to frame number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

video

protected Video video

playAllSteps

public boolean playAllSteps
Constructor Detail

VideoClip

public VideoClip(Video video)
Constructs a VideoClip.

Parameters:
video - the video
Method Detail

getVideo

public Video getVideo()
Gets the video.

Returns:
the video

setStartFrameNumber

public void setStartFrameNumber(int start)
Sets the start frame number.

Parameters:
start - the desired start frame number

getStartFrameNumber

public int getStartFrameNumber()
Gets the start frame number.

Returns:
the start frame number

setStepSize

public void setStepSize(int size)
Sets the step size.

Parameters:
size - the desired step size

getStepSize

public int getStepSize()
Gets the step size.

Returns:
the step size

setStepCount

public void setStepCount(int count)
Sets the step count.

Parameters:
count - the desired number of steps

getStepCount

public int getStepCount()
Gets the step count.

Returns:
the number of steps

setStartTime

public void setStartTime(double t0)
Sets the start time.

Parameters:
t0 - the start time in milliseconds

getStartTime

public double getStartTime()
Gets the start time.

Returns:
the start time in milliseconds

getEndFrameNumber

public int getEndFrameNumber()
Gets the end frame number.

Returns:
the end frame

setEndFrameNumber

public void setEndFrameNumber(int end)
Sets the end frame number.

Parameters:
end - the desired end frame

stepToFrame

public int stepToFrame(int stepNumber)
Converts step number to frame number.

Parameters:
stepNumber - the step number
Returns:
the frame number

frameToStep

public int frameToStep(int n)
Converts frame number to step number. A frame number that falls between two steps maps to the previous step.

Parameters:
n - the frame number
Returns:
the step number

includesFrame

public boolean includesFrame(int n)
Determines whether the specified frame is a step frame.

Parameters:
n - the frame number
Returns:
true if the frame is a step frame

getClipInspector

public ClipInspector getClipInspector()
Gets the clip inspector.

Returns:
the clip inspector

getClipInspector

public ClipInspector getClipInspector(java.awt.Frame frame)
Gets the clip inspector.

Parameters:
frame - the owner of the inspector
Returns:
the clip inspector

getClipInspector

public ClipInspector getClipInspector(ClipControl control,
                                      java.awt.Frame frame)
Gets the clip inspector with access to the specified ClipControl.

Parameters:
control - the clip control
frame - the owner of the inspector
Returns:
the clip inspector

hideClipInspector

public void hideClipInspector()
Hides the clip inspector.


addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to this video clip.

Parameters:
listener - the object requesting property change notification

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String property,
                                      java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to this video clip.

Parameters:
property - the name of the property of interest to the listener
listener - the object requesting property change notification

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener from this video clip.

Parameters:
listener - the listener requesting removal

removePropertyChangeListener

public void removePropertyChangeListener(java.lang.String property,
                                         java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener for a specified property.

Parameters:
property - the name of the property
listener - the listener to remove

getLoader

public static XML.ObjectLoader getLoader()
Returns an XML.ObjectLoader to save and load data for this class.

Returns:
the object loader