Class SettingsManager

java.lang.Object
control.SettingsManager

public class SettingsManager extends Object
The SettingsManager class provides methods for managing user settings and notifying listeners of changes.

Includes methods for getting and setting the current MeasurementSystem, ErrorDisplayState, and Currency, as well as registering listeners to be notified when settings change to reflect the changes in the UI.

See Also:
  • Constructor Details

    • SettingsManager

      public SettingsManager()
  • Method Details

    • getMeasurementSystem

      public static MeasurementSystem getMeasurementSystem()
      Retrieves the current measurement system.
      Returns:
      the current measurement system
    • setMeasurementSystem

      public static void setMeasurementSystem(MeasurementSystem system)
      Sets/updates the current measurement system to the given system.
      Parameters:
      system - the new measurement system
    • getErrorDisplayState

      public static ErrorDisplayState getErrorDisplayState()
      Retrieves the current error display state.
      Returns:
      the current error display state
    • setShowErrorPopups

      public static void setShowErrorPopups(ErrorDisplayState state)
      Sets/updates the current error display state to the given state.
      Parameters:
      state - the new error display state
    • getCurrency

      public static Currency getCurrency()
      Retrieves the current currency.
      Returns:
      the current currency
    • setCurrency

      public static void setCurrency(Currency selectedCurrency)
      Sets/updates the current currency to the given currency.
      Parameters:
      selectedCurrency - the new currency
    • registerListener

      public static void registerListener(SettingsManager.SettingsListener listener)
      Registers a listener to be notified when settings change.
      Parameters:
      listener - the listener to register