public abstract class AbstractFacesManager extends java.lang.Object implements FacesManager
FacesManager
implementations.Modifier and Type | Field and Description |
---|---|
private FaceCache |
faceCache
The
FaceCache instance used to look up in-memory faces. |
private EventListenerList2<FacesManagerListener> |
facesManagerListeners
The
FacesManagerListeners to notify about
changed faces. |
Modifier | Constructor and Description |
---|---|
protected |
AbstractFacesManager(FaceCache faceCache)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addFacesManagerListener(FacesManagerListener facesManagerListener)
Adds a
FacesManagerListener to be notified about updated faces. |
protected void |
fireFaceUpdated(Face face)
Notifies all
FacesManagerListeners that a
face has been updated. |
Face |
getFace(int faceNum)
Returns the
Face instance for a given face ID. |
Face |
getFace2(int faceNum)
Returns the
Face instance for a given face ID. |
protected abstract FaceImages |
getFaceImages(int faceNum,
boolean[] isUnknownImage)
Returns the
FaceImages information for a face ID. |
javax.swing.ImageIcon |
getMagicMapImageIcon(int faceNum,
boolean[] isUnknownImage)
Returns the "magic map" face for a face ID.
|
javax.swing.ImageIcon |
getOriginalImageIcon(int faceNum,
boolean[] isUnknownImage)
Returns the "original" face for a face ID.
|
javax.swing.ImageIcon |
getScaledImageIcon(int faceNum,
boolean[] isUnknownImage)
Returns the "scaled" face for a face ID.
|
protected Face |
lookupFace(int faceNum)
Returns the
Face instance for a given face ID. |
void |
removeFacesManagerListener(FacesManagerListener facesManagerListener)
Removes a
FacesManagerListener to be notified about updated
faces. |
void |
reset()
Forgets about pending faces.
|
@NotNull private final FaceCache faceCache
FaceCache
instance used to look up in-memory faces.@NotNull private final EventListenerList2<FacesManagerListener> facesManagerListeners
FacesManagerListeners
to notify about
changed faces.protected AbstractFacesManager(@NotNull FaceCache faceCache)
faceCache
- the face cache instance for storing in-memory facespublic void addFacesManagerListener(@NotNull FacesManagerListener facesManagerListener)
FacesManagerListener
to be notified about updated faces.addFacesManagerListener
in interface FacesManager
facesManagerListener
- the listenerprotected void fireFaceUpdated(@NotNull Face face)
FacesManagerListeners
that a
face has been updated.face
- the face@NotNull public Face getFace(int faceNum)
Face
instance for a given face ID. Requests the face
face from the server if necessary.getFace
in interface FacesManager
faceNum
- the face ID to request@Nullable public Face getFace2(int faceNum)
Face
instance for a given face ID. Requests the face
from the server if necessary.getFace2
in interface FacesManager
faceNum
- the face ID to requestnull
for the empty face@NotNull protected abstract FaceImages getFaceImages(int faceNum, @Nullable boolean[] isUnknownImage)
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.faceNum
- the face IDisUnknownImage
- returns whether the returned face is the "unknown"
face; ignored if null
@NotNull public javax.swing.ImageIcon getMagicMapImageIcon(int faceNum, @Nullable boolean[] isUnknownImage)
getMagicMapImageIcon
in interface FacesManager
faceNum
- the face IDisUnknownImage
- returns whether the returned face is the "unknown"
face; ignored if null
@NotNull public javax.swing.ImageIcon getOriginalImageIcon(int faceNum, @Nullable boolean[] isUnknownImage)
getOriginalImageIcon
in interface FacesManager
faceNum
- the face IDisUnknownImage
- returns whether the returned face is the "unknown"
face; ignored if null
@NotNull public javax.swing.ImageIcon getScaledImageIcon(int faceNum, @Nullable boolean[] isUnknownImage)
getScaledImageIcon
in interface FacesManager
faceNum
- the face IDisUnknownImage
- returns whether the returned face is the "unknown"
face; ignored if null
@NotNull protected Face lookupFace(int faceNum)
Face
instance for a given face ID. Other than getFace(int)
, does not request the face face from the server if
unknown.faceNum
- the face ID to look uppublic void removeFacesManagerListener(@NotNull FacesManagerListener facesManagerListener)
FacesManagerListener
to be notified about updated
faces.removeFacesManagerListener
in interface FacesManager
facesManagerListener
- the listenerpublic void reset()
reset
in interface FacesManager