Package com.esprit.controllers.cinemas
Class ModifierCinemaController
java.lang.Object
com.esprit.controllers.cinemas.ModifierCinemaController
- All Implemented Interfaces:
javafx.fxml.Initializable
Is used to modify the details of a cinema object in a GUI application using
JavaFX. It has fields for entering cinema name, address, and logo, and
methods for updating the cinema details and displaying an alert message. The
class also includes an initialize method and event handlers for the select
and modifier buttons.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Sets text fields and displays an image based on input cinema object's properties: nom, adresse, logo.void
initialize
(URL location, ResourceBundle resources) Is called when an instance of a class is created and initializes its resources by performing no-op actions.(package private) void
modifier
(javafx.event.ActionEvent event) Allows users to edit the details of a cinema, including its name and address.(package private) void
select
(javafx.event.ActionEvent event) Is used to select an image file from a file chooser and set it as the logo for the FXML stage.private void
Creates an Alert dialog with an information message.
-
Field Details
-
tfNom
private javafx.scene.control.TextField tfNom -
tfAdresse
private javafx.scene.control.TextField tfAdresse -
tfLogo
private javafx.scene.image.ImageView tfLogo -
cinema
-
selectedFile
-
-
Constructor Details
-
ModifierCinemaController
public ModifierCinemaController()
-
-
Method Details
-
initialize
Is called when an instance of a class is created and initializes its resources by performing no-op actions.- Specified by:
initialize
in interfacejavafx.fxml.Initializable
- Parameters:
location
- URL of the web application's root document, which is used to locate the necessary resources for its proper operation.resources
- ResourceBundle that contains keys for localization of the application's user interface and other textual content.
-
initData
Sets text fields and displays an image based on input cinema object's properties: nom, adresse, logo.- Parameters:
cinema
- Cinema object that contains the name, address, and logo of the cinema, which are then set as text values for the `tfNom`, `tfAdresse`, and `tfLogo` fields, respectively, within the function's body.- `cinema`: A `Cinema` object representing a movie theater with name, address, and logo.
-
modifier
Allows users to edit the details of a cinema, including its name and address. It updates the cinema's information in the database and displays an alert message upon successful completion.- Parameters:
event
- ActionEvent object that triggered the method execution, providing the source of the event and any related data.- `event` is an instance of `ActionEvent`, which represents a user action related to a UI component. - The `event` object contains information about the action that triggered the function, such as the source of the action (e.g., a button or a menu item) and the state of the component at the time of the action.
- Throws:
IOException
-
select
void select(javafx.event.ActionEvent event) Is used to select an image file from a file chooser and set it as the logo for the FXML stage.- Parameters:
event
- selection event that triggered the function execution.- Event type: `ActionEvent` - Target: `null` (no specific component is associated with the event)
-
showAlert
Creates an Alert dialog with an information message.- Parameters:
message
- text to be displayed as an information message when the `showAlert()` method is called.
-