Package games.stendhal.client.gui
Interface ScalingModel
- All Known Implementing Classes:
AbstractScalingModel,LinearScalingModel
public interface ScalingModel
A model interface for values that need a representation as values [0, max],
where the representation is not necessarily the same as the original value,
for example the length of a health bar.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddChangeListener(ChangeListener listener) Add a listener that should be notified when the representation of the value changes.intGet the representation value.voidsetMaxRepresentation(int max) Set the maximum representation value.voidsetValue(double value) Set the internal value.
-
Method Details
-
addChangeListener
Add a listener that should be notified when the representation of the value changes.- Parameters:
listener- change listener
-
setValue
void setValue(double value) Set the internal value.- Parameters:
value- new value
-
getRepresentation
int getRepresentation()Get the representation value.- Returns:
- representation
-
setMaxRepresentation
void setMaxRepresentation(int max) Set the maximum representation value.- Parameters:
max- new maximum
-