Class DefaultFacesManager
java.lang.Object
com.realtime.crossfire.jxclient.faces.AbstractFacesManager
com.realtime.crossfire.jxclient.faces.DefaultFacesManager
- All Implemented Interfaces:
FacesManager
Retrieves
Face information by face ID. If a face is not available
in-memory, an "unknown" (question mark) face is returned immediately.
Asynchronously, the face is loaded from the file cache. If loading fails, the
face is requested from the server (and later stored into the file cache). As
soon as the face becomes available, all registered
FacesManagerListeners are notified.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultFacesManager(@NotNull FaceCache faceCache, @NotNull FaceQueue faceQueue) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected @NotNull FaceImagesgetFaceImages(int faceNum, @Nullable AtomicBoolean returnIsUnknownImage) Returns theFaceImagesinformation for a face ID.voidreset()Forgets about pending faces.Methods inherited from class com.realtime.crossfire.jxclient.faces.AbstractFacesManager
addFacesManagerListener, fireFaceUpdated, getFace, getFace2, getMagicMapImageIcon, getOriginalImageIcon, getScaledImageIcon, lookupFace, removeFacesManagerListener
-
Constructor Details
-
DefaultFacesManager
public DefaultFacesManager(@NotNull @NotNull FaceCache faceCache, @NotNull @NotNull FaceQueue faceQueue) throws IOException Creates a new instance.- Parameters:
faceCache- the face cache instance for storing in-memory facesfaceQueue- the face queue to use- Throws:
IOException- if the unknown image resource cannot be loaded
-
-
Method Details
-
getFaceImages
@NotNull protected @NotNull FaceImages getFaceImages(int faceNum, @Nullable @Nullable AtomicBoolean returnIsUnknownImage) Returns theFaceImagesinformation for a face ID. This function returns immediately even if the face is not loaded. A not loaded face will be updated as soon as loading has finished.- Specified by:
getFaceImagesin classAbstractFacesManager- Parameters:
faceNum- the face IDreturnIsUnknownImage- returns whether the returned face is the "unknown" face; ignored ifnull- Returns:
- the face images information
-
reset
public void reset()Description copied from interface:FacesManagerForgets about pending faces.- Specified by:
resetin interfaceFacesManager- Overrides:
resetin classAbstractFacesManager
-