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,
FaceObjects faceObjects,
ResourceIcons resourceIcons)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addFaceObjectProvidersListener(FaceObjectProvidersListener listener)
Adds a
FaceObjectProvidersListener to be notified about changes. |
javax.swing.ImageIcon |
getDisplayIcon(NamedObject namedObject)
Returns the display icon for a
NamedObject . |
javax.swing.ImageIcon |
getDouble(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(BaseObject<G,A,R,?> baseObject)
Returns the face of a
BaseObject as an ImageIcon . |
javax.swing.ImageIcon |
getImageIconForFacename(java.lang.String faceObjName)
Returns the
ImageIcon for a given face object name. |
javax.swing.ImageIcon |
getStretched(GameObject<?,?,?> gameObject,
long stretch)
Returns the stretched face for a
GameObject as an ImageIcon . |
javax.swing.ImageIcon |
getTrans(GameObject<?,?,?> gameObject)
Returns the transparent face for a
GameObject as an ImageIcon . |
javax.swing.ImageIcon |
getTransDouble(GameObject<?,?,?> gameObject)
Returns the transparent double face for a
GameObject as an ImageIcon . |
void |
reloadAll()
Reloads all providers provided by this FaceObjects.
|
void |
removeFaceObjectProvidersListener(FaceObjectProvidersListener listener)
Removes a
FaceObjectProvidersListener to be notified about
changes. |
void |
setNormal(FaceProvider normalFaceProvider)
Sets the normal
FaceProvider . |
public FaceObjectProviders(int doubleFaceOffset, @NotNull FaceObjects faceObjects, @NotNull ResourceIcons resourceIcons)
doubleFaceOffset
- the offset for shifting double facesfaceObjects
- the face objects instanceresourceIcons
- the resource icons for creating iconspublic void addFaceObjectProvidersListener(@NotNull FaceObjectProvidersListener listener)
FaceObjectProvidersListener
to be notified about changes.listener
- the listenerpublic void removeFaceObjectProvidersListener(@NotNull FaceObjectProvidersListener listener)
FaceObjectProvidersListener
to be notified about
changes.listener
- the listenerpublic void reloadAll()
public void setNormal(@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>> javax.swing.ImageIcon getFace(@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 javax.swing.ImageIcon getTrans(@NotNull GameObject<?,?,?> gameObject)
GameObject
as an ImageIcon
.gameObject
- the game object@NotNull public javax.swing.ImageIcon getDouble(@NotNull GameObject<?,?,?> gameObject)
GameObject
as an ImageIcon
.gameObject
- the game object@NotNull public javax.swing.ImageIcon getTransDouble(@NotNull GameObject<?,?,?> gameObject)
GameObject
as an ImageIcon
.gameObject
- the game object@NotNull public javax.swing.ImageIcon getStretched(@NotNull GameObject<?,?,?> gameObject, long stretch)
GameObject
as an ImageIcon
.gameObject
- the game object@Nullable public javax.swing.ImageIcon getImageIconForFacename(@NotNull java.lang.String faceObjName)
ImageIcon
for a given face object name.faceObjName
- the face object namenull
if not found@Nullable public javax.swing.ImageIcon getDisplayIcon(@NotNull NamedObject namedObject)
NamedObject
.namedObject
- the named object