Skip to content

Commit

Permalink
Add documentation for command history feature
Browse files Browse the repository at this point in the history
  • Loading branch information
aureliony committed Apr 14, 2024
1 parent 365e35d commit 3367d62
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

# Configuration guide

Certain properties of the application can be controlled (e.g user preferences file location, logging level) through the configuration file (default: `config.json`).
Certain properties of the application can be controlled (e.g. user preferences file location, logging level) through the configuration file (default: `config.json`).
18 changes: 15 additions & 3 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ The **API** of this component is specified in [`Ui.java`](https://github.com/se-

The UI consists of a `MainWindow` that is made up of parts e.g.`CommandBox`, `ResultDisplay`, `PersonListPanel`, `StatusBarFooter` 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/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,

Expand Down Expand Up @@ -143,7 +143,7 @@ The `Storage` component,

### Common classes

Classes used by multiple components are in the `seedu.addressbook.commons` package.
Some classes used by multiple components are in the `seedu.addressbook.commons` package.

--------------------------------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -212,7 +212,7 @@ associated with person.

The `PersonMatchesQueryPredicate` class defines the algorithm that determines whether a `Person` matches the user's `query` string.

The following sequence diagram shows how the `command` object is created. Note that the leading whitespace in `" David"` is intentional due to the implementation of `AddressBookParser`.
The following sequence diagram shows how the `command` object is created when the user executes `find David`. Note that the leading whitespace in `" David"` is an implementation detail of `AddressBookParser`.

<puml src="diagrams/FindSequenceDiagram1.puml"/>
<br><br>
Expand Down Expand Up @@ -325,6 +325,18 @@ The following activity diagram summarizes what happens when a user executes a ne
<puml src="diagrams/SaveActivityDiagram.puml" width="250" />
<br><br>

### Command History feature

The `CommandHistory` class is an abstraction for a command history data structure.
It stores all command strings that were successfully executed by the user.

When the user presses the `UP` key, a `KeyEvent` is generated by JavaFX, which is then handled by the `CommandBox` class through the `handleKeyPressed()` method.

The following sequence diagram shows the interaction between the classes when the user presses the `UP` key.

<puml src="diagrams/CommandHistorySequenceDiagram.puml" />
<br><br>

#### Design considerations:

**Aspect: How undo & redo executes:**
Expand Down
3 changes: 3 additions & 0 deletions docs/diagrams/style.puml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
!define STORAGE_COLOR_T3 #806600
!define STORAGE_COLOR_T2 #544400

!define JAVAFX_COLOR #E76F00
!define JAVAFX_COLOR_T1 #DEB38C

!define USER_COLOR #000000

skinparam Package {
Expand Down

0 comments on commit 3367d62

Please sign in to comment.