Class SettingsManager
java.lang.Object
control.SettingsManager
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThe SettingsListener interface provides a method for notifying listeners when settings change. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CurrencyRetrieves the current currency.static ErrorDisplayStateRetrieves the current error display state.static MeasurementSystemRetrieves the current measurement system.static voidRegisters a listener to be notified when settings change.static voidsetCurrency(Currency selectedCurrency) Sets/updates the current currency to the given currency.static voidSets/updates the current measurement system to the given system.static voidSets/updates the current error display state to the given state.
-
Constructor Details
-
SettingsManager
public SettingsManager()
-
-
Method Details
-
getMeasurementSystem
Retrieves the current measurement system.- Returns:
- the current measurement system
-
setMeasurementSystem
Sets/updates the current measurement system to the given system.- Parameters:
system- the new measurement system
-
getErrorDisplayState
Retrieves the current error display state.- Returns:
- the current error display state
-
setShowErrorPopups
Sets/updates the current error display state to the given state.- Parameters:
state- the new error display state
-
getCurrency
-
setCurrency
Sets/updates the current currency to the given currency.- Parameters:
selectedCurrency- the new currency
-
registerListener
Registers a listener to be notified when settings change.- Parameters:
listener- the listener to register
-