Class DefaultFacesManager
- java.lang.Object
-
- com.realtime.crossfire.jxclient.faces.AbstractFacesManager
-
- com.realtime.crossfire.jxclient.faces.DefaultFacesManager
-
- All Implemented Interfaces:
FacesManager
public class DefaultFacesManager extends AbstractFacesManager
RetrievesFaceinformation 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 registeredFacesManagerListenersare notified.
-
-
Constructor Summary
Constructors Constructor Description DefaultFacesManager(@NotNull FaceCache faceCache, @NotNull FaceQueue faceQueue)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected @NotNull FaceImagesgetFaceImages(int faceNum, boolean @Nullable [] isUnknownImage)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 Detail
-
DefaultFacesManager
public DefaultFacesManager(@NotNull @NotNull FaceCache faceCache, @NotNull @NotNull FaceQueue faceQueue) throws java.io.IOExceptionCreates a new instance.- Parameters:
faceCache- the face cache instance for storing in-memory facesfaceQueue- the face queue to use- Throws:
java.io.IOException- if the unknown image resource cannot be loaded
-
-
Method Detail
-
getFaceImages
@NotNull protected @NotNull FaceImages getFaceImages(int faceNum, boolean @Nullable [] isUnknownImage)
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 IDisUnknownImage- 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
-
-