Class CollectedFaceProvider

  • All Implemented Interfaces:
    FaceProvider

    public class CollectedFaceProvider
    extends AbstractFaceProvider
    Implementation of FaceProvider which reads images from the collected PNG archive.
    Todo:
    Construction of this class should succeed even in case the face file is unavailable., Move parsing of the face files to this class, so the faces can be easily reloaded while the application is running.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addInfo​(@NotNull java.lang.String faceName, int pos, int size)
      Report position and size of a face for loading it later.
      protected @Nullable javax.swing.ImageIcon createImage​(@NotNull java.lang.String faceName, long stretch)
      Creates an image not found in the cache.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CollectedFaceProvider

        public CollectedFaceProvider​(java.io.File file)
                              throws java.io.FileNotFoundException
        Creates a new instance.
        Parameters:
        file - file where icons are found
        Throws:
        java.io.FileNotFoundException - in case the File file wasn't found
      • CollectedFaceProvider

        public CollectedFaceProvider​(java.lang.String fileName)
                              throws java.io.FileNotFoundException
        Creates a new instance.
        Parameters:
        fileName - name of file where icons are found
        Throws:
        java.io.FileNotFoundException - in case the File with name fileName wasn't found
    • Method Detail

      • addInfo

        public void addInfo​(@NotNull
                            @NotNull java.lang.String faceName,
                            int pos,
                            int size)
        Report position and size of a face for loading it later.
        Parameters:
        faceName - face name to get image for, excluding path and ending
        pos - position of image
        size - Size of image
      • createImage

        @Nullable
        protected @Nullable javax.swing.ImageIcon createImage​(@NotNull
                                                              @NotNull java.lang.String faceName,
                                                              long stretch)
        Description copied from class: AbstractFaceProvider
        Creates an image not found in the cache.
        Specified by:
        createImage in class AbstractFaceProvider
        Parameters:
        faceName - face name to get image for, excluding path and ending
        stretch - stretch factor
        Returns:
        icon for faceName