forked from nus-cs2103-AY2223S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 6
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 #518 from bryanljx/bryan/update-tag-DG
Update DG Tag implementations
- Loading branch information
Showing
9 changed files
with
132 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@startuml | ||
!pragma useVerticalIf on | ||
start | ||
:User enters filtertag command; | ||
if () then ([else]) | ||
:Error:Invalid command format; | ||
stop | ||
([tag name provided]) elseif () then ([else]) | ||
:Error: Tag does not exist; | ||
stop | ||
else ([tag exists in model]) | ||
endif | ||
-Model filters Item List for items that are tagged with the tag specified. | ||
:FilterTag Command successfully executes. | ||
Item gets tagged with tag.; | ||
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,90 @@ | ||
|
||
@startuml | ||
!include style.puml | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":FoodRemParser" as FoodRemParser LOGIC_COLOR | ||
participant ":FilterTagCommandParser" as FilterTagCommandParser LOGIC_COLOR | ||
participant ":Tag" as Tag LOGIC_COLOR | ||
participant ":FilterTagCommand" as FilterTagCommand LOGIC_COLOR | ||
participant ":TagSetContainsTagPredicate" as TagSetContainsTagPredicate LOGIC_COLOR | ||
participant ":CommandResult" as CommandResult LOGIC_COLOR | ||
|
||
|
||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
end box | ||
|
||
[-> LogicManager : execute("filtertag n/tagname") | ||
activate LogicManager | ||
|
||
LogicManager -> FoodRemParser : parseCommand("filtertag n/tagname") | ||
activate FoodRemParser | ||
|
||
create FilterTagCommandParser | ||
FoodRemParser -> FilterTagCommandParser | ||
activate FilterTagCommandParser | ||
|
||
|
||
FilterTagCommandParser --> FoodRemParser | ||
deactivate FilterTagCommandParser | ||
|
||
|
||
FoodRemParser -> FilterTagCommandParser : parse("n/tagname") | ||
activate FilterTagCommandParser | ||
|
||
create Tag | ||
FilterTagCommandParser -> Tag | ||
activate Tag | ||
Tag --> FilterTagCommandParser | ||
deactivate Tag | ||
|
||
create FilterTagCommand | ||
FilterTagCommandParser -> FilterTagCommand : FilterTagCommand(tag) | ||
activate FilterTagCommand | ||
|
||
create TagSetContainsTagPredicate | ||
FilterTagCommand --> TagSetContainsTagPredicate | ||
activate TagSetContainsTagPredicate | ||
|
||
TagSetContainsTagPredicate --> FilterTagCommand | ||
deactivate TagSetContainsTagPredicate | ||
|
||
FilterTagCommand --> FilterTagCommandParser : | ||
deactivate FilterTagCommand | ||
|
||
FilterTagCommand --> FoodRemParser : | ||
deactivate FilterTagCommandParser | ||
'Hidden arrow to position the destroy marker below the end of the activation bar. | ||
FilterTagCommandParser -[hidden]-> FoodRemParser | ||
destroy FilterTagCommandParser | ||
|
||
FoodRemParser --> LogicManager : | ||
deactivate FoodRemParser | ||
|
||
LogicManager -> FilterTagCommand : execute(model) | ||
activate FilterTagCommand | ||
|
||
|
||
FilterTagCommand -> Model : updateFilteredItemList(pred) | ||
activate Model | ||
|
||
Model --> FilterTagCommand | ||
deactivate Model | ||
|
||
create CommandResult | ||
FilterTagCommand -> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> FilterTagCommand | ||
deactivate CommandResult | ||
|
||
FilterTagCommand --> LogicManager | ||
deactivate FilterTagCommand | ||
|
||
[<--LogicManager | ||
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.