Class PoliceDashboardController

java.lang.Object
com.example.cab302project.PoliceDashboardController

public class PoliceDashboardController extends Object
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

    Constructors
    Constructor
    Description
    Initialises the controller and retrieves the shared DAO instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Hides the AI summary card when the user closes it or clears the suburb search.
    void
    Runs automatically after the FXML has loaded.
    void
    Called when the actioned status dropdown changes.
    void
    Called when the user clicks anywhere on the transparent backdrop behind the filter drawer.
    void
    Called when the crime category dropdown changes.
    void
    Clears the suburb search, removes the boundary from the map, and resets to all crimes.
    void
    Called when the days filter dropdown changes.
    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.
    void
    Returns to the login screen and logs out the current UserSession.
    void
    Resets all filter dropdowns to their defaults and refreshes the map.
    void
    Handles the suburb search when the user presses enter or the Search button.
    void
    Toggles the filter drawer open and closed.
    void
    Navigates to the police crimes view.
    void
    Navigates to the hotspots view screen.
    void
    Navigates to the profile view.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.