Package jmri

Class ScaleManager

java.lang.Object
jmri.ScaleManager

public class ScaleManager extends Object
Create a list of layout scale objects and provide retrieval methods.

See Scale for details of each scale object.

Since:
4.13.6
  • Method Details

    • addScale

      public static void addScale(String scaleName, String userName, double scaleRatio)
      Create a scale instance and add it to the map.
      Parameters:
      scaleName - The scale name, such as HO.
      userName - The user name. By default the same as the scale name.
      scaleRatio - The ratio for the scale, such as 87.1.
    • getScale

      public static Scale getScale(@Nonnull String name)
      Get the scale that corresponds to the supplied scale name, otherwise null.
      Parameters:
      name - The scale name.
      Returns:
      The selected scale or null.
    • getScales

      public static ArrayList<Scale> getScales()
      Get a list of all scale entries sorted by user name.
      Returns:
      The sorted scale list.
    • getScaleByName

      public static Scale getScaleByName(@Nonnull String name)
      Get the scale that matches the user name, the scale name, or null. The user names are searched first. If not found then the scale name is used.
      Parameters:
      name - The user name or scale name.
      Returns:
      The selected scale or null.