Class LinearScalingModel

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

public class LinearScalingModel extends AbstractScalingModel
A ScalingModel that implements a linearly displayed value with a known maximum. The representation will have value 0 at value 0, and the maximum representation when the value is the specified maximum.
  • Constructor Details

    • LinearScalingModel

      public LinearScalingModel()
      Create a LinearScalingModel with maximum value of 1.0, and maximum representation 1.
    • LinearScalingModel

      public LinearScalingModel(double maxValue, int maxRepresentation)
      Create a LinearScalingModel.
      Parameters:
      maxValue - maximum value of the variable
      maxRepresentation - the maximum of the presentation of the value
  • Method Details

    • setValue

      public void setValue(double value)
      Description copied from interface: ScalingModel
      Set the internal value.
      Parameters:
      value - new value
    • getValue

      public double getValue()
      Get the internal value.
      Returns:
      value
    • setMaxRepresentation

      public void setMaxRepresentation(int max)
      Description copied from interface: ScalingModel
      Set the maximum representation value.
      Parameters:
      max - new maximum
    • setMaxValue

      public void setMaxValue(double maxValue)
      Set the maximum value for the model, ie. the value that corresponds to the maximum representation.
      Parameters:
      maxValue - new maximum value