Class AbstractFacesManager

java.lang.Object
com.realtime.crossfire.jxclient.faces.AbstractFacesManager
All Implemented Interfaces:
FacesManager
Direct Known Subclasses:
DefaultFacesManager

public abstract class AbstractFacesManager extends Object implements FacesManager
Abstract base class for FacesManager implementations.
  • Constructor Details

    • AbstractFacesManager

      protected AbstractFacesManager(@NotNull @NotNull FaceCache faceCache)
      Creates a new instance.
      Parameters:
      faceCache - the face cache instance for storing in-memory faces
  • Method Details

    • addFacesManagerListener

      public void addFacesManagerListener(@NotNull @NotNull FacesManagerListener facesManagerListener)
      Description copied from interface: FacesManager
      Adds a FacesManagerListener to be notified about updated faces.
      Specified by:
      addFacesManagerListener in interface FacesManager
      Parameters:
      facesManagerListener - the listener
    • removeFacesManagerListener

      public void removeFacesManagerListener(@NotNull @NotNull FacesManagerListener facesManagerListener)
      Description copied from interface: FacesManager
      Removes a FacesManagerListener to be notified about updated faces.
      Specified by:
      removeFacesManagerListener in interface FacesManager
      Parameters:
      facesManagerListener - the listener
    • fireFaceUpdated

      protected void fireFaceUpdated(@NotNull @NotNull Face face)
      Notifies all FacesManagerListeners that a face has been updated.
      Parameters:
      face - the face
    • getOriginalImageIcon

      @NotNull public @NotNull ImageIcon getOriginalImageIcon(int faceNum, @Nullable @Nullable AtomicBoolean returnIsUnknownImage)
      Description copied from interface: FacesManager
      Returns the "original" face 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:
      getOriginalImageIcon in interface FacesManager
      Parameters:
      faceNum - the face ID
      returnIsUnknownImage - returns whether the returned face is the "unknown" face; ignored if null
      Returns:
      the face, or the "unknown" face if the face is not loaded
    • getScaledImageIcon

      @NotNull public @NotNull ImageIcon getScaledImageIcon(int faceNum, @Nullable @Nullable AtomicBoolean returnIsUnknownImage)
      Description copied from interface: FacesManager
      Returns the "scaled" face 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:
      getScaledImageIcon in interface FacesManager
      Parameters:
      faceNum - the face ID
      returnIsUnknownImage - returns whether the returned face is the "unknown" face; ignored if null
      Returns:
      the face, or the "unknown" face if the face is not loaded
    • getMagicMapImageIcon

      @NotNull public @NotNull ImageIcon getMagicMapImageIcon(int faceNum, @Nullable @Nullable AtomicBoolean returnIsUnknownImage)
      Description copied from interface: FacesManager
      Returns the "magic map" face 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:
      getMagicMapImageIcon in interface FacesManager
      Parameters:
      faceNum - the face ID
      returnIsUnknownImage - returns whether the returned face is the "unknown" face; ignored if null
      Returns:
      the face, or the "unknown" face if the face is not loaded
    • getFace

      @NotNull public @NotNull Face getFace(int faceNum)
      Description copied from interface: FacesManager
      Returns the Face instance for a given face ID. Requests the face from the server if necessary.
      Specified by:
      getFace in interface FacesManager
      Parameters:
      faceNum - the face ID to request
      Returns:
      the face
    • getFaceImages

      @NotNull protected abstract @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.
      Parameters:
      faceNum - the face ID
      returnIsUnknownImage - returns whether the returned face is the "unknown" face; ignored if null
      Returns:
      the face images information
    • lookupFace

      @NotNull protected @NotNull Face lookupFace(int faceNum)
      Returns the Face instance for a given face ID. Other than getFace(int), does not request the face from the server if unknown.
      Parameters:
      faceNum - the face ID to look up
      Returns:
      the face
    • getFace2

      @Nullable public @Nullable Face getFace2(int faceNum)
      Description copied from interface: FacesManager
      Returns the Face instance for a given face ID. Requests the face from the server if necessary.
      Specified by:
      getFace2 in interface FacesManager
      Parameters:
      faceNum - the face ID to request
      Returns:
      the face or null for the empty face
    • reset

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