com.realtime.crossfire.jxclient.faces
Class AbstractFaceQueue

java.lang.Object
  extended by com.realtime.crossfire.jxclient.faces.AbstractFaceQueue
All Implemented Interfaces:
FaceQueue
Direct Known Subclasses:
AskfaceFaceQueue, FacesQueue, FileCacheFaceQueue

public abstract class AbstractFaceQueue
extends java.lang.Object
implements FaceQueue

Abstract base class for classes implementing FaceQueue. This class maintains the FaceQueueListeners; implementing classes need to implement only the actual face loading code.


Field Summary
private  java.util.Collection<FaceQueueListener> faceQueueListeners
          The registered FaceQueueListeners.
 
Constructor Summary
AbstractFaceQueue()
           
 
Method Summary
 void addFaceQueueListener(FaceQueueListener faceQueueListener)
          Adds a FaceQueueListener to be notified about processed faces.
protected  void fireFaceFailed(Face face)
          Notify all listener with FaceQueueListener.faceFailed(Face).
protected  void fireFaceLoaded(Face face, FaceImages faceImages)
          Notify all listener with FaceQueueListener.faceLoaded(Face, FaceImages).
 void removeFaceQueueListener(FaceQueueListener faceQueueListener)
          Removes a FaceQueueListener to be notified about processed faces.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.realtime.crossfire.jxclient.faces.FaceQueue
loadFace, reset
 

Field Detail

faceQueueListeners

@NotNull
private final java.util.Collection<FaceQueueListener> faceQueueListeners
The registered FaceQueueListeners.

Constructor Detail

AbstractFaceQueue

public AbstractFaceQueue()
Method Detail

addFaceQueueListener

public void addFaceQueueListener(@NotNull
                                 FaceQueueListener faceQueueListener)
Adds a FaceQueueListener to be notified about processed faces.

Specified by:
addFaceQueueListener in interface FaceQueue
Parameters:
faceQueueListener - the listener to add

fireFaceFailed

protected void fireFaceFailed(@NotNull
                              Face face)
Notify all listener with FaceQueueListener.faceFailed(Face).

Parameters:
face - the face that has failed to load

fireFaceLoaded

protected void fireFaceLoaded(@NotNull
                              Face face,
                              @NotNull
                              FaceImages faceImages)
Notify all listener with FaceQueueListener.faceLoaded(Face, FaceImages).

Parameters:
face - the face that has been loaded
faceImages - the face images instance that has been loaded

removeFaceQueueListener

public void removeFaceQueueListener(@NotNull
                                    FaceQueueListener faceQueueListener)
Removes a FaceQueueListener to be notified about processed faces.

Specified by:
removeFaceQueueListener in interface FaceQueue
Parameters:
faceQueueListener - the listener to remove