Class AbstractImageWriter<T extends AbstractImageContainer>

    • Constructor Detail

      • AbstractImageWriter

        public AbstractImageWriter()
    • Method Detail

      • getFormatDescription

        public abstract String getFormatDescription()
        Returns a string describing the format (used in the file chooser).
        Specified by:
        getFormatDescription in interface FileFormatHandler
        Returns:
        a description suitable for displaying in the file chooser
      • getFormatExtensions

        public abstract String[] getFormatExtensions()
        Returns the extension(s) of the format.
        Specified by:
        getFormatExtensions in interface FileFormatHandler
        Returns:
        the extension (without the dot!)
      • isAvailable

        public boolean isAvailable()
        Returns whether the writer is actually available.
        Specified by:
        isAvailable in interface ImageWriter<T extends AbstractImageContainer>
        Returns:
        true if available and ready to use
      • check

        protected void check​(T cont)
        Performs checks.
        Parameters:
        cont - the image container to check
      • doWrite

        protected abstract String doWrite​(PlaceholderFile file,
                                          T cont)
        Performs the actual writing of the image file.
        Parameters:
        file - the file to write to
        cont - the image container to write
        Returns:
        null if successfully written, otherwise error message
      • write

        public String write​(PlaceholderFile file,
                            T cont)
        Writes the image file.
        Specified by:
        write in interface ImageWriter<T extends AbstractImageContainer>
        Parameters:
        file - the file to write to
        cont - the image container to write
        Returns:
        null if successfully written, otherwise error message
      • getWriters

        public static String[] getWriters()
        Returns a list with classnames of writers.
        Returns:
        the writer classnames