Package net.sf.gridarta.model.face
Class CollectedFaceProvider
- java.lang.Object
-
- net.sf.gridarta.model.face.AbstractFaceProvider
-
- net.sf.gridarta.model.face.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.
-
-
Constructor Summary
Constructors Constructor Description CollectedFaceProvider(java.io.File file)Creates a new instance.CollectedFaceProvider(java.lang.String fileName)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInfo(@NotNull java.lang.String faceName, int pos, int size)Report position and size 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.-
Methods inherited from class net.sf.gridarta.model.face.AbstractFaceProvider
getImageIconForFacename, reload
-
-
-
-
Constructor Detail
-
CollectedFaceProvider
public CollectedFaceProvider(java.io.File file) throws java.io.FileNotFoundExceptionCreates a new instance.- Parameters:
file- file where icons are found- Throws:
java.io.FileNotFoundException- in case the Filefilewasn't found
-
CollectedFaceProvider
public CollectedFaceProvider(java.lang.String fileName) throws java.io.FileNotFoundExceptionCreates a new instance.- Parameters:
fileName- name of file where icons are found- Throws:
java.io.FileNotFoundException- in case the File with namefileNamewasn'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 endingpos- position of imagesize- Size of image
-
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
-
-