java.lang.Object
org.tentackle.fx.DefaultFxFactory
- All Implemented Interfaces:
FxFactory
Default implementation of
FxFactory.- Author:
- harald
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected javafx.util.BuilderFactoryCreates the builder factory.<T extends FxController>
TcreateController(Class<T> controllerClass, URL fxmlUrl, ResourceBundle resources, URL cssUrl) Creates a controller together with its FXML-based view.
The controller class must be annotated withFxControllerService.javafx.scene.NodecreateGraphic(String realm, String name) Creates the graphic node for a given realm and name.
Throws IllegalArgumentException if no such icon and/or realm.Creates a notification builder.
Notifications are a lightweight alternative toAlerts.javafx.scene.ScenecreateScene(javafx.scene.Parent root) Creates a scene.javafx.stage.StagecreateStage(javafx.stage.StageStyle stageStyle, javafx.stage.Modality modality) Creates a configured stage.<S> TableConfiguration<S>createTableConfiguration(Class<S> objectClass, String name) Creates an empty configuration for a class.<S> TableConfiguration<S>createTableConfiguration(S template, String name) Creates an empty configuration from a template object.<M,V> ValueTranslator<V, M> createValueTranslator(Class<M> modelClass, Class<V> viewClass, FxComponent component) Creates a value translator.javafx.util.BuilderFactoryGets the builder factory.<T> Configurator<T>getConfigurator(Class<T> clazz) Gets the configurator for a given class.Gets all classes annotated withFxControllerService.
-
Constructor Details
-
DefaultFxFactory
public DefaultFxFactory()Creates the default factory.
-
-
Method Details
-
getBuilderFactory
public javafx.util.BuilderFactory getBuilderFactory()Description copied from interface:FxFactoryGets the builder factory.- Specified by:
getBuilderFactoryin interfaceFxFactory- Returns:
- the FX builder factory
-
getConfigurator
Description copied from interface:FxFactoryGets the configurator for a given class.- Specified by:
getConfiguratorin interfaceFxFactory- Type Parameters:
T- the node type- Parameters:
clazz- the class- Returns:
- the configurator, null if none
-
createValueTranslator
public <M,V> ValueTranslator<V,M> createValueTranslator(Class<M> modelClass, Class<V> viewClass, FxComponent component) Description copied from interface:FxFactoryCreates a value translator.- Specified by:
createValueTranslatorin interfaceFxFactory- Type Parameters:
M- the model typeV- the view type- Parameters:
modelClass- the model's value classviewClass- the view's value classcomponent- the fx component- Returns:
- the value translator best fitting for the requested types
-
createStage
public javafx.stage.Stage createStage(javafx.stage.StageStyle stageStyle, javafx.stage.Modality modality) Description copied from interface:FxFactoryCreates a configured stage.- Specified by:
createStagein interfaceFxFactory- Parameters:
stageStyle- the stylemodality- the modality- Returns:
- the stage
-
createScene
public javafx.scene.Scene createScene(javafx.scene.Parent root) Description copied from interface:FxFactoryCreates a scene.- Specified by:
createScenein interfaceFxFactory- Parameters:
root- the parent node- Returns:
- the scene
-
createNotificationBuilder
Description copied from interface:FxFactoryCreates a notification builder.
Notifications are a lightweight alternative toAlerts.- Specified by:
createNotificationBuilderin interfaceFxFactory- Returns:
- the builder
-
createController
public <T extends FxController> T createController(Class<T> controllerClass, URL fxmlUrl, ResourceBundle resources, URL cssUrl) Description copied from interface:FxFactoryCreates a controller together with its FXML-based view.
The controller class must be annotated withFxControllerService.- Specified by:
createControllerin interfaceFxFactory- Type Parameters:
T- the controller type- Parameters:
controllerClass- the controller classfxmlUrl- the URL to load the FXML from, null if derived from controllerClass or FxController annotationresources- the resource bundle, null if derived from controllerClass or FxController annotationcssUrl- the URL to load the CSS from, null if derived from controllerClass or FxController annotation- Returns:
- the initialized controller
-
getControllerClasses
Description copied from interface:FxFactoryGets all classes annotated withFxControllerService.- Specified by:
getControllerClassesin interfaceFxFactory- Returns:
- the classes
-
createGraphic
Description copied from interface:FxFactoryCreates the graphic node for a given realm and name.
Throws IllegalArgumentException if no such icon and/or realm.- Specified by:
createGraphicin interfaceFxFactory- Parameters:
realm- the realm, null of empty if default tentackle realmname- the graphic name- Returns:
- the graphic node
-
createTableConfiguration
Description copied from interface:FxFactoryCreates an empty configuration from a template object.- Specified by:
createTableConfigurationin interfaceFxFactory- Type Parameters:
S- the type of the objects contained within the table's items list- Parameters:
template- a template objectname- the table's name, null if basename from effective class of template- Returns:
- the table configuration
-
createTableConfiguration
Description copied from interface:FxFactoryCreates an empty configuration for a class.- Specified by:
createTableConfigurationin interfaceFxFactory- Type Parameters:
S- the type of the objects contained within the table's items list- Parameters:
objectClass- the object classname- the table's name, null if basename of object class- Returns:
- the table configuration
-
createBuilderFactory
protected javafx.util.BuilderFactory createBuilderFactory()Creates the builder factory.- Returns:
- the factory
-