![]() |
SudokuFX
|
ViewModel managing menu options UI state and accessibility strings. More...
Collaboration diagram for fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel:Public Member Functions | |
| MenuBackgroundViewModel () | |
| StringBinding | backgroundAccessibleTextProperty () |
| StringBinding | backgroundColorAccessibleTextProperty () |
| StringBinding | backgroundColorRoleDescriptionProperty () |
| StringBinding | backgroundColorTooltipProperty () |
| StringBinding | backgroundImageAccessibleTextProperty () |
| StringBinding | backgroundImageRoleDescriptionProperty () |
| StringBinding | backgroundImageTextProperty () |
| StringBinding | backgroundImageTooltipProperty () |
| StringBinding | backgroundMenuMaxiAccessibleTextProperty () |
| StringBinding | backgroundMenuMaxiRoleDescriptionProperty () |
| StringBinding | backgroundMenuMaxiTextProperty () |
| StringBinding | backgroundMenuMaxiTooltipProperty () |
| StringBinding | backgroundOpacityAccessibleTextProperty () |
| StringBinding | backgroundOpacityRoleDescriptionProperty () |
| StringBinding | backgroundOpacityTextProperty () |
| StringBinding | backgroundOpacityTooltipProperty () |
| StringBinding | backgroundReduceAccessibleTextProperty () |
| StringBinding | backgroundReduceTextProperty () |
| StringBinding | backgroundReduceTooltipProperty () |
| StringBinding | backgroundRoleDescriptionProperty () |
| StringBinding | backgroundTextProperty () |
| StringBinding | backgroundTooltipProperty () |
| File | chooseBackgroundImage (Stage primaryStage) |
| Opens file chooser dialog for options image selection. | |
| boolean | getOpaqueMode () |
| Gets the grid opacity mode. | |
| void | handleFileImageChooser (File selectedFile, ToasterVBox toaster, SpinnerGridPane spinner, GridPane sudokuFX) |
| Handles image file selection by validating the file format and starting the image loading process. | |
| void | init (GridPane sudokuFX, ColorPicker menuBackgroundButtonColor, ToasterVBox toaster, SpinnerGridPane spinner) |
| Initializes the GridPane options with settings from database. | |
| boolean | toggleGridOpacity () |
| Toggles grid opacity mode and returns the new state. | |
| void | updateBackgroundColorAndApply (GridPane sudokuFX, Color color) |
| Sets the options color of the given GridPane. | |
Package Functions | |
| void | onImageTaskError (WorkerStateEvent e, ToasterVBox toaster, SpinnerGridPane spinner) |
| Called when the image loading task fails. | |
Private Member Functions | |
| StringBinding | createFormattedBinding (String key, String suffixKey) |
| Creates a StringBinding that returns the concatenation of two localized strings (main key and suffix key), updating automatically when the locale changes. | |
| FileChooser | createImageFileChooser () |
| Creates configured FileChooser for image files. | |
| StringBinding | createStringBinding (String key) |
| Creates a StringBinding that returns the localized string for the given key, updating automatically when the locale changes. | |
| void | loadImage (File selectedFile, ToasterVBox toaster, SpinnerGridPane spinner, GridPane sudokuFX) |
| Starts the asynchronous image loading and resizing task. | |
| void | onImageTaskComplete (Task< BackgroundImage > backgroundTask, ToasterVBox toaster, SpinnerGridPane spinner, GridPane sudokuFX) |
| Called upon successful completion of the image loading task. | |
| void | setColorFromModel (GridPane sudokuFX, ColorPicker menuBackgroundButtonColor, String colorValueFromModel) |
| Applies a options color to the GridPane and sets it in the ColorPicker. | |
| void | setOpaqueMode (boolean opaque) |
| Sets the grid opacity mode. | |
Static Private Attributes | |
| static final int | HEX_RADIX = 16 |
| static final Logger | LOG = LoggerFactory.getLogger(MenuBackgroundViewModel.class) |
| static final String | ROLE_CLOSED = "menu.accessibility.role.description.closed" |
| static final String | ROLE_OPENED = "menu.accessibility.role.description.opened" |
| static final String | ROLE_SUBMENU_OPTION |
ViewModel managing menu options UI state and accessibility strings.
Provides localized StringBindings for button labels, tooltips, and roles, updating automatically on locale changes. Supports options color and image initialization and updates, including asynchronous image loading with user feedback.
| fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.MenuBackgroundViewModel | ( | ) |
Here is the call graph for this function:| StringBinding fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.backgroundAccessibleTextProperty | ( | ) |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.backgroundColorAccessibleTextProperty | ( | ) |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.backgroundColorRoleDescriptionProperty | ( | ) |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.backgroundColorTooltipProperty | ( | ) |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.backgroundImageAccessibleTextProperty | ( | ) |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.backgroundImageRoleDescriptionProperty | ( | ) |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.backgroundImageTextProperty | ( | ) |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.backgroundImageTooltipProperty | ( | ) |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.backgroundMenuMaxiAccessibleTextProperty | ( | ) |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.backgroundMenuMaxiRoleDescriptionProperty | ( | ) |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.backgroundMenuMaxiTextProperty | ( | ) |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.backgroundMenuMaxiTooltipProperty | ( | ) |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.backgroundOpacityAccessibleTextProperty | ( | ) |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.backgroundOpacityRoleDescriptionProperty | ( | ) |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.backgroundOpacityTextProperty | ( | ) |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.backgroundOpacityTooltipProperty | ( | ) |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.backgroundReduceAccessibleTextProperty | ( | ) |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.backgroundReduceTextProperty | ( | ) |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.backgroundReduceTooltipProperty | ( | ) |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.backgroundRoleDescriptionProperty | ( | ) |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.backgroundTextProperty | ( | ) |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.backgroundTooltipProperty | ( | ) |
| File fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.chooseBackgroundImage | ( | Stage | primaryStage | ) |
Opens file chooser dialog for options image selection.
| primaryStage | parent stage for the dialog |
Here is the call graph for this function:
|
private |
Creates a StringBinding that returns the concatenation of two localized strings (main key and suffix key), updating automatically when the locale changes.
| key | the main i18n translation key |
| suffixKey | the suffix i18n translation key to append |
|
private |
Creates configured FileChooser for image files.
|
private |
Creates a StringBinding that returns the localized string for the given key, updating automatically when the locale changes.
| key | the i18n translation key |
| boolean fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.getOpaqueMode | ( | ) |
Gets the grid opacity mode.
| void fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.handleFileImageChooser | ( | File | selectedFile, |
| ToasterVBox | toaster, | ||
| SpinnerGridPane | spinner, | ||
| GridPane | sudokuFX ) |
Handles image file selection by validating the file format and starting the image loading process.
| selectedFile | The selected image file. |
| toaster | The toaster component for user notifications. |
| spinner | The spinner component to indicate loading. |
| sudokuFX | The GridPane where the options image will be applied. |
Here is the call graph for this function:| void fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.init | ( | GridPane | sudokuFX, |
| ColorPicker | menuBackgroundButtonColor, | ||
| ToasterVBox | toaster, | ||
| SpinnerGridPane | spinner ) |
Initializes the GridPane options with settings from database.
Loads and applies saved options configuration including color, image, and grid transparency.
This method performs the following initialization steps:
| sudokuFX | The GridPane to initialize with options settings |
| menuBackgroundButtonColor | The ColorPicker to sync with current color value |
| toaster | The toaster component for user notifications during image loading |
| spinner | The spinner component to indicate loading state during operations |
Here is the call graph for this function:
|
private |
Starts the asynchronous image loading and resizing task.
The task runs on a separate daemon thread, so it does not block application shutdown.
| selectedFile | The selected image file. |
| toaster | The toaster component for user notifications. |
| spinner | The spinner component to indicate loading. |
| sudokuFX | The GridPane where the options image will be applied. |
Here is the call graph for this function:
|
private |
Called upon successful completion of the image loading task.
Applies the loaded options image or shows an error toast if loading failed.
| backgroundTask | The completed options task. |
| toaster | The toaster component for user notifications. |
| spinner | The spinner component to hide loading state. |
| sudokuFX | The GridPane where the options image will be applied. |
Here is the call graph for this function:
|
package |
Called when the image loading task fails.
Logs the error and shows an error toast to the user.
| e | The failure event. |
| toaster | The toaster component for user notifications. |
| spinner | The spinner component to hide loading state. |
Here is the call graph for this function:
|
private |
Applies a options color to the GridPane and sets it in the ColorPicker.
| sudokuFX | The GridPane to update. |
| menuBackgroundButtonColor | The ColorPicker to update. |
| colorValueFromModel | The hex color string (e.g., "99b3ffcd"). |
|
private |
Sets the grid opacity mode.
| opaque | true for opaque mode, false for transparent |
| boolean fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.toggleGridOpacity | ( | ) |
Toggles grid opacity mode and returns the new state.
| void fr.softsf.sudokufx.viewmodel.MenuOptionsViewModel.updateBackgroundColorAndApply | ( | GridPane | sudokuFX, |
| Color | color ) |
Sets the options color of the given GridPane.
| sudokuFX | The GridPane to update. |
| color | The color to apply as the options. |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
private |
|
private |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |