Class ModifierCinemaController

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

public class ModifierCinemaController extends Object implements 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
    Modifier and Type
    Field
    Description
    private Cinema
     
    private File
     
    private javafx.scene.control.TextField
     
    private javafx.scene.image.ImageView
     
    private javafx.scene.control.TextField
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    initData(Cinema cinema)
    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
    showAlert(String message)
    Creates an Alert dialog with an information message.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • tfNom

      private javafx.scene.control.TextField tfNom
    • tfAdresse

      private javafx.scene.control.TextField tfAdresse
    • cinema

      private Cinema cinema
    • selectedFile

      private File selectedFile
  • Constructor Details

    • ModifierCinemaController

      public ModifierCinemaController()
  • Method Details

    • initialize

      public 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.
      Specified by:
      initialize in interface javafx.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

      public void initData(Cinema cinema)
      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

      void modifier(javafx.event.ActionEvent event) throws IOException
      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

      private void showAlert(String message)
      Creates an Alert dialog with an information message.
      Parameters:
      message - text to be displayed as an information message when the `showAlert()` method is called.