java.lang.Object
com.example.cab302project.DashboardController
Controller for the public dashboard screen (dashboard-view.fxml).
Displays the hotspot map as the home screen for public users.
Manages the hamburger menu, hotspot clustering, suburb search,
and the filter drawer (crime type, time range, actioned status).
-
Constructor Summary
ConstructorsConstructorDescriptionInitialises the controller and retrieves the shared DAO instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidRuns automatically after the FXML has loaded.voidCalled when the actioned status dropdown changes.voidCalled when the user clicks anywhere on the transparent backdrop behind the filter drawer.voidCalled when the crime category dropdown changes.voidClears the suburb search, removes the boundary from the map, and resets to all crimes.voidCalled when the days filter dropdown changes.voidonFilterDrawerClicked(javafx.scene.input.MouseEvent event) Consumes mouse clicks on the filter drawer itself so they do not propagate to the backdrop and accidentally close the panel.voidonLogout()Returns to the login screen and logs out the current UserSession.voidResets all filter dropdowns to their defaults and refreshes the map.voidonSearch()Handles the suburb search when the user presses enter or the Search button.voidNavigates to the crimes screen so the user can submit a new report.voidToggles the filter drawer open and closed.voidNavigates to the crimes view.voidNavigates to the hotspots view scene.voidNavigates to the profile view.
-
Constructor Details
-
DashboardController
public DashboardController()Initialises the controller and retrieves the shared DAO instance.
-
-
Method Details
-
onSearch
public void onSearch()Handles the suburb search when the user presses enter or the Search button. Runs the Nominatim request on a background thread to keep the UI responsive, then draws the suburb boundary on the map and filters crimes to that area. -
onClearSearch
public void onClearSearch()Clears the suburb search, removes the boundary from the map, and resets to all crimes. -
onToggleFilter
public void onToggleFilter()Toggles the filter drawer open and closed. Also shows or hides the transparent backdrop that catches outside clicks. -
onBackdropClicked
public void onBackdropClicked()Called when the user clicks anywhere on the transparent backdrop behind the filter drawer. Closes the filter drawer. -
onFilterDrawerClicked
public void onFilterDrawerClicked(javafx.scene.input.MouseEvent event) Consumes mouse clicks on the filter drawer itself so they do not propagate to the backdrop and accidentally close the panel.- Parameters:
event- the mouse event to consume
-
onCategoryChanged
public void onCategoryChanged()Called when the crime category dropdown changes. -
onDaysChanged
public void onDaysChanged()Called when the days filter dropdown changes. -
onActionedChanged
public void onActionedChanged()Called when the actioned status dropdown changes. -
onResetFilters
public void onResetFilters()Resets all filter dropdowns to their defaults and refreshes the map. -
initialize
public void initialize()Runs automatically after the FXML has loaded. -
onLogout
public void onLogout()Returns to the login screen and logs out the current UserSession. -
viewCrimes
public void viewCrimes()Navigates to the crimes view. -
viewProfile
public void viewProfile()Navigates to the profile view. -
viewHotspots
public void viewHotspots()Navigates to the hotspots view scene. -
onSubmitReport
public void onSubmitReport()Navigates to the crimes screen so the user can submit a new report.
-