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.
Merge pull request #206 from larrywang0701/milestone-1.4
Bug fix and add diagrams for list event
- Loading branch information
Showing
15 changed files
with
349 additions
and
27 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,92 @@ | ||
@startuml | ||
!include ../style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR | ||
participant ":DeleteCommandParser" as DeleteCommandParser LOGIC_COLOR | ||
participant ":DeleteEventCommandParser" as DeleteEventCommandParser LOGIC_COLOR | ||
participant ":DeleteEventCommand" as DeleteEventCommand LOGIC_COLOR | ||
participant "commandResult:CommandResult" as CommandResult LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
end box | ||
|
||
[-> LogicManager : execute(commandText) | ||
activate LogicManager | ||
|
||
LogicManager -> AddressBookParser : parseCommand(commandText) | ||
activate AddressBookParser | ||
|
||
create DeleteCommandParser | ||
AddressBookParser -> DeleteCommandParser | ||
activate DeleteCommandParser | ||
|
||
DeleteCommandParser --> AddressBookParser | ||
deactivate DeleteCommandParser | ||
|
||
AddressBookParser -> DeleteCommandParser : parse(commandText) | ||
activate DeleteCommandParser | ||
|
||
create DeleteEventCommandParser | ||
DeleteCommandParser -> DeleteEventCommandParser | ||
activate DeleteEventCommandParser | ||
|
||
DeleteEventCommandParser -> DeleteCommandParser | ||
deactivate DeleteEventCommandParser | ||
|
||
DeleteCommandParser -> DeleteEventCommandParser : parse(args) | ||
activate DeleteEventCommandParser | ||
|
||
create DeleteEventCommand | ||
DeleteEventCommandParser -> DeleteEventCommand | ||
activate DeleteEventCommand | ||
|
||
DeleteEventCommand --> DeleteEventCommandParser | ||
deactivate DeleteEventCommand | ||
|
||
DeleteEventCommandParser --> DeleteCommandParser | ||
deactivate DeleteEventCommandParser | ||
DeleteEventCommandParser -[hidden]-> DeleteCommandParser | ||
destroy DeleteEventCommandParser | ||
|
||
DeleteCommandParser --> AddressBookParser | ||
deactivate DeleteCommandParser | ||
DeleteCommandParser -[hidden]-> AddressBookParser | ||
destroy DeleteCommandParser | ||
|
||
AddressBookParser --> LogicManager | ||
deactivate AddressBookParser | ||
|
||
LogicManager -> DeleteEventCommand : execute() | ||
activate DeleteEventCommand | ||
|
||
DeleteEventCommand -> Model: findPersonByUserFriendlyId(contactId) | ||
activate Model | ||
|
||
Model -> DeleteEventCommand: person | ||
deactivate Model | ||
|
||
DeleteEventCommand --> Model : removeEventByID(eventID, owner) | ||
activate Model | ||
DeleteEventCommand <-- Model | ||
deactivate Model | ||
|
||
create CommandResult | ||
DeleteEventCommand -> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> DeleteEventCommand : commandResult | ||
deactivate CommandResult | ||
|
||
DeleteEventCommand --> LogicManager : commandResult | ||
deactivate DeleteEventCommand | ||
DeleteEventCommand -[hidden]-> LogicManager | ||
destroy DeleteEventCommand | ||
|
||
[<--LogicManager : commandResult | ||
deactivate LogicManager | ||
@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,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,116 @@ | ||
@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 | ||
destroy CommandResult | ||
[<--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
Oops, something went wrong.