Class ListFavorisController

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

public class ListFavorisController extends Object implements javafx.fxml.Initializable
Is responsible for handling user actions related to favorite series. It displays a list of series in an AnchorPane and provides buttons to watch, dislike, and add to favorites. The controller also loads the favorite series list from the database using the IServiceSerieImpl and IServiceFavorisImpl interfaces.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
     
    private javafx.scene.control.ListView<Series>
     
    private static final Logger
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Displays a list of series with buttons for liking, disliking, and watching each series.
    void
    initialize(URL url, ResourceBundle resourceBundle)
    Initializes a series fav list by loading it from a database using a SQLException-catching mechanism if an error occurs.
    private void
    Retrieves a list of series from a database based on the current session ID, and then loops through the list of favorite series to retrieve the corresponding series object from a separate service implementation, finally displaying the combined list of series in the UI.

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

      private final int idSession
      See Also:
    • listViewFav

      private javafx.scene.control.ListView<Series> listViewFav
  • Constructor Details

    • ListFavorisController

      public ListFavorisController()
  • Method Details

    • initialize

      public void initialize(URL url, ResourceBundle resourceBundle)
      Initializes a series fav list by loading it from a database using a SQLException-catching mechanism if an error occurs.
      Specified by:
      initialize in interface javafx.fxml.Initializable
      Parameters:
      url - URL of the web page from which the user's favorite series should be loaded.

      - `URL`: represents a web address or a URL, which provides access to a specific resource or service on the internet.

      resourceBundle - localized data for the application, which is used to load the series favor list.

      - `URL`: represents the URL of the web page that contains the series favorites list data - `ResourceBundle`: is a collection of culturally-specific data, including messages, labels, and other information.

    • afficherliste

      public void afficherliste(List<Series> series)
      Displays a list of series with buttons for liking, disliking, and watching each series. When a button is clicked, the corresponding action is performed on the series data model.
      Parameters:
      series - 2D array of series data that will be displayed in the list view, and it is used to populate the list view with the appropriate series items.

      - `id`: an integer representing the unique identifier of the series. - `nom`: a string representing the name of the series. - `genre`: a string representing the genre of the series (e.g., "drama", "comedy", etc.). - `description`: a string representing a brief description of the series. - `poster`: a URL or image path representing the poster image for the series. - `nbEpisodes`: an integer representing the number of episodes in the series.

    • loadSeriesFavList

      private void loadSeriesFavList() throws SQLException
      Retrieves a list of series from a database based on the current session ID, and then loops through the list of favorite series to retrieve the corresponding series object from a separate service implementation, finally displaying the combined list of series in the UI.
      Throws:
      SQLException