Class AbstractFacesManager
- java.lang.Object
-
- com.realtime.crossfire.jxclient.faces.AbstractFacesManager
-
- All Implemented Interfaces:
FacesManager
- Direct Known Subclasses:
DefaultFacesManager
public abstract class AbstractFacesManager extends java.lang.Object implements FacesManager
Abstract base class forFacesManagerimplementations.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractFacesManager(@NotNull FaceCache faceCache)Creates a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddFacesManagerListener(@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, boolean @Nullable [] isUnknownImage)Returns theFaceImagesinformation for a face ID.@NotNull javax.swing.ImageIcongetMagicMapImageIcon(int faceNum, boolean @Nullable [] isUnknownImage)Returns the "magic map" face for a face ID.@NotNull javax.swing.ImageIcongetOriginalImageIcon(int faceNum, boolean @Nullable [] isUnknownImage)Returns the "original" face for a face ID.@NotNull javax.swing.ImageIcongetScaledImageIcon(int faceNum, boolean @Nullable [] isUnknownImage)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 Detail
-
AbstractFacesManager
protected AbstractFacesManager(@NotNull @NotNull FaceCache faceCache)Creates a new instance.- Parameters:
faceCache- the face cache instance for storing in-memory faces
-
-
Method Detail
-
addFacesManagerListener
public void addFacesManagerListener(@NotNull @NotNull FacesManagerListener facesManagerListener)Description copied from interface:FacesManagerAdds aFacesManagerListenerto be notified about updated faces.- Specified by:
addFacesManagerListenerin interfaceFacesManager- Parameters:
facesManagerListener- the listener
-
removeFacesManagerListener
public void removeFacesManagerListener(@NotNull @NotNull FacesManagerListener facesManagerListener)Description copied from interface:FacesManagerRemoves aFacesManagerListenerto be notified about updated faces.- Specified by:
removeFacesManagerListenerin interfaceFacesManager- Parameters:
facesManagerListener- the listener
-
fireFaceUpdated
protected void fireFaceUpdated(@NotNull @NotNull Face face)Notifies allFacesManagerListenersthat a face has been updated.- Parameters:
face- the face
-
getOriginalImageIcon
@NotNull public @NotNull javax.swing.ImageIcon getOriginalImageIcon(int faceNum, boolean @Nullable [] isUnknownImage)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 IDisUnknownImage- 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 javax.swing.ImageIcon getScaledImageIcon(int faceNum, boolean @Nullable [] isUnknownImage)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 IDisUnknownImage- 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 javax.swing.ImageIcon getMagicMapImageIcon(int faceNum, boolean @Nullable [] isUnknownImage)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 IDisUnknownImage- 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
@NotNull public @NotNull Face getFace(int faceNum)
Description copied from interface:FacesManagerReturns theFaceinstance for a given face ID. Requests the face 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, 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.- Parameters:
faceNum- the face IDisUnknownImage- returns whether the returned face is the "unknown" face; ignored ifnull- Returns:
- the face images information
-
lookupFace
@NotNull protected @NotNull Face lookupFace(int faceNum)
Returns theFaceinstance for a given face ID. Other thangetFace(int), does not request the face 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: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
-
-