Skip to content

Commit 8d71bbb

Browse files
committed
Add new UML diagrams
1 parent 9b488c9 commit 8d71bbb

7 files changed

+165
-3
lines changed

docs/DeveloperGuide.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ The implementation of `labedit` is as follows:
257257

258258
6. The `EditLabCommand` calls `LabList#setLab` of the student specified by the given `INDEX`, which edits the target `Lab` to the new `Lab`.
259259

260-
The following sequence diagram shows the interactions between components during the execution of the `labedit` command:
260+
The following sequence diagram shows the interactions between components during a `labedit` command, `labedit l/1 s/u`:
261261

262262
<img src="images/EditLabCommandSequenceDiagram.png" width="850" />
263263

@@ -272,9 +272,9 @@ The detailed steps are as follows:
272272
1. `LabList#setLab` checks if the edited `Lab` is the same as the original `Lab`, and whether the target `Lab` exists in the `LabList`.
273273
2. `LabList#setLab` edits the target `Lab` to the new `Lab` with different `LabStatus` and/or `LabMark`.
274274

275-
To summarize, the following activity diagram summarizes what happens when the user requests to edit a lab:
275+
To summarize, the following activity diagram shows what happens when the user requests to edit a lab:
276276

277-
<img src="images/EditLabCommandActivityDiagram.png" width="600" />
277+
<img src="images/EditLabCommandActivityDiagram.png" width="500" />
278278

279279

280280
### \[Proposed\] Undo/redo feature
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
@startuml
2+
'https://plantuml.com/activity-diagram-beta
3+
4+
start
5+
:User executes labedit command;
6+
if () then ([valid command format])
7+
if () then ([index out of bounds])
8+
:Displays error message;
9+
else ([else])
10+
if () then ([valid combination of LabStatus and LabMark])
11+
if () then ([LabMark is 'Unknown'])
12+
:Creates new lab with given LabStatus;
13+
else ([else])
14+
:Creates new lab with LabStatus GRADED and given LabMark;
15+
endif
16+
if () then ([target lab exists and is different from new lab])
17+
:Edits target lab to new lab;
18+
else ([else])
19+
:Displays error message;
20+
endif
21+
else ([else])
22+
:Displays error message;
23+
endif
24+
endif
25+
else ([invalid command format or parameters])
26+
:Displays error message;
27+
endif
28+
stop
29+
30+
@enduml
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
@startuml
2+
'https://plantuml.com/sequence-diagram
3+
!include style.puml
4+
5+
box Logic LOGIC_COLOR_T1
6+
participant ":LogicManager" as LogicManager LOGIC_COLOR
7+
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
8+
participant ":EditLabCommandParser" as EditLabCommandParser LOGIC_COLOR
9+
participant "e:EditLabCommand" as EditLabCommand LOGIC_COLOR
10+
participant "c:CommandResult" as CommandResult LOGIC_COLOR
11+
end box
12+
13+
box Model MODEL_COLOR_T1
14+
participant "m:Model" as Model MODEL_COLOR
15+
participant ":List<Student>" as List MODEL_COLOR
16+
participant "s:Student" as Student MODEL_COLOR
17+
participant "list:LabList" as LabList MODEL_COLOR
18+
end box
19+
20+
[-> LogicManager : execute("labedit l/1 s/u")
21+
activate LogicManager
22+
23+
LogicManager -> AddressBookParser : parseCommand("labedit l/1 s/u")
24+
activate AddressBookParser
25+
26+
create EditLabCommandParser
27+
AddressBookParser -> EditLabCommandParser
28+
activate EditLabCommandParser
29+
30+
EditLabCommandParser --> AddressBookParser
31+
deactivate EditLabCommandParser
32+
33+
AddressBookParser -> EditLabCommandParser : parse("l/1 s/u")
34+
activate EditLabCommandParser
35+
36+
create EditLabCommand
37+
EditLabCommandParser -> EditLabCommand
38+
activate EditLabCommand
39+
40+
EditLabCommand --> EditLabCommandParser : e
41+
deactivate EditLabCommand
42+
43+
EditLabCommandParser --> AddressBookParser : e
44+
deactivate EditLabCommandParser
45+
EditLabCommandParser -[hidden]-> AddressBookParser
46+
destroy EditLabCommandParser
47+
48+
AddressBookParser --> LogicManager : e
49+
deactivate AddressBookParser
50+
51+
LogicManager -> EditLabCommand : execute(m)
52+
activate EditLabCommand
53+
54+
EditLabCommand -> Model : getFilteredStudentList()
55+
activate Model
56+
57+
Model --> EditLabCommand
58+
deactivate Model
59+
60+
EditLabCommand -> List : get(index)
61+
activate List
62+
63+
List --> EditLabCommand : s
64+
deactivate List
65+
66+
EditLabCommand -> Student : getLabs()
67+
activate Student
68+
69+
Student --> EditLabCommand : list
70+
deactivate Student
71+
72+
EditLabCommand -> LabList : getLab()
73+
activate LabList
74+
75+
LabList --> EditLabCommand : labToEdit
76+
deactivate LabList
77+
78+
EditLabCommand -> LabList : setLab(labToEdit, editedLab)
79+
activate LabList
80+
81+
LabList --> EditLabCommand
82+
deactivate LabList
83+
84+
create CommandResult
85+
EditLabCommand -> CommandResult
86+
activate CommandResult
87+
88+
CommandResult --> EditLabCommand
89+
deactivate CommandResult
90+
91+
EditLabCommand --> LogicManager
92+
deactivate EditLabCommand
93+
94+
[<--LogicManager :
95+
deactivate LogicManager
96+
97+
@enduml
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@startuml
2+
'https://plantuml.com/sequence-diagram
3+
!include style.puml
4+
5+
box Model MODEL_COLOR_T1
6+
participant "LabList" as LabList MODEL_COLOR
7+
participant "target:Lab" as Lab MODEL_COLOR
8+
participant ":ObservableList<Lab>" as ObservableList MODEL_COLOR
9+
end box
10+
11+
[-> LabList : setLab(target, editedLab)
12+
activate LabList
13+
14+
LabList -> Lab : equals(editedLab)
15+
activate Lab
16+
17+
Lab --> LabList
18+
deactivate Lab
19+
20+
LabList -> ObservableList : indexOf(target)
21+
activate ObservableList
22+
23+
ObservableList --> LabList
24+
deactivate ObservableList
25+
26+
LabList -> ObservableList : set(target, editedLab)
27+
activate ObservableList
28+
29+
ObservableList --> LabList
30+
deactivate ObservableList
31+
32+
[<-- LabList
33+
deactivate LabList
34+
35+
@enduml
47.9 KB
Loading
57.3 KB
Loading
15.1 KB
Loading

0 commit comments

Comments
 (0)