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
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 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 faces
      faceQueue - 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 the FaceImages information 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:
      getFaceImages in class AbstractFacesManager
      Parameters:
      faceNum - the face ID
      returnIsUnknownImage - returns whether the returned face is the "unknown" face; ignored if null
      Returns:
      the face images information
    • reset

      public void reset()
      Description copied from interface: FacesManager
      Forgets about pending faces.
      Specified by:
      reset in interface FacesManager
      Overrides:
      reset in class AbstractFacesManager