Interface FacesManager
- All Known Implementing Classes:
AbstractFacesManager,DefaultFacesManager
public interface FacesManager
Maintains a mapping of face numbers to face data. Face data can be queried
for
original size,
scaled data for map views, or
reduced size for minimap
views.
Listeners can be
attached to be notified when face data has been loaded.-
Method Summary
Modifier and TypeMethodDescriptionvoidaddFacesManagerListener(@NotNull FacesManagerListener facesManagerListener) Adds aFacesManagerListenerto be notified about updated faces.@NotNull FacegetFace(int faceNum) Returns theFaceinstance for a given face ID.@Nullable FacegetFace2(int faceNum) Returns theFaceinstance for a given face ID.@NotNull ImageIcongetMagicMapImageIcon(int faceNum, @Nullable AtomicBoolean returnIsUnknownImage) Returns the "magic map" face for a face ID.@NotNull ImageIcongetOriginalImageIcon(int faceNum, @Nullable AtomicBoolean returnIsUnknownImage) Returns the "original" face for a face ID.@NotNull ImageIcongetScaledImageIcon(int faceNum, @Nullable AtomicBoolean returnIsUnknownImage) Returns the "scaled" face for a face ID.voidremoveFacesManagerListener(@NotNull FacesManagerListener facesManagerListener) Removes aFacesManagerListenerto be notified about updated faces.voidreset()Forgets about pending faces.
-
Method Details
-
getOriginalImageIcon
@NotNull @NotNull ImageIcon getOriginalImageIcon(int faceNum, @Nullable @Nullable AtomicBoolean returnIsUnknownImage) Returns the "original" face 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.- Parameters:
faceNum- the face IDreturnIsUnknownImage- returns whether the returned face is the "unknown" face; ignored ifnull- Returns:
- the face, or the "unknown" face if the face is not loaded
-
getScaledImageIcon
@NotNull @NotNull ImageIcon getScaledImageIcon(int faceNum, @Nullable @Nullable AtomicBoolean returnIsUnknownImage) Returns the "scaled" face 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.- Parameters:
faceNum- the face IDreturnIsUnknownImage- returns whether the returned face is the "unknown" face; ignored ifnull- Returns:
- the face, or the "unknown" face if the face is not loaded
-
getMagicMapImageIcon
@NotNull @NotNull ImageIcon getMagicMapImageIcon(int faceNum, @Nullable @Nullable AtomicBoolean returnIsUnknownImage) Returns the "magic map" face 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.- Parameters:
faceNum- the face IDreturnIsUnknownImage- returns whether the returned face is the "unknown" face; ignored ifnull- Returns:
- the face, or the "unknown" face if the face is not loaded
-
getFace
Returns theFaceinstance for a given face ID. Requests the face from the server if necessary.- Parameters:
faceNum- the face ID to request- Returns:
- the face
-
getFace2
Returns theFaceinstance for a given face ID. Requests the face from the server if necessary.- Parameters:
faceNum- the face ID to request- Returns:
- the face or
nullfor the empty face
-
addFacesManagerListener
Adds aFacesManagerListenerto be notified about updated faces.- Parameters:
facesManagerListener- the listener
-
removeFacesManagerListener
Removes aFacesManagerListenerto be notified about updated faces.- Parameters:
facesManagerListener- the listener
-
reset
void reset()Forgets about pending faces.
-