Package Controllers
Class MainController
java.lang.Object
Controllers.MainController
- All Implemented Interfaces:
javafx.fxml.Initializable
Controller class for the Main.fmxl form.
Implements Initializable
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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 appointmentvoid
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 errorsvoid
Function that correctly fetch the appointments and customers ObservableListsstatic Boolean
static javafx.collections.ObservableList<Appointment>
static javafx.collections.ObservableList<Customer>
static Appointment
static Customer
void
initialize
(URL url, ResourceBundle resourceBundle) Initializes the FXML Screenvoid
Function that correctly maps all the labels to the correct languagevoid
Function that correctly maps all the tables with te correct ObservableListsvoid
Utility function that is used to switch between pagesvoid
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
-
Constructor Details
-
MainController
public MainController()
-
-
Method Details
-
getAdding
- Returns:
- [Boolean] value whether the action is adding or updating
-
getCustomer
- Returns:
- [Customer] object that was selected from the table
-
getAppointment
- Returns:
- [Appointment] object that was selected from the table
-
getAllCustomers
- Returns:
- [ObservableList Customer] list from the table
-
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
Sends the user to the Reports screen.- Parameters:
actionEvent
- JavaFX action event- Throws:
IOException
-
addCustomer
Sends the user to the Add Customer screen.- Parameters:
actionEvent
- JavaFX action event- Throws:
IOException
-
updateCustomer
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
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
Sends the user to the Add Appointment screen.- Parameters:
actionEvent
- JavaFX action event- Throws:
IOException
-
updateAppointment
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
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
Initializes the FXML Screen- Specified by:
initialize
in interfacejavafx.fxml.Initializable
- Parameters:
url
- parameter for the FXML ScreenresourceBundle
- parameter for the FXML Screen
-
openPage
Utility function that is used to switch between pages- Parameters:
actionEvent
- JavaFX action event- Throws:
IOException
-
displayError
Utility function that is used to display errors- Parameters:
text
- String value text of the main text
-