Interface PortraitProvider
-
- All Known Subinterfaces:
Handler
- All Known Implementing Classes:
DIY
public interface PortraitProviderThis interface is implemented by game components that include (or may include)Portraits: images that can be configured by the user and which appear on the component's sheets.- Since:
- 2.1a13
- Author:
- Chris Jennings
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PortraitgetPortrait(int index)Returns aPortraitthat can be used to manipulate one of the portrait images used by a component.intgetPortraitCount()Returns the number of portraits available from this provider.
-
-
-
Method Detail
-
getPortrait
Portrait getPortrait(int index)
Returns aPortraitthat can be used to manipulate one of the portrait images used by a component. A component may use more than one portrait. The value ofindexindicates which portrait is desired, and must be be between 0 andgetPortraitCount()-1 (inclusive).- Parameters:
index- the index of the desired portrait (0 for the primary portrait)- Returns:
- a portrait instance that controls the requested portrait
- Throws:
java.lang.IndexOutOfBoundsException- if the portrait index is negative or greater or equal to the portrait count
-
getPortraitCount
int getPortraitCount()
Returns the number of portraits available from this provider. The number of portraits should remain fixed over the lifetime of a provider.- Returns:
- the number of portraits that can be obtained with
getPortrait(int)(may be 0)
-
-