Class DefaultFxFactory

java.lang.Object
org.tentackle.fx.DefaultFxFactory
All Implemented Interfaces:
FxFactory

@Service(FxFactory.class) public class DefaultFxFactory extends Object implements FxFactory
Default implementation of FxFactory.
Author:
harald
  • Constructor Details

    • DefaultFxFactory

      public DefaultFxFactory()
      Creates the default factory.
  • Method Details

    • getBuilderFactory

      public javafx.util.BuilderFactory getBuilderFactory()
      Description copied from interface: FxFactory
      Gets the builder factory.
      Specified by:
      getBuilderFactory in interface FxFactory
      Returns:
      the FX builder factory
    • getConfigurator

      public <T> Configurator<T> getConfigurator(Class<T> clazz)
      Description copied from interface: FxFactory
      Gets the configurator for a given class.
      Specified by:
      getConfigurator in interface FxFactory
      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: FxFactory
      Creates a value translator.
      Specified by:
      createValueTranslator in interface FxFactory
      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

      public javafx.stage.Stage createStage(javafx.stage.StageStyle stageStyle, javafx.stage.Modality modality)
      Description copied from interface: FxFactory
      Creates a configured stage.
      Specified by:
      createStage in interface FxFactory
      Parameters:
      stageStyle - the style
      modality - the modality
      Returns:
      the stage
    • createScene

      public javafx.scene.Scene createScene(javafx.scene.Parent root)
      Description copied from interface: FxFactory
      Creates a scene.
      Specified by:
      createScene in interface FxFactory
      Parameters:
      root - the parent node
      Returns:
      the scene
    • createNotificationBuilder

      public NotificationBuilder createNotificationBuilder()
      Description copied from interface: FxFactory
      Creates a notification builder.
      Notifications are a lightweight alternative to Alerts.
      Specified by:
      createNotificationBuilder in interface FxFactory
      Returns:
      the builder
    • createController

      public <T extends FxController> T createController(Class<T> controllerClass, URL fxmlUrl, ResourceBundle resources, URL cssUrl)
      Description copied from interface: FxFactory
      Creates a controller together with its FXML-based view.
      The controller class must be annotated with FxControllerService.
      Specified by:
      createController in interface FxFactory
      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
    • getControllerClasses

      public Collection<Class<FxController>> getControllerClasses()
      Description copied from interface: FxFactory
      Gets all classes annotated with FxControllerService.
      Specified by:
      getControllerClasses in interface FxFactory
      Returns:
      the classes
    • createGraphic

      public javafx.scene.Node createGraphic(String realm, String name)
      Description copied from interface: FxFactory
      Creates the graphic node for a given realm and name.
      Throws IllegalArgumentException if no such icon and/or realm.
      Specified by:
      createGraphic in interface FxFactory
      Parameters:
      realm - the realm, null of empty if default tentackle realm
      name - the graphic name
      Returns:
      the graphic node
    • createTableConfiguration

      public <S> TableConfiguration<S> createTableConfiguration(S template, String name)
      Description copied from interface: FxFactory
      Creates an empty configuration from a template object.
      Specified by:
      createTableConfiguration in interface FxFactory
      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

      public <S> TableConfiguration<S> createTableConfiguration(Class<S> objectClass, String name)
      Description copied from interface: FxFactory
      Creates an empty configuration for a class.
      Specified by:
      createTableConfiguration in interface FxFactory
      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 object class
      Returns:
      the table configuration
    • createBuilderFactory

      protected javafx.util.BuilderFactory createBuilderFactory()
      Creates the builder factory.
      Returns:
      the factory