public class FaceObjectProviders
extends java.lang.Object
GameObjects
and Archetypes
. The face can be the "normal" (default) face or a filtered
variant such as (semi-)transparent and/or double height.Constructor and Description |
---|
FaceObjectProviders(int doubleFaceOffset,
@NotNull FaceObjects faceObjects,
@NotNull ResourceIcons resourceIcons)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addFaceObjectProvidersListener(@NotNull FaceObjectProvidersListener listener)
Adds a
FaceObjectProvidersListener to be notified about changes. |
@Nullable javax.swing.ImageIcon |
getDisplayIcon(@NotNull NamedObject namedObject)
Returns the display icon for a
NamedObject . |
@NotNull javax.swing.ImageIcon |
getDouble(@NotNull GameObject<?,?,?> gameObject)
Returns the double face for a
GameObject as an ImageIcon . |
<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> |
getFace(@NotNull BaseObject<G,A,R,?> baseObject)
Returns the face of a
BaseObject as an ImageIcon . |
@Nullable javax.swing.ImageIcon |
getImageIconForFacename(@NotNull java.lang.String faceObjName)
Returns the
ImageIcon for a given face object name. |
@NotNull javax.swing.ImageIcon |
getStretched(@NotNull GameObject<?,?,?> gameObject,
long stretch)
Returns the stretched face for a
GameObject as an ImageIcon . |
@NotNull javax.swing.ImageIcon |
getTrans(@NotNull GameObject<?,?,?> gameObject)
Returns the transparent face for a
GameObject as an ImageIcon . |
@NotNull javax.swing.ImageIcon |
getTransDouble(@NotNull GameObject<?,?,?> gameObject)
Returns the transparent double face for a
GameObject as an ImageIcon . |
void |
reloadAll()
Reloads all providers provided by this FaceObjects.
|
void |
removeFaceObjectProvidersListener(@NotNull FaceObjectProvidersListener listener)
Removes a
FaceObjectProvidersListener to be notified about
changes. |
void |
setNormal(@NotNull FaceProvider normalFaceProvider)
Sets the normal
FaceProvider . |
public FaceObjectProviders(int doubleFaceOffset, @NotNull @NotNull FaceObjects faceObjects, @NotNull @NotNull ResourceIcons resourceIcons)
doubleFaceOffset
- the offset for shifting double facesfaceObjects
- the face objects instanceresourceIcons
- the resource icons for creating iconspublic void addFaceObjectProvidersListener(@NotNull @NotNull FaceObjectProvidersListener listener)
FaceObjectProvidersListener
to be notified about changes.listener
- the listenerpublic void removeFaceObjectProvidersListener(@NotNull @NotNull FaceObjectProvidersListener listener)
FaceObjectProvidersListener
to be notified about
changes.listener
- the listenerpublic void reloadAll()
public void setNormal(@NotNull @NotNull FaceProvider normalFaceProvider)
FaceProvider
. The normal face provider also
serves as parent for all other face providers.normalFaceProvider
- face the provider that provides normal images@NotNull public <G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> @NotNull javax.swing.ImageIcon getFace(@NotNull @NotNull BaseObject<G,A,R,?> baseObject)
BaseObject
as an ImageIcon
.baseObject
- the base object to get the face fornull
if no face
could be found@NotNull public @NotNull javax.swing.ImageIcon getTrans(@NotNull @NotNull GameObject<?,?,?> gameObject)
GameObject
as an ImageIcon
.gameObject
- the game object@NotNull public @NotNull javax.swing.ImageIcon getDouble(@NotNull @NotNull GameObject<?,?,?> gameObject)
GameObject
as an ImageIcon
.gameObject
- the game object@NotNull public @NotNull javax.swing.ImageIcon getTransDouble(@NotNull @NotNull GameObject<?,?,?> gameObject)
GameObject
as an ImageIcon
.gameObject
- the game object@NotNull public @NotNull javax.swing.ImageIcon getStretched(@NotNull @NotNull GameObject<?,?,?> gameObject, long stretch)
GameObject
as an ImageIcon
.gameObject
- the game object@Nullable public @Nullable javax.swing.ImageIcon getImageIconForFacename(@NotNull @NotNull java.lang.String faceObjName)
ImageIcon
for a given face object name.faceObjName
- the face object namenull
if not found@Nullable public @Nullable javax.swing.ImageIcon getDisplayIcon(@NotNull @NotNull NamedObject namedObject)
NamedObject
.namedObject
- the named object