![]() |
SudokuFX
|
ViewModel for managing difficulty level selection in the menu. More...
Collaboration diagram for fr.softsf.sudokufx.viewmodel.MenuLevelViewModel:Public Member Functions | |
| StringBinding | accessibleTextBinding (PossibilityStarsHBox starsBox, String key) |
| Creates a StringBinding for the accessibility text of the stars UI component associated with a difficulty level. | |
| String | getAccessibilityKeyForLevel (DifficultyLevel level) |
| Returns the i18n key used for accessibility descriptions of a given difficulty level. | |
| BooleanBinding | isSelectedBinding (DifficultyLevel level) |
| Returns a reactive BooleanBinding indicating whether the given difficulty level is currently selected. | |
| StringBinding | labelTextBinding (DifficultyLevel level) |
| Creates a StringBinding for the localized label text of the specified difficulty level. | |
| IntegerProperty | percentageProperty () |
| Returns the property representing the stars completion percentage. | |
| ObjectProperty< DifficultyLevel > | selectedLevelProperty () |
| Returns the property representing the currently selected difficulty level. | |
| StringBinding | selectedRoleDescriptionBinding () |
| Returns a StringBinding for the localized role description text used for accessibility, describing the selected difficulty level. | |
| void | setPercentage (int value) |
| Sets the stars completion percentage. | |
| void | updateSelectedLevel (DifficultyLevel level, int stars) |
| Updates the selected difficulty level and its associated stars percentage. | |
Private Member Functions | |
| String | getLevelNameKey (DifficultyLevel level) |
| Returns the i18n key used for the display text of a given difficulty level. | |
Private Attributes | |
| final ObjectProperty< DifficultyLevel > | selectedLevel = new SimpleObjectProperty<>(null) |
| final IntegerProperty | starsPercentage = new SimpleIntegerProperty(100) |
ViewModel for managing difficulty level selection in the menu.
Manages the currently selected difficulty level and related UI bindings including labels, accessibility texts, and stars completion percentage. Provides reactive properties and bindings to facilitate JavaFX UI updates in response to state changes.
| StringBinding fr.softsf.sudokufx.viewmodel.MenuLevelViewModel.accessibleTextBinding | ( | PossibilityStarsHBox | starsBox, |
| String | key ) |
Creates a StringBinding for the accessibility text of the stars UI component associated with a difficulty level.
The binding reacts to changes in selection, stars percentage, and locale.
| starsBox | the stars UI component providing formatted text |
| key | the localization key for the accessibility text |
Here is the call graph for this function:| String fr.softsf.sudokufx.viewmodel.MenuLevelViewModel.getAccessibilityKeyForLevel | ( | DifficultyLevel | level | ) |
Returns the i18n key used for accessibility descriptions of a given difficulty level.
| level | the difficulty level |
|
private |
Returns the i18n key used for the display text of a given difficulty level.
| level | the difficulty level |
| BooleanBinding fr.softsf.sudokufx.viewmodel.MenuLevelViewModel.isSelectedBinding | ( | DifficultyLevel | level | ) |
Returns a reactive BooleanBinding indicating whether the given difficulty level is currently selected.
| level | the difficulty level to test |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuLevelViewModel.labelTextBinding | ( | DifficultyLevel | level | ) |
Creates a StringBinding for the localized label text of the specified difficulty level.
This binding updates automatically when the application locale changes.
| level | the difficulty level |
Here is the call graph for this function:| IntegerProperty fr.softsf.sudokufx.viewmodel.MenuLevelViewModel.percentageProperty | ( | ) |
Returns the property representing the stars completion percentage.
| ObjectProperty< DifficultyLevel > fr.softsf.sudokufx.viewmodel.MenuLevelViewModel.selectedLevelProperty | ( | ) |
Returns the property representing the currently selected difficulty level.
| StringBinding fr.softsf.sudokufx.viewmodel.MenuLevelViewModel.selectedRoleDescriptionBinding | ( | ) |
Returns a StringBinding for the localized role description text used for accessibility, describing the selected difficulty level.
| void fr.softsf.sudokufx.viewmodel.MenuLevelViewModel.setPercentage | ( | int | value | ) |
Sets the stars completion percentage.
| value | the new percentage value to set |
| void fr.softsf.sudokufx.viewmodel.MenuLevelViewModel.updateSelectedLevel | ( | DifficultyLevel | level, |
| int | stars ) |
Updates the selected difficulty level and its associated stars percentage.
| level | the new difficulty level (must not be null) |
| stars | the completion percentage |
| IllegalArgumentException | if level is null |
|
private |
|
private |