Skip to content

Commit

Permalink
Merge pull request #176 from Fallman2/branch-DGEdits2
Browse files Browse the repository at this point in the history
DG Edits
  • Loading branch information
lihongguang00 authored Nov 13, 2023
2 parents 48d0e27 + 12bca92 commit ded2c11
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 14 deletions.
11 changes: 7 additions & 4 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ Step 9. For each event in range, the command calls the `Model#deleteEventsInRang

Step 10. All deleted events are displayed in the command result.

<puml src="diagrams/ClearEventsSequenceDiagram.puml" alt="ClearEventsSequenceDiagram"/>

### Calendar Comparison (compareCalendars)

#### Implementation
Expand Down Expand Up @@ -340,6 +342,7 @@ reflects in the resultant pop-up comparison calendar window.
* Pros: Less application tabs for the user to manage.
* Cons: More clutter on the main GUI.


### Contact Filtering

#### Implementation
Expand Down Expand Up @@ -412,11 +415,11 @@ Here's a sequence diagram to summarise the steps above:
The task list feature is facilitated by 'TaskManager'. It extends a ReadOnlyTaskManager that will be used for
saving users' tasks. The data of the TaskManager is contained in a `TaskList` object. Additionally, it implements the following operations:

*`TaskManager#addTask(Task)` -- Adds a task to the current task list and saves it to memory.
*`TaskManager#deleteTask(int)` -- Delete an existing task from the current task list as indicated by its index and saves the change to memory.
*`TaskManager#sortTasksBy(String)` -- Sets the comparator by which the internal TaskList is sorted to one of two preset options.
* `TaskManager#addTask(Task)` -- Adds a task to the current task list and saves it to memory.
* `TaskManager#deleteTask(int)` -- Delete an existing task from the current task list as indicated by its index and saves the change to memory.
* `TaskManager#sortTasksBy(String)` -- Sets the comparator by which the internal TaskList is sorted to one of two preset options.
This method only accepts the strings `"Description"` or `"Deadline"` as input and throws an error otherwise.
*`TaskManager#getTaskList()` -- Returns and exposes the internal `TaskList` as an unmodifiable `ObservableList<Task>` that can be 'observed'.
* `TaskManager#getTaskList()` -- Returns and exposes the internal `TaskList` as an unmodifiable `ObservableList<Task>` that can be 'observed'.

These operations are exposed in the `Model` interface as `Model#addTask(Task)`, `Model#deleteTask(int)`, `Model#sortTasksBy` and `Model#getTaskList` respectively.

Expand Down
77 changes: 77 additions & 0 deletions docs/diagrams/ClearEventsSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":UniMateParser" as UniMateParser LOGIC_COLOR
participant ":ClearEventsCommandParser" as ClearEventsCommandParser LOGIC_COLOR
participant "d:ClearEventsCommand" as ClearEventsCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
participant ":Calendar" as Calendar MODEL_COLOR
end box

[-> LogicManager : execute("clearEvents ts/2023-02-03 12:00 \nte/2023-02-03 14:00")
activate LogicManager

LogicManager -> UniMateParser : parseCommand("clearEvents ts/2023-02-03 12:00 \nte/2023-02-03 14:00")
activate UniMateParser

create ClearEventsCommandParser
UniMateParser -> ClearEventsCommandParser
activate ClearEventsCommandParser

ClearEventsCommandParser --> UniMateParser
deactivate ClearEventsCommandParser

UniMateParser -> ClearEventsCommandParser : parse("ts/2023-02-03 12:00 \nte/2023-02-03 14:00")
activate ClearEventsCommandParser

create ClearEventsCommand
ClearEventsCommandParser -> ClearEventsCommand : new ClearEventsCommand(EventPeriod)
activate ClearEventsCommand

ClearEventsCommand --> ClearEventsCommandParser : d
deactivate ClearEventsCommand

ClearEventsCommandParser --> UniMateParser : d
deactivate ClearEventsCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
ClearEventsCommandParser -[hidden]-> UniMateParser
destroy ClearEventsCommandParser

UniMateParser --> LogicManager : d
deactivate UniMateParser

LogicManager -> ClearEventsCommand : execute()
activate ClearEventsCommand

ClearEventsCommand -> Model : findEventsInRange(EventPeriod)
activate Model

Model -> Calendar : getEventsInRange((EventPeriod)
activate Calendar

Calendar --> Model
deactivate Calendar

Model --> ClearEventsCommand
deactivate Model

create CommandResult
ClearEventsCommand -> CommandResult
activate CommandResult

CommandResult --> ClearEventsCommand
deactivate CommandResult

ClearEventsCommand --> LogicManager : result
deactivate ClearEventsCommand

[<--LogicManager
deactivate LogicManager
@enduml
20 changes: 10 additions & 10 deletions docs/diagrams/DeleteSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":UniMateParser" as UniMateParser LOGIC_COLOR
participant ":DeleteCommandParser" as DeleteCommandParser LOGIC_COLOR
participant "d:DeleteCommand" as DeleteCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
Expand All @@ -17,17 +17,17 @@ end box
[-> LogicManager : execute("delete 1")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("delete 1")
activate AddressBookParser
LogicManager -> UniMateParser : parseCommand("delete 1")
activate UniMateParser

create DeleteCommandParser
AddressBookParser -> DeleteCommandParser
UniMateParser -> DeleteCommandParser
activate DeleteCommandParser

DeleteCommandParser --> AddressBookParser
DeleteCommandParser --> UniMateParser
deactivate DeleteCommandParser

AddressBookParser -> DeleteCommandParser : parse("1")
UniMateParser -> DeleteCommandParser : parse("1")
activate DeleteCommandParser

create DeleteCommand
Expand All @@ -37,14 +37,14 @@ activate DeleteCommand
DeleteCommand --> DeleteCommandParser : d
deactivate DeleteCommand

DeleteCommandParser --> AddressBookParser : d
DeleteCommandParser --> UniMateParser : d
deactivate DeleteCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
DeleteCommandParser -[hidden]-> AddressBookParser
DeleteCommandParser -[hidden]-> UniMateParser
destroy DeleteCommandParser

AddressBookParser --> LogicManager : d
deactivate AddressBookParser
UniMateParser --> LogicManager : d
deactivate UniMateParser

LogicManager -> DeleteCommand : execute()
activate DeleteCommand
Expand Down
9 changes: 9 additions & 0 deletions docs/diagrams/ModelClassDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ Class Email
Class Name
Class Phone
Class Tag
Class TaskList
Class Task
Class TaskDescription
Class Deadline

Class I #FFFFFF
}
Expand Down Expand Up @@ -72,5 +76,10 @@ Name -[hidden]right-> Phone
Phone -[hidden]right-> Address
Address -[hidden]right-> Email

TaskManager --> "1" TaskList
TaskList --> "*" Task
Task *--> "1" TaskDescription
Task *--> "0..1"Deadline

ModelManager --> "~* filtered" Person
@enduml

0 comments on commit ded2c11

Please sign in to comment.