org.opensourcephysics.tools
Class VideoCaptureTool

java.lang.Object
  extended by org.opensourcephysics.tools.VideoCaptureTool
All Implemented Interfaces:
java.rmi.Remote, Tool, VideoTool
Direct Known Subclasses:
VideoGrabber

public class VideoCaptureTool
extends java.lang.Object
implements Tool, VideoTool

A video capture tool. This simply forwards jobs to the media tool.

Version:
1.0
Author:
Douglas Brown

Constructor Summary
VideoCaptureTool()
          Public constructor.
 
Method Summary
 boolean addFrame(java.awt.image.BufferedImage image)
          Adds a frame to the video if it is recording.
 boolean canCapture()
          Determines whether this tool is functional.
 void clear()
          Clear the video from the tool in preparation for a new video.
static VideoCaptureTool getTool()
          Gets the shared Tool.
 boolean isRecording()
          Gets the recording flag.
 boolean isVisible()
          Gets the visibility.
 void send(Job job, Tool replyTo)
          Adds frame specified by image file path.
 void setFrameRate(double fps)
          Sets the frame rate.
 void setRecording(boolean record)
          Sets the recording flag.
 void setVideoType(VideoType type)
          Sets the video type.
 void setVisible(boolean visible)
          Sets the visibility.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VideoCaptureTool

public VideoCaptureTool()
Public constructor.

Method Detail

addFrame

public boolean addFrame(java.awt.image.BufferedImage image)
Adds a frame to the video if it is recording.

Specified by:
addFrame in interface VideoTool
Parameters:
image - the frame to be added
Returns:
true if frame was added

clear

public void clear()
Clear the video from the tool in preparation for a new video.

Specified by:
clear in interface VideoTool

setRecording

public void setRecording(boolean record)
Sets the recording flag.

Parameters:
record - true to record rendered images

isRecording

public boolean isRecording()
Gets the recording flag.

Specified by:
isRecording in interface VideoTool
Returns:
true if recording rendered images

setVisible

public void setVisible(boolean visible)
Sets the visibility.

Specified by:
setVisible in interface VideoTool
Parameters:
visible - true to set this visible

isVisible

public boolean isVisible()
Gets the visibility.

Returns:
true if visible

canCapture

public boolean canCapture()
Determines whether this tool is functional.

Returns:
true if media capture is available

setVideoType

public void setVideoType(VideoType type)
Sets the video type.

Parameters:
type - the video type

setFrameRate

public void setFrameRate(double fps)
Sets the frame rate.

Parameters:
fps - the frame rate in frames per second

send

public void send(Job job,
                 Tool replyTo)
          throws java.rmi.RemoteException
Adds frame specified by image file path.

Specified by:
send in interface Tool
Parameters:
job - the job
replyTo - the tool to reply to
Throws:
java.rmi.RemoteException

getTool

public static VideoCaptureTool getTool()
Gets the shared Tool.

Returns:
the shared VideoCaptureTool