Class CashierView

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class CashierView extends JPanel
Represents the main graphical interface for the cashier terminal. This component manages the order lifecycle, including menu item selection, real-time subtotal calculation, and transitioning to the payment phase. * @author Team 60
See Also:
  • Constructor Details

    • CashierView

      public CashierView(Connection conn, JPanel parentPanel)
      Initializes the cashier interface with database connectivity and layout. * @param conn The active SQL database connection for fetching menu data.
      Parameters:
      parentPanel - The container panel used for CardLayout navigation.
  • Method Details

    • addItemToSummary

      public void addItemToSummary(String name, double fullPrice)
      Adds a specific item to the current order summary and updates the total. * @param name The display name of the menu item.
      Parameters:
      fullPrice - The base price of the item plus any customization upcharges.
    • getSummaryModel

      public DefaultListModel<String> getSummaryModel()
      Retrieves the data model containing the current list of ordered items. * @return The DefaultListModel used by the summary sidebar.
    • getCurrentTotal

      public double getCurrentTotal()
      Gets the current cumulative total for the active order. * @return The total price as a double.
    • resetOrder

      public void resetOrder()
      Clears all items from the current order and resets the total to zero. Used after successful payments or when canceling an entire order.
    • getSelectedEmployeeId

      public int getSelectedEmployeeId()
      Identifies the specific employee currently operating the terminal. * @return The unique integer ID of the selected employee.