Package org.opensourcephysics.media.core
Class VideoFileFilter
java.lang.Object
javax.swing.filechooser.FileFilter
org.opensourcephysics.media.core.VideoIO.SingleExtFileFilter
org.opensourcephysics.media.core.VideoFileFilter
- All Implemented Interfaces:
Comparable<VideoFileFilter>
public class VideoFileFilter
extends VideoIO.SingleExtFileFilter
implements Comparable<VideoFileFilter>
This is a FileFilter that accepts video files. Filters for single
container types (eg, gif, mov, avi, mp4, etc) are created by specifying
the container type and one or more extensions in the constructor.
The no-arg constructor creates a filter that accepts all container types
in the collection VideoIO.singleVideoTypeFilters.
- Version:
- 1.0
- Author:
- Douglas Brown
-
Field Summary
Fields inherited from class org.opensourcephysics.media.core.VideoIO.SingleExtFileFilter
desc
-
Constructor Summary
ConstructorsConstructorDescriptionNo-arg constructor.VideoFileFilter
(String containerType, String[] extensions) Constructor with container type and accepted file extensions. -
Method Summary
Modifier and TypeMethodDescriptionboolean
BH fix for no need to check directories if a remote path or SwingJS temp fileint
compareTo
(VideoFileFilter filter) Compares this filter to another.Gets the container type.Gets the default extension to suggest when saving.Gets a description of the file types accepted by this filter.String[]
Gets all extensions accepted by this filter.toString()
Methods inherited from class org.opensourcephysics.media.core.VideoIO.SingleExtFileFilter
accept
-
Constructor Details
-
VideoFileFilter
public VideoFileFilter()No-arg constructor. Will accept all types in VideoIO.singleVideoTypeFilters -
VideoFileFilter
Constructor with container type and accepted file extensions.- Parameters:
containerType
- the container type (eg "mov" or "jpg")extensions
- array of accepted extensions
-
-
Method Details
-
accept
BH fix for no need to check directories if a remote path or SwingJS temp file- Overrides:
accept
in classVideoIO.SingleExtFileFilter
- Parameters:
f
-checkIfDir
-- Returns:
-
getDescription
Gets a description of the file types accepted by this filter.- Overrides:
getDescription
in classVideoIO.SingleExtFileFilter
- Returns:
- the description
-
getDefaultExtension
Gets the default extension to suggest when saving.- Returns:
- the default extension
-
getExtensions
Gets all extensions accepted by this filter.- Returns:
- array of extensions
-
getContainerType
Gets the container type.- Returns:
- the container type
-
compareTo
Compares this filter to another. Implements Comparable. This compares them alphabetically by description.- Specified by:
compareTo
in interfaceComparable<VideoFileFilter>
- Parameters:
filter
- the filter to compare- Returns:
- the comparison of their descriptions
-
toString
-