Package com.ehealthsystem.appointment
Class AppointmentHealthController
java.lang.Object
com.ehealthsystem.appointment.AppointmentHealthController
- All Implemented Interfaces:
javafx.fxml.Initializable
Class for loading the health information
-
Field Summary
Modifier and TypeFieldDescriptionprivate ArrayList<HealthInformation>
stores all the from the database loaded health information(package private) javafx.scene.control.Button
(package private) javafx.scene.control.Button
(package private) javafx.scene.control.Label
(package private) javafx.scene.layout.GridPane
attributes with a fx:id of the viewprivate ArrayList<javafx.scene.control.CheckBox>
stores all the checkboxes to determine which is selectedprivate ArrayList<HealthInformation>
stores all from the user selected health informaiton -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
fillHealthTable
(ArrayList<HealthInformation> allHealthInformation) fill the grid pane with the loaded health informationvoid
handleBackButton
(javafx.event.ActionEvent event) load the previous sceneprivate void
handleCheckBox
(javafx.scene.control.CheckBox selection, HealthInformation selectedRow, int row) dynamically added eventhandler for checkboxvoid
handleContinueButton
(javafx.event.ActionEvent event) load the next scenevoid
handleDeselectAllButton
(javafx.event.ActionEvent event) deselects all the checkboxes/health information in the grid panevoid
handleSelectAllButton
(javafx.event.ActionEvent event) select all the checkboxes/health information in the grid paneprivate boolean
void
initialize
(URL url, ResourceBundle resourceBundle) First method that is called when scene is switched.private void
load the health information of the user from the databaseprivate void
manuallySelect
(javafx.scene.control.CheckBox c, HealthInformation h, boolean selected) if a check box is selected and add the health information to the grid paneprivate void
Compare the data instead of the object because the object is a different one when switching scenesprivate void
setStyle
(javafx.scene.control.Label ICD, javafx.scene.control.Label health_problem, javafx.scene.control.Label medication, javafx.scene.control.CheckBox selection) set the style for labels and buttons
-
Field Details
-
healthGridPane
javafx.scene.layout.GridPane healthGridPaneattributes with a fx:id of the view -
continueButton
javafx.scene.control.Button continueButton -
backButton
javafx.scene.control.Button backButton -
errorLabel
javafx.scene.control.Label errorLabel -
selectedHealthInformation
stores all from the user selected health informaiton -
allHealthInformation
stores all the from the database loaded health information -
numberOfCheckBoxes
stores all the checkboxes to determine which is selected
-
-
Constructor Details
-
AppointmentHealthController
public AppointmentHealthController()
-
-
Method Details
-
initialize
First method that is called when scene is switched. Used to call the method for initalizing the health information- Specified by:
initialize
in interfacejavafx.fxml.Initializable
- Parameters:
url
-resourceBundle
-
-
handleContinueButton
load the next scene- Parameters:
event
-- Throws:
IOException
-
handleBackButton
load the previous scene- Parameters:
event
-- Throws:
IOException
-
loadHealthInformation
load the health information of the user from the database- Throws:
SQLException
-
fillHealthTable
fill the grid pane with the loaded health information- Parameters:
allHealthInformation
-
-
setStyle
private void setStyle(javafx.scene.control.Label ICD, javafx.scene.control.Label health_problem, javafx.scene.control.Label medication, javafx.scene.control.CheckBox selection) set the style for labels and buttons- Parameters:
ICD
- the parameter of the first column of the grid panehealth_problem
- the parameter of the second column of the grid panemedication
- the third parameter of the grid paneselection
- the created checkbox of a row
-
handleCheckBox
private void handleCheckBox(javafx.scene.control.CheckBox selection, HealthInformation selectedRow, int row) dynamically added eventhandler for checkbox- Parameters:
selection
-selectedRow
-row
-
-
removeMatchingHealthInformation
Compare the data instead of the object because the object is a different one when switching scenes- Parameters:
c
-
-
healthInformationsMatch
-
handleSelectAllButton
public void handleSelectAllButton(javafx.event.ActionEvent event) select all the checkboxes/health information in the grid pane- Parameters:
event
- the event triggered the method
-
handleDeselectAllButton
public void handleDeselectAllButton(javafx.event.ActionEvent event) deselects all the checkboxes/health information in the grid pane- Parameters:
event
- the event triggered the method
-
manuallySelect
if a check box is selected and add the health information to the grid pane- Parameters:
c
- the checkbox selectedh
- the health information of the rowselected
- paramter to determine if checkbox is selected
-