Gridarta Editor
net.sf.gridarta.model.face.ArchFaceProvider Class Reference

Implementation of FaceProvider which reads images from the arch directory. More...

+ Inheritance diagram for net.sf.gridarta.model.face.ArchFaceProvider:
+ Collaboration diagram for net.sf.gridarta.model.face.ArchFaceProvider:

Public Member Functions

void addInfo (@NotNull final String faceName, @NotNull final String fileName)
 Report position of a face for loading it later. More...
 
String getFilename (@NotNull final String faceName)
 Get the filename for a face. More...
 
int size ()
 Returns the number of faces. More...
 
- Public Member Functions inherited from net.sf.gridarta.model.face.AbstractFaceProvider
ImageIcon getImageIconForFacename (@NotNull final String faceName, final long stretch)
 Get an image from this FaceProvider. More...
 
void reload ()
 Reload faces. More...
 

Protected Member Functions

ImageIcon createImage (@NotNull final String faceName, final long stretch)
 
- Protected Member Functions inherited from net.sf.gridarta.model.face.AbstractFaceProvider
abstract ImageIcon createImage (@NotNull String faceName, long stretch)
 Create an image not found in the cache. More...
 

Private Attributes

final Map< String, String > files = new HashMap<>()
 The icon filename. More...
 

Detailed Description

Implementation of FaceProvider which reads images from the arch directory.

Author
Christian Hujer
Todo:
Move scanning for face files to this class, so the faces can be easily reloaded while the application is running.

Definition at line 38 of file ArchFaceProvider.java.

Member Function Documentation

◆ addInfo()

void net.sf.gridarta.model.face.ArchFaceProvider.addInfo ( @NotNull final String  faceName,
@NotNull final String  fileName 
)

Report position of a face for loading it later.

Parameters
faceNameface name to get image for, excluding path and ending
fileNamefilename with full reachable path of the png file (maybe relative but must be loadable).

Definition at line 60 of file ArchFaceProvider.java.

◆ createImage()

ImageIcon net.sf.gridarta.model.face.ArchFaceProvider.createImage ( @NotNull final String  faceName,
final long  stretch 
)
protected

Definition at line 76 of file ArchFaceProvider.java.

◆ getFilename()

String net.sf.gridarta.model.face.ArchFaceProvider.getFilename ( @NotNull final String  faceName)

Get the filename for a face.

Parameters
faceNameface name to get filename for
Returns
filename for
faceName
or
null
if no face

Definition at line 70 of file ArchFaceProvider.java.

Referenced by net.sf.gridarta.model.collectable.FaceObjectsCollectable.collectImageFile().

+ Here is the caller graph for this function:

◆ size()

int net.sf.gridarta.model.face.ArchFaceProvider.size ( )

Returns the number of faces.

Returns
the number of faces

Definition at line 50 of file ArchFaceProvider.java.

Referenced by net.sf.gridarta.model.resource.AbstractFilesResourcesReader< TestGameObject, TestMapArchObject, TestArchetype >.read().

+ Here is the caller graph for this function:

Member Data Documentation

◆ files

final Map<String, String> net.sf.gridarta.model.face.ArchFaceProvider.files = new HashMap<>()
private

The icon filename.

The value is a String with the full reachable path of the png file.

Definition at line 44 of file ArchFaceProvider.java.


The documentation for this class was generated from the following file: