forked from nus-cs2113-AY2122S2/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 #168 from emilysim00/dg-for-schedule-features
Update DG for schedule features documentation
- Loading branch information
Showing
11 changed files
with
603 additions
and
13 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,53 @@ | ||
@startuml | ||
'https://plantuml.com/sequence-diagram | ||
!include ../Style.puml | ||
|
||
autonumber | ||
|
||
title Sequence Diagram of `schedule /clear` Command | ||
|
||
actor User | ||
participant "werkIt:WerkIt" AS WerkIt | ||
participant "ui:UI" AS UI | ||
participant "parser:Parser" AS Parser | ||
participant "newCommand\n:ScheduleCommand" AS newCommand | ||
participant "dayList\n:DayList" AS DayList | ||
|
||
|
||
activate WerkIt | ||
WerkIt -> UI : getUserInput() | ||
activate UI | ||
User -> UI : `schedule /clear` command | ||
WerkIt <-- UI : userInputTrimmed:String | ||
deactivate UI | ||
|
||
WerkIt -> Parser : parseUserInput(userInput) | ||
activate Parser | ||
WerkIt <-- Parser : :Command | ||
deactivate Parser | ||
|
||
WerkIt -> newCommand : execute() | ||
activate newCommand | ||
|
||
newCommand -> DayList : clearAllSchedule() | ||
activate DayList | ||
deactivate DayList | ||
|
||
newCommand -> UI : printClearedScheduleMessage(); | ||
activate UI | ||
UI --> User: Display a message to indicate the process is completed | ||
deactivate UI | ||
|
||
participant "fileManager:FileManager" as FileManager | ||
newCommand -> FileManager : rewriteAllDaysScheduleToFile(newDay) | ||
activate FileManager | ||
ref over FileManager | ||
Write the plans scheduled | ||
for the week into 'schedule.txt' | ||
file on user's system. | ||
end | ||
newCommand <-- FileManager | ||
deactivate FileManager | ||
|
||
destroy newCommand | ||
@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,63 @@ | ||
@startuml | ||
'https://plantuml.com/sequence-diagram | ||
!include ../Style.puml | ||
|
||
autonumber | ||
|
||
title Sequence Diagram of `schedule /clear` Command | ||
|
||
actor User | ||
participant "werkIt:WerkIt" AS WerkIt | ||
participant "ui:UI" AS UI1 | ||
participant "parser:Parser" AS Parser | ||
participant "newCommand\n:ScheduleCommand" AS newCommand | ||
participant "dayList\n:DayList" AS DayList | ||
|
||
|
||
activate WerkIt | ||
WerkIt -> UI1 : getUserInput() | ||
activate UI1 | ||
User -> UI1 : `schedule /clear` command | ||
WerkIt <-- UI1 : userInputTrimmed:String | ||
deactivate UI1 | ||
|
||
WerkIt -> Parser : parseUserInput(userInput) | ||
activate Parser | ||
WerkIt <-- Parser : :Command | ||
deactivate Parser | ||
|
||
WerkIt -> newCommand : execute() | ||
activate newCommand | ||
|
||
newCommand -> DayList : clearDayPlan(userArgument) | ||
activate DayList | ||
create "Integer" AS int | ||
DayList -> int: parseInt(userArgument) | ||
DayList <-- int : dayNumber:Integer | ||
|
||
create InvalidScheduleException AS ise | ||
opt !isDayValid | ||
DayList -> ise : throw new InvalidScheduleException | ||
activate ise | ||
return | ||
deactivate ise | ||
end | ||
DayList -> DayList : covertDayNumberToDay(dayNumber) | ||
activate DayList | ||
return day:String | ||
DayList --> User : Display plan clear success message | ||
deactivate DayList | ||
|
||
participant "fileManager:FileManager" as FileManager | ||
newCommand -> FileManager : rewriteAllDaysScheduleToFile(newDay) | ||
activate FileManager | ||
ref over FileManager | ||
Write the plans scheduled | ||
for the week into 'schedule.txt' | ||
file on user's system. | ||
end | ||
newCommand <-- FileManager | ||
deactivate FileManager | ||
|
||
destroy newCommand | ||
@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.
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.
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,60 @@ | ||
@startuml | ||
'https://plantuml.com/sequence-diagram | ||
!include ../Style.puml | ||
|
||
autonumber | ||
|
||
title Sequence Diagram of `schedule /update` Command | ||
|
||
actor User | ||
participant "werkIt:WerkIt" AS WerkIt | ||
participant "ui:UI" AS UI1 | ||
participant "parser:Parser" AS Parser | ||
participant "newCommand\n:ScheduleCommand" AS newCommand | ||
participant "dayList\n:DayList" AS DayList | ||
participant "ui:UI" AS UI2 | ||
participant "fileManager:FileManager" as FileManager | ||
|
||
activate WerkIt | ||
WerkIt -> UI1 : getUserInput() | ||
activate UI1 | ||
User -> UI1 : `schedule /update` command | ||
WerkIt <-- UI1 : userInputTrimmed:String | ||
deactivate UI1 | ||
|
||
WerkIt -> Parser : parseUserInput(userInput) | ||
activate Parser | ||
WerkIt <-- Parser : :Command | ||
deactivate Parser | ||
|
||
WerkIt -> newCommand : execute() | ||
activate newCommand | ||
newCommand -> DayList : updateDay(userArgument) | ||
activate DayList | ||
ref over DayList | ||
Add/update a | ||
plan for a Day. | ||
end | ||
newCommand <-- DayList : "newDay:Day" | ||
deactivate DayList | ||
|
||
newCommand -> UI2 : printNewScheduleCreatedMessage(newDay) | ||
activate UI2 | ||
User <-- UI2 : Plan successfully added/updated message | ||
deactivate UI2 | ||
|
||
newCommand -> FileManager : rewriteAllDaysScheduleToFile(newDay) | ||
activate FileManager | ||
ref over FileManager | ||
Write the plans scheduled | ||
for the week into 'schedule.txt' | ||
file on user's system. | ||
end | ||
newCommand <-- FileManager | ||
deactivate FileManager | ||
|
||
WerkIt <-- newCommand | ||
deactivate newCommand | ||
|
||
destroy newCommand | ||
@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,72 @@ | ||
@startuml | ||
'https://plantuml.com/sequence-diagram | ||
!include ../Style.puml | ||
|
||
autonumber 7.1 | ||
|
||
participant "dayList\n:DayList" AS DayList | ||
participant ":String" AS string | ||
|
||
|
||
activate DayList | ||
|
||
group sd Add/update a plan for a Day. | ||
|
||
|
||
DayList -> string : userArgument.split(" ") | ||
activate string | ||
return userArgumentArray:String[] | ||
|
||
|
||
opt userArgumentArray. length > 2 | ||
create ":ArrayOutOfBoundException" AS iee | ||
DayList -> iee : throw new ArrayOutOfBoundException | ||
activate iee | ||
return | ||
deactivate iee | ||
end | ||
create "Integer" AS int | ||
DayList -> int: parseInt(userArgument[0]) | ||
return dayNumber:Int | ||
DayList -> int: parseInt(userArgument[1]) | ||
return planNumber:Int | ||
|
||
opt !isDayValid | ||
create ":InvalidScheduleException" AS ise | ||
DayList -> ise : throw new InvalidScheduleException | ||
activate ise | ||
return | ||
deactivate ise | ||
end | ||
|
||
opt !isPlanValid | ||
DayList -> ise : throw new InvalidScheduleException | ||
activate ise | ||
return | ||
deactivate ise | ||
end | ||
|
||
participant "planList\n:PlanList" AS PlanList | ||
DayList -> PlanList : getPlanDisplayList().get(planNumber - 1) | ||
activate PlanList | ||
return planToAddKey:String | ||
|
||
DayList -> PlanList : getPlanFromKey(planToAddKey) | ||
activate PlanList | ||
return planToAdd:Plan | ||
|
||
create "Day" AS newDay | ||
alt scheduleList[dayNumber - 1] == null | ||
DayList -> newDay : new Day(dayNumber, planToAdd) | ||
activate newDay | ||
return newDay:Day | ||
else | ||
DayList -> newDay :setNewPlanForThisDay(newDay, planToAdd) | ||
activate newDay | ||
return | ||
deactivate newDay | ||
end | ||
end | ||
|
||
|
||
@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,44 @@ | ||
@startuml | ||
'https://plantuml.com/sequence-diagram | ||
!include ../Style.puml | ||
|
||
autonumber | ||
|
||
title Sequence Diagram of `schedule /list` Command | ||
|
||
actor User | ||
participant "werkIt:WerkIt" AS WerkIt | ||
participant "ui:UI" AS UI1 | ||
participant "parser:Parser" AS Parser | ||
participant "newCommand\n:ScheduleCommand" AS newCommand | ||
participant "dayList\n:DayList" AS DayList | ||
|
||
|
||
activate WerkIt | ||
WerkIt -> UI1 : getUserInput() | ||
activate UI1 | ||
User -> UI1 : `schedule /list` command | ||
WerkIt <-- UI1 : userInputTrimmed:String | ||
deactivate UI1 | ||
|
||
WerkIt -> Parser : parseUserInput(userInput) | ||
activate Parser | ||
WerkIt <-- Parser : :Command | ||
deactivate Parser | ||
|
||
WerkIt -> newCommand : execute() | ||
activate newCommand | ||
|
||
newCommand -> DayList : printSchedule() | ||
activate DayList | ||
loop 7 times | ||
|
||
DayList -> DayList : padWithSpaces(planForDay) | ||
activate DayList | ||
return planForDayWithPadding:string | ||
|
||
end | ||
User <-- DayList : Display plans scheduled for the week | ||
return | ||
destroy newCommand | ||
@enduml |