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 interface
The SettingsListener interface provides a method for notifying listeners when settings change. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Currency
Retrieves the current currency.static ErrorDisplayState
Retrieves the current error display state.static MeasurementSystem
Retrieves the current measurement system.static void
Registers a listener to be notified when settings change.static void
setCurrency
(Currency selectedCurrency) Sets/updates the current currency to the given currency.static void
Sets/updates the current measurement system to the given system.static void
Sets/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
-