Class 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
  • Constructor Details

    • VideoFileFilter

      public VideoFileFilter()
      No-arg constructor. Will accept all types in VideoIO.singleVideoTypeFilters
    • VideoFileFilter

      public VideoFileFilter(String containerType, String[] extensions)
      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

      public boolean accept(File f, boolean checkIfDir)
      BH fix for no need to check directories if a remote path or SwingJS temp file
      Overrides:
      accept in class VideoIO.SingleExtFileFilter
      Parameters:
      f -
      checkIfDir -
      Returns:
    • getDescription

      public String getDescription()
      Gets a description of the file types accepted by this filter.
      Overrides:
      getDescription in class VideoIO.SingleExtFileFilter
      Returns:
      the description
    • getDefaultExtension

      public String getDefaultExtension()
      Gets the default extension to suggest when saving.
      Returns:
      the default extension
    • getExtensions

      public String[] getExtensions()
      Gets all extensions accepted by this filter.
      Returns:
      array of extensions
    • getContainerType

      public String getContainerType()
      Gets the container type.
      Returns:
      the container type
    • compareTo

      public int compareTo(VideoFileFilter filter)
      Compares this filter to another. Implements Comparable. This compares them alphabetically by description.
      Specified by:
      compareTo in interface Comparable<VideoFileFilter>
      Parameters:
      filter - the filter to compare
      Returns:
      the comparison of their descriptions
    • toString

      public String toString()
      Overrides:
      toString in class Object