package CH.ifa.draw.io;

import de.renew.io.api.FileApi;
import de.renew.ioontology.FileType;
import de.renew.ioontology.MultiExtensionFileFilterImpl;

/**
 * Extends the MultiExtensionFileFilterImpl to accept the Image file types png, jpg, gif.
 * @deprecated This class is not to be used externally and will later be hidden.
 */
@Deprecated(since = "5.0", forRemoval = true)
public class ImageFileFilter extends MultiExtensionFileFilterImpl {

    /**
     * Constructs ImageFileFilter and adds three filters for png, jpg and gif files.
     */
    public ImageFileFilter() {
        super("Image File (png, jpg, gif)");
        add(FileApi.createExtensionFileFilter(FileType.PNG));
        addAll(new JPGFileFilter().getFileFilters());
        add(FileApi.createExtensionFileFilter(FileType.GIF));
    }

    /**
     * Extends CombinationFileFilter to accept jpeg and jpg image files.
     * @deprecated This class is not to be used externally.
     * Please use {@link FileApi#createExtensionFileFilter(FileType)} with the file type {@link FileType#JPG} or {@link FileType#JPEG} instead.
     */
    @Deprecated(since = "5.0", forRemoval = true)
    public static class JPGFileFilter extends MultiExtensionFileFilterImpl {

        /**
         * Constructs and sets up JPGFileFilter with super class constructor.
         * @deprecated This constructor is not to be used externally.
         * Please use {@link FileApi#createExtensionFileFilter(FileType)} with the file type {@link FileType#JPG} or {@link FileType#JPEG} instead.
         */
        @Deprecated(since = "5.0", forRemoval = true)
        public JPGFileFilter() {
            super("JPEG File Filter");
            add(new SimpleFileFilter("jpg", " Joint Photographic Experts Group File"));
            add(new SimpleFileFilter("jpeg", " Joint Photographic Experts Group File"));
        }
    }
    /**
     * Extends SimpleFileFilter to accept gif image files.
     * @deprecated This class is not to be used externally.
     * Please use {@link FileApi#createExtensionFileFilter(FileType)} with the file type {@link FileType#GIF} instead.
     */
    @Deprecated(since = "5.0", forRemoval = true)
    public static class GIFFileFilter extends SimpleFileFilter {
        /**
         * Constructs GIFFileFilter with parent class constructor.
         * @deprecated This constructor is not to be used externally.
         * Please use {@link FileApi#createExtensionFileFilter(FileType)} with the file type {@link FileType#GIF} instead.
         */
        @Deprecated(since = "5.0", forRemoval = true)
        public GIFFileFilter() {
            super("gif", "Graphics Interchange Format File");
        }
    }
}