forked from nus-cs2103-AY2324S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fix and add diagrams for list event
- Fix a bug that the events in the event list window are not sorted - Add activity and sequence diagrams for `list events` command
- Loading branch information
1 parent
6ee412d
commit 5c9199a
Showing
12 changed files
with
210 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@startuml | ||
skin rose | ||
skinparam ActivityFontSize 15 | ||
skinparam ArrowFontSize 12 | ||
start | ||
:User executes list event command; | ||
|
||
if () then ([both exist -st and -et argument or neither exists -st nor -et argument]) | ||
if () then ([exist -st argument]) | ||
if() then([valid start time and end time]) | ||
:Filter the event based on start and end time; | ||
else ([else]) | ||
:Throw CommandException; | ||
endif | ||
else ([else]) | ||
endif | ||
if () then ([exists -descending argument]) | ||
:Sort events in descending order; | ||
else ([else]) | ||
:Sort events in ascending order; | ||
endif | ||
:Returns Result message; | ||
:Open a new window to display the event list; | ||
else ([else]) | ||
:Throw CommandException; | ||
endif | ||
stop | ||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
@startuml | ||
!include ../style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
box UI UI_COLOR_T1 | ||
participant ":MainWindow" as MainWindow UI_COLOR | ||
participant ":EventListWindow" as EventListWindow UI_COLOR | ||
end box | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR | ||
participant ":ListCommandParser" as ListCommandParser LOGIC_COLOR | ||
participant ":ListEventCommandParser" as ListEventCommandParser LOGIC_COLOR | ||
participant ":ListEventCommand" as ListEventCommand LOGIC_COLOR | ||
participant "commandResult:CommandResult" as CommandResult LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
end box | ||
|
||
-> MainWindow : executeCommand(commandText) | ||
activate MainWindow | ||
MainWindow -> LogicManager : execute(commandText) | ||
activate LogicManager | ||
|
||
LogicManager -> AddressBookParser : parseCommand(commandText) | ||
activate AddressBookParser | ||
|
||
create ListCommandParser | ||
AddressBookParser -> ListCommandParser | ||
activate ListCommandParser | ||
|
||
ListCommandParser --> AddressBookParser | ||
deactivate ListCommandParser | ||
|
||
AddressBookParser -> ListCommandParser : parse(commandText) | ||
activate ListCommandParser | ||
|
||
create ListEventCommandParser | ||
ListCommandParser -> ListEventCommandParser | ||
activate ListEventCommandParser | ||
|
||
ListEventCommandParser -> ListCommandParser | ||
deactivate ListEventCommandParser | ||
|
||
ListCommandParser -> ListEventCommandParser : parse(args) | ||
activate ListEventCommandParser | ||
|
||
create ListEventCommand | ||
ListEventCommandParser -> ListEventCommand | ||
activate ListEventCommand | ||
|
||
ListEventCommand --> ListEventCommandParser | ||
deactivate ListEventCommand | ||
|
||
ListEventCommandParser --> ListCommandParser | ||
deactivate ListEventCommandParser | ||
ListEventCommandParser -[hidden]-> ListCommandParser | ||
destroy ListEventCommandParser | ||
|
||
ListCommandParser --> AddressBookParser | ||
deactivate ListCommandParser | ||
ListCommandParser -[hidden]-> AddressBookParser | ||
destroy ListCommandParser | ||
|
||
AddressBookParser --> LogicManager | ||
deactivate AddressBookParser | ||
|
||
LogicManager -> ListEventCommand : execute() | ||
activate ListEventCommand | ||
|
||
ListEventCommand -> Model: updateFilteredEventList(predicate) | ||
activate Model | ||
|
||
Model -> ListEventCommand | ||
deactivate Model | ||
|
||
ListEventCommand -> Model: generateSortedFilteredEventList(comparator) | ||
activate Model | ||
ListEventCommand <- Model : sortedFilteredEventList | ||
deactivate Model | ||
|
||
create CommandResult | ||
ListEventCommand -> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> ListEventCommand : commandResult | ||
deactivate CommandResult | ||
|
||
ListEventCommand --> LogicManager : commandResult | ||
deactivate ListEventCommand | ||
ListEventCommand -[hidden]-> LogicManager | ||
destroy ListEventCommand | ||
|
||
MainWindow <-- LogicManager : commandResult | ||
deactivate LogicManager | ||
MainWindow --> MainWindow : handleEventList() | ||
activate MainWindow | ||
MainWindow --> LogicManager : getSortedFilteredEventList() | ||
activate LogicManager | ||
LogicManager --> Model : getSortedFilteredEventList() | ||
activate Model | ||
LogicManager <-- Model : sortedFilteredEventList | ||
deactivate Model | ||
MainWindow <-- LogicManager : sortedFilteredEventList | ||
deactivate LogicManager | ||
MainWindow --> EventListWindow : show(events) | ||
activate EventListWindow | ||
MainWindow <-- EventListWindow | ||
deactivate EventListWindow | ||
deactivate MainWindow | ||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters