Class DashboardAdminController
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<javafx.scene.control.CheckBox>
private javafx.scene.layout.AnchorPane
private javafx.scene.control.TableColumn<Cinema,
javafx.scene.image.ImageView> private javafx.scene.layout.AnchorPane
private javafx.scene.control.TableView<Cinema>
private final List<javafx.scene.control.CheckBox>
private javafx.scene.control.TextField
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
Configures a table to display cinemas, including their name, address, and responsible person.(package private) void
afficherEventsAdmin
(javafx.event.ActionEvent event) Loads an fxml file and displays a stage with a scene, changing the current stage to the new one.(package private) void
afficherMovieAdmin
(javafx.event.ActionEvent event) Loads an FXML file, creates a stage and window for film management, and replaces the current stage with the new one.(package private) void
AfficherProductAdmin
(javafx.event.ActionEvent event) Loads an fxml file, creates a scene and stage, and replaces the current stage with the new one.(package private) void
afficherserieAdmin
(javafx.event.ActionEvent event) Loads a FXML file, creates a stage and window for a series management interface, and replaces the current stage with the new one.private javafx.scene.layout.AnchorPane
createFilmCard
(Film film) private void
filterCinemas
(String searchText) Filters a list of cinemas based on a search query, updating the displayed list in a TableView.(package private) void
filtrer
(javafx.event.ActionEvent event) Updates the opacity of a container and makes a filter anchor visible, then clears the lists of check boxes for addresses and statuses, retrieves unique addresses and statuses from the database, creates VBoxes for each address and status, adds them to the filter anchor, and sets the filter anchor's visibility to true.(package private) void
filtrercinema
(javafx.event.ActionEvent event) Filters a list of cinemas based on selected addresses and/or statuses, and updates the TableView with the filtered list.Retrieves a list of cinemas through the use of the `CinemaService`.Retrieves a list of cinema addresses from a database and extracts unique addresses from the list of cinemas using Stream API.Creates a list of predefined cinema statuses, including "Pending" and "Accepted", and returns it.Streamlines the selected addresses from an `AnchorPane` of filtering, applies a filter to only include selected checkboxes, and collects the results into a list of strings.Retrieves the selected statuses from an `AnchorPane` of filtering by streaming the checked checkboxes, filtering the non-checked ones, and collecting the selected statuses as a list.void
Adds a listener to the `tfSearch` text field to filter and update the list of cinemas when the user types in it, loads all cinemas initially, and displays them.private void
Creates an observable list of cinemas by reading them from a service and setting it as the items of a `ListBox`.private void
showFilmsInModal
(Cinema cinema)
-
Field Details
-
addressCheckBoxes
-
statusCheckBoxes
-
cinemasList
private javafx.scene.layout.AnchorPane cinemasList -
colAction
-
colAdresse
-
colCinema
-
colLogo
-
colResponsable
-
colStatut
-
listCinema
-
tfSearch
private javafx.scene.control.TextField tfSearch -
filterAnchor
private javafx.scene.layout.AnchorPane filterAnchor
-
-
Constructor Details
-
DashboardAdminController
public DashboardAdminController()
-
-
Method Details
-
afficherCinemas
void afficherCinemas()Configures a table to display cinemas, including their name, address, and responsible person. It also sets up buttons for accepting or refusing cinemas, and a button to show movies. -
showFilmsInModal
-
createFilmCard
-
loadCinemas
private void loadCinemas()Creates an observable list of cinemas by reading them from a service and setting it as the items of a `ListBox`. -
getAllCinemas
Retrieves a list of cinemas through the use of the `CinemaService`. The list is then returned. -
initialize
public void initialize()Adds a listener to the `tfSearch` text field to filter and update the list of cinemas when the user types in it, loads all cinemas initially, and displays them. -
filterCinemas
Filters a list of cinemas based on a search query, updating the displayed list in a TableView.- Parameters:
searchText
- search term used to filter the list of cinemas displayed on the screen.
-
filtrer
void filtrer(javafx.event.ActionEvent event) Updates the opacity of a container and makes a filter anchor visible, then clears the lists of check boxes for addresses and statuses, retrieves unique addresses and statuses from the database, creates VBoxes for each address and status, adds them to the filter anchor, and sets the filter anchor's visibility to true.- Parameters:
event
- ActionEvent that triggered the filtrer method, providing the necessary information to update the UI components accordingly.- `event`: an ActionEvent object representing the user's action that triggered the function execution.
-
getCinemaAddresses
Retrieves a list of cinema addresses from a database and extracts unique addresses from the list of cinemas using Stream API. -
getCinemaStatuses
Creates a list of predefined cinema statuses, including "Pending" and "Accepted", and returns it. -
filtrercinema
void filtrercinema(javafx.event.ActionEvent event) Filters a list of cinemas based on selected addresses and/or statuses, and updates the TableView with the filtered list.- Parameters:
event
- occurrence of an action event, such as a button press or key stroke, that triggers the execution of the `filtrercinema` method.- `Event`: This represents an event object that triggered the function to be executed. - `ActionEvent`: This is a specific type of event object that indicates that a button or other control was pressed.
-
getSelectedAddresses
Streamlines the selected addresses from an `AnchorPane` of filtering, applies a filter to only include selected checkboxes, and collects the results into a list of strings. -
getSelectedStatuses
Retrieves the selected statuses from an `AnchorPane` of filtering by streaming the checked checkboxes, filtering the non-checked ones, and collecting the selected statuses as a list. -
afficherEventsAdmin
Loads an fxml file and displays a stage with a scene, changing the current stage to the new one.- Parameters:
event
- event that triggered the function and provides access to its related data, allowing the code inside the function to interact with it.- `event`: An `ActionEvent` object representing an action performed on the application.
- Throws:
IOException
-
afficherMovieAdmin
Loads an FXML file, creates a stage and window for film management, and replaces the current stage with the new one.- Parameters:
event
- event that triggered the function execution, specifically an `ActionEvent` related to the loading of the FXML file.Event: An event object that represents a user-initiated action or event, such as a button click or a key press.
- Throws:
IOException
-
afficherserieAdmin
Loads a FXML file, creates a stage and window for a series management interface, and replaces the current stage with the new one.- Parameters:
event
- event that triggered the execution of the `afficherserieAdmin()` function, which is an action event generated by a user's click on a button or other element in the FXML file.- `event` is an `ActionEvent`, indicating that the method was called as a result of user action.
- Throws:
IOException
-
AfficherProductAdmin
Loads an fxml file, creates a scene and stage, and replaces the current stage with the new one.- Parameters:
event
- ActionEvent object that triggered the execution of the `AfficherProductAdmin()` method.- `event`: An `ActionEvent` object representing a user action that triggered the function to execute.
- Throws:
IOException
-