Class AbstractScalingModel

java.lang.Object
games.stendhal.client.gui.AbstractScalingModel
All Implemented Interfaces:
ScalingModel
Direct Known Subclasses:
LinearScalingModel

public abstract class AbstractScalingModel extends Object implements ScalingModel
A ScalingModel that implements ChangeListener handling, but nothing else.
  • Constructor Details

    • AbstractScalingModel

      public AbstractScalingModel()
  • Method Details

    • addChangeListener

      public void addChangeListener(ChangeListener listener)
      Description copied from interface: ScalingModel
      Add a listener that should be notified when the representation of the value changes.
      Specified by:
      addChangeListener in interface ScalingModel
      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, otherwise false
    • getRepresentation

      public int getRepresentation()
      Description copied from interface: ScalingModel
      Get the representation value.
      Specified by:
      getRepresentation in interface ScalingModel
      Returns:
      representation
    • fireChanged

      protected void fireChanged()
      Notify change listeners.