java.lang.Objectcom.realtime.crossfire.jxclient.faces.AbstractFacesManager
public abstract class AbstractFacesManager
Abstract base class for FacesManager implementations.
| Field Summary | |
|---|---|
private FaceCache |
faceCache
The FaceCache instance used to look up in-memory faces. |
private java.util.Collection<FacesManagerListener> |
facesManagerListeners
The FacesManagerListeners to notify about changed faces. |
| Constructor Summary | |
|---|---|
protected |
AbstractFacesManager(FaceCache faceCache)
Creates a new instance. |
| Method Summary | |
|---|---|
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)
Returns the FaceImages information for a face ID. |
javax.swing.ImageIcon |
getMagicMapImageIcon(int faceNum)
Returns the "magic map" face for a face ID. |
javax.swing.ImageIcon |
getOriginalImageIcon(int faceNum)
Returns the "original" face for a face ID. |
javax.swing.ImageIcon |
getScaledImageIcon(int faceNum)
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
@NotNull private final FaceCache faceCache
FaceCache instance used to look up in-memory faces.
@NotNull private final java.util.Collection<FacesManagerListener> facesManagerListeners
FacesManagerListeners to notify about changed faces.
| Constructor Detail |
|---|
protected AbstractFacesManager(@NotNull
FaceCache faceCache)
faceCache - the face cache instance for storing in-memory faces| Method Detail |
|---|
public void addFacesManagerListener(@NotNull
FacesManagerListener facesManagerListener)
FacesManagerListener to be notified about updated faces.
addFacesManagerListener in interface FacesManagerfacesManagerListener - the listener
protected 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 FacesManagerfaceNum - 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 FacesManagerfaceNum - the face ID to request
null for the empty face@NotNull protected abstract FaceImages getFaceImages(int faceNum)
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 ID
@NotNull public javax.swing.ImageIcon getMagicMapImageIcon(int faceNum)
getMagicMapImageIcon in interface FacesManagerfaceNum - the face ID
@NotNull public javax.swing.ImageIcon getOriginalImageIcon(int faceNum)
getOriginalImageIcon in interface FacesManagerfaceNum - the face ID
@NotNull public javax.swing.ImageIcon getScaledImageIcon(int faceNum)
getScaledImageIcon in interface FacesManagerfaceNum - the face ID
@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 up
public void removeFacesManagerListener(@NotNull
FacesManagerListener facesManagerListener)
FacesManagerListener to be notified about updated
faces.
removeFacesManagerListener in interface FacesManagerfacesManagerListener - the listenerpublic void reset()
reset in interface FacesManager