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
FieldsModifier 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.GridPaneattributes 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidfillHealthTable(ArrayList<HealthInformation> allHealthInformation) fill the grid pane with the loaded health informationvoidhandleBackButton(javafx.event.ActionEvent event) load the previous sceneprivate voidhandleCheckBox(javafx.scene.control.CheckBox selection, HealthInformation selectedRow, int row) dynamically added eventhandler for checkboxvoidhandleContinueButton(javafx.event.ActionEvent event) load the next scenevoidhandleDeselectAllButton(javafx.event.ActionEvent event) deselects all the checkboxes/health information in the grid panevoidhandleSelectAllButton(javafx.event.ActionEvent event) select all the checkboxes/health information in the grid paneprivate booleanvoidinitialize(URL url, ResourceBundle resourceBundle) First method that is called when scene is switched.private voidload the health information of the user from the databaseprivate voidmanuallySelect(javafx.scene.control.CheckBox c, HealthInformation h, boolean selected) if a check box is selected and add the health information to the grid paneprivate voidCompare the data instead of the object because the object is a different one when switching scenesprivate voidsetStyle(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:
initializein 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
-