public class DefaultFacesManager extends AbstractFacesManager
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 and Description |
---|
DefaultFacesManager(@NotNull FaceCache faceCache,
@NotNull FaceQueue faceQueue)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected @NotNull FaceImages |
getFaceImages(int faceNum,
@Nullable java.util.concurrent.atomic.AtomicBoolean returnIsUnknownImage)
Returns the
FaceImages information for a face ID. |
void |
reset()
Forgets about pending faces.
|
addFacesManagerListener, fireFaceUpdated, getFace, getFace2, getMagicMapImageIcon, getOriginalImageIcon, getScaledImageIcon, lookupFace, removeFacesManagerListener
public DefaultFacesManager(@NotNull @NotNull FaceCache faceCache, @NotNull @NotNull FaceQueue faceQueue) throws java.io.IOException
faceCache
- the face cache instance for storing in-memory facesfaceQueue
- the face queue to usejava.io.IOException
- if the unknown image resource cannot be loaded@NotNull protected @NotNull FaceImages getFaceImages(int faceNum, @Nullable @Nullable java.util.concurrent.atomic.AtomicBoolean returnIsUnknownImage)
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.getFaceImages
in class AbstractFacesManager
faceNum
- the face IDreturnIsUnknownImage
- returns whether the returned face is the
"unknown" face; ignored if null
public void reset()
FacesManager
reset
in interface FacesManager
reset
in class AbstractFacesManager