Class FxStateConfigurableImage
public class FxStateConfigurableImage
{
// Constructors
public FxStateConfigurableImage(int states[]);
public FxStateConfigurableImage(int states[], Image images[]);
public FxStateConfigurableImage();
// Methods
public void addImage(int state, Image img);
public Image getImage(int state);
public int getStateID(int state);
public int[] getStates();
public void setImage(int state, Image img);
}
This class is a class factory, providing a set of Image objects that are associated with system states.
public FxStateConfigurableImage(int states[]);
Creates an FxStateConfigurableImage class factory with the specified states.
Parameter | Description |
states
| An array of states with which to create the class factory.
|
public FxStateConfigurableImage(int states[], Image images[]);
Creates an FxStateConfigurableImage class factory with the specified states.
Parameter | Description |
states
| An array of states with which to create the class factory.
|
images
| An array of Image objects to associate with the states.
|
public FxStateConfigurableImage();
The default constructor.
Remarks:
Currently, this constructor is not implemented.
public void addImage(int state, Image img);
Adds a new state and its associated image to the FxStateConfigurableImage class factory.
Return Value:
No return value.
Parameter | Description |
state
| The new state to add to the class factory object.
|
img
| The image to associate with the state.
|
public Image getImage(int state);
Retrieves a system image that is associated with the specified state.
Return Value:
Returns the requested system image. If no image is associated with the specified state, null is returned.
Parameter | Description |
state
| The state to retrieve the image for.
|
public int getStateID(int state);
Retrieves the states array index for the specified state. This method is used by the getImage method.
Return Value:
Returns the array index of the state. If the states array does not contain this state, -1 is returned.
Parameter | Description |
state
| The state to retrieve the array index for.
|
public int[] getStates();
Retrieves the FxStateConfigurableImage object's current states array.
Return Value:
Returns the current states array.
public void setImage(int state, Image img);
Associates a new image with the specified state.
Return Value:
No return value.
Parameter | Description |
state
| The state that the image is associated with.
|
img
| The image to set for the state.
|