Class ArchFaceProvider

  • All Implemented Interfaces:
    FaceProvider

    public class ArchFaceProvider
    extends AbstractFaceProvider
    Implementation of FaceProvider which reads images from the arch directory.
    Todo:
    Move scanning for 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, @NotNull java.lang.String fileName)
      Report position 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.
      @Nullable java.lang.String getFilename​(@NotNull java.lang.String faceName)
      Get the filename for a face.
      int size()
      Returns the number of faces.
      • Methods inherited from class java.lang.Object

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

      • ArchFaceProvider

        public ArchFaceProvider()
    • Method Detail

      • size

        public int size()
        Returns the number of faces.
        Returns:
        the number of faces
      • addInfo

        public void addInfo​(@NotNull
                            @NotNull java.lang.String faceName,
                            @NotNull
                            @NotNull java.lang.String fileName)
        Report position of a face for loading it later.
        Parameters:
        faceName - face name to get image for, excluding path and ending
        fileName - filename with full reachable path of the png file (maybe relative but must be loadable).
      • getFilename

        @Nullable
        public @Nullable java.lang.String getFilename​(@NotNull
                                                      @NotNull java.lang.String faceName)
        Get the filename for a face.
        Parameters:
        faceName - face name to get filename for
        Returns:
        filename for faceName or null if no face
      • 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