Class DesignCategorieAdminController

java.lang.Object
com.esprit.controllers.products.DesignCategorieAdminController

public class DesignCategorieAdminController extends Object
JavaFX controller class for the RAKCHA application. Handles UI interactions and manages view logic using FXML.
Since:
1.0.0
Version:
1.0.0
Author:
RAKCHA Team
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final List<javafx.scene.control.CheckBox>
     
    private javafx.scene.control.TableView<ProductCategory>
     
    private javafx.scene.layout.AnchorPane
     
    private javafx.scene.control.TableColumn<ProductCategory,Void>
     
    private javafx.scene.control.TableColumn<ProductCategory,String>
     
    private javafx.scene.control.TextArea
     
    private javafx.scene.layout.AnchorPane
     
    private javafx.scene.layout.AnchorPane
     
    private org.kordamp.ikonli.javafx.FontIcon
     
    private static final Logger
     
    private javafx.scene.control.TableColumn<ProductCategory,String>
     
    private javafx.scene.control.TextField
     
    private javafx.scene.control.TextField
     
    private final List<javafx.scene.control.CheckBox>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    Sets up a table view to display and edit category data from a service.
    (package private) void
    ajouter_categorie(javafx.event.ActionEvent event)
    /** Enables user input to create a new category and add it to the existing list in the `ProductCategory` class.
    (package private) void
    cinemaclient(javafx.event.ActionEvent event)
    Loads a new user interface "/ui/produits/CommentaireProduct.fxml" using the FXMLLoader, creates a new scene from it, and attaches it to a new stage.
    (package private) void
    eventClient(javafx.event.ActionEvent event)
    Loads a new FXML file, creates a new scene, and attaches it to a new stage when an event is triggered.
    private void
    Takes a search text as input and filters the observable list of `ProductCategory` objects in the `categorie_tableview` based on the search text.
    void
    filtercinema(javafx.event.ActionEvent event)
    Filters cinema list based on selected categories and statuses from the list of all cinemas.
    (package private) void
    filtrer(javafx.scene.input.MouseEvent event)
    1) sets the opacity of a category tableview to 0.5, 2) sets a filter anchor's visibility to true, and 3) clears any previously selected addresses from checkboxes before recurring addresses from a database and displaying them in a new VBox added to the filter anchor.
    (package private) void
    GestionProduct(javafx.event.ActionEvent event)
    /** Loads a new UI component called `DesignProductAdmin.fxml`, creates a new scene with it, obtains the current stage from the event, and then opens a new stage with the new scene, closing the previous one.
    Retrieves all categories from the database through the `CategoryService`.
    Retrieves a list of unique movie theater addresses from the database based on their names.
    private List<String>
    Streamlines and filters the selected addresses within an AnchorPane component, returning a list of selected categories as strings.
    private void
    Defines a callback to create a table cell that displays a delete button for each item in a table, and adds an on-click listener to remove the item from the table when clicked.
    (package private) void
    Sets up listeners for changes to the `SearchBar` text property and triggers actions when the search term changes, including searching the products database and filtering product categories based on the new value.
    (package private) void
    Modifies the attributes of a `CategorieProduct` object and stores the changes in the database using the `CategoryService`.
    (package private) void
    MovieClient(javafx.event.ActionEvent event)
    Charges a new UI file, creates a new scene, and attaches it to a new stage.
    (package private) void
    produitClient(javafx.event.ActionEvent event)
    Loads a new FXML file, creates a new scene and attaches it to a new stage, replacing the current stage.
    (package private) void
    profilclient(javafx.event.ActionEvent event)
    Likely performs some client-side profiling tasks, such as collecting and analyzing data on performance metrics for a given application or user session.
    private void
    search(String keyword)
    Takes a search keyword and searches the `CategoryService` for matching categories, adding them to an observable list which is then set as the table view's items.
    (package private) void
    SerieClient(javafx.event.ActionEvent event)
    Charges a new UI file "/ui//ui/Series-view.fxml" into an existing scene, creates a new stage with the new interface and attaches it to the current stage, closing the original stage upon attachment.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • LOGGER

      private static final Logger LOGGER
    • addressCheckBoxes

      private final List<javafx.scene.control.CheckBox> addressCheckBoxes
    • statusCheckBoxes

      private final List<javafx.scene.control.CheckBox> statusCheckBoxes
    • categorie_tableview

      private javafx.scene.control.TableView<ProductCategory> categorie_tableview
    • deleteColumn

      private javafx.scene.control.TableColumn<ProductCategory,Void> deleteColumn
    • descriptionC_textArea

      private javafx.scene.control.TextArea descriptionC_textArea
    • nomC_textFile

      private javafx.scene.control.TextField nomC_textFile
    • idfilter

      private org.kordamp.ikonli.javafx.FontIcon idfilter
    • categorieList

      private javafx.scene.layout.AnchorPane categorieList
    • filterAnchor

      private javafx.scene.layout.AnchorPane filterAnchor
    • formulaire

      private javafx.scene.layout.AnchorPane formulaire
    • nomC_tableC

      private javafx.scene.control.TableColumn<ProductCategory,String> nomC_tableC
    • description_tableC

      private javafx.scene.control.TableColumn<ProductCategory,String> description_tableC
  • Constructor Details

    • DesignCategorieAdminController

      public DesignCategorieAdminController()
  • Method Details

    • GestionProduct

      void GestionProduct(javafx.event.ActionEvent event) throws IOException
      /** Loads a new UI component called `DesignProductAdmin.fxml`, creates a new scene with it, obtains the current stage from the event, and then opens a new stage with the new scene, closing the previous one.
      Parameters:
      event - ActionEvent object that triggered the method call, providing information about the action that was performed, such as the source of the event and any associated data.
      Throws:
      IOException
    • initialize

      void initialize()
      Sets up listeners for changes to the `SearchBar` text property and triggers actions when the search term changes, including searching the products database and filtering product categories based on the new value.
    • ajouter_categorie

      void ajouter_categorie(javafx.event.ActionEvent event)
      /** Enables user input to create a new category and add it to the existing list in the `ProductCategory` class.
      Parameters:
      event - user action that triggered the method, and it is used to determine the specific action taken by the user, such as clicking on the "Ajouter une catégorie" button.
    • initDeleteColumn

      private void initDeleteColumn()
      Defines a callback to create a table cell that displays a delete button for each item in a table, and adds an on-click listener to remove the item from the table when clicked.
    • modifier_categorie

      void modifier_categorie(ProductCategory categorieProduct)
      Modifies the attributes of a `CategorieProduct` object and stores the changes in the database using the `CategoryService`.
      Parameters:
      categorieProduct - categorization information for a product, which is used to update the corresponding record in the database using the `CategoryService`.
    • afficher_categorie

      void afficher_categorie()
      Sets up a table view to display and edit category data from a service. It allows for line editing and validation on enter press, and enables cell selection.
    • search

      private void search(String keyword)
      Takes a search keyword and searches the `CategoryService` for matching categories, adding them to an observable list which is then set as the table view's items.
      Parameters:
      keyword - search term that filters the data displayed in the `categorie_tableview`.
    • filterCategorieProducts

      private void filterCategorieProducts(String searchText)
      Takes a search text as input and filters the observable list of `ProductCategory` objects in the `categorie_tableview` based on the search text. It updates the `categorie_tableview` with the filtered list.
      Parameters:
      searchText - search term used to filter the list of cinemas.
    • getAllCategories

      private List<ProductCategory> getAllCategories()
      Retrieves all categories from the database through the `CategoryService`. It returns a list of `ProductCategory` objects representing the retrieved categories.
    • filtrer

      void filtrer(javafx.scene.input.MouseEvent event)
      1) sets the opacity of a category tableview to 0.5, 2) sets a filter anchor's visibility to true, and 3) clears any previously selected addresses from checkboxes before recurring addresses from a database and displaying them in a new VBox added to the filter anchor.
      Parameters:
      event - mouse event that triggered the function execution and is not used in this specific code snippet.
    • getProductCategory

      public List<String> getProductCategory()
      Retrieves a list of unique movie theater addresses from the database based on their names.
    • filtercinema

      public void filtercinema(javafx.event.ActionEvent event)
      Filters cinema list based on selected categories and statuses from the list of all cinemas. It retrieves the addresses and/or statuses of the selected categories, streams them into a list of all cinemas, filters the cinemas based on the retrieved information, and updates the tableview with the filtered list.
      Parameters:
      event - ActionEvent that triggered the function, and it is not used or referred to within the provided code snippet.
    • getSelectedCategories

      private List<String> getSelectedCategories()
      Streamlines and filters the selected addresses within an AnchorPane component, returning a list of selected categories as strings.
    • cinemaclient

      void cinemaclient(javafx.event.ActionEvent event)
      Loads a new user interface "/ui/produits/CommentaireProduct.fxml" using the FXMLLoader, creates a new scene from it, and attaches it to a new stage. It then closes the current stage and shows the new one.
      Parameters:
      event - ActionEvent that triggered the function, providing information about the source of the event and the event itself.
    • eventClient

      void eventClient(javafx.event.ActionEvent event)
      Loads a new FXML file, creates a new scene, and attaches it to a new stage when an event is triggered. It then closes the current stage.
      Parameters:
      event - ActionEvent that triggered the event handling method, providing access to information about the action that occurred and the underlying source node.
    • produitClient

      void produitClient(javafx.event.ActionEvent event)
      Loads a new FXML file, creates a new scene and attaches it to a new stage, replacing the current stage.
      Parameters:
      event - ActionEvent object that triggers the fonction and provides access to information about the event, such as the source of the event and the event's type.
    • profilclient

      void profilclient(javafx.event.ActionEvent event)
      Likely performs some client-side profiling tasks, such as collecting and analyzing data on performance metrics for a given application or user session.
      Parameters:
      event - event that triggered the execution of the `profilclient` method.
    • MovieClient

      void MovieClient(javafx.event.ActionEvent event)
      Charges a new UI file, creates a new scene, and attaches it to a new stage. It then closes the current stage and displays the new one.
      Parameters:
      event - action event that triggers the function and provides access to the source node of the event, which is used to load the FXML file.
    • SerieClient

      void SerieClient(javafx.event.ActionEvent event)
      Charges a new UI file "/ui//ui/Series-view.fxml" into an existing scene, creates a new stage with the new interface and attaches it to the current stage, closing the original stage upon attachment.
      Parameters:
      event - ActionEvent object that triggers the method, providing access to information about the action that triggered the method call, such as the source of the action and any related data.