 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.faces;
25 import java.util.Collection;
26 import java.util.HashSet;
27 import java.util.concurrent.ExecutorService;
28 import java.util.concurrent.Executors;
29 import javax.swing.ImageIcon;
30 import org.jetbrains.annotations.NotNull;
42 private final Object
sync =
new Object();
101 synchronized (
sync) {
110 synchronized (
sync) {
156 final Thread thread = Thread.currentThread();
157 final String name = thread.getName();
166 if (originalImageIcon ==
null) {
172 if (scaledImageIcon ==
null) {
178 if (magicMapImageIcon ==
null) {
185 synchronized (
sync) {
190 thread.setName(name);
226 final Thread thread = Thread.currentThread();
227 final String name = thread.getName();
234 thread.setName(name);
final ExecutorService executorService
The ExecutorService used to execute face loading.
void reset()
Reset the processing: forget about pending faces.
ImageIcon getMagicMapImageIcon()
Returns the ImageIcon scaled for the magic map view.
FileCacheFaceQueue(@NotNull final ImageCache imageCacheOriginal, @NotNull final ImageCache imageCacheScaled, @NotNull final ImageCache imageCacheMagicMap)
Creates a new instance.
final FaceImages faceImages
The images to save.
ImageIcon getScaledImageIcon()
Returns the ImageIcon scaled for the map view.
final int taskId
The expected task FileCacheFaceQueue#id.
void loadFace(@NotNull final Face face)
Request a face.
void save(@NotNull Face face, @NotNull ImageIcon imageIcon)
Stores an ImageIcon into the cache.
void fireFaceLoaded(@NotNull final Face face, @NotNull final FaceImages faceImages)
Notify all listener with FaceQueueListener#faceLoaded(Face, FaceImages).
void saveFace(@NotNull final Face face, @NotNull final FaceImages faceImages)
Saves a face to the caches.
final Collection< Face > pendingLoadFaces
The faces for which loadFace(Face) has been called but that are not yet processed.
Interface for ImageIcon caching classes.
final Face face
The face to load.
ImageIcon load(@NotNull Face face)
Retrieves an image from the cache.
LoadTask(@NotNull final Face face)
Creates a new instance.
final ImageCache imageCacheMagicMap
The image cache used for loading magic map images.
SaveTask(@NotNull final Face face, @NotNull final FaceImages faceImages)
Creates a new instance.
final ImageCache imageCacheOriginal
The image cache used for loading original images.
A thread which loads one face from the caches.
final ImageCache imageCacheScaled
The image cache used for loading scaled images.
A FaceQueue loading faces from ImageCache instances.
int id
Counts the number of calls to reset().
Consists of three ImageIcons representing a Face.
final Face face
The face to save.
String getFaceName()
Returns the face name.
void fireFaceFailed(@NotNull final Face face)
Notify all listener with FaceQueueListener#faceFailed(Face).
ImageIcon getOriginalImageIcon()
Returns the ImageIcon as sent by the Crossfire server.
final Object sync
The object used for synchronization.
Abstract base class for classes implementing FaceQueue.
A thread which saves one face to the caches.