Package com.nnamo.controllers
Class UIController
java.lang.Object
com.nnamo.controllers.UIController
Controller responsible to directly interact with the mainframe
functionalities.
It defines different behaviours for the various views
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUIController
(DatabaseService db, MainFrame mainFrame, RealtimeGtfsService realtimeService) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
handleStopSelection
(StopModel stop, UserModel user, org.jxmapviewer.viewer.GeoPosition position, RealtimeGtfsService realtimeService, MainFrame mainFrame, DatabaseService db) It defines the behaviour of when the user clicks on a stopvoid
run()
It setups up all the different behavioursvoid
It setups up all the different behaviours and defines the user interacting with the UIvoid
Handles behaviour when clicking on the left panel's buttons (which open the panels on the left)void
void
void
static void
updatePreferButton
(String itemId, boolean isFav, DataType dataType, MainFrame mainFrame) static void
updateStopPanel
(StopModel stop, List<StopTimeModel> stopTimes, List<RealtimeStopUpdate> realtimeUpdates, MainFrame mainFrame, DatabaseService db)
-
Constructor Details
-
UIController
-
-
Method Details
-
run
public void run()It setups up all the different behaviours -
run
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
-
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 stopuser
- The user clicking on the stopposition
- The position of the stoprealtimeService
- The realtime service to fetch real-time updatesmainFrame
- The main frame to update the UIdb
- 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
-