Class Manager

  • Direct Known Subclasses:
    ReactiveManager

    public class Manager
    extends Object
    This class manage the view components
    Version:
    1.0.0
    Author:
    Ramon Rangel Osorio <ramon.rangel@protonmail.com>
    • Constructor Detail

      • Manager

        protected Manager()
    • Method Detail

      • getManager

        public static final Manager getManager()
        Returns the Manager object.
        Returns:
        the Manager object
      • getManager

        public static final Manager getManager​(Map<Class<?>,​Map<String,​Object>> components)
        Generates a function comment for the given function body.
        Parameters:
        components - a map containing components
        Returns:
        the Manager instance
      • init

        public void init​(javafx.stage.Stage stage,
                         Class<? extends javafx.application.Application> application)
        Initializes the stage, loads the specified application, and switches to the main view.
        Parameters:
        stage - the stage to initialize
        application - the application class to load
      • switchView

        public final void switchView​(String name)
        Switches the view to the specified name.
        Parameters:
        name - the name of the view to switch to
      • switchSyncView

        public final void switchSyncView​(String name)
        Switches to the specified sync view.
        Parameters:
        name - the name of the sync view to switch to
      • load

        protected void load​(Class<? extends javafx.application.Application> application)
        Loads the given application class by loading its views. If the views cannot be loaded, a RuntimeException is thrown.
        Parameters:
        application - the class of the application to load
      • loadViews

        protected void loadViews​(Class<? extends javafx.application.Application> application)
        Loads views for the given application class.
        Parameters:
        application - the application class to load views for
      • setStage

        public void setStage​(javafx.stage.Stage stage)
        Sets the stage of the object.
        Parameters:
        stage - the stage to set
      • getStage

        public javafx.stage.Stage getStage()
        Retrieves the stage object.
        Returns:
        the stage object if it is not null, otherwise a new stage object
      • loadAppConfig

        protected final File loadAppConfig​(String root)
        A protected method that loads the application configuration file.
        Parameters:
        root - the root directory of the application
        Returns:
        a File object representing the loaded application configuration file
      • loadFxml

        protected List<javafx.scene.Parent> loadFxml​(Class<? extends javafx.application.Application> application)
        Load FXML files for the given Java application class.
        Parameters:
        application - the Java application class
        Returns:
        a list of Parent objects representing the loaded FXML files