Package com.ehealthsystem.appointment
Class AppointmentInformationController
java.lang.Object
com.ehealthsystem.appointment.AppointmentInformationController
- All Implemented Interfaces:
javafx.fxml.Initializable
Class which manages the appointment data
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) javafx.scene.control.Label(package private) javafx.scene.control.ComboBox(package private) javafx.scene.control.TextField(package private) javafx.scene.control.Sliderattributes with a fix:id in the view -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleBackButton(javafx.event.ActionEvent event) switch to the last scene if the button is pressed.voidhandleContinueButton(javafx.event.ActionEvent event) handle the event that is triggered when pressing the continue button.voidinitialize(URL url, ResourceBundle resourceBundle) First method that is called when switching the scene.private booleansaveData()Save the appointment databooleantriggers error method if field is left empty.booleanCheck if the user provided a health problem as a reason for making an appointment
-
Field Details
-
searchDistanceSlider
javafx.scene.control.Slider searchDistanceSliderattributes with a fix:id in the view -
healthProblemField
javafx.scene.control.TextField healthProblemField -
healthProblemChoiceBox
javafx.scene.control.ComboBox healthProblemChoiceBox -
errorLabel
javafx.scene.control.Label errorLabel
-
-
Constructor Details
-
AppointmentInformationController
public AppointmentInformationController()
-
-
Method Details
-
initialize
First method that is called when switching the scene. Used to set the default values of the all the scene components.- Specified by:
initializein interfacejavafx.fxml.Initializable- Parameters:
url-resourceBundle-
-
handleContinueButton
public void handleContinueButton(javafx.event.ActionEvent event) throws IOException, InterruptedException, com.google.maps.errors.ApiException, SQLException handle the event that is triggered when pressing the continue button. Save the selected appointment information and determine if something is left empty.- Parameters:
event- the event that triggered the method- Throws:
IOExceptionInterruptedExceptioncom.google.maps.errors.ApiExceptionSQLException
-
saveData
Save the appointment data- Returns:
- Throws:
SQLException
-
handleBackButton
switch to the last scene if the button is pressed.- Parameters:
event- the event that triggered the method- Throws:
IOExceptionSQLException
-
validateHealthProblem
public boolean validateHealthProblem()triggers error method if field is left empty.- Returns:
-
validateHealthProblemChoiceBox
public boolean validateHealthProblemChoiceBox()Check if the user provided a health problem as a reason for making an appointment- Returns:
- boolean if the choice of health problem is valid
-