- All Known Implementing Classes:
DefaultFxFactory
public interface FxFactory
A factory for FX-related stuff.
- Author:
- harald
-
Method Summary
Modifier and TypeMethodDescription<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.Node
createGraphic
(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 toAlert
s.javafx.scene.Scene
createScene
(javafx.scene.Parent root) Creates a scene.javafx.stage.Stage
createStage
(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.BuilderFactory
Gets the builder factory.<T> Configurator
<T> getConfigurator
(Class<T> clazz) Gets the configurator for a given class.Gets all classes annotated withFxControllerService
.static FxFactory
The singleton.
-
Method Details
-
getInstance
The singleton.- Returns:
- the singleton
-
getControllerClasses
Collection<Class<FxController>> getControllerClasses()Gets all classes annotated withFxControllerService
.- Returns:
- the classes
-
getBuilderFactory
javafx.util.BuilderFactory getBuilderFactory()Gets the builder factory.- Returns:
- the FX builder factory
-
getConfigurator
Gets the configurator for a given class.- Type Parameters:
T
- the node type- Parameters:
clazz
- the class- Returns:
- the configurator, null if none
-
createValueTranslator
<M,V> ValueTranslator<V,M> createValueTranslator(Class<M> modelClass, Class<V> viewClass, FxComponent component) Creates a value translator.- 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
javafx.stage.Stage createStage(javafx.stage.StageStyle stageStyle, javafx.stage.Modality modality) Creates a configured stage.- Parameters:
stageStyle
- the stylemodality
- the modality- Returns:
- the stage
-
createScene
javafx.scene.Scene createScene(javafx.scene.Parent root) Creates a scene.- Parameters:
root
- the parent node- Returns:
- the scene
-
createNotificationBuilder
NotificationBuilder createNotificationBuilder()Creates a notification builder.
Notifications are a lightweight alternative toAlert
s.- Returns:
- the builder
-
createController
<T extends FxController> T createController(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
.- 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
-
createGraphic
Creates the graphic node for a given realm and name.
Throws IllegalArgumentException if no such icon and/or realm.- Parameters:
realm
- the realm, null of empty if default tentackle realmname
- the graphic name- Returns:
- the graphic node
-
createTableConfiguration
Creates an empty configuration from a template object.- 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
Creates an empty configuration for a class.- 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
-