Class BookingSwingView

All Implemented Interfaces:
BookingView, ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class BookingSwingView extends JFrame implements BookingView
A concrete implementation of the view for the booking application using Swing.
See Also:
  • Constructor Details

    • BookingSwingView

      public BookingSwingView()
      Create the frame.
  • Method Details

    • setBookingPresenter

      @Generated public void setBookingPresenter(BookingPresenter bookingPresenter)
      Sets the presenter called to carry out the actions of the controls.
      Parameters:
      bookingPresenter - the presenter of the booking application.
    • showAllClients

      public void showAllClients(List<Client> clients)
      Displays the clients of the given list on the graphical user interface through Swing. Additionally, this method resets the client list selection and disables any buttons that fire when a client is selected in the list.
      Specified by:
      showAllClients in interface BookingView
      Parameters:
      clients - the List of clients to show.
    • showAllReservations

      public void showAllReservations(List<Reservation> reservations)
      Displays the reservations of the given list on the user interface through Swing. Additionally, this method resets the reservation list selection and disables any buttons that fire when a reservation is selected in the list.
      Specified by:
      showAllReservations in interface BookingView
      Parameters:
      reservations - the List of reservations to show.
    • reservationAdded

      public void reservationAdded(Reservation reservation)
      Displays the reservation just inserted into the repository on the user interface through Swing. Additionally, this method resets client forms and disables any buttons that fire when those forms are filled out.
      Specified by:
      reservationAdded in interface BookingView
      Parameters:
      reservation - the Reservation to show.
    • clientAdded

      public void clientAdded(Client client)
      Displays the client just inserted into the repository on the user interface through Swing. Additionally, this method resets reservation forms and disables any buttons that fire when those forms are filled out.
      Specified by:
      clientAdded in interface BookingView
      Parameters:
      client - the Client to show.
    • reservationRemoved

      public void reservationRemoved(Reservation reservation)
      Makes the just deleted reservation disappear from the user interface through Swing. If the deleted reservation was selected, this method disables related buttons.
      Specified by:
      reservationRemoved in interface BookingView
      Parameters:
      reservation - the Reservation to remove from the view.
    • clientRemoved

      public void clientRemoved(Client client)
      Makes the just deleted client disappear from the user interface through Swing. If the deleted client was selected, this method disables related buttons.
      Specified by:
      clientRemoved in interface BookingView
      Parameters:
      client - the Client to remove from the view.
    • clientRenamed

      public void clientRenamed(Client oldClient, Client renamedClient)
      Displays the changes of the client just renamed on the user interface through Swing. Additionally, this method resets client forms and disables any buttons that fire when those forms are filled out.
      Specified by:
      clientRenamed in interface BookingView
      Parameters:
      oldClient - the Client to replace from the view.
      renamedClient - the Client that replaces the old one.
    • reservationRescheduled

      public void reservationRescheduled(Reservation oldReservation, Reservation rescheduledReservation)
      Displays the changes of the reservation just rescheduled on the user interface through Swing. Additionally, this method resets reservation forms and disables any buttons that fire when those forms are filled out.
      Specified by:
      reservationRescheduled in interface BookingView
      Parameters:
      oldReservation - the Reservation to replace from the view.
      rescheduledReservation - the Reservation that replaces the old one.
    • showOperationError

      public void showOperationError(String message)
      Displays an error message that involves operation results through Swing.
      Specified by:
      showOperationError in interface BookingView
      Parameters:
      message - the message to show.
    • showFormError

      public void showFormError(String message)
      Displays an error message that involves input forms through Swing.
      Specified by:
      showFormError in interface BookingView
      Parameters:
      message - the message to show.