Class UIController

java.lang.Object
com.nnamo.controllers.UIController

public class UIController extends Object
Controller responsible to directly interact with the mainframe functionalities. It defines different behaviours for the various views
See Also:
  • Constructor Details

  • Method Details

    • run

      public void run()
      It setups up all the different behaviours
    • run

      public void run(UserModel sessionUser)
      It setups up all the different behaviours and defines the user interacting with the UI
      Parameters:
      sessionUser - The session user that interacts with the UI
    • setUser

      public void setUser(UserModel sessionUser)
    • setupTableBehavior

      public void setupTableBehavior()
    • setupFavoriteBehavior

      public void setupFavoriteBehavior()
    • setupButtonPanelBehaviours

      public void setupButtonPanelBehaviours()
      Handles behaviour when clicking on the left panel's buttons (which open the panels on the left)
    • handleStopSelection

      public static void handleStopSelection(StopModel stop, UserModel user, org.jxmapviewer.viewer.GeoPosition position, RealtimeGtfsService realtimeService, MainFrame mainFrame, DatabaseService db) throws IOException, SQLException
      It defines the behaviour of when the user clicks on a stop
      Parameters:
      stop - The selected stop
      user - The user clicking on the stop
      position - The position of the stop
      realtimeService - The realtime service to fetch real-time updates
      mainFrame - The main frame to update the UI
      db - The database service to fetch stop times and favorite status
      Throws:
      IOException
      SQLException - Database queries
    • updateStopPanel

      public static void updateStopPanel(StopModel stop, List<StopTimeModel> stopTimes, List<RealtimeStopUpdate> realtimeUpdates, MainFrame mainFrame, DatabaseService db) throws SQLException, IOException
      Throws:
      SQLException
      IOException
    • updatePreferButton

      public static void updatePreferButton(String itemId, boolean isFav, DataType dataType, MainFrame mainFrame)