Package games.stendhal.client.gui
Class AbstractScalingModel
java.lang.Object
games.stendhal.client.gui.AbstractScalingModel
- All Implemented Interfaces:
ScalingModel
- Direct Known Subclasses:
LinearScalingModel
A
ScalingModel
that implements ChangeListener handling, but nothing
else.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChangeListener(ChangeListener listener)
Add a listener that should be notified when the representation of the value changes.protected void
Notify change listeners.int
Get the representation value.protected boolean
setRepresentation(int representation)
Set the representation, and notify listeners if it changed.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface games.stendhal.client.gui.ScalingModel
setMaxRepresentation, setValue
-
Constructor Details
-
AbstractScalingModel
public AbstractScalingModel()
-
-
Method Details
-
addChangeListener
Description copied from interface:ScalingModel
Add a listener that should be notified when the representation of the value changes.- Specified by:
addChangeListener
in interfaceScalingModel
- Parameters:
listener
- change listener
-
setRepresentation
protected boolean setRepresentation(int representation)Set the representation, and notify listeners if it changed.- Parameters:
representation
- new representation- Returns:
true
if the representation changed, otherwisefalse
-
getRepresentation
public int getRepresentation()Description copied from interface:ScalingModel
Get the representation value.- Specified by:
getRepresentation
in interfaceScalingModel
- Returns:
- representation
-
fireChanged
protected void fireChanged()Notify change listeners.
-