Package dev.zemco.codegame.presentation
Class FxmlViewProvider
java.lang.Object
dev.zemco.codegame.presentation.FxmlViewProvider
- All Implemented Interfaces:
IViewProvider
Provides JavaFX views by loading raw FXML views from the
IFxmlViewSourceProvider.
These views are controlled using controllers created by the IControllerFactory,
and styles with stylesheets provided by the IViewStylesheetProvider.- Author:
- Erik Zemčík
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFxmlViewProvider(IFxmlViewSourceProvider viewSourceProvider, IControllerFactory controllerFactory, IViewStylesheetProvider viewStylesheetProvider, IFxmlLoaderFactory fxmlLoaderFactory) Creates an instance ofFxmlViewProviderready for use. -
Method Summary
Modifier and TypeMethodDescriptionjavafx.scene.ParentgetViewById(String viewId) Provides the root node of the requested view ready to be presented.
-
Constructor Details
-
FxmlViewProvider
public FxmlViewProvider(IFxmlViewSourceProvider viewSourceProvider, IControllerFactory controllerFactory, IViewStylesheetProvider viewStylesheetProvider, IFxmlLoaderFactory fxmlLoaderFactory) Creates an instance ofFxmlViewProviderready for use.- Parameters:
viewSourceProvider- raw fxml view source provider for the sources of viewscontrollerFactory- factory used to create controllers for viewsviewStylesheetProvider- view stylesheet provider used as a source of needed styles for viewsfxmlLoaderFactory- factory used to createfxml loaders- Throws:
IllegalArgumentException- if any argument isnull
-
-
Method Details
-
getViewById
Provides the root node of the requested view ready to be presented. The view is identified by theviewIdparameter. This parameter is used by the internal providers specified during instantiation for providing the required parts of the view.- Specified by:
getViewByIdin interfaceIViewProvider- Parameters:
viewId- identification of the view- Returns:
- root node of the view
- Throws:
IllegalArgumentException- ifviewIdisnullor emptyUnknownViewException- if the view is not known by the usedfxml view source provideror thestylesheet providerResourceLoadException- if the raw fxml view source couldn't be loaded
-