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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAppointment(javafx.event.ActionEvent actionEvent) Sends the user to the Add Appointment screen.voidaddCustomer(javafx.event.ActionEvent actionEvent) Sends the user to the Add Customer screen.voidFunction that checks and alerts the user if they are within 15 minutes of an appointmentvoiddeleteAppointment(javafx.event.ActionEvent actionEvent) Sends the user to the Modify Appointment screen.voiddeleteCustomer(javafx.event.ActionEvent actionEvent) Sends the user to the Modify Customer screen.voiddisplayError(String text, Controllers.MainController.errorLabelFunc func) Utility function that is used to display errorsvoidFunction that correctly fetch the appointments and customers ObservableListsstatic Booleanstatic javafx.collections.ObservableList<Appointment>static javafx.collections.ObservableList<Customer>static Appointmentstatic Customervoidinitialize(URL url, ResourceBundle resourceBundle) Initializes the FXML ScreenvoidFunction that correctly maps all the labels to the correct languagevoidFunction that correctly maps all the tables with te correct ObservableListsvoidUtility function that is used to switch between pagesvoidopenReports(javafx.event.ActionEvent actionEvent) Sends the user to the Reports screen.voidupdateAppointment(javafx.event.ActionEvent actionEvent) Sends the user to the Modify Appointment screen.voidupdateCustomer(javafx.event.ActionEvent actionEvent) Sends the user to the Modify Customer screen.voidupdateTables(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:
initializein 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
-