Class CategorieController

java.lang.Object
com.esprit.controllers.series.CategorieController

public class CategorieController extends Object
Is responsible for handling user input and displaying information related to categories in a movie streaming platform. The controller includes methods for modifiying category details, adding new categories, and displaying statistics related to the categories. Additionally, it includes methods for navigating between different views of the application, such as the main menu, series view, episode view, and product view.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private javafx.scene.control.Label
     
    private javafx.scene.control.Label
     
    private javafx.scene.control.TextField
     
    private static final Logger
     
    private javafx.scene.control.TextField
     
    private javafx.scene.control.TableView<Category>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    ajouteroeuvre(javafx.event.ActionEvent event)
    Allows users to add a new category by validating input fields, saving the category to a service implementation class, and displaying an alert message upon successful save.
    (package private) boolean
    Checks if the user has entered a non-empty string in the `descreptionF.getText()` field, and returns `true` if so, or `false` otherwise, along with a message to enter a valid description.
    (package private) boolean
    Checks if the user has entered a non-empty string.
    private void
    References an object called `ref`.
    private void
    Allows for the modification of a category's name and description through a dialogue box interface.
    (package private) void
    Ocategories(javafx.event.ActionEvent event)
    Loads a FXML file, creates a scene and sets it as the scene of a stage, and then shows the stage.
    (package private) void
    Oepisode(javafx.event.ActionEvent event)
    Loads an FXML file, creates a scene, and sets it as the scene of a Stage, displaying the content on the stage.
    (package private) void
    Oseriess(javafx.event.ActionEvent event)
    Loads and displays a FXML view named "Serie-view".
    private void
    ref()
    Updates the table view's contents by clearing its items and columns, then adding new columns for an "Edit" and "Delete" button, and finally adding the recovered categories from the database to the table view.
    private void
    showAlert(String title, String message)
    Creates an Alert object with an informational message and shows it to the user via the `showAndWait()` method.
    void
    showcinema(javafx.event.ActionEvent actionEvent)
    Does not have any discernible behavior or functionality as it is empty and lacks any statements or actions to perform.
    void
    showevent(javafx.event.ActionEvent actionEvent)
    Is invoked when an event occurs and has no discernible functionality as it only contains a blank implementation.
    void
    showmovies(javafx.event.ActionEvent actionEvent)
    Likely displays a list or movies or performs some other movie-related actions when an event is triggered.
    void
    showproducts(javafx.event.ActionEvent actionEvent)
    Displays a list of products.
    void
    showseries(javafx.event.ActionEvent actionEvent)
    Is triggered by an `ActionEvent`.
    void
    showStatistics(javafx.event.ActionEvent actionEvent)
    Loads a FXML view and replaces the current scene with it when an action event is triggered.

    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
    • checkdescreption

      private javafx.scene.control.Label checkdescreption
    • checkname

      private javafx.scene.control.Label checkname
    • nomF

      private javafx.scene.control.TextField nomF
    • descreptionF

      private javafx.scene.control.TextField descreptionF
    • tableView

      private javafx.scene.control.TableView<Category> tableView
  • Constructor Details

    • CategorieController

      public CategorieController()
  • Method Details

    • ref

      private void ref()
      Updates the table view's contents by clearing its items and columns, then adding new columns for an "Edit" and "Delete" button, and finally adding the recovered categories from the database to the table view.
    • showAlert

      private void showAlert(String title, String message)
      Creates an Alert object with an informational message and shows it to the user via the `showAndWait()` method.
      Parameters:
      title - title of an alert window that will be displayed when the `showAlert` method is called.
      message - text to be displayed in the alert box.
    • modifierCategorie

      private void modifierCategorie(Category categorie)
      Allows for the modification of a category's name and description through a dialogue box interface. The function calls the `iServiceCategorie.modifier()` method to update the category in the database after the user has entered the new details and confirmed the modifications.
      Parameters:
      categorie - category object that is to be modified through the dialog box, and its properties (name and description) are editable and can be modified by the user through the dialog UI.

      - `nom`: The name of the category. - `description`: A brief description of the category.

    • initialize

      private void initialize()
      References an object called `ref`.
    • checkname

      boolean checkname()
      Checks if the user has entered a non-empty string. If so, it returns `true`. Otherwise, it displays an error message and returns `false`.
    • checkdescreption

      boolean checkdescreption()
      Checks if the user has entered a non-empty string in the `descreptionF.getText()` field, and returns `true` if so, or `false` otherwise, along with a message to enter a valid description.
    • ajouteroeuvre

      void ajouteroeuvre(javafx.event.ActionEvent event)
      Allows users to add a new category by validating input fields, saving the category to a service implementation class, and displaying an alert message upon successful save.
      Parameters:
      event - user's action of clicking the "Add Category" button, which triggers the execution of the code within the function.

      - Type: `ActionEvent` - Details: Contains information about the action that triggered the function, such as the source of the event and the identifier of the event.

    • Ocategories

      void Ocategories(javafx.event.ActionEvent event) throws IOException
      Loads a FXML file, creates a scene and sets it as the scene of a stage, and then shows the stage.
      Parameters:
      event - event that triggered the method, specifically the opening of the `Categorie-view.fxml` file.

      - `Event`: This is the class that represents an event in Java, containing information about the source and type of the event. - `Object`: The `event` parameter is an instance of the `Object` class, which provides no additional information beyond the fact that it is an event object.

      Throws:
      IOException
    • Oseriess

      void Oseriess(javafx.event.ActionEvent event) throws IOException
      Loads and displays a FXML view named "Serie-view".
      Parameters:
      event - event object that triggered the function, providing information about the source of the event and other details.

      Event: An ActionEvent object representing an action triggered by the user.

      Properties:

      - `getSource()`: Returns the source of the event (i.e., the button or menu item that was clicked).

      Throws:
      IOException
    • Oepisode

      void Oepisode(javafx.event.ActionEvent event) throws IOException
      Loads an FXML file, creates a scene, and sets it as the scene of a Stage, displaying the content on the stage.
      Parameters:
      event - source of the action that triggered the method, providing a reference to the object from which the event originated.

      Event: An instance of the `ActionEvent` class that contains information about the action performed by the user. Properties:

      - `getSource()`: Returns the object that triggered the event. In this case, it is a `Node` representing the `Episode-view.fxml` stage.

      Throws:
      IOException
    • showStatistics

      public void showStatistics(javafx.event.ActionEvent actionEvent)
      Loads a FXML view and replaces the current scene with it when an action event is triggered.
      Parameters:
      actionEvent - event that triggered the function, which is used to determine what action to take based on the event type.

      - If `actionEvent` is not null, it represents an action event triggered by the user.

    • showmovies

      public void showmovies(javafx.event.ActionEvent actionEvent)
      Likely displays a list or movies or performs some other movie-related actions when an event is triggered.
      Parameters:
      actionEvent - event that triggered the execution of the `showMovies` function.
    • showproducts

      public void showproducts(javafx.event.ActionEvent actionEvent)
      Displays a list of products.
      Parameters:
      actionEvent - event that triggered the function call.
    • showcinema

      public void showcinema(javafx.event.ActionEvent actionEvent)
      Does not have any discernible behavior or functionality as it is empty and lacks any statements or actions to perform.
      Parameters:
      actionEvent - event that triggered the function call.
    • showevent

      public void showevent(javafx.event.ActionEvent actionEvent)
      Is invoked when an event occurs and has no discernible functionality as it only contains a blank implementation.
      Parameters:
      actionEvent - event that triggered the function's execution.
    • showseries

      public void showseries(javafx.event.ActionEvent actionEvent)
      Is triggered by an `ActionEvent`. It does not provide any information about the code author or licensing.
      Parameters:
      actionEvent - event that triggered the `showseries()` function to be called, providing the necessary context for its execution.