SudokuFX
Loading...
Searching...
No Matches
fr.softsf.sudokufx.viewmodel.MenuSaveViewModel Class Reference

ViewModel for managing backup menu UI state and accessibility texts. More...

+ Collaboration diagram for fr.softsf.sudokufx.viewmodel.MenuSaveViewModel:

Public Member Functions

 MenuSaveViewModel ()
 
StringBinding backupAccessibleTextProperty ()
 
StringBinding backupRoleDescriptionProperty ()
 
StringBinding backupTextProperty ()
 
StringBinding backupTooltipProperty ()
 
StringBinding cellConfirmationMessageProperty ()
 
StringBinding cellConfirmationTitleProperty ()
 
StringBinding cellDeleteAccessibleTextProperty ()
 
ObservableList< GameDto > getBackups ()
 
StringBinding maxiBackupAccessibleTextProperty ()
 
StringBinding maxiBackupRoleDescriptionProperty ()
 
StringBinding maxiBackupTextProperty ()
 
StringBinding maxiBackupTooltipProperty ()
 
StringBinding reduceAccessibleTextProperty ()
 
StringBinding reduceTextProperty ()
 
StringBinding reduceTooltipProperty ()
 
StringBinding saveAccessibleTextProperty ()
 
StringBinding saveRoleDescriptionProperty ()
 
StringBinding saveTextProperty ()
 
StringBinding saveTooltipProperty ()
 
ObjectProperty< GameDto > selectedBackupProperty ()
 

Private Member Functions

GameDto createBackupGameDto (Instant date, boolean isSelected)
 Generates a sample GameDto instance for testing purposes.
 
StringBinding createFormattedAndConcatenatedBinding (String key, String suffixKey)
 Creates a localized StringBinding by concatenating the value of two keys.
 
StringBinding createStringBinding (String key)
 Creates a simple localized StringBinding for the given key.
 
void loadBackups ()
 Loads test backups into the observable list.
 
void setSelectedBackup ()
 Sets the selected backup to the one marked as selected, or defaults to the first in the list if none are selected.
 

Private Attributes

final StringBinding backupAccessibleText
 
final StringBinding backupRoleDescription
 
final ObservableList< GameDto > backups = FXCollections.observableArrayList()
 
final StringBinding backupText
 
final StringBinding backupTooltip
 
final StringBinding cellConfirmationMessage
 
final StringBinding cellConfirmationTitle
 
final StringBinding cellDeleteAccessibleText
 
final StringBinding maxiBackupAccessibleText
 
final StringBinding maxiBackupRoleDescription
 
final StringBinding maxiBackupText
 
final StringBinding maxiBackupTooltip
 
final StringBinding reduceAccessibleText
 
final StringBinding reduceText
 
final StringBinding reduceTooltip
 
final StringBinding saveAccessibleText
 
final StringBinding saveRoleDescription
 
final StringBinding saveText
 
final StringBinding saveTooltip
 
final ObjectProperty< GameDto > selectedBackup = new SimpleObjectProperty<>()
 

Static Private Attributes

static final String MENU_ACCESSIBILITY_ROLE_DESCRIPTION_CLOSED
 
static final String MENU_ACCESSIBILITY_ROLE_DESCRIPTION_OPENED
 
static final int TEST_BACKUP_END = 11
 
static final int TEST_BACKUP_SELECTED_MINUTE = 25
 
static final int TEST_BACKUP_START = 31
 
static final int TEST_GRID_BYTE_VALUE = 75
 
static final int TEST_GRID_STRING_LENGTH = 81
 
static final int TEST_GRID_STRING_LENGTH_ALT = 810
 

Detailed Description

ViewModel for managing backup menu UI state and accessibility texts.

Holds an observable list of saved games, the currently selected backup, and provides localized StringBindings for UI labels, accessibility, tooltips, and role descriptions.

Uses I18n singleton for localization with automatic updates on locale changes.

Constructor & Destructor Documentation

◆ MenuSaveViewModel()

fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.MenuSaveViewModel ( )
+ Here is the call graph for this function:

Member Function Documentation

◆ backupAccessibleTextProperty()

StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.backupAccessibleTextProperty ( )

◆ backupRoleDescriptionProperty()

StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.backupRoleDescriptionProperty ( )

◆ backupTextProperty()

StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.backupTextProperty ( )

◆ backupTooltipProperty()

StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.backupTooltipProperty ( )

◆ cellConfirmationMessageProperty()

StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.cellConfirmationMessageProperty ( )

◆ cellConfirmationTitleProperty()

StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.cellConfirmationTitleProperty ( )

◆ cellDeleteAccessibleTextProperty()

StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.cellDeleteAccessibleTextProperty ( )

◆ createBackupGameDto()

GameDto fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.createBackupGameDto ( Instant date,
boolean isSelected )
private

Generates a sample GameDto instance for testing purposes.

Parameters
datethe timestamp of the backup
isSelectedwhether the backup is selected
Returns
a GameDto populated with mock data

◆ createFormattedAndConcatenatedBinding()

StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.createFormattedAndConcatenatedBinding ( String key,
String suffixKey )
private

Creates a localized StringBinding by concatenating the value of two keys.

Updates automatically when the locale changes.

Parameters
keythe base key
suffixKeythe key for the suffix to append
Returns
a StringBinding for the combined localized value

◆ createStringBinding()

StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.createStringBinding ( String key)
private

Creates a simple localized StringBinding for the given key.

Updates automatically when the locale changes.

Parameters
keythe i18n key
Returns
a StringBinding for the localized value

◆ getBackups()

ObservableList< GameDto > fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.getBackups ( )

◆ loadBackups()

void fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.loadBackups ( )
private

Loads test backups into the observable list.

The backup at minute +25 is marked as selected.

+ Here is the call graph for this function:

◆ maxiBackupAccessibleTextProperty()

StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.maxiBackupAccessibleTextProperty ( )

◆ maxiBackupRoleDescriptionProperty()

StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.maxiBackupRoleDescriptionProperty ( )

◆ maxiBackupTextProperty()

StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.maxiBackupTextProperty ( )

◆ maxiBackupTooltipProperty()

StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.maxiBackupTooltipProperty ( )

◆ reduceAccessibleTextProperty()

StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.reduceAccessibleTextProperty ( )

◆ reduceTextProperty()

StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.reduceTextProperty ( )

◆ reduceTooltipProperty()

StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.reduceTooltipProperty ( )

◆ saveAccessibleTextProperty()

StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.saveAccessibleTextProperty ( )

◆ saveRoleDescriptionProperty()

StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.saveRoleDescriptionProperty ( )

◆ saveTextProperty()

StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.saveTextProperty ( )

◆ saveTooltipProperty()

StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.saveTooltipProperty ( )

◆ selectedBackupProperty()

ObjectProperty< GameDto > fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.selectedBackupProperty ( )

◆ setSelectedBackup()

void fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.setSelectedBackup ( )
private

Sets the selected backup to the one marked as selected, or defaults to the first in the list if none are selected.

Member Data Documentation

◆ backupAccessibleText

final StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.backupAccessibleText
private

◆ backupRoleDescription

final StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.backupRoleDescription
private

◆ backups

final ObservableList<GameDto> fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.backups = FXCollections.observableArrayList()
private

◆ backupText

final StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.backupText
private

◆ backupTooltip

final StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.backupTooltip
private

◆ cellConfirmationMessage

final StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.cellConfirmationMessage
private

◆ cellConfirmationTitle

final StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.cellConfirmationTitle
private

◆ cellDeleteAccessibleText

final StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.cellDeleteAccessibleText
private

◆ maxiBackupAccessibleText

final StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.maxiBackupAccessibleText
private

◆ maxiBackupRoleDescription

final StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.maxiBackupRoleDescription
private

◆ maxiBackupText

final StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.maxiBackupText
private

◆ maxiBackupTooltip

final StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.maxiBackupTooltip
private

◆ MENU_ACCESSIBILITY_ROLE_DESCRIPTION_CLOSED

final String fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.MENU_ACCESSIBILITY_ROLE_DESCRIPTION_CLOSED
staticprivate
Initial value:
=
"menu.accessibility.role.description.closed"

◆ MENU_ACCESSIBILITY_ROLE_DESCRIPTION_OPENED

final String fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.MENU_ACCESSIBILITY_ROLE_DESCRIPTION_OPENED
staticprivate
Initial value:
=
"menu.accessibility.role.description.opened"

◆ reduceAccessibleText

final StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.reduceAccessibleText
private

◆ reduceText

final StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.reduceText
private

◆ reduceTooltip

final StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.reduceTooltip
private

◆ saveAccessibleText

final StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.saveAccessibleText
private

◆ saveRoleDescription

final StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.saveRoleDescription
private

◆ saveText

final StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.saveText
private

◆ saveTooltip

final StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.saveTooltip
private

◆ selectedBackup

final ObjectProperty<GameDto> fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.selectedBackup = new SimpleObjectProperty<>()
private

◆ TEST_BACKUP_END

final int fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.TEST_BACKUP_END = 11
staticprivate

◆ TEST_BACKUP_SELECTED_MINUTE

final int fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.TEST_BACKUP_SELECTED_MINUTE = 25
staticprivate

◆ TEST_BACKUP_START

final int fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.TEST_BACKUP_START = 31
staticprivate

◆ TEST_GRID_BYTE_VALUE

final int fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.TEST_GRID_BYTE_VALUE = 75
staticprivate

◆ TEST_GRID_STRING_LENGTH

final int fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.TEST_GRID_STRING_LENGTH = 81
staticprivate

◆ TEST_GRID_STRING_LENGTH_ALT

final int fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.TEST_GRID_STRING_LENGTH_ALT = 810
staticprivate

The documentation for this class was generated from the following file: