Skip to content

Commit

Permalink
Merge pull request AY2324S2-CS2103T-W13-4#67 from nobodyishappy/branc…
Browse files Browse the repository at this point in the history
…h-update-DG

Update to implementation of grouping
  • Loading branch information
Kaya3842 authored Apr 5, 2024
2 parents 1baaa19 + b66be5d commit d129239
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 2 deletions.
12 changes: 10 additions & 2 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ The sections below give more details of each component.

### UI component

The **API** of this component is specified in [`Ui.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/ui/Ui.java)
The **API** of this component is specified in [`Ui.java`](https://github.com/AY2324S2-CS2103T-W13-4/tp/blob/master/src/main/java/seedu/address/ui/Ui.java)

<puml src="diagrams/UiClassDiagram.puml" alt="Structure of the UI Component"/>

The UI consists of a `MainWindow` that is made up of parts e.g.`CommandBox`, `ResultDisplay`, `PersonListPanel`, `StatusBarFooter`, `TaskListPanel` etc. All these, including the `MainWindow`, inherit from the abstract `UiPart` class which captures the commonalities between classes that represent parts of the visible GUI.

The `UI` component uses the JavaFx UI framework. The layout of these UI parts are defined in matching `.fxml` files that are in the `src/main/resources/view` folder. For example, the layout of the [`MainWindow`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/ui/MainWindow.java) is specified in [`MainWindow.fxml`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/resources/view/MainWindow.fxml)
The `UI` component uses the JavaFx UI framework. The layout of these UI parts are defined in matching `.fxml` files that are in the `src/main/resources/view` folder. For example, the layout of the [`MainWindow`](https://github.com/AY2324S2-CS2103T-W13-4/tp/blob/master/src/main/java/seedu/address/ui/MainWindow.java) is specified in [`MainWindow.fxml`](https://github.com/AY2324S2-CS2103T-W13-4/tp/blob/master/src/main/resources/view/MainWindow.fxml)

The `UI` component,

Expand Down Expand Up @@ -201,12 +201,20 @@ Step 3. The user executes `assigngroup gn/2103T gt/Task 1` command to assign a t

Step 4. The user executes `addpersontogroup gn/2103T gp/Bob` command to add Bob to the group named "2103T" from the group list. The `addpersontogroup` command calls `Model#addPersonToGroup(String, Person)`, which finds the group with the same name and add the person to the group.

<puml src="diagrams/GroupingState2.puml" alt="GroupingState3" />

Step 5. The user executes `removepersonfromgroup gn/2103T gp/4` command to remove Bob from the group named "2103T" from the group list. The `removepersonfromgroup` command calls `Model#removePersonFromGroup(String, Person)`, which finds the group with the same name and remove the person to the group.

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

Step 6. The user executes `deletetaskgroup gn/2103T gt/Task 1` command to remove a task named "Task 1" from the group named "2103T" from the group list. The `deletetaskgroup` command calls `Model#deleteAssignedTaskGroup(String, Task)`, which finds the group with the same name and remove that task from everyone that is in the group.

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

Step 7. The user executes `deletegroup gn/2103T` command to remove the group from the list. The `deletegroup` command calls `Model#removeGroup(String)`, which finds the group with the same name and remove that group from the list.

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

### \[Proposed\] Undo/Redo Feature

The proposed undo/redo mechanism is facilitated by `VersionedAddressBook`. It extends `AddressBook` with an undo/redo history, stored internally as an `addressBookStateList` and `currentStatePointer`. Additionally, it implements the following operations:
Expand Down
49 changes: 49 additions & 0 deletions docs/diagrams/GroupingState3puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
@startuml
!include style.puml
skinparam ClassFontColor #000000
skinparam ClassBorderColor #000000
skinparam ClassBackgroundColor #FFFFAA

title Model

package Groups {
class Group1 as "<u>2103T:GroupedUniquePersonList</u>"
}

package Persons {
class Person1 as "<u>Ivan:Person</u>"
class Person2 as "<u>Greg:Person</u>"
class Person3 as "<u>Dave:Person</u>"
class Person4 as "<u>Bob:Person</u>"
}

Person1 -[hidden]right-> Person2
Person2 -[hidden]right-> Person3
Person3 -[hidden]right-> Person4

Person1 -up-> Group1
Person2 -up-> Group1
Person3 -up-> Group1
Person4 -up-> Group1

package TaskList_Ivan {
class Task1 as "<u>Task 1:Task</u>"
}

package TaskList_Greg {
class Task2 as "<u>Task 1:Task</u>"
}

package TaskList_Dave {
class Task3 as "<u>Task 1:Task</u>"
}

package TaskList_Bob {
class Task4 as "<u>Task 1:Task</u>"
}


Task1 -up-> Person1
Task2 -up-> Person2
Task3 -up-> Person3
Task4 -up-> Person4

0 comments on commit d129239

Please sign in to comment.