Skip to content

Commit 9bd0208

Browse files
authored
Merge pull request nus-cs2103-AY2021S1#86 from Licheng-Wu/branch-Update-DG
Update DG
2 parents bc29fb1 + 4805188 commit 9bd0208

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

docs/DeveloperGuide.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,38 @@ corresponding predicate for finding the exercises. When executed, `FindExercises
184184
the respective `FilteredList` for exercises in `ModelManager` such that only exercises matching the predicate will be
185185
displayed in the list.
186186

187+
Given below is an example usage scenario and how the find exercise mechanism behaves at each step.
188+
189+
**Step 1:**
190+
191+
The user types into fitNUS `find_exercises bench`.
192+
193+
**Step 2:**
194+
195+
This input is passed to `LogicManager` as a String and from there, the input is parsed by the `parseCommand`
196+
method of `FitNusParser`.
197+
198+
**Step 3:**
199+
200+
`parseCommand` identifies that this is a command to find exercises, so calls the `parse` method of
201+
`FindExercisesCommandParser` on the input.
202+
203+
**Step 4:**
204+
205+
Within `parse`, the keywords to match are added to a `List`, and an `ExerciseNameContainsKeywordsPredicate` object
206+
is created based on this list. A `FindExercisesCommand` object is created using this
207+
`ExerciseNameContainsKeywordsPredicate` object.
208+
209+
**Step 5:**
210+
211+
`LogicManager` then calls the `execute` method of this returned `FindExercisesCommand`.
212+
Within `execute`, `ModelManager`'s `updateFilteredExerciseList` method is called with the
213+
`ExerciseNameContainsKeywordsPredicate` object as its argument. This filters out the relevant exercises.
214+
215+
**Step 6:**
216+
217+
The GUI then lists the filtered exercises.
218+
187219
Given below is the Sequence Diagram for interactions within the Logic component for the execute("find_exercises bench")
188220
API call.
189221
![FindExercisesSequenceDiagram](images/FindExercisesSequenceDiagram.png)

src/main/resources/view/MainWindow.fxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<?import java.net.URL?>
44
<?import javafx.geometry.Insets?>
55
<?import javafx.scene.Scene?>
6-
<?import javafx.scene.control.Label?>
76
<?import javafx.scene.control.Menu?>
87
<?import javafx.scene.control.MenuBar?>
98
<?import javafx.scene.control.MenuItem?>
@@ -15,6 +14,7 @@
1514

1615
<?import javafx.scene.control.Tab?>
1716
<?import javafx.scene.control.TabPane?>
17+
1818
<fx:root minHeight="600" minWidth="450" onCloseRequest="#handleExit" title="FitNUS" type="javafx.stage.Stage" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
1919
<icons>
2020
<Image url="@/images/address_book_32.png" />

0 commit comments

Comments
 (0)