Class AbstractFacesManager
java.lang.Object
com.realtime.crossfire.jxclient.faces.AbstractFacesManager
- All Implemented Interfaces:
FacesManager
- Direct Known Subclasses:
DefaultFacesManager
Abstract base class for
FacesManager implementations.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractFacesManager(@NotNull FaceCache faceCache) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFacesManagerListener(@NotNull FacesManagerListener facesManagerListener) Adds aFacesManagerListenerto be notified about updated faces.protected voidfireFaceUpdated(@NotNull Face face) Notifies allFacesManagerListenersthat a face has been updated.@NotNull FacegetFace(int faceNum) Returns theFaceinstance for a given face ID.@Nullable FacegetFace2(int faceNum) Returns theFaceinstance for a given face ID.protected abstract @NotNull FaceImagesgetFaceImages(int faceNum, @Nullable AtomicBoolean returnIsUnknownImage) Returns theFaceImagesinformation for a face ID.@NotNull ImageIcongetMagicMapImageIcon(int faceNum, @Nullable AtomicBoolean returnIsUnknownImage) Returns the "magic map" face for a face ID.@NotNull ImageIcongetOriginalImageIcon(int faceNum, @Nullable AtomicBoolean returnIsUnknownImage) Returns the "original" face for a face ID.@NotNull ImageIcongetScaledImageIcon(int faceNum, @Nullable AtomicBoolean returnIsUnknownImage) Returns the "scaled" face for a face ID.protected @NotNull FacelookupFace(int faceNum) Returns theFaceinstance for a given face ID.voidremoveFacesManagerListener(@NotNull FacesManagerListener facesManagerListener) Removes aFacesManagerListenerto be notified about updated faces.voidreset()Forgets about pending faces.
-
Constructor Details
-
AbstractFacesManager
Creates a new instance.- Parameters:
faceCache- the face cache instance for storing in-memory faces
-
-
Method Details
-
addFacesManagerListener
Description copied from interface:FacesManagerAdds aFacesManagerListenerto be notified about updated faces.- Specified by:
addFacesManagerListenerin interfaceFacesManager- Parameters:
facesManagerListener- the listener
-
removeFacesManagerListener
Description copied from interface:FacesManagerRemoves aFacesManagerListenerto be notified about updated faces.- Specified by:
removeFacesManagerListenerin interfaceFacesManager- Parameters:
facesManagerListener- the listener
-
fireFaceUpdated
Notifies allFacesManagerListenersthat 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:FacesManagerReturns 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:
getOriginalImageIconin interfaceFacesManager- Parameters:
faceNum- the face IDreturnIsUnknownImage- returns whether the returned face is the "unknown" face; ignored ifnull- 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:FacesManagerReturns 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:
getScaledImageIconin interfaceFacesManager- Parameters:
faceNum- the face IDreturnIsUnknownImage- returns whether the returned face is the "unknown" face; ignored ifnull- 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:FacesManagerReturns 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:
getMagicMapImageIconin interfaceFacesManager- Parameters:
faceNum- the face IDreturnIsUnknownImage- returns whether the returned face is the "unknown" face; ignored ifnull- Returns:
- the face, or the "unknown" face if the face is not loaded
-
getFace
Description copied from interface:FacesManagerReturns theFaceinstance for a given face ID. Requests the face from the server if necessary.- Specified by:
getFacein interfaceFacesManager- Parameters:
faceNum- the face ID to request- Returns:
- the face
-
getFaceImages
@NotNull protected abstract @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.- Parameters:
faceNum- the face IDreturnIsUnknownImage- returns whether the returned face is the "unknown" face; ignored ifnull- Returns:
- the face images information
-
lookupFace
Returns theFaceinstance for a given face ID. Other thangetFace(int), does not request the face from the server if unknown.- Parameters:
faceNum- the face ID to look up- Returns:
- the face
-
getFace2
Description copied from interface:FacesManagerReturns theFaceinstance for a given face ID. Requests the face from the server if necessary.- Specified by:
getFace2in interfaceFacesManager- Parameters:
faceNum- the face ID to request- Returns:
- the face or
nullfor the empty face
-
reset
public void reset()Description copied from interface:FacesManagerForgets about pending faces.- Specified by:
resetin interfaceFacesManager
-