Package Controllers

Class MainController

java.lang.Object
Controllers.MainController
All Implemented Interfaces:
javafx.fxml.Initializable

public class MainController extends Object implements javafx.fxml.Initializable
Controller class for the Main.fmxl form. Implements Initializable
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addAppointment(javafx.event.ActionEvent actionEvent)
    Sends the user to the Add Appointment screen.
    void
    addCustomer(javafx.event.ActionEvent actionEvent)
    Sends the user to the Add Customer screen.
    void
    Function that checks and alerts the user if they are within 15 minutes of an appointment
    void
    deleteAppointment(javafx.event.ActionEvent actionEvent)
    Sends the user to the Modify Appointment screen.
    void
    deleteCustomer(javafx.event.ActionEvent actionEvent)
    Sends the user to the Modify Customer screen.
    void
    displayError(String text, Controllers.MainController.errorLabelFunc func)
    Utility function that is used to display errors
    void
    Function that correctly fetch the appointments and customers ObservableLists
    static Boolean
     
    static javafx.collections.ObservableList<Appointment>
     
    static javafx.collections.ObservableList<Customer>
     
     
    static Customer
     
    void
    initialize(URL url, ResourceBundle resourceBundle)
    Initializes the FXML Screen
    void
    Function that correctly maps all the labels to the correct language
    void
    Function that correctly maps all the tables with te correct ObservableLists
    void
    openPage(javafx.event.ActionEvent actionEvent, String form)
    Utility function that is used to switch between pages
    void
    openReports(javafx.event.ActionEvent actionEvent)
    Sends the user to the Reports screen.
    void
    updateAppointment(javafx.event.ActionEvent actionEvent)
    Sends the user to the Modify Appointment screen.
    void
    updateCustomer(javafx.event.ActionEvent actionEvent)
    Sends the user to the Modify Customer screen.
    void
    updateTables(Controllers.MainController.FetchTables func)
    Utility function that is update tables

    Methods inherited from class java.lang.Object

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

    • MainController

      public MainController()
  • Method Details

    • getAdding

      public static Boolean getAdding()
      Returns:
      [Boolean] value whether the action is adding or updating
    • getCustomer

      public static Customer getCustomer()
      Returns:
      [Customer] object that was selected from the table
    • getAppointment

      public static Appointment getAppointment()
      Returns:
      [Appointment] object that was selected from the table
    • getAllCustomers

      public static javafx.collections.ObservableList<Customer> getAllCustomers()
      Returns:
      [ObservableList Customer] list from the table
    • getAllAppointments

      public static javafx.collections.ObservableList<Appointment> getAllAppointments()
      Returns:
      [ObservableList Appointment] list from the table
    • updateTables

      public void updateTables(Controllers.MainController.FetchTables func)
      Utility function that is update tables
      Parameters:
      func - LAMBDA Function
    • openReports

      public void openReports(javafx.event.ActionEvent actionEvent) throws IOException
      Sends the user to the Reports screen.
      Parameters:
      actionEvent - JavaFX action event
      Throws:
      IOException
    • addCustomer

      public void addCustomer(javafx.event.ActionEvent actionEvent) throws IOException
      Sends the user to the Add Customer screen.
      Parameters:
      actionEvent - JavaFX action event
      Throws:
      IOException
    • updateCustomer

      public void updateCustomer(javafx.event.ActionEvent actionEvent) throws IOException
      Sends the user to the Modify Customer screen.
      Parameters:
      actionEvent - JavaFX action event
      Throws:
      IOException - A LAMBDA expression is utilized in this method to set the error label
    • deleteCustomer

      public void deleteCustomer(javafx.event.ActionEvent actionEvent) throws IOException
      Sends the user to the Modify Customer screen.
      Parameters:
      actionEvent - JavaFX action event
      Throws:
      IOException - A LAMBDA expression is utilized in this method to clear the error label A LAMBDA expression is utilized in this method to set the error label
    • addAppointment

      public void addAppointment(javafx.event.ActionEvent actionEvent) throws IOException
      Sends the user to the Add Appointment screen.
      Parameters:
      actionEvent - JavaFX action event
      Throws:
      IOException
    • updateAppointment

      public void updateAppointment(javafx.event.ActionEvent actionEvent) throws IOException
      Sends the user to the Modify Appointment screen.
      Parameters:
      actionEvent - JavaFX action event
      Throws:
      IOException - A LAMBDA expression is utilized in this method to clear the error label
    • deleteAppointment

      public void deleteAppointment(javafx.event.ActionEvent actionEvent) throws IOException
      Sends the user to the Modify Appointment screen.
      Parameters:
      actionEvent - JavaFX action event
      Throws:
      IOException - A LAMBDA expression is utilized in this method to clear the error label
    • appointmentAlert

      public void appointmentAlert()
      Function that checks and alerts the user if they are within 15 minutes of an appointment
    • mapLabels

      public void mapLabels()
      Function that correctly maps all the labels to the correct language
    • mapTables

      public void mapTables()
      Function that correctly maps all the tables with te correct ObservableLists
    • fetchData

      public void fetchData()
      Function that correctly fetch the appointments and customers ObservableLists
    • initialize

      public void initialize(URL url, ResourceBundle resourceBundle)
      Initializes the FXML Screen
      Specified by:
      initialize in interface javafx.fxml.Initializable
      Parameters:
      url - parameter for the FXML Screen
      resourceBundle - parameter for the FXML Screen
    • openPage

      public void openPage(javafx.event.ActionEvent actionEvent, String form) throws IOException
      Utility function that is used to switch between pages
      Parameters:
      actionEvent - JavaFX action event
      Throws:
      IOException
    • displayError

      public void displayError(String text, Controllers.MainController.errorLabelFunc func)
      Utility function that is used to display errors
      Parameters:
      text - String value text of the main text