Class CinemaManagerSideBarController

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

public class CinemaManagerSideBarController extends Object implements javafx.fxml.Initializable
Is responsible for managing the navigation between different views in a cinema management application. It provides buttons for switching between different categories of films, moviesessions, and statistics, as well as a logout button. The controller also sets data for the current user and handles actions such as switching to profiles or films.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private javafx.scene.control.Button
     
    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
     
    (package private) CinemaManager
     
    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 the application starts and initializes its resources by taking a URL and resource bundle as arguments.
    void
    Sets the value of the `resp` field to a provided `CinemaManager` object.
    (package private) void
    switchstatestique(javafx.event.ActionEvent event)
    Loads an FXML file named "/ui/cinemas/statistiques.fxml" using the `FXMLLoader` class, creates a new controller instance from the loaded file, and sets the scene of a stage to display the loaded content.
    (package private) void
    switchToActor(javafx.event.ActionEvent event)
    Loads and displays an actor's interface using the `FXMLLoader` class, passing in a reference to the actor's data as an argument.
    (package private) void
    switchToCinema(javafx.event.ActionEvent event)
    Loads and displays a FXML file named "/ui/cinemas/DashboardResponsableCinema.fxml" in a JavaFX stage, replacing the existing content.
    (package private) void
    switchToFilmCategorie(javafx.event.ActionEvent event)
    Loads an FXML file and displays its contents on a stage, replacing the current scene.
    (package private) void
    switchToLogout(javafx.event.ActionEvent event)
    Loads a new FXML file `/Login.fxml` when the logout button is clicked, replacing the current scene with a new one containing the loaded stage.
    (package private) void
    switchToMovies(javafx.event.ActionEvent event)
    Loads an FXML file and creates a new scene in a Stage using the FXMLLoader class.
    (package private) void
    switchToMovieSessions(javafx.event.ActionEvent event)
    Loads and displays a new FXML document when the "MovieSession" button is clicked, using the `FXMLLoader` class and the `Stage` class to switch between scenes.
    (package private) void
    switchToProfile(javafx.event.ActionEvent event)
    Loads a new FXML file, replacing the current scene with the new one.

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

    • actorButton

      private javafx.scene.control.Button actorButton
    • cinemaButton

      private javafx.scene.control.Button cinemaButton
    • filmCategorieButton

      private javafx.scene.control.Button filmCategorieButton
    • movieButton

      private javafx.scene.control.Button movieButton
    • moviesessionButton

      private javafx.scene.control.Button moviesessionButton
    • statestique_button

      private javafx.scene.control.Button statestique_button
    • logoutButton

      private javafx.scene.control.Button logoutButton
    • profileButton

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

    • CinemaManagerSideBarController

      public CinemaManagerSideBarController()
  • Method Details

    • switchToActor

      void switchToActor(javafx.event.ActionEvent event)
      Loads and displays an actor's interface using the `FXMLLoader` class, passing in a reference to the actor's data as an argument.
      Parameters:
      event - user's action of clicking on the button that triggers the function.

      - `event`: An `ActionEvent` object representing a user interaction with the stage button.

    • switchstatestique

      void switchstatestique(javafx.event.ActionEvent event)
      Loads an FXML file named "/ui/cinemas/statistiques.fxml" using the `FXMLLoader` class, creates a new controller instance from the loaded file, and sets the scene of a stage to display the loaded content.
      Parameters:
      event - event of a button click that triggered the function execution.

      - Event is an ActionEvent object, representing a user action related to the stage or window where the function is called.

    • switchToCinema

      void switchToCinema(javafx.event.ActionEvent event) throws IOException
      Loads and displays a FXML file named "/ui/cinemas/DashboardResponsableCinema.fxml" in a JavaFX stage, replacing the existing content.
      Parameters:
      event - click event on the cinema button that triggered the function execution.

      Event: An ActionEvent object representing a button press.

      Throws:
      IOException
    • switchToFilmCategorie

      void switchToFilmCategorie(javafx.event.ActionEvent event)
      Loads an FXML file and displays its contents on a stage, replacing the current scene.
      Parameters:
      event - clicked button that triggered the function call.

      Event: An action event object representing the user's interaction with the button.

    • switchToMovies

      void switchToMovies(javafx.event.ActionEvent event)
      Loads an FXML file and creates a new scene in a Stage using the FXMLLoader class.
      Parameters:
      event - click event that triggered the `switchToMovies()` method to be executed.

      - Event type: `ActionEvent` indicating a user action on the movie button - Target object: `movieButton` providing the context of the event

    • switchToMovieSessions

      void switchToMovieSessions(javafx.event.ActionEvent event)
      Loads and displays a new FXML document when the "MovieSession" button is clicked, using the `FXMLLoader` class and the `Stage` class to switch between scenes.
      Parameters:
      event - occurrence of a button press event that triggers the function to switch to the `DashboardResponsableCinema.fxml` scene.

      - `event`: An `ActionEvent` object representing the user's action that triggered the function.

    • setData

      public void setData(CinemaManager resp)
      Sets the value of the `resp` field to a provided `CinemaManager` object.
      Parameters:
      resp - CinemaManager object that will store the data.
    • initialize

      public void initialize(URL location, ResourceBundle resources)
      Is called when the application starts and initializes its resources by taking a URL and resource bundle as arguments.
      Specified by:
      initialize in interface javafx.fxml.Initializable
      Parameters:
      location - URL of the initial resource to be processed by the function.
      resources - resource bundle for the application, providing localized strings and formatting data to the initialize method.
    • switchToLogout

      void switchToLogout(javafx.event.ActionEvent event)
      Loads a new FXML file `/Login.fxml` when the logout button is clicked, replacing the current scene with a new one containing the loaded stage.
      Parameters:
      event - event of button click, which triggers the function to switch to the login screen.

      - `event`: an `ActionEvent` object representing a user action on the logout button.

    • switchToProfile

      void switchToProfile(javafx.event.ActionEvent event)
      Loads a new FXML file, replacing the current scene with the new one.
      Parameters:
      event - occurrence of a button press event that triggers the execution of the `switchToProfile()` method.

      - `event`: An `ActionEvent` object representing the user's action of pressing the profile button.