Crossfire JXClient, Trunk  R20561
com.realtime.crossfire.jxclient.faces.DefaultFacesManager Class Reference

Retrieves Face information by face ID. More...

+ Inheritance diagram for com.realtime.crossfire.jxclient.faces.DefaultFacesManager:
+ Collaboration diagram for com.realtime.crossfire.jxclient.faces.DefaultFacesManager:

Public Member Functions

 DefaultFacesManager (@NotNull final FaceCache faceCache, @NotNull final FaceQueue faceQueue) throws IOException
 Creates a new instance. More...
 
void reset ()
 Forgets about pending faces. More...
 
- Public Member Functions inherited from com.realtime.crossfire.jxclient.faces.AbstractFacesManager
void addFacesManagerListener (@NotNull final FacesManagerListener facesManagerListener)
 Adds a FacesManagerListener to be notified about updated faces.
Parameters
facesManagerListenerthe listener
More...
 
Face getFace (final int faceNum)
 Returns the Face instance for a given face ID.Requests the face face from the server if necessary.

Parameters
faceNumthe face ID to request
Returns
the face
More...
 
Face getFace2 (final int faceNum)
 Returns the Face instance for a given face ID.Requests the face from the server if necessary.

Parameters
faceNumthe face ID to request
Returns
the face or
null
for the empty face
More...
 
ImageIcon getMagicMapImageIcon (final int faceNum, @Nullable final boolean[] isUnknownImage)
 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.

Parameters
faceNumthe face ID
isUnknownImagereturns whether the returned face is the "unknown" face; ignored if
null
Returns
the face, or the "unknown" face if the face is not loaded
More...
 
ImageIcon getOriginalImageIcon (final int faceNum, @Nullable final boolean[] isUnknownImage)
 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.

Parameters
faceNumthe face ID
isUnknownImagereturns whether the returned face is the "unknown" face; ignored if
null
Returns
the face, or the "unknown" face if the face is not loaded
More...
 
ImageIcon getScaledImageIcon (final int faceNum, @Nullable final boolean[] isUnknownImage)
 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.

Parameters
faceNumthe face ID
isUnknownImagereturns whether the returned face is the "unknown" face; ignored if
null
Returns
the face, or the "unknown" face if the face is not loaded
More...
 
void removeFacesManagerListener (@NotNull final FacesManagerListener facesManagerListener)
 Removes a FacesManagerListener to be notified about updated faces.
Parameters
facesManagerListenerthe listener
More...
 
void reset ()
 Forgets about pending faces. More...
 

Protected Member Functions

FaceImages getFaceImages (final int faceNum, @Nullable final boolean[] isUnknownImage)
 Returns the FaceImages information for a face ID. More...
 
- Protected Member Functions inherited from com.realtime.crossfire.jxclient.faces.AbstractFacesManager
 AbstractFacesManager (@NotNull final FaceCache faceCache)
 Creates a new instance. More...
 
void fireFaceUpdated (@NotNull final Face face)
 Notifies all FacesManagerListeners that a face has been updated. More...
 
abstract FaceImages getFaceImages (final int faceNum, @Nullable boolean[] isUnknownImage)
 Returns the FaceImages information for a face ID. More...
 
Face lookupFace (final int faceNum)
 Returns the Face instance for a given face ID. More...
 

Private Attributes

final FaceImages emptyFaceImages
 The empty face; returned for face ID 0. More...
 
final FaceQueue faceQueue
 The FaceQueue instance used to load faces not present in-memory. More...
 
final FaceQueueListener faceQueueListener
 The FaceQueueListener registered to faceQueue. More...
 
final FaceImages unknownFaceImages
 The unknown face. More...
 

Detailed Description

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.

Author
Andreas Kirschbaum

Definition at line 38 of file DefaultFacesManager.java.

Constructor & Destructor Documentation

◆ DefaultFacesManager()

com.realtime.crossfire.jxclient.faces.DefaultFacesManager.DefaultFacesManager ( @NotNull final FaceCache  faceCache,
@NotNull final FaceQueue  faceQueue 
) throws IOException

Member Function Documentation

◆ getFaceImages()

FaceImages com.realtime.crossfire.jxclient.faces.DefaultFacesManager.getFaceImages ( final int  faceNum,
@Nullable final boolean []  isUnknownImage 
)
protected

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
faceNumthe face ID
Returns
the face images information

Definition at line 103 of file DefaultFacesManager.java.

References com.realtime.crossfire.jxclient.faces.DefaultFacesManager.emptyFaceImages, com.realtime.crossfire.jxclient.faces.Face.getFaceImages(), com.realtime.crossfire.jxclient.faces.FaceQueue.loadFace(), com.realtime.crossfire.jxclient.faces.AbstractFacesManager.lookupFace(), and com.realtime.crossfire.jxclient.faces.DefaultFacesManager.unknownFaceImages.

+ Here is the call graph for this function:

◆ reset()

void com.realtime.crossfire.jxclient.faces.DefaultFacesManager.reset ( )

Forgets about pending faces.

Implements com.realtime.crossfire.jxclient.faces.FacesManager.

Definition at line 131 of file DefaultFacesManager.java.

References com.realtime.crossfire.jxclient.faces.FaceQueue.reset().

+ Here is the call graph for this function:

Member Data Documentation

◆ emptyFaceImages

final FaceImages com.realtime.crossfire.jxclient.faces.DefaultFacesManager.emptyFaceImages
private

The empty face; returned for face ID 0.

Definition at line 56 of file DefaultFacesManager.java.

Referenced by com.realtime.crossfire.jxclient.faces.DefaultFacesManager.getFaceImages().

◆ faceQueue

final FaceQueue com.realtime.crossfire.jxclient.faces.DefaultFacesManager.faceQueue
private

The FaceQueue instance used to load faces not present in-memory.

Definition at line 44 of file DefaultFacesManager.java.

Referenced by com.realtime.crossfire.jxclient.faces.DefaultFacesManager.DefaultFacesManager().

◆ faceQueueListener

final FaceQueueListener com.realtime.crossfire.jxclient.faces.DefaultFacesManager.faceQueueListener
private
Initial value:
= new FaceQueueListener() {
@Override
public void faceLoaded(@NotNull final Face face, @NotNull final FaceImages faceImages) {
face.setFaceImages(faceImages);
}
@Override
public void faceFailed(@NotNull final Face face) {
face.setFaceImages(unknownFaceImages);
}
}

The FaceQueueListener registered to faceQueue.

Definition at line 63 of file DefaultFacesManager.java.

Referenced by com.realtime.crossfire.jxclient.faces.DefaultFacesManager.DefaultFacesManager().

◆ unknownFaceImages

final FaceImages com.realtime.crossfire.jxclient.faces.DefaultFacesManager.unknownFaceImages
private

The documentation for this class was generated from the following file: