org.opensourcephysics.media.core
Class VideoGrabber

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

public class VideoGrabber
extends VideoCaptureTool

A video capture utility using media classes.

Version:
1.0
Author:
Douglas Brown

Constructor Summary
VideoGrabber()
          Constructor.
VideoGrabber(java.awt.Dimension dim)
          Constructor.
 
Method Summary
 boolean addFrame(java.awt.image.BufferedImage image)
          Adds a frame to the video if it is recording.
 void clear()
          Clear the video from the tool in preparation for a new video.
protected  void createActions()
          Creates the actions.
protected  void createGUI()
          Creates the GUI.
static VideoCaptureTool getTool()
          Gets the shared VideoGrabber.
static VideoCaptureTool getTool(java.awt.Dimension dim)
          Gets the shared VideoGrabber.
 boolean isRecording()
          Gets the recording flag.
 boolean isVisible()
          Gets the visibility.
protected  void refreshGUI()
          Refreshes the GUI.
 void setFrameRate(int 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 org.opensourcephysics.tools.VideoCaptureTool
canCapture, send
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VideoGrabber

public VideoGrabber()
Constructor.


VideoGrabber

public VideoGrabber(java.awt.Dimension dim)
Constructor.

Method Detail

getTool

public static VideoCaptureTool getTool()
Gets the shared VideoGrabber.

Returns:
the shared VideoGrabber

getTool

public static VideoCaptureTool getTool(java.awt.Dimension dim)
Gets the shared VideoGrabber.

Returns:
the shared VideoGrabber

clear

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

Specified by:
clear in interface VideoTool
Overrides:
clear in class VideoCaptureTool

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
Overrides:
addFrame in class VideoCaptureTool
Parameters:
image - the frame to be added
Returns:
true if frame was added

setVisible

public void setVisible(boolean visible)
Sets the visibility.

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

isVisible

public boolean isVisible()
Gets the visibility.

Overrides:
isVisible in class VideoCaptureTool
Returns:
true if visible

setRecording

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

Overrides:
setRecording in class VideoCaptureTool
Parameters:
record - true to record rendered images

isRecording

public boolean isRecording()
Gets the recording flag.

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

setVideoType

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

Overrides:
setVideoType in class VideoCaptureTool
Parameters:
type - the video type

setFrameRate

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

Overrides:
setFrameRate in class VideoCaptureTool
Parameters:
fps - the frame rate in frames per second

createGUI

protected void createGUI()
Creates the GUI.


createActions

protected void createActions()
Creates the actions.


refreshGUI

protected void refreshGUI()
Refreshes the GUI.