SudokuFX
Loading...
Searching...
No Matches
fr.softsf.sudokufx.view.main.MainView Class Reference

Main view class of the Sudoku application. More...

+ Inheritance diagram for fr.softsf.sudokufx.view.main.MainView:
+ Collaboration diagram for fr.softsf.sudokufx.view.main.MainView:

Public Member Functions

 MainView (ActiveMenuOrSubmenuViewModel activeMenuOrSubmenuViewModel, Coordinator coordinator, HelpViewModel helpViewModel, MenuHiddenViewModel menuHiddenViewModel, MenuMiniViewModel menuMiniViewModel, MenuLevelViewModel menuLevelViewModel, MenuMaxiViewModel menuMaxiViewModel, MenuPlayerViewModel menuPlayerViewModel, MenuSaveViewModel menuSaveViewModel, MenuSolveViewModel menuSolveViewModel, MenuOptionsViewModel menuOptionsViewModel, MenuNewViewModel menuNewViewModel, GridViewModel gridViewModel, AudioService audioService, FileChooserService fileChooserService, BindingConfigurator bindingConfigurator, GenericListViewFactory genericListViewFactory, ToasterService toasterService)
 
void handleDifficultLevelShow ()
 Applies the DIFFICULT difficulty level, updates the grid and level view models accordingly.
 
void handleEasyLevelShow ()
 Applies the EASY difficulty level, updates the grid and level view models accordingly.
 
void handleMediumLevelShow ()
 Applies the MEDIUM difficulty level, updates the grid and level view models accordingly.
 
void handleMenuBackupShow ()
 Activates the BACKUP menu, refreshes the backup list to ensure the displayed data is up-to-date, and sets focus on the save button to facilitate keyboard navigation and accessibility.
 
void handleMenuHelpShow ()
 Displays the Help menu dialog with game rules and the application log path.
 
void handleMenuMaxiShow (ActionEvent event)
 Activates the MAXI menu and sets focus on the corresponding button based on the event source.
 
void handleMenuMiniShow ()
 Activates the MINI menu and starts a timer to auto-hide it after N seconds if it remains active and the "menuMiniButtonShow" button still has focus.
 
void handleMenuNewShow ()
 Opens GitHub releases URL via the Coordinator.
 
void handleMenuOptionsShow ()
 Activates the OPTIONS menu and sets focus on the options button.
 
void handleMenuPlayerShow ()
 Activates the PLAYER menu, refreshes the player list to reflect potential localization changes, and sets focus on the player button to assist keyboard and accessibility navigation.
 
void handleMenuSolveShow ()
 Activates the SOLVE menu, focuses the solve button, and updates the selected level if a solved grid is available.
 
void handleMute ()
 Called when the mute button is pressed.
 
void handleRestoreGridAndMenuMaxiShow (ActionEvent event)
 Restores the grid and shows the MAXI menu.
 
void handleRestoreGridAndMenuMiniShow ()
 Restores the grid and shows the MINI menu.
 
void handleSolveClearGrid ()
 Clear the grid in solve submenu.
 
void handleSongClear ()
 Clears the song, shows a toast, and refocuses the song button.
 
void handleToggleLanguage ()
 Switches language.
 
void openingMainStage (final ISplashScreenView iSplashScreenView)
 Opens the main stage and handles the transition from splash screen to full menu.
 

Private Member Functions

void activeMenuManagerInitialization ()
 Initializes bindings between each menu pane's visibility and managed state and the corresponding value of the active menu from ActiveMenuOrSubmenuViewModel.
 
void applyOpaqueMode (boolean opaque)
 Applies opaque or transparent styling to the sudoku grid and its cells by setting the
OPAQUE_MODE_PSEUDO_SELECTED
pseudo-class.
 
void bindLevel (DifficultyLevel level, PossibilityStarsHBox starsBox, Button maxi, Label label, Button mini)
 Binds UI components related to a specific difficulty level in both the maxi and mini menus.
 
void bindLevelAccessibility (DifficultyLevel level, PossibilityStarsHBox starsBox, Button maxi, Button mini)
 Binds accessibility properties (accessible text and role description) for the specified difficulty level's buttons.
 
void bindLevelLabelText (DifficultyLevel level, Label label)
 Binds the label's text to the localized name of the specified difficulty level.
 
void bindLevelSelectedStyling (DifficultyLevel level, Button maxi, Button mini)
 Binds the pseudo-class ":selected" state of the given buttons to the specified difficulty level.
 
void bindLevelStarsVisibility (DifficultyLevel level, PossibilityStarsHBox starsBox)
 Binds the visibility of the stars box to whether the specified difficulty level is selected.
 
void bindLevelTooltipText (DifficultyLevel level, PossibilityStarsHBox starsBox, Button maxi, Button mini)
 Binds the tooltip text properties of both buttons to the accessible text corresponding to the specified difficulty level to ensure consistency and improve user experience.
 
void bindVisibleAndManaged (Region menu, ActiveMenuOrSubmenuViewModel.ActiveMenu menuType)
 
void gridInitialization ()
 Initializes the 9x9 Sudoku grid UI and loads the current grid values from the model if they exist.
 
void handleFileImageChooser ()
 Opens a file chooser for a background image and passes the selected file to the ViewModel for asynchronous loading.
 
void handleFileSongChooser ()
 Opens a file chooser for a song and passes the selected file to the ViewModel for saving the path.
 
void handleGridOpacity ()
 Handles grid transparency toggle button action.
 
void hiddenMenuInitialization ()
 Initializes the hidden menu by binding its show button's accessible text and tooltip to the ViewModel.
 
Timeline hideMiniMenuTimelineInitialization ()
 Initializes a Timeline that hides the MINI menu after
AUTO_HIDE_MINI_MENU_DELAY_MS
milliseconds if it is still active and the "menuMiniButtonShow" button retains focus.
 
void initialize ()
 Initializes the main view.
 
void levelsMenuInitialization ()
 Initializes each difficulty level section in the menu by binding UI components to ViewModel properties for EASY, MEDIUM, and DIFFICULT levels.
 
void maxiMenuInitialization ()
 Initializes the maxi menu components by binding their labels, accessible texts, and tooltips to the corresponding properties in the ViewModel.
 
void miniMenuInitialization ()
 Initializes the mini menu by binding all buttons' texts and tooltips to their respective ViewModel properties.
 
void newMenuInitialization ()
 Binds "New" menu UI elements to the ViewModel for text, accessibility, visibility, and tooltips, and shows toast notifications on status message updates.
 
void openingConfigureStage ()
 Configures the primary stage for the full menu view.
 
void openingFadeIn (final Node node)
 Applies a fade-in effect to the given node.
 
void openingMaximizePrimaryStage ()
 Maximizes the primary stage to fill the primary screen.
 
void openingShowStage ()
 Shows the primary stage.
 
void optionsMenuInitialization ()
 Initializes and binds all UI components of the options menu to the MenuOptionsViewModel.
 
void playerMenuInitialization ()
 Initializes bindings and event listeners for the player menu components.
 
void restoreCurrentGridLevelFromModel ()
 Loads the current user-entered grid from the model and updates the selected level and completion percentage in the menu.
 
void saveMenuInitialization ()
 Initializes bindings and event listeners for the save menu components.
 
void solveMenuInitialization ()
 Sets up bindings between the solve menu UI components and menuSolveViewModel.
 
void stopAudioOnExitInitialization ()
 Registers a listener on the primary stage to stop all audio when the application window is closed.
 
void toasterInitialization ()
 Initializes the toaster by subscribing to the ToasterService.
 

Private Attributes

final ActiveMenuOrSubmenuViewModel activeMenuOrSubmenuViewModel
 
final AudioService audioService
 
final BindingConfigurator bindingConfigurator
 
final Coordinator coordinator
 
final FileChooserService fileChooserService
 
final GenericListViewFactory genericListViewFactory
 
final GridViewModel gridViewModel
 
final HelpViewModel helpViewModel
 
Timeline hideMiniMenuTimeline
 
VBox menuHidden
 
Button menuHiddenButtonShow
 
final MenuHiddenViewModel menuHiddenViewModel
 
final MenuLevelViewModel menuLevelViewModel
 
VBox menuMaxi
 
Button menuMaxiButtonBackup
 
Label menuMaxiButtonBackupText
 
Button menuMaxiButtonDifficult
 
Label menuMaxiButtonDifficultText
 
Button menuMaxiButtonEasy
 
Label menuMaxiButtonEasyText
 
Button menuMaxiButtonHelp
 
Label menuMaxiButtonHelpText
 
Button menuMaxiButtonLanguage
 
Label menuMaxiButtonLanguageIso
 
Label menuMaxiButtonLanguageText
 
Button menuMaxiButtonMedium
 
Label menuMaxiButtonMediumText
 
Button menuMaxiButtonNew
 
Label menuMaxiButtonNewText
 
Button menuMaxiButtonOptions
 
Label menuMaxiButtonOptionsText
 
Button menuMaxiButtonPlayer
 
Label menuMaxiButtonPlayerText
 
Button menuMaxiButtonReduce
 
Label menuMaxiButtonReduceText
 
Button menuMaxiButtonSolve
 
Label menuMaxiButtonSolveText
 
PossibilityStarsHBox menuMaxiHBoxDifficultPossibilities
 
PossibilityStarsHBox menuMaxiHBoxEasyPossibilities
 
PossibilityStarsHBox menuMaxiHBoxMediumPossibilities
 
final MenuMaxiViewModel menuMaxiViewModel
 
VBox menuMini
 
Button menuMiniButtonBackup
 
Button menuMiniButtonDifficult
 
Button menuMiniButtonEasy
 
Button menuMiniButtonHelp
 
Button menuMiniButtonLanguage
 
Label menuMiniButtonLanguageIso
 
Button menuMiniButtonMedium
 
Button menuMiniButtonNew
 
Button menuMiniButtonOptions
 
Button menuMiniButtonPlayer
 
Button menuMiniButtonShow
 
Button menuMiniButtonSolve
 
final MenuMiniViewModel menuMiniViewModel
 
final MenuNewViewModel menuNewViewModel
 
VBox menuOptions
 
ColorPicker menuOptionsButtonColor
 
Button menuOptionsButtonImage
 
Label menuOptionsButtonImageText
 
Button menuOptionsButtonMute
 
Text menuOptionsButtonMuteIcon
 
Label menuOptionsButtonMuteText
 
Button menuOptionsButtonOpacity
 
Text menuOptionsButtonOpacityIcon
 
Label menuOptionsButtonOpacityText
 
Button menuOptionsButtonOptions
 
Label menuOptionsButtonOptionsText
 
Button menuOptionsButtonReduce
 
Label menuOptionsButtonReduceText
 
Button menuOptionsButtonSong
 
Button menuOptionsButtonSongClear
 
Label menuOptionsButtonSongText
 
final MenuOptionsViewModel menuOptionsViewModel
 
VBox menuPlayer
 
Button menuPlayerButtonNew
 
Label menuPlayerButtonNewText
 
Button menuPlayerButtonPlayer
 
Button menuPlayerButtonPlayerEdit
 
Label menuPlayerButtonPlayerText
 
Button menuPlayerButtonReduce
 
Label menuPlayerButtonReduceText
 
Rectangle menuPlayerClipListView
 
ListView< PlayerDto > menuPlayerListView
 
final MenuPlayerViewModel menuPlayerViewModel
 
VBox menuSave
 
Button menuSaveButtonBackup
 
Label menuSaveButtonBackupText
 
Button menuSaveButtonReduce
 
Label menuSaveButtonReduceText
 
Button menuSaveButtonSave
 
Label menuSaveButtonSaveText
 
Rectangle menuSaveClipListView
 
ListView< GameDto > menuSaveListView
 
final MenuSaveViewModel menuSaveViewModel
 
VBox menuSolve
 
Button menuSolveButtonReduce
 
Label menuSolveButtonReduceText
 
Button menuSolveButtonSolve
 
Button menuSolveButtonSolveClear
 
Label menuSolveButtonSolveText
 
PossibilityStarsHBox menuSolveHBoxPossibilities
 
final MenuSolveViewModel menuSolveViewModel
 
Stage primaryStage
 
SpinnerGridPane spinner
 
GridPane sudokuFX
 
GridPane sudokuFXGridPane
 
ToasterVBox toaster
 
final ToasterService toasterService
 

Static Private Attributes

static final int AUTO_HIDE_MINI_MENU_DELAY_MS = 5_000
 
static final PseudoClass DIFFICULTY_LEVEL_PSEUDO_SELECTED
 
static final double FADE_IN_IN_SECONDS_AFTER_SPLASHSCREEN = 0.3
 
static final Logger LOG = LoggerFactory.getLogger(MainView.class)
 
static final int MAX_STARS_PERCENTAGE = 100
 
static final PseudoClass OPAQUE_MODE_PSEUDO_SELECTED
 
static final PseudoClass REDUCED_SONG_PSEUDO_SELECTED
 

Detailed Description

Main view class of the Sudoku application.

This class is responsible for displaying and managing the UI.

Constructor & Destructor Documentation

◆ MainView()

fr.softsf.sudokufx.view.main.MainView.MainView ( ActiveMenuOrSubmenuViewModel activeMenuOrSubmenuViewModel,
Coordinator coordinator,
HelpViewModel helpViewModel,
MenuHiddenViewModel menuHiddenViewModel,
MenuMiniViewModel menuMiniViewModel,
MenuLevelViewModel menuLevelViewModel,
MenuMaxiViewModel menuMaxiViewModel,
MenuPlayerViewModel menuPlayerViewModel,
MenuSaveViewModel menuSaveViewModel,
MenuSolveViewModel menuSolveViewModel,
MenuOptionsViewModel menuOptionsViewModel,
MenuNewViewModel menuNewViewModel,
GridViewModel gridViewModel,
AudioService audioService,
FileChooserService fileChooserService,
BindingConfigurator bindingConfigurator,
GenericListViewFactory genericListViewFactory,
ToasterService toasterService )

Member Function Documentation

◆ activeMenuManagerInitialization()

void fr.softsf.sudokufx.view.main.MainView.activeMenuManagerInitialization ( )
private

Initializes bindings between each menu pane's visibility and managed state and the corresponding value of the active menu from ActiveMenuOrSubmenuViewModel.

Ensures that only the currently active menu is visible and participates in layout calculations.

+ Here is the call graph for this function:

◆ applyOpaqueMode()

void fr.softsf.sudokufx.view.main.MainView.applyOpaqueMode ( boolean opaque)
private

Applies opaque or transparent styling to the sudoku grid and its cells by setting the
OPAQUE_MODE_PSEUDO_SELECTED
pseudo-class.

Parameters
opaquetrue for opaque styling, false for transparent

◆ bindLevel()

void fr.softsf.sudokufx.view.main.MainView.bindLevel ( DifficultyLevel level,
PossibilityStarsHBox starsBox,
Button maxi,
Label label,
Button mini )
private

Binds UI components related to a specific difficulty level in both the maxi and mini menus.

This method sets up the following behaviors:

  • Label: Binds the level name label text to the localized difficulty name.
  • Percentage binding: Binds the percentage property from the ViewModel to the stars box, ensuring that star display updates reflect changes in the ViewModel.
  • Visibility: Shows the stars box only when the level is selected.
  • Accessibility: Binds accessible text and role descriptions for screen readers.
  • Tooltip: Synchronizes tooltip text with accessible text for consistency.
  • Styling: Applies a pseudo-class to indicate selection state on buttons.
Parameters
levelthe difficulty level to bind
starsBoxthe UI component displaying possibility stars for this level
maxithe button in the maxi menu for this level
labelthe label showing the difficulty level name in the maxi menu
minithe button in the mini menu for this level
+ Here is the call graph for this function:

◆ bindLevelAccessibility()

void fr.softsf.sudokufx.view.main.MainView.bindLevelAccessibility ( DifficultyLevel level,
PossibilityStarsHBox starsBox,
Button maxi,
Button mini )
private

Binds accessibility properties (accessible text and role description) for the specified difficulty level's buttons.

Parameters
levelthe difficulty level whose accessibility properties are bound
starsBoxthe stars box used for calculating accessible text
maxithe button in the maxi menu
minithe button in the mini menu

◆ bindLevelLabelText()

void fr.softsf.sudokufx.view.main.MainView.bindLevelLabelText ( DifficultyLevel level,
Label label )
private

Binds the label's text to the localized name of the specified difficulty level.

Parameters
levelthe difficulty level whose label text to bind
labelthe label to bind

◆ bindLevelSelectedStyling()

void fr.softsf.sudokufx.view.main.MainView.bindLevelSelectedStyling ( DifficultyLevel level,
Button maxi,
Button mini )
private

Binds the pseudo-class ":selected" state of the given buttons to the specified difficulty level.

Updates styling immediately and whenever the selected level changes.

Parameters
levelthe difficulty level to track
maxithe button in the maxi menu
minithe button in the mini menu

◆ bindLevelStarsVisibility()

void fr.softsf.sudokufx.view.main.MainView.bindLevelStarsVisibility ( DifficultyLevel level,
PossibilityStarsHBox starsBox )
private

Binds the visibility of the stars box to whether the specified difficulty level is selected.

Parameters
levelthe difficulty level whose selection state controls visibility
starsBoxthe stars box to show or hide

◆ bindLevelTooltipText()

void fr.softsf.sudokufx.view.main.MainView.bindLevelTooltipText ( DifficultyLevel level,
PossibilityStarsHBox starsBox,
Button maxi,
Button mini )
private

Binds the tooltip text properties of both buttons to the accessible text corresponding to the specified difficulty level to ensure consistency and improve user experience.

Parameters
levelthe difficulty level whose tooltip text is bound
starsBoxthe stars UI component used to compute accessible text
maxithe button in the maxi menu
minithe button in the mini menu

◆ bindVisibleAndManaged()

void fr.softsf.sudokufx.view.main.MainView.bindVisibleAndManaged ( Region menu,
ActiveMenuOrSubmenuViewModel.ActiveMenu menuType )
private

◆ gridInitialization()

void fr.softsf.sudokufx.view.main.MainView.gridInitialization ( )
private

Initializes the 9x9 Sudoku grid UI and loads the current grid values from the model if they exist.

+ Here is the call graph for this function:

◆ handleDifficultLevelShow()

void fr.softsf.sudokufx.view.main.MainView.handleDifficultLevelShow ( )

Applies the DIFFICULT difficulty level, updates the grid and level view models accordingly.

+ Here is the call graph for this function:

◆ handleEasyLevelShow()

void fr.softsf.sudokufx.view.main.MainView.handleEasyLevelShow ( )

Applies the EASY difficulty level, updates the grid and level view models accordingly.

+ Here is the call graph for this function:

◆ handleFileImageChooser()

void fr.softsf.sudokufx.view.main.MainView.handleFileImageChooser ( )
private

Opens a file chooser for a background image and passes the selected file to the ViewModel for asynchronous loading.

◆ handleFileSongChooser()

void fr.softsf.sudokufx.view.main.MainView.handleFileSongChooser ( )
private

Opens a file chooser for a song and passes the selected file to the ViewModel for saving the path.

◆ handleGridOpacity()

void fr.softsf.sudokufx.view.main.MainView.handleGridOpacity ( )
private

Handles grid transparency toggle button action.

+ Here is the call graph for this function:

◆ handleMediumLevelShow()

void fr.softsf.sudokufx.view.main.MainView.handleMediumLevelShow ( )

Applies the MEDIUM difficulty level, updates the grid and level view models accordingly.

+ Here is the call graph for this function:

◆ handleMenuBackupShow()

void fr.softsf.sudokufx.view.main.MainView.handleMenuBackupShow ( )

Activates the BACKUP menu, refreshes the backup list to ensure the displayed data is up-to-date, and sets focus on the save button to facilitate keyboard navigation and accessibility.

◆ handleMenuHelpShow()

void fr.softsf.sudokufx.view.main.MainView.handleMenuHelpShow ( )

Displays the Help menu dialog with game rules and the application log path.

◆ handleMenuMaxiShow()

void fr.softsf.sudokufx.view.main.MainView.handleMenuMaxiShow ( ActionEvent event)

Activates the MAXI menu and sets focus on the corresponding button based on the event source.

Stops the MINI menu auto-hide timer if running.

Parameters
eventthe event triggered by a submenu button click

◆ handleMenuMiniShow()

void fr.softsf.sudokufx.view.main.MainView.handleMenuMiniShow ( )

Activates the MINI menu and starts a timer to auto-hide it after N seconds if it remains active and the "menuMiniButtonShow" button still has focus.

◆ handleMenuNewShow()

void fr.softsf.sudokufx.view.main.MainView.handleMenuNewShow ( )

Opens GitHub releases URL via the Coordinator.

◆ handleMenuOptionsShow()

void fr.softsf.sudokufx.view.main.MainView.handleMenuOptionsShow ( )

Activates the OPTIONS menu and sets focus on the options button.

◆ handleMenuPlayerShow()

void fr.softsf.sudokufx.view.main.MainView.handleMenuPlayerShow ( )

Activates the PLAYER menu, refreshes the player list to reflect potential localization changes, and sets focus on the player button to assist keyboard and accessibility navigation.

◆ handleMenuSolveShow()

void fr.softsf.sudokufx.view.main.MainView.handleMenuSolveShow ( )

Activates the SOLVE menu, focuses the solve button, and updates the selected level if a solved grid is available.

◆ handleMute()

void fr.softsf.sudokufx.view.main.MainView.handleMute ( )

Called when the mute button is pressed.

Toggles the audio mute state via the ViewModel.

◆ handleRestoreGridAndMenuMaxiShow()

void fr.softsf.sudokufx.view.main.MainView.handleRestoreGridAndMenuMaxiShow ( ActionEvent event)

Restores the grid and shows the MAXI menu.

+ Here is the call graph for this function:

◆ handleRestoreGridAndMenuMiniShow()

void fr.softsf.sudokufx.view.main.MainView.handleRestoreGridAndMenuMiniShow ( )

Restores the grid and shows the MINI menu.

+ Here is the call graph for this function:

◆ handleSolveClearGrid()

void fr.softsf.sudokufx.view.main.MainView.handleSolveClearGrid ( )

Clear the grid in solve submenu.

+ Here is the call graph for this function:

◆ handleSongClear()

void fr.softsf.sudokufx.view.main.MainView.handleSongClear ( )

Clears the song, shows a toast, and refocuses the song button.

◆ handleToggleLanguage()

void fr.softsf.sudokufx.view.main.MainView.handleToggleLanguage ( )

Switches language.

◆ hiddenMenuInitialization()

void fr.softsf.sudokufx.view.main.MainView.hiddenMenuInitialization ( )
private

Initializes the hidden menu by binding its show button's accessible text and tooltip to the ViewModel.

◆ hideMiniMenuTimelineInitialization()

Timeline fr.softsf.sudokufx.view.main.MainView.hideMiniMenuTimelineInitialization ( )
private

Initializes a Timeline that hides the MINI menu after
AUTO_HIDE_MINI_MENU_DELAY_MS
milliseconds if it is still active and the "menuMiniButtonShow" button retains focus.

Returns
the Timeline responsible for automatically hiding the MINI menu

◆ initialize()

void fr.softsf.sudokufx.view.main.MainView.initialize ( )
private

Initializes the main view.

This method is automatically called by JavaFX after loading the FXML. It performs the following actions:

  • Sets the application's locale based on the current player's language.
  • Initializes audio management, menu timelines, and menu components.
  • Initializes the grid and active menu manager.
+ Here is the call graph for this function:

◆ levelsMenuInitialization()

void fr.softsf.sudokufx.view.main.MainView.levelsMenuInitialization ( )
private

Initializes each difficulty level section in the menu by binding UI components to ViewModel properties for EASY, MEDIUM, and DIFFICULT levels.

+ Here is the call graph for this function:

◆ maxiMenuInitialization()

void fr.softsf.sudokufx.view.main.MainView.maxiMenuInitialization ( )
private

Initializes the maxi menu components by binding their labels, accessible texts, and tooltips to the corresponding properties in the ViewModel.

◆ miniMenuInitialization()

void fr.softsf.sudokufx.view.main.MainView.miniMenuInitialization ( )
private

Initializes the mini menu by binding all buttons' texts and tooltips to their respective ViewModel properties.

◆ newMenuInitialization()

void fr.softsf.sudokufx.view.main.MainView.newMenuInitialization ( )
private

Binds "New" menu UI elements to the ViewModel for text, accessibility, visibility, and tooltips, and shows toast notifications on status message updates.

◆ openingConfigureStage()

void fr.softsf.sudokufx.view.main.MainView.openingConfigureStage ( )
private

Configures the primary stage for the full menu view.

◆ openingFadeIn()

void fr.softsf.sudokufx.view.main.MainView.openingFadeIn ( final Node node)
private

Applies a fade-in effect to the given node.

Parameters
nodeThe node to apply the fade-in effect to

◆ openingMainStage()

void fr.softsf.sudokufx.view.main.MainView.openingMainStage ( final ISplashScreenView iSplashScreenView)

Opens the main stage and handles the transition from splash screen to full menu.

Parameters
iSplashScreenViewThe splash screen view interface

Implements fr.softsf.sudokufx.common.interfaces.IMainView.

+ Here is the call graph for this function:

◆ openingMaximizePrimaryStage()

void fr.softsf.sudokufx.view.main.MainView.openingMaximizePrimaryStage ( )
private

Maximizes the primary stage to fill the primary screen.

◆ openingShowStage()

void fr.softsf.sudokufx.view.main.MainView.openingShowStage ( )
private

Shows the primary stage.

◆ optionsMenuInitialization()

void fr.softsf.sudokufx.view.main.MainView.optionsMenuInitialization ( )
private

Initializes and binds all UI components of the options menu to the MenuOptionsViewModel.

Loads saved options from the database and applies them to the corresponding UI controls.

This method performs the following tasks:

  • Binds accessibility texts, tooltips, role descriptions, and labels for all options buttons.
  • Synchronizes user interactions (color selection, opacity adjustment, mute toggle, etc.) with the ViewModel.
  • Loads and applies saved configuration settings to the UI controls, including background color, background image, grid transparency, etc.
  • Configures reactive UI states: song clear button visibility and song selection pseudo-class are bound to song availability state.
+ Here is the call graph for this function:

◆ playerMenuInitialization()

void fr.softsf.sudokufx.view.main.MainView.playerMenuInitialization ( )
private

Initializes bindings and event listeners for the player menu components.

Binds accessible texts, tooltips, and displayed texts to the ViewModel. Synchronizes selected player state between the ListView and ViewModel. Sets up the player ListView with custom cells and refreshes UI state.

◆ restoreCurrentGridLevelFromModel()

void fr.softsf.sudokufx.view.main.MainView.restoreCurrentGridLevelFromModel ( )
private

Loads the current user-entered grid from the model and updates the selected level and completion percentage in the menu.

Used to synchronize the ViewModel with the latest grid state stored in the model.

◆ saveMenuInitialization()

void fr.softsf.sudokufx.view.main.MainView.saveMenuInitialization ( )
private

Initializes bindings and event listeners for the save menu components.

Binds accessibility texts, tooltips, and labels to the ViewModel. Synchronizes the selected backup between the ListView and the ViewModel. Sets up the ListView with custom backup cells and refreshes UI state.

◆ solveMenuInitialization()

void fr.softsf.sudokufx.view.main.MainView.solveMenuInitialization ( )
private

Sets up bindings between the solve menu UI components and menuSolveViewModel.

Binds accessibility texts, tooltips, role descriptions, and labels, and synchronizes stars percentage from menuLevelViewModel to menuSolveViewModel (bindBidirectional).

◆ stopAudioOnExitInitialization()

void fr.softsf.sudokufx.view.main.MainView.stopAudioOnExitInitialization ( )
private

Registers a listener on the primary stage to stop all audio when the application window is closed.

◆ toasterInitialization()

void fr.softsf.sudokufx.view.main.MainView.toasterInitialization ( )
private

Initializes the toaster by subscribing to the ToasterService.

When a new fr.softsf.sudokufx.dto.ToastData is published via ToasterService#toastRequestProperty(), this method adds the toast to the ToasterVBox. It also listens to ToasterService#removeToastRequestProperty() to remove the currently displayed toast when requested.

Member Data Documentation

◆ activeMenuOrSubmenuViewModel

final ActiveMenuOrSubmenuViewModel fr.softsf.sudokufx.view.main.MainView.activeMenuOrSubmenuViewModel
private

◆ audioService

final AudioService fr.softsf.sudokufx.view.main.MainView.audioService
private

◆ AUTO_HIDE_MINI_MENU_DELAY_MS

final int fr.softsf.sudokufx.view.main.MainView.AUTO_HIDE_MINI_MENU_DELAY_MS = 5_000
staticprivate

◆ bindingConfigurator

final BindingConfigurator fr.softsf.sudokufx.view.main.MainView.bindingConfigurator
private

◆ coordinator

final Coordinator fr.softsf.sudokufx.view.main.MainView.coordinator
private

◆ DIFFICULTY_LEVEL_PSEUDO_SELECTED

final PseudoClass fr.softsf.sudokufx.view.main.MainView.DIFFICULTY_LEVEL_PSEUDO_SELECTED
staticprivate
Initial value:
=
PseudoClass.getPseudoClass("selected")

◆ FADE_IN_IN_SECONDS_AFTER_SPLASHSCREEN

final double fr.softsf.sudokufx.view.main.MainView.FADE_IN_IN_SECONDS_AFTER_SPLASHSCREEN = 0.3
staticprivate

◆ fileChooserService

final FileChooserService fr.softsf.sudokufx.view.main.MainView.fileChooserService
private

◆ genericListViewFactory

final GenericListViewFactory fr.softsf.sudokufx.view.main.MainView.genericListViewFactory
private

◆ gridViewModel

final GridViewModel fr.softsf.sudokufx.view.main.MainView.gridViewModel
private

◆ helpViewModel

final HelpViewModel fr.softsf.sudokufx.view.main.MainView.helpViewModel
private

◆ hideMiniMenuTimeline

Timeline fr.softsf.sudokufx.view.main.MainView.hideMiniMenuTimeline
private

◆ LOG

final Logger fr.softsf.sudokufx.view.main.MainView.LOG = LoggerFactory.getLogger(MainView.class)
staticprivate

◆ MAX_STARS_PERCENTAGE

final int fr.softsf.sudokufx.view.main.MainView.MAX_STARS_PERCENTAGE = 100
staticprivate

◆ menuHidden

VBox fr.softsf.sudokufx.view.main.MainView.menuHidden
private

◆ menuHiddenButtonShow

Button fr.softsf.sudokufx.view.main.MainView.menuHiddenButtonShow
private

◆ menuHiddenViewModel

final MenuHiddenViewModel fr.softsf.sudokufx.view.main.MainView.menuHiddenViewModel
private

◆ menuLevelViewModel

final MenuLevelViewModel fr.softsf.sudokufx.view.main.MainView.menuLevelViewModel
private

◆ menuMaxi

VBox fr.softsf.sudokufx.view.main.MainView.menuMaxi
private

◆ menuMaxiButtonBackup

Button fr.softsf.sudokufx.view.main.MainView.menuMaxiButtonBackup
private

◆ menuMaxiButtonBackupText

Label fr.softsf.sudokufx.view.main.MainView.menuMaxiButtonBackupText
private

◆ menuMaxiButtonDifficult

Button fr.softsf.sudokufx.view.main.MainView.menuMaxiButtonDifficult
private

◆ menuMaxiButtonDifficultText

Label fr.softsf.sudokufx.view.main.MainView.menuMaxiButtonDifficultText
private

◆ menuMaxiButtonEasy

Button fr.softsf.sudokufx.view.main.MainView.menuMaxiButtonEasy
private

◆ menuMaxiButtonEasyText

Label fr.softsf.sudokufx.view.main.MainView.menuMaxiButtonEasyText
private

◆ menuMaxiButtonHelp

Button fr.softsf.sudokufx.view.main.MainView.menuMaxiButtonHelp
private

◆ menuMaxiButtonHelpText

Label fr.softsf.sudokufx.view.main.MainView.menuMaxiButtonHelpText
private

◆ menuMaxiButtonLanguage

Button fr.softsf.sudokufx.view.main.MainView.menuMaxiButtonLanguage
private

◆ menuMaxiButtonLanguageIso

Label fr.softsf.sudokufx.view.main.MainView.menuMaxiButtonLanguageIso
private

◆ menuMaxiButtonLanguageText

Label fr.softsf.sudokufx.view.main.MainView.menuMaxiButtonLanguageText
private

◆ menuMaxiButtonMedium

Button fr.softsf.sudokufx.view.main.MainView.menuMaxiButtonMedium
private

◆ menuMaxiButtonMediumText

Label fr.softsf.sudokufx.view.main.MainView.menuMaxiButtonMediumText
private

◆ menuMaxiButtonNew

Button fr.softsf.sudokufx.view.main.MainView.menuMaxiButtonNew
private

◆ menuMaxiButtonNewText

Label fr.softsf.sudokufx.view.main.MainView.menuMaxiButtonNewText
private

◆ menuMaxiButtonOptions

Button fr.softsf.sudokufx.view.main.MainView.menuMaxiButtonOptions
private

◆ menuMaxiButtonOptionsText

Label fr.softsf.sudokufx.view.main.MainView.menuMaxiButtonOptionsText
private

◆ menuMaxiButtonPlayer

Button fr.softsf.sudokufx.view.main.MainView.menuMaxiButtonPlayer
private

◆ menuMaxiButtonPlayerText

Label fr.softsf.sudokufx.view.main.MainView.menuMaxiButtonPlayerText
private

◆ menuMaxiButtonReduce

Button fr.softsf.sudokufx.view.main.MainView.menuMaxiButtonReduce
private

◆ menuMaxiButtonReduceText

Label fr.softsf.sudokufx.view.main.MainView.menuMaxiButtonReduceText
private

◆ menuMaxiButtonSolve

Button fr.softsf.sudokufx.view.main.MainView.menuMaxiButtonSolve
private

◆ menuMaxiButtonSolveText

Label fr.softsf.sudokufx.view.main.MainView.menuMaxiButtonSolveText
private

◆ menuMaxiHBoxDifficultPossibilities

PossibilityStarsHBox fr.softsf.sudokufx.view.main.MainView.menuMaxiHBoxDifficultPossibilities
private

◆ menuMaxiHBoxEasyPossibilities

PossibilityStarsHBox fr.softsf.sudokufx.view.main.MainView.menuMaxiHBoxEasyPossibilities
private

◆ menuMaxiHBoxMediumPossibilities

PossibilityStarsHBox fr.softsf.sudokufx.view.main.MainView.menuMaxiHBoxMediumPossibilities
private

◆ menuMaxiViewModel

final MenuMaxiViewModel fr.softsf.sudokufx.view.main.MainView.menuMaxiViewModel
private

◆ menuMini

VBox fr.softsf.sudokufx.view.main.MainView.menuMini
private

◆ menuMiniButtonBackup

Button fr.softsf.sudokufx.view.main.MainView.menuMiniButtonBackup
private

◆ menuMiniButtonDifficult

Button fr.softsf.sudokufx.view.main.MainView.menuMiniButtonDifficult
private

◆ menuMiniButtonEasy

Button fr.softsf.sudokufx.view.main.MainView.menuMiniButtonEasy
private

◆ menuMiniButtonHelp

Button fr.softsf.sudokufx.view.main.MainView.menuMiniButtonHelp
private

◆ menuMiniButtonLanguage

Button fr.softsf.sudokufx.view.main.MainView.menuMiniButtonLanguage
private

◆ menuMiniButtonLanguageIso

Label fr.softsf.sudokufx.view.main.MainView.menuMiniButtonLanguageIso
private

◆ menuMiniButtonMedium

Button fr.softsf.sudokufx.view.main.MainView.menuMiniButtonMedium
private

◆ menuMiniButtonNew

Button fr.softsf.sudokufx.view.main.MainView.menuMiniButtonNew
private

◆ menuMiniButtonOptions

Button fr.softsf.sudokufx.view.main.MainView.menuMiniButtonOptions
private

◆ menuMiniButtonPlayer

Button fr.softsf.sudokufx.view.main.MainView.menuMiniButtonPlayer
private

◆ menuMiniButtonShow

Button fr.softsf.sudokufx.view.main.MainView.menuMiniButtonShow
private

◆ menuMiniButtonSolve

Button fr.softsf.sudokufx.view.main.MainView.menuMiniButtonSolve
private

◆ menuMiniViewModel

final MenuMiniViewModel fr.softsf.sudokufx.view.main.MainView.menuMiniViewModel
private

◆ menuNewViewModel

final MenuNewViewModel fr.softsf.sudokufx.view.main.MainView.menuNewViewModel
private

◆ menuOptions

VBox fr.softsf.sudokufx.view.main.MainView.menuOptions
private

◆ menuOptionsButtonColor

ColorPicker fr.softsf.sudokufx.view.main.MainView.menuOptionsButtonColor
private

◆ menuOptionsButtonImage

Button fr.softsf.sudokufx.view.main.MainView.menuOptionsButtonImage
private

◆ menuOptionsButtonImageText

Label fr.softsf.sudokufx.view.main.MainView.menuOptionsButtonImageText
private

◆ menuOptionsButtonMute

Button fr.softsf.sudokufx.view.main.MainView.menuOptionsButtonMute
private

◆ menuOptionsButtonMuteIcon

Text fr.softsf.sudokufx.view.main.MainView.menuOptionsButtonMuteIcon
private

◆ menuOptionsButtonMuteText

Label fr.softsf.sudokufx.view.main.MainView.menuOptionsButtonMuteText
private

◆ menuOptionsButtonOpacity

Button fr.softsf.sudokufx.view.main.MainView.menuOptionsButtonOpacity
private

◆ menuOptionsButtonOpacityIcon

Text fr.softsf.sudokufx.view.main.MainView.menuOptionsButtonOpacityIcon
private

◆ menuOptionsButtonOpacityText

Label fr.softsf.sudokufx.view.main.MainView.menuOptionsButtonOpacityText
private

◆ menuOptionsButtonOptions

Button fr.softsf.sudokufx.view.main.MainView.menuOptionsButtonOptions
private

◆ menuOptionsButtonOptionsText

Label fr.softsf.sudokufx.view.main.MainView.menuOptionsButtonOptionsText
private

◆ menuOptionsButtonReduce

Button fr.softsf.sudokufx.view.main.MainView.menuOptionsButtonReduce
private

◆ menuOptionsButtonReduceText

Label fr.softsf.sudokufx.view.main.MainView.menuOptionsButtonReduceText
private

◆ menuOptionsButtonSong

Button fr.softsf.sudokufx.view.main.MainView.menuOptionsButtonSong
private

◆ menuOptionsButtonSongClear

Button fr.softsf.sudokufx.view.main.MainView.menuOptionsButtonSongClear
private

◆ menuOptionsButtonSongText

Label fr.softsf.sudokufx.view.main.MainView.menuOptionsButtonSongText
private

◆ menuOptionsViewModel

final MenuOptionsViewModel fr.softsf.sudokufx.view.main.MainView.menuOptionsViewModel
private

◆ menuPlayer

VBox fr.softsf.sudokufx.view.main.MainView.menuPlayer
private

◆ menuPlayerButtonNew

Button fr.softsf.sudokufx.view.main.MainView.menuPlayerButtonNew
private

◆ menuPlayerButtonNewText

Label fr.softsf.sudokufx.view.main.MainView.menuPlayerButtonNewText
private

◆ menuPlayerButtonPlayer

Button fr.softsf.sudokufx.view.main.MainView.menuPlayerButtonPlayer
private

◆ menuPlayerButtonPlayerEdit

Button fr.softsf.sudokufx.view.main.MainView.menuPlayerButtonPlayerEdit
private

◆ menuPlayerButtonPlayerText

Label fr.softsf.sudokufx.view.main.MainView.menuPlayerButtonPlayerText
private

◆ menuPlayerButtonReduce

Button fr.softsf.sudokufx.view.main.MainView.menuPlayerButtonReduce
private

◆ menuPlayerButtonReduceText

Label fr.softsf.sudokufx.view.main.MainView.menuPlayerButtonReduceText
private

◆ menuPlayerClipListView

Rectangle fr.softsf.sudokufx.view.main.MainView.menuPlayerClipListView
private

◆ menuPlayerListView

ListView<PlayerDto> fr.softsf.sudokufx.view.main.MainView.menuPlayerListView
private

◆ menuPlayerViewModel

final MenuPlayerViewModel fr.softsf.sudokufx.view.main.MainView.menuPlayerViewModel
private

◆ menuSave

VBox fr.softsf.sudokufx.view.main.MainView.menuSave
private

◆ menuSaveButtonBackup

Button fr.softsf.sudokufx.view.main.MainView.menuSaveButtonBackup
private

◆ menuSaveButtonBackupText

Label fr.softsf.sudokufx.view.main.MainView.menuSaveButtonBackupText
private

◆ menuSaveButtonReduce

Button fr.softsf.sudokufx.view.main.MainView.menuSaveButtonReduce
private

◆ menuSaveButtonReduceText

Label fr.softsf.sudokufx.view.main.MainView.menuSaveButtonReduceText
private

◆ menuSaveButtonSave

Button fr.softsf.sudokufx.view.main.MainView.menuSaveButtonSave
private

◆ menuSaveButtonSaveText

Label fr.softsf.sudokufx.view.main.MainView.menuSaveButtonSaveText
private

◆ menuSaveClipListView

Rectangle fr.softsf.sudokufx.view.main.MainView.menuSaveClipListView
private

◆ menuSaveListView

ListView<GameDto> fr.softsf.sudokufx.view.main.MainView.menuSaveListView
private

◆ menuSaveViewModel

final MenuSaveViewModel fr.softsf.sudokufx.view.main.MainView.menuSaveViewModel
private

◆ menuSolve

VBox fr.softsf.sudokufx.view.main.MainView.menuSolve
private

◆ menuSolveButtonReduce

Button fr.softsf.sudokufx.view.main.MainView.menuSolveButtonReduce
private

◆ menuSolveButtonReduceText

Label fr.softsf.sudokufx.view.main.MainView.menuSolveButtonReduceText
private

◆ menuSolveButtonSolve

Button fr.softsf.sudokufx.view.main.MainView.menuSolveButtonSolve
private

◆ menuSolveButtonSolveClear

Button fr.softsf.sudokufx.view.main.MainView.menuSolveButtonSolveClear
private

◆ menuSolveButtonSolveText

Label fr.softsf.sudokufx.view.main.MainView.menuSolveButtonSolveText
private

◆ menuSolveHBoxPossibilities

PossibilityStarsHBox fr.softsf.sudokufx.view.main.MainView.menuSolveHBoxPossibilities
private

◆ menuSolveViewModel

final MenuSolveViewModel fr.softsf.sudokufx.view.main.MainView.menuSolveViewModel
private

◆ OPAQUE_MODE_PSEUDO_SELECTED

final PseudoClass fr.softsf.sudokufx.view.main.MainView.OPAQUE_MODE_PSEUDO_SELECTED
staticprivate
Initial value:
=
PseudoClass.getPseudoClass("opaque-mode")

◆ primaryStage

Stage fr.softsf.sudokufx.view.main.MainView.primaryStage
private

◆ REDUCED_SONG_PSEUDO_SELECTED

final PseudoClass fr.softsf.sudokufx.view.main.MainView.REDUCED_SONG_PSEUDO_SELECTED
staticprivate
Initial value:
=
PseudoClass.getPseudoClass("reduced")

◆ spinner

SpinnerGridPane fr.softsf.sudokufx.view.main.MainView.spinner
private

◆ sudokuFX

GridPane fr.softsf.sudokufx.view.main.MainView.sudokuFX
private

◆ sudokuFXGridPane

GridPane fr.softsf.sudokufx.view.main.MainView.sudokuFXGridPane
private

◆ toaster

ToasterVBox fr.softsf.sudokufx.view.main.MainView.toaster
private

◆ toasterService

final ToasterService fr.softsf.sudokufx.view.main.MainView.toasterService
private

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