Class ClientSideBarController

java.lang.Object
com.esprit.controllers.ClientSideBarController
All Implemented Interfaces:
javafx.fxml.Initializable

public class ClientSideBarController extends Object implements javafx.fxml.Initializable
Is responsible for handling button clicks and navigating between different views in a client-side application. It provides methods for switching to various sections such as events, movies, products, series, cinema, logout, and profile. The class also initializes the application's user data.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private javafx.scene.control.Button
     
    private javafx.scene.control.Button
     
    private static final Logger
     
    private javafx.scene.control.Button
     
    private javafx.scene.control.Button
     
    private javafx.scene.control.Button
     
    private javafx.scene.control.Button
     
    private javafx.scene.control.Button
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    initialize(URL location, ResourceBundle resources)
    Is called when an instance of a class is created and initializes the object's state by calling its superclass's `initialize` method and performing any additional initialization logic specified in the method body.
    (package private) void
    switchtcinema(javafx.event.ActionEvent event)
    Loads a new scene from an FXML file when the "Cinema" button is clicked.
    (package private) void
    switchToEvent(javafx.event.ActionEvent event)
    Handles an `ActionEvent` and performs a specific action based on the event type.
    (package private) void
    switchToLogout(javafx.event.ActionEvent event)
    Loads a new FXML file, replaces the current stage's scene with it, and sets the stage's user data to null.
    (package private) void
    switchToMovies(javafx.event.ActionEvent event)
    Loads a new FXML file "/ui/films/filmuser.fxml" into the stage using the `FXMLLoader` class, replacing the current scene with the newly loaded one.
    (package private) void
    switchToProducts(javafx.event.ActionEvent event)
    Loads an FXML file named `AfficherProductClient.fxml`, and sets the scene of a Stage to the loaded root element, replacing the previous content.
    (package private) void
    switchToProfile(javafx.event.ActionEvent event)
    Loads a new scene containing a `Parent` element with the FXML file `"/ui/users/Profile.fxml"` when the `profileButton` is clicked.
    (package private) void
    switchToSeries(javafx.event.ActionEvent event)
    Loads a new FXML file "/ui/series/SeriesClient.fxml" when the " serieButton" action is triggered, replacing the current stage with a new scene containing the loaded root node.

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

      private javafx.scene.control.Button cinemaButton
    • eventButton

      private javafx.scene.control.Button eventButton
    • movieButton

      private javafx.scene.control.Button movieButton
    • productButton

      private javafx.scene.control.Button productButton
    • serieButton

      private javafx.scene.control.Button serieButton
    • logoutButton

      private javafx.scene.control.Button logoutButton
    • profileButton

      private javafx.scene.control.Button profileButton
  • Constructor Details

    • ClientSideBarController

      public ClientSideBarController()
  • Method Details

    • switchToEvent

      void switchToEvent(javafx.event.ActionEvent event)
      Handles an `ActionEvent` and performs a specific action based on the event type.
      Parameters:
      event - event that triggered the function execution, providing the necessary information for the function to perform its intended action.
    • switchToMovies

      void switchToMovies(javafx.event.ActionEvent event)
      Loads a new FXML file "/ui/films/filmuser.fxml" into the stage using the `FXMLLoader` class, replacing the current scene with the newly loaded one.
      Parameters:
      event - user's action that triggered the function, and it is of type `ActionEvent`.

      - It is an `ActionEvent`, indicating that the event occurred due to user action. - The event target is the `movieButton`, indicating the button that was clicked.

    • switchToProducts

      void switchToProducts(javafx.event.ActionEvent event)
      Loads an FXML file named `AfficherProductClient.fxml`, and sets the scene of a Stage to the loaded root element, replacing the previous content.
      Parameters:
      event - occurrence of a button press, which triggers the execution of the `switchToProducts()` method.

      Event: An action event that triggered the function execution.

    • switchToSeries

      void switchToSeries(javafx.event.ActionEvent event)
      Loads a new FXML file "/ui/series/SeriesClient.fxml" when the " serieButton" action is triggered, replacing the current stage with a new scene containing the loaded root node.
      Parameters:
      event - `ActionEvent` that triggered the `switchToSeries()` method, providing the source of the event that initiated the method's execution.

      - Type: `ActionEvent` (represents an action event occurring on a JavaFX component) - Source: Reference to the component that generated the event (usually a button or menu item)

    • switchtcinema

      void switchtcinema(javafx.event.ActionEvent event)
      Loads a new scene from an FXML file when the "Cinema" button is clicked.
      Parameters:
      event - event that triggered the `switchtcinema` function, which is an ActionEvent in this case.

      - `event`: an `ActionEvent` object representing a user-initiated event.

    • switchToLogout

      void switchToLogout(javafx.event.ActionEvent event)
      Loads a new FXML file, replaces the current stage's scene with it, and sets the stage's user data to null.
      Parameters:
      event - click event on the logout button that triggered the function execution.

      - `event`: An instance of the `ActionEvent` class, representing a user action (such as button press) that triggered the function execution.

    • switchToProfile

      void switchToProfile(javafx.event.ActionEvent event)
      Loads a new scene containing a `Parent` element with the FXML file `"/ui/users/Profile.fxml"` when the `profileButton` is clicked.
      Parameters:
      event - click event that triggered the function execution.

      - Event type: `ActionEvent` indicating that the event was triggered by a user action on the associated control (in this case, the `profileButton`).

    • initialize

      public void initialize(URL location, ResourceBundle resources)
      Is called when an instance of a class is created and initializes the object's state by calling its superclass's `initialize` method and performing any additional initialization logic specified in the method body.
      Specified by:
      initialize in interface javafx.fxml.Initializable
      Parameters:
      location - URL of the web application's root directory.
      resources - resource bundle for the application, providing localized strings and other resources for the user interface and functionality.