forked from nus-cs2103-AY2223S2/tp
-
Notifications
You must be signed in to change notification settings - Fork 0
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 nus-cs2103-AY2223S2#65 from hongshenggg/master
Add delete-image feature to DeveloperGuide
- Loading branch information
Showing
7 changed files
with
169 additions
and
14 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
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 | ||
start | ||
:User executes delete-image command; | ||
'Since the beta syntax does not support placing the condition outside the | ||
'diamond we place it as the true branch instead. | ||
|
||
if () then ([index provided is valid]) | ||
if () then ([person at index does not have default image]) | ||
:Person's image is set to default image; | ||
:Image is deleted from program directory; | ||
else ([else]) | ||
:Display error message; | ||
endif | ||
else ([else]) | ||
: Display error message; | ||
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,79 @@ | ||
@startuml | ||
!include style.puml | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR | ||
participant ":DeleteImageCommandParser" as DeleteImageCommandParser LOGIC_COLOR | ||
participant "d:DeleteImageCommand" as DeleteImageCommand LOGIC_COLOR | ||
participant "result:CommandResult" as CommandResult LOGIC_COLOR | ||
participant "<<class>>\nImageUtil" as ImageUtil LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
end box | ||
|
||
[-> LogicManager : execute("delete-image 1") | ||
activate LogicManager | ||
|
||
LogicManager -> AddressBookParser : parseCommand("delete-image 1") | ||
activate AddressBookParser | ||
|
||
create DeleteImageCommandParser | ||
AddressBookParser -> DeleteImageCommandParser | ||
activate DeleteImageCommandParser | ||
|
||
DeleteImageCommandParser --> AddressBookParser | ||
deactivate DeleteImageCommandParser | ||
|
||
AddressBookParser -> DeleteImageCommandParser : parse("1") | ||
activate DeleteImageCommandParser | ||
|
||
create DeleteImageCommand | ||
DeleteImageCommandParser -> DeleteImageCommand | ||
activate DeleteImageCommand | ||
|
||
DeleteImageCommand --> DeleteImageCommandParser : d | ||
deactivate DeleteImageCommand | ||
|
||
DeleteImageCommandParser --> AddressBookParser : d | ||
deactivate DeleteImageCommandParser | ||
'Hidden arrow to position the destroy marker below the end of the activation bar. | ||
DeleteImageCommandParser -[hidden]-> AddressBookParser | ||
destroy DeleteImageCommandParser | ||
|
||
AddressBookParser --> LogicManager : d | ||
deactivate AddressBookParser | ||
|
||
LogicManager -> DeleteImageCommand : execute() | ||
activate DeleteImageCommand | ||
|
||
DeleteImageCommand -> Model : deleteImage(personaAtIndex) | ||
activate Model | ||
|
||
Model --> DeleteImageCommand | ||
deactivate Model | ||
|
||
DeleteImageCommand -> ImageUtil : deleteImage(imageName) | ||
activate ImageUtil | ||
|
||
ImageUtil --> DeleteImageCommand | ||
deactivate ImageUtil | ||
|
||
create CommandResult | ||
DeleteImageCommand -> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> DeleteImageCommand : result | ||
deactivate CommandResult | ||
|
||
DeleteImageCommand --> LogicManager : result | ||
deactivate DeleteImageCommand | ||
'Hidden arrow to position the destroy marker below the end of the activation bar. | ||
DeleteImageCommandParser -[hidden]-> LogicManager | ||
destroy DeleteImageCommand | ||
|
||
[<--LogicManager : result | ||
deactivate LogicManager | ||
@enduml |
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.