Package net.sf.gridarta.model.face
Class ArchFaceProvider
- java.lang.Object
-
- net.sf.gridarta.model.face.AbstractFaceProvider
-
- net.sf.gridarta.model.face.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.
-
-
Constructor Summary
Constructors Constructor Description ArchFaceProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInfo(@NotNull java.lang.String faceName, @NotNull java.lang.String fileName)Report position of a face for loading it later.protected @Nullable javax.swing.ImageIconcreateImage(@NotNull java.lang.String faceName, long stretch)Creates an image not found in the cache.@Nullable java.lang.StringgetFilename(@NotNull java.lang.String faceName)Get the filename for a face.intsize()Returns the number of faces.-
Methods inherited from class net.sf.gridarta.model.face.AbstractFaceProvider
getImageIconForFacename, reload
-
-
-
-
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 endingfileName- 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
faceNameornullif no face
-
createImage
@Nullable protected @Nullable javax.swing.ImageIcon createImage(@NotNull @NotNull java.lang.String faceName, long stretch)Description copied from class:AbstractFaceProviderCreates an image not found in the cache.- Specified by:
createImagein classAbstractFaceProvider- Parameters:
faceName- face name to get image for, excluding path and endingstretch- stretch factor- Returns:
- icon for faceName
-
-