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 TypeMethodDescriptionvoid
addChangeListener(ChangeListener listener)
Add a listener that should be notified when the representation of the value changes.int
Get the representation value.void
setMaxRepresentation(int max)
Set the maximum representation value.void
setValue(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
-