java.lang.Object
com.example.cab302project.PoliceDashboardController
Controller for the police dashboard screen (police-dashboard-view.fxml).
Displays the hotspot map as the home screen for police users.
Manages the police 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 TypeMethodDescriptionvoidHides the AI summary card when the user closes it or clears the suburb search.voidRuns 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.voidToggles the filter drawer open and closed.voidNavigates to the police crimes view.voidNavigates to the hotspots view screen.voidNavigates to the profile view.
-
Constructor Details
-
PoliceDashboardController
public PoliceDashboardController()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. -
hideAiSummaryPopup
public void hideAiSummaryPopup()Hides the AI summary card when the user closes it or clears the suburb search. -
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 police crimes view. -
viewProfile
public void viewProfile()Navigates to the profile view. -
viewHotspots
public void viewHotspots()Navigates to the hotspots view screen.
-