SudokuFX
Loading...
Searching...
No Matches
fr.softsf.sudokufx.service.FxmlService Class Reference

FxmlService is a Spring service that manages the loading of FXML files and updating the root of the JavaFX scene. More...

+ Collaboration diagram for fr.softsf.sudokufx.service.FxmlService:

Public Member Functions

 FxmlService (FXMLLoader fxmlLoader)
 Constructor for FxmlService.
 
void setRootByFXMLName (final String fxml)
 Sets the root of the scene based on the given FXML file name, and adapt the font size dynamically.
 

Package Functions

public< T > T getController ()
 Retrieves the controller associated with the loaded FXML file.
 

Private Attributes

DynamicFontSize dynamicFontSize
 
final FXMLLoader fxmlLoader
 
final Scene scene
 

Detailed Description

FxmlService is a Spring service that manages the loading of FXML files and updating the root of the JavaFX scene.

This service allows for dynamic changes to the user interface by loading different FXML files based on the application's needs.

Constructor & Destructor Documentation

◆ FxmlService()

fr.softsf.sudokufx.service.FxmlService.FxmlService ( FXMLLoader fxmlLoader)

Constructor for FxmlService.

This constructor initializes the scene by retrieving the current scene from the main application class.

Member Function Documentation

◆ getController()

public< T > T fr.softsf.sudokufx.service.FxmlService.getController ( )
package

Retrieves the controller associated with the loaded FXML file.

Parameters
<T>the type of the controller
Returns
the controller instance of type T
Exceptions
IllegalStateExceptionif the FXML file has not been loaded yet

◆ setRootByFXMLName()

void fr.softsf.sudokufx.service.FxmlService.setRootByFXMLName ( final String fxml)

Sets the root of the scene based on the given FXML file name, and adapt the font size dynamically.

Parameters
fxmlThe name of the FXML file to load (without the .fxml extension)
Exceptions
IllegalArgumentExceptionif the FXML file is not found
RuntimeExceptionExits the application if an error occurs while loading the FXML file
+ Here is the call graph for this function:

Member Data Documentation

◆ dynamicFontSize

DynamicFontSize fr.softsf.sudokufx.service.FxmlService.dynamicFontSize
private

◆ fxmlLoader

final FXMLLoader fr.softsf.sudokufx.service.FxmlService.fxmlLoader
private

◆ scene

final Scene fr.softsf.sudokufx.service.FxmlService.scene
private

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