|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensourcephysics.media.core.VideoIO
public class VideoIO
This provides static methods for managing video and text input/output.
| Nested Class Summary | |
|---|---|
static class |
VideoIO.StreamPiper
|
protected static class |
VideoIO.VideoEnginePanel
A JPanel for setting a preferred video engine when opening a video. |
| Field Summary | |
|---|---|
protected static boolean |
canceled
|
protected static javax.swing.JFileChooser |
chooser
|
protected static java.lang.String |
defaultXMLExt
|
protected static javax.swing.filechooser.FileFilter |
imageFileFilter
|
static boolean |
loadQTLast
|
protected static java.util.Collection<VideoFileFilter> |
singleVideoTypeFilters
|
static java.lang.String[] |
VIDEO_EXTENSIONS
|
protected static VideoIO.VideoEnginePanel |
videoEnginePanel
|
protected static java.util.ArrayList<VideoType> |
videoEngines
|
protected static VideoFileFilter |
videoFileFilter
|
protected static java.util.ArrayList<VideoType> |
videoTypes
|
| Constructor Summary | |
|---|---|
protected |
VideoIO()
protected constructor to discourage instantiation |
| Method Summary | |
|---|---|
static void |
addVideoEngine(VideoType type)
Adds a video engine to the list of available types |
static void |
addVideoType(VideoType type)
Adds a video type to the list of available types |
static Video |
clone(Video video)
Returns a clone of the specified video. |
static boolean |
copyFile(java.io.File inFile,
java.io.File outFile)
Copies a source file to a target file. |
static javax.swing.JFileChooser |
getChooser()
Gets the file chooser. |
static java.io.File[] |
getChooserFiles(java.lang.String type)
Displays a file chooser and returns the chosen files. |
static java.lang.String |
getExtension(java.io.File file)
Gets the extension of a file. |
static java.lang.String |
getRelativePath(java.lang.String absolutePath)
Gets the path relative to the user directory. |
static Video |
getVideo(java.lang.String path,
VideoType vidType)
Returns a video from a specified path. |
static java.lang.String[] |
getVideoExtensions()
Returns the currently supported video file extensions |
static VideoType |
getVideoType(java.lang.String className,
java.lang.String extension)
Returns the first registered video type corresponding to a class name and/or extension. |
static VideoType[] |
getVideoTypes()
Gets an array of available video types |
static VideoType[] |
getVideoTypes(java.lang.String ext)
Gets an array of video types that can open files with a given extension |
static boolean |
isCanceled()
Determines if the current operation is canceled. |
static boolean |
isQTPreferred()
Returns true if QTVideo is present and preferred. |
static java.io.File |
open(java.io.File file,
VideoPanel vidPanel)
Loads data or a video from a specified file into a VideoPanel. |
static java.io.File |
open(VideoPanel vidPanel)
Loads the specified video panel from a file selected with a chooser and sets the data file of the panel. |
static java.io.File |
save(java.io.File file,
VideoPanel vidPanel)
Writes VideoPanel data to the specified file. |
static java.io.File |
save(java.io.File file,
VideoPanel vidPanel,
java.lang.String chooserTitle)
Writes VideoPanel data to the specified file. |
static void |
setCanceled(boolean cancel)
Cancels the current operation when true. |
static void |
setDefaultXMLExtension(java.lang.String ext)
Sets the default xml extension used when saving data. |
static void |
setQTLast(boolean last)
Sets the loadQTLast flag. |
static void |
testExec()
test executing shell commands |
static boolean |
updateVideoType(java.lang.Class<? extends VideoType> type)
Updates a VideoType if needed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String[] VIDEO_EXTENSIONS
protected static javax.swing.JFileChooser chooser
protected static VideoFileFilter videoFileFilter
protected static java.util.Collection<VideoFileFilter> singleVideoTypeFilters
protected static javax.swing.filechooser.FileFilter imageFileFilter
protected static java.util.ArrayList<VideoType> videoTypes
protected static java.util.ArrayList<VideoType> videoEngines
protected static java.lang.String defaultXMLExt
public static boolean loadQTLast
protected static VideoIO.VideoEnginePanel videoEnginePanel
protected static boolean canceled
| Constructor Detail |
|---|
protected VideoIO()
| Method Detail |
|---|
public static java.lang.String getExtension(java.io.File file)
file - the file
public static javax.swing.JFileChooser getChooser()
public static void setDefaultXMLExtension(java.lang.String ext)
ext - the default extensionpublic static java.lang.String getRelativePath(java.lang.String absolutePath)
absolutePath - the absolute path
public static boolean updateVideoType(java.lang.Class<? extends VideoType> type)
type - the VideoType class
public static void testExec()
public static boolean copyFile(java.io.File inFile,
java.io.File outFile)
inFile - the sourceoutFile - the target
public static java.lang.String[] getVideoExtensions()
public static void addVideoType(VideoType type)
type - the video typepublic static void addVideoEngine(VideoType type)
type - the video type
public static VideoType getVideoType(java.lang.String className,
java.lang.String extension)
className - all or part of the simple class name (may be null)extension - the extension (may be null)public static VideoType[] getVideoTypes(java.lang.String ext)
ext - the extension
public static VideoType[] getVideoTypes()
public static void setCanceled(boolean cancel)
cancel - true to cancelpublic static boolean isCanceled()
public static void setQTLast(boolean last)
last - true to load QTVideo lastpublic static boolean isQTPreferred()
public static Video getVideo(java.lang.String path,
VideoType vidType)
path - the pathvidType - a requested video type (may be null)
public static Video clone(Video video)
video - the video to clone
public static java.io.File open(VideoPanel vidPanel)
vidPanel - the video panel
public static java.io.File[] getChooserFiles(java.lang.String type)
type - may be "open", "open video", "save", "insert image"
public static java.io.File open(java.io.File file,
VideoPanel vidPanel)
file - the file to be loadedvidPanel - the video panel
public static java.io.File save(java.io.File file,
VideoPanel vidPanel)
file - the file to write tovidPanel - the video panel
public static java.io.File save(java.io.File file,
VideoPanel vidPanel,
java.lang.String chooserTitle)
file - the file to write tovidPanel - the video panel
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||