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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChangeListener(ChangeListener listener) Add a listener that should be notified when the representation of the value changes.protected voidNotify change listeners.intGet the representation value.protected booleansetRepresentation(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, waitMethods inherited from interface games.stendhal.client.gui.ScalingModel
setMaxRepresentation, setValue
-
Constructor Details
-
AbstractScalingModel
public AbstractScalingModel()
-
-
Method Details
-
addChangeListener
Description copied from interface:ScalingModelAdd a listener that should be notified when the representation of the value changes.- Specified by:
addChangeListenerin 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:
trueif the representation changed, otherwisefalse
-
getRepresentation
public int getRepresentation()Description copied from interface:ScalingModelGet the representation value.- Specified by:
getRepresentationin interfaceScalingModel- Returns:
- representation
-
fireChanged
protected void fireChanged()Notify change listeners.
-