Package com.ehealthsystem.doctor
Class FoundDoctorFullController
java.lang.Object
com.ehealthsystem.appointment.ScheduleLoader
com.ehealthsystem.doctor.FoundDoctorFullController
Class for managing the full view of a selected doctor
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) javafx.scene.control.Label(package private) javafx.scene.control.Label(package private) javafx.scene.control.DatePickerprivate DoctorDistanceprivate String(package private) javafx.scene.control.Labelall attributes with a fx:id assigned in the view(package private) javafx.scene.control.Buttonprivate javafx.scene.web.WebView(package private) javafx.scene.control.ComboBox(package private) javafx.scene.control.Labelprivate StringFields inherited from class com.ehealthsystem.appointment.ScheduleLoader
errorLabel, NO_TIME_SELECTED, selectedTime -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate com.google.maps.model.LatLng[]getBoundsForImage(com.google.maps.model.LatLng l1, com.google.maps.model.LatLng l2) Algorithm to determine bounds to display a map image with two locations as markers Adds spacing so that the map markers are not directly at the edge but within the displayed area/frame Adds spacing on top of the map because marker is represented by a bubble above the actual locationvoidhandleBackButton(javafx.event.ActionEvent event) method to load to previous scenevoidhandleDateChoice(javafx.event.ActionEvent event) check if a valid date is pickedvoidhandleMakeAppointmentButton(javafx.event.ActionEvent event) method to handle the event when trying to make an appointmentprivate voidload the doctor data into the LabelsvoidloadGMap()loads the map into the scene via webengine and webviewprivate voidDeprecated.private booleandynamically load the doctors scheduleprotected voidHandler that triggers whenever the user selected another time.voidsetDoctor(DoctorDistance doctor) set the doctor selected in the scene beforevoidsetDoctorGeoData(String doctorGeoData) set the doctor geodata for mapvoidsetUserGeoData(String userGeoData) set the user's geodata for mapvoidstart()sets reminder times, loads the map, doctor data and the doctors scheduleMethods inherited from class com.ehealthsystem.appointment.ScheduleLoader
loadSchedule
-
Field Details
-
doctorLabel
javafx.scene.control.Label doctorLabelall attributes with a fx:id assigned in the view -
addressLabel
javafx.scene.control.Label addressLabel -
specializationsLabel
javafx.scene.control.Label specializationsLabel -
dateLabel
javafx.scene.control.Label dateLabel -
datePicker
javafx.scene.control.DatePicker datePicker -
reminderComboBox
javafx.scene.control.ComboBox reminderComboBox -
makeAppointmentButton
javafx.scene.control.Button makeAppointmentButton -
mapWebView
private javafx.scene.web.WebView mapWebView -
doctor
-
userGeoData
-
doctorGeoData
-
-
Constructor Details
-
FoundDoctorFullController
public FoundDoctorFullController()
-
-
Method Details
-
start
public void start() throws IOException, InterruptedException, com.google.maps.errors.ApiException, SQLExceptionsets reminder times, loads the map, doctor data and the doctors schedule- Throws:
IOExceptionInterruptedExceptioncom.google.maps.errors.ApiExceptionSQLException
-
setDoctor
set the doctor selected in the scene before- Parameters:
doctor-
-
setUserGeoData
set the user's geodata for map- Parameters:
userGeoData-
-
setDoctorGeoData
set the doctor geodata for map- Parameters:
doctorGeoData-
-
loadOsmMap
private void loadOsmMap() throws IOException, InterruptedException, com.google.maps.errors.ApiExceptionDeprecated.: replaced by interactive route display:loadGMap()Load a static map image using OpenStreetMap data into the webview- Throws:
IOExceptionInterruptedExceptioncom.google.maps.errors.ApiException
-
getBoundsForImage
private com.google.maps.model.LatLng[] getBoundsForImage(com.google.maps.model.LatLng l1, com.google.maps.model.LatLng l2) Algorithm to determine bounds to display a map image with two locations as markers Adds spacing so that the map markers are not directly at the edge but within the displayed area/frame Adds spacing on top of the map because marker is represented by a bubble above the actual location- Parameters:
l1- coordinates 1l2- coordinates 2- Returns:
-
loadDoctorData
private void loadDoctorData() throws SQLException, IOException, InterruptedException, com.google.maps.errors.ApiExceptionload the doctor data into the Labels- Throws:
SQLExceptionIOExceptionInterruptedExceptioncom.google.maps.errors.ApiException
-
loadSchedule
dynamically load the doctors schedule- Throws:
SQLExceptionjavax.activation.UnsupportedDataTypeException
-
selectedTimeChanged
protected void selectedTimeChanged()Description copied from class:ScheduleLoaderHandler that triggers whenever the user selected another time. Empty in this abstract class, but can be overwritten in inheriting/extending classes to easily add functionality- Overrides:
selectedTimeChangedin classScheduleLoader
-
handleBackButton
method to load to previous scene- Parameters:
event-- Throws:
IOException
-
handleMakeAppointmentButton
public void handleMakeAppointmentButton(javafx.event.ActionEvent event) throws IOException, SQLException, javax.mail.MessagingException, InterruptedException, com.google.maps.errors.ApiException method to handle the event when trying to make an appointment- Parameters:
event-- Throws:
IOExceptionSQLExceptionjavax.mail.MessagingExceptionInterruptedExceptioncom.google.maps.errors.ApiException
-
loadGMap
public void loadGMap() throws IOException, InterruptedException, com.google.maps.errors.ApiExceptionloads the map into the scene via webengine and webview- Throws:
IOExceptionInterruptedExceptioncom.google.maps.errors.ApiException
-
handleDateChoice
public void handleDateChoice(javafx.event.ActionEvent event) throws SQLException, javax.activation.UnsupportedDataTypeException check if a valid date is picked- Parameters:
event- event that triggered the method- Throws:
SQLExceptionjavax.activation.UnsupportedDataTypeException
-
loadGMap()Load a static map image using OpenStreetMap data into the webview