Interface FxFactory

  • All Known Implementing Classes:
    DefaultFxFactory

    public interface FxFactory
    A factory for FX-related stuff.
    Author:
    harald
    • Method Detail

      • getInstance

        static FxFactory getInstance()
        The singleton.
        Returns:
        the singleton
      • getControllerClasses

        java.util.Collection<java.lang.Class<FxController>> getControllerClasses()
        Gets all classes annotated with FxControllerService.
        Returns:
        the classes
      • getBuilderFactory

        javafx.util.BuilderFactory getBuilderFactory()
        Gets the builder factory.
        Returns:
        the FX builder factory
      • getConfigurator

        <T> Configurator<T> getConfigurator​(java.lang.Class<T> clazz)
        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​(java.lang.Class<M> modelClass,
                                                                     java.lang.Class<V> viewClass,
                                                                     FxComponent component)
        Creates a value translator.
        Type Parameters:
        M - the model type
        V - the view type
        Parameters:
        modelClass - the model's value class
        viewClass - the view's value class
        component - 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 style
        modality - the modality
        Returns:
        the stage
      • createController

        <T extends FxController> T createController​(java.lang.Class<T> controllerClass,
                                                    java.net.URL fxmlUrl,
                                                    java.util.ResourceBundle resources,
                                                    java.net.URL cssUrl)
        Creates a controller together with its FXML-based view.
        The controller class must be annotated with FxControllerService.
        Type Parameters:
        T - the controller type
        Parameters:
        controllerClass - the controller class
        fxmlUrl - the URL to load the FXML from, null if derived from controllerClass or FxController annotation
        resources - the resource bundle, null if derived from controllerClass or FxController annotation
        cssUrl - the URL to load the CSS from, null if derived from controllerClass or FxController annotation
        Returns:
        the initialized controller
      • getImage

        javafx.scene.image.Image getImage​(java.lang.String realm,
                                          java.lang.String name)
        Gets the given image.
        Throws IllegalArgumentException if no such image and/or realm.
        Parameters:
        realm - the realm, null of empty if tentackle images
        name - the image name
        Returns:
        the image
      • createTableConfiguration

        <S> TableConfiguration<S> createTableConfiguration​(S template,
                                                           java.lang.String name)
        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 object
        name - the table's name, null if basename from effective class of template
        Returns:
        the table configuration
      • createTableConfiguration

        <S> TableConfiguration<S> createTableConfiguration​(java.lang.Class<S> objectClass,
                                                           java.lang.String name)
        Creates an empty configuration for a PDO class.
        Type Parameters:
        S - the type of the objects contained within the table's items list
        Parameters:
        objectClass - the object class
        name - the table's name, null if basename of objectclass
        Returns:
        the table configuration