From a9b23bf08e5dc1abfb32129ee4b903b43291e43a Mon Sep 17 00:00:00 2001 From: Nicholas Leong Date: Wed, 19 Feb 2020 18:21:55 +0800 Subject: [PATCH 001/411] Update Build Status Badge --- README.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.adoc b/README.adoc index e36efe534bb..a96546c5f41 100644 --- a/README.adoc +++ b/README.adoc @@ -1,7 +1,7 @@ = Address Book (Level 3) ifdef::env-github,env-browser[:relfileprefix: docs/] -https://travis-ci.org/se-edu/addressbook-level3[image:https://travis-ci.org/se-edu/addressbook-level3.svg?branch=master[Build Status]] +https://travis-ci.org/AY1920S2-CS2103T-W17-1/main[image:https://travis-ci.org/AY1920S2-CS2103T-W17-1/main.svg?branch=master[Build Status]] https://ci.appveyor.com/project/damithc/addressbook-level3[image:https://ci.appveyor.com/api/projects/status/3boko2x2vr5cc3w2?svg=true[Build status]] https://coveralls.io/github/se-edu/addressbook-level3?branch=master[image:https://coveralls.io/repos/github/se-edu/addressbook-level3/badge.svg?branch=master[Coverage Status]] https://www.codacy.com/app/damith/addressbook-level3?utm_source=github.com&utm_medium=referral&utm_content=se-edu/addressbook-level3&utm_campaign=Badge_Grade[image:https://api.codacy.com/project/badge/Grade/fc0b7775cf7f4fdeaf08776f3d8e364a[Codacy Badge]] From 0eff4b012b1709c56dd320e830be14a4721f52ba Mon Sep 17 00:00:00 2001 From: Nicholas Leong Date: Wed, 19 Feb 2020 18:35:58 +0800 Subject: [PATCH 002/411] Remove codacy badge --- README.adoc | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.adoc b/README.adoc index a96546c5f41..d24322f15ff 100644 --- a/README.adoc +++ b/README.adoc @@ -4,8 +4,6 @@ ifdef::env-github,env-browser[:relfileprefix: docs/] https://travis-ci.org/AY1920S2-CS2103T-W17-1/main[image:https://travis-ci.org/AY1920S2-CS2103T-W17-1/main.svg?branch=master[Build Status]] https://ci.appveyor.com/project/damithc/addressbook-level3[image:https://ci.appveyor.com/api/projects/status/3boko2x2vr5cc3w2?svg=true[Build status]] https://coveralls.io/github/se-edu/addressbook-level3?branch=master[image:https://coveralls.io/repos/github/se-edu/addressbook-level3/badge.svg?branch=master[Coverage Status]] -https://www.codacy.com/app/damith/addressbook-level3?utm_source=github.com&utm_medium=referral&utm_content=se-edu/addressbook-level3&utm_campaign=Badge_Grade[image:https://api.codacy.com/project/badge/Grade/fc0b7775cf7f4fdeaf08776f3d8e364a[Codacy Badge]] - ifdef::env-github[] image::docs/images/Ui.png[width="600"] From 03205ecd80d3f4a43d979dc28cb22caf3481d00f Mon Sep 17 00:00:00 2001 From: Nicholas Leong Date: Wed, 19 Feb 2020 18:56:17 +0800 Subject: [PATCH 003/411] Undo remove codacy badge --- README.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/README.adoc b/README.adoc index d24322f15ff..42019bc7c7d 100644 --- a/README.adoc +++ b/README.adoc @@ -4,6 +4,7 @@ ifdef::env-github,env-browser[:relfileprefix: docs/] https://travis-ci.org/AY1920S2-CS2103T-W17-1/main[image:https://travis-ci.org/AY1920S2-CS2103T-W17-1/main.svg?branch=master[Build Status]] https://ci.appveyor.com/project/damithc/addressbook-level3[image:https://ci.appveyor.com/api/projects/status/3boko2x2vr5cc3w2?svg=true[Build status]] https://coveralls.io/github/se-edu/addressbook-level3?branch=master[image:https://coveralls.io/repos/github/se-edu/addressbook-level3/badge.svg?branch=master[Coverage Status]] +https://www.codacy.com/app/damith/addressbook-level3?utm_source=github.com&utm_medium=referral&utm_content=se-edu/addressbook-level3&utm_campaign=Badge_Grade[image:https://api.codacy.com/project/badge/Grade/fc0b7775cf7f4fdeaf08776f3d8e364a[Codacy Badge]] ifdef::env-github[] image::docs/images/Ui.png[width="600"] From 8af1d6a5a3167e54a1f8a596cb1e9ce95f191286 Mon Sep 17 00:00:00 2001 From: Nicholas Leong Date: Wed, 19 Feb 2020 19:07:07 +0800 Subject: [PATCH 004/411] Remove codacy badge --- README.adoc | 1 - 1 file changed, 1 deletion(-) diff --git a/README.adoc b/README.adoc index 42019bc7c7d..d24322f15ff 100644 --- a/README.adoc +++ b/README.adoc @@ -4,7 +4,6 @@ ifdef::env-github,env-browser[:relfileprefix: docs/] https://travis-ci.org/AY1920S2-CS2103T-W17-1/main[image:https://travis-ci.org/AY1920S2-CS2103T-W17-1/main.svg?branch=master[Build Status]] https://ci.appveyor.com/project/damithc/addressbook-level3[image:https://ci.appveyor.com/api/projects/status/3boko2x2vr5cc3w2?svg=true[Build status]] https://coveralls.io/github/se-edu/addressbook-level3?branch=master[image:https://coveralls.io/repos/github/se-edu/addressbook-level3/badge.svg?branch=master[Coverage Status]] -https://www.codacy.com/app/damith/addressbook-level3?utm_source=github.com&utm_medium=referral&utm_content=se-edu/addressbook-level3&utm_campaign=Badge_Grade[image:https://api.codacy.com/project/badge/Grade/fc0b7775cf7f4fdeaf08776f3d8e364a[Codacy Badge]] ifdef::env-github[] image::docs/images/Ui.png[width="600"] From 1e248e992d10320a88f3ddb5865e5d5eb823a03f Mon Sep 17 00:00:00 2001 From: amrl Date: Thu, 20 Feb 2020 00:48:32 +0800 Subject: [PATCH 005/411] Initial user guide for FlashSpeed --- docs/UserGuide.adoc | 158 +++++++++++++++++++++++--------------------- 1 file changed, 82 insertions(+), 76 deletions(-) diff --git a/docs/UserGuide.adoc b/docs/UserGuide.adoc index 4e5d297a19f..ed6003324a0 100644 --- a/docs/UserGuide.adoc +++ b/docs/UserGuide.adoc @@ -1,4 +1,4 @@ -= AddressBook Level 3 - User Guide += FlashSpeed - User Guide :site-section: UserGuide :toc: :toc-title: @@ -12,19 +12,24 @@ ifdef::env-github[] :tip-caption: :bulb: :note-caption: :information_source: endif::[] -:repoURL: https://github.com/se-edu/addressbook-level3 +:repoURL: https://github.com/AY1920S2-CS2103T-W17-1/main -By: `Team SE-EDU` Since: `Jun 2016` Licence: `MIT` +By: `AY1920S2-CS2103T-W17-1` Since: `Feb 2020` Licence: `MIT` == Introduction -AddressBook Level 3 (AB3) is for those who *prefer to use a desktop app for managing contacts*. More importantly, AB3 is *optimized for those who prefer to work with a Command Line Interface* (CLI) while still having the benefits of a Graphical User Interface (GUI). If you can type fast, AB3 can get your contact management tasks done faster than traditional GUI apps. Interested? Jump to the <> to get started. Enjoy! +FlashSpeed is a text-based flashcard application specifically designed for university students who are learning a foreign language. University students often have hectic schedules. With this in mind, FlashSpeed was created to allow students to be able to study and revise foreign vocabulary on the fly. With a single command, you can start a quick study session on FlashSpeed whenever! + +FlashSpeed enhances the revision process by adopting the Space Repetition System (SRS) in its design. Users will be tested more frequently on new words, or words that they have gotten wrong in previous sessions. This system benefits from the psychological spacing effect. SRS has been scientifically proven to increase the rate of learning and memorisation [1]. By using FlashSpeed, you will learn faster and remember for longer! + +We hope you enjoy using our app. Happy FlashSpeeding! + == Quick Start . Ensure you have Java `11` or above installed in your Computer. -. Download the latest `addressbook.jar` link:{repoURL}/releases[here]. -. Copy the file to the folder you want to use as the home folder for your Address Book. +. Download the latest `flashspeed.jar` link:{https://github.com/AY1920S2-CS2103T-W17-1/main/releases}/releases[here]. +. Copy the file to the folder you want to use as the home folder for FlashSpeed. . Double-click the file to start the app. The GUI should appear in a few seconds. + image::Ui.png[width="790"] @@ -33,9 +38,9 @@ image::Ui.png[width="790"] e.g. typing *`help`* and pressing kbd:[Enter] will open the help window. . Some example commands you can try: -* *`list`* : lists all contacts -* **`add`**`n/John Doe p/98765432 e/johnd@example.com a/John street, block 123, #01-01` : adds a contact named `John Doe` to the Address Book. -* **`delete`**`3` : deletes the 3rd contact shown in the current list +* *`list`* : lists all decks +* **`create`**`Japanese 1` : creates a deck named `Japanese 1` in the FlashSpeed library. +* **`delete`**`3` : deletes the 3rd deck shown in the deck list * *`exit`* : exits the app . Refer to <> for details of each command. @@ -46,83 +51,84 @@ e.g. typing *`help`* and pressing kbd:[Enter] will open the help window. ==== *Command Format* -* Words in `UPPER_CASE` are the parameters to be supplied by the user e.g. in `add n/NAME`, `NAME` is a parameter which can be used as `add n/John Doe`. -* Items in square brackets are optional e.g `n/NAME [t/TAG]` can be used as `n/John Doe t/friend` or as `n/John Doe`. -* Items with `…`​ after them can be used multiple times including zero times e.g. `[t/TAG]...` can be used as `{nbsp}` (i.e. 0 times), `t/friend`, `t/friend t/family` etc. -* Parameters can be in any order e.g. if the command specifies `n/NAME p/PHONE_NUMBER`, `p/PHONE_NUMBER n/NAME` is also acceptable. +* Words in `<>` are the parameters to be supplied by the user. + +e.g. in `create `, `` is a parameter which can be used as `create Japanese 1`. ==== === Viewing help : `help` Format: `help` -=== Adding a person: `add` +=== Listing all decks : `list` -Adds a person to the address book + -Format: `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]...` +Shows a list of all decks in the library. + +Format: `list` + +=== Creating a deck : `create` -[TIP] -A person can have any number of tags (including 0) +Creates a new deck in the library. + +Format: `create ` Examples: -* `add n/John Doe p/98765432 e/johnd@example.com a/John street, block 123, #01-01` -* `add n/Betsy Crowe t/friend e/betsycrowe@example.com a/Newgate Prison p/1234567 t/criminal` +* `create Japanese 1` +* `create Japanese Verbs` -=== Listing all persons : `list` +=== Adding a card : `add` -Shows a list of all persons in the address book. + -Format: `list` +Adds a new card to a deck. + +Format: `add :` + +**** +* Adds a card to the deck at the specified `index`. The index refers to the index number shown in the displayed decks list. The index *must be a positive integer* 1, 2, 3, ... +**** + +Examples: -=== Editing a person : `edit` +* `add 1 ありがとう:thanks` +* `add 2 いい[お]てんきですね。:Nice weather, isn't it?` -Edits an existing person in the address book. + -Format: `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [t/TAG]...` +=== Showing all cards in a deck : `show` + +Shows all cards in a deck. + +Format: `show ` **** -* Edits the person at the specified `INDEX`. The index refers to the index number shown in the displayed person list. The index *must be a positive integer* 1, 2, 3, ... -* At least one of the optional fields must be provided. -* Existing values will be updated to the input values. -* When editing tags, the existing tags of the person will be removed i.e adding of tags is not cumulative. -* You can remove all the person's tags by typing `t/` without specifying any tags after it. +* Shows all cards in the deck at the specified `index`. The index refers to the index number shown in the displayed decks list. The index *must be a positive integer* 1, 2, 3, ... **** -Examples: +Example: -* `edit 1 p/91234567 e/johndoe@example.com` + -Edits the phone number and email address of the 1st person to be `91234567` and `johndoe@example.com` respectively. -* `edit 2 n/Betsy Crower t/` + -Edits the name of the 2nd person to be `Betsy Crower` and clears all existing tags. +* `show 2` + +Shows all cards in the 2nd deck. -=== Locating persons by name: `find` +=== Editing a card : `edit` -Finds persons whose names contain any of the given keywords. + -Format: `find KEYWORD [MORE_KEYWORDS]` +Edits an existing card in a deck. + +Format: `edit :` or `edit :` or `edit :` **** -* The search is case insensitive. e.g `hans` will match `Hans` -* The order of the keywords does not matter. e.g. `Hans Bo` will match `Bo Hans` -* Only the name is searched. -* Only full words will be matched e.g. `Han` will not match `Hans` -* Persons matching at least one keyword will be returned (i.e. `OR` search). e.g. `Hans Bo` will return `Hans Gruber`, `Bo Yang` +* Edits the card in a deck at the specified `index`. The index refers to the index number shown in the displayed cards list. The index *must be a positive integer* 1, 2, 3, ... +* Existing values will be updated to the input values. **** Examples: -* `find John` + -Returns `john` and `John Doe` -* `find Betsy Tim John` + -Returns any person having names `Betsy`, `Tim`, or `John` +* `edit 1 ありがとう:thanks` + +Edits the front and back values of the 1st card in the deck to be `ありがとう` and `thanks` respectively. +* `edit 1 :thanks` + +Edits the back value of the 1st card in the deck to be `thanks`. +* `edit 1 ありがとう:` + +Edits the front value of the 1st card in the deck to be `ありがとう`. -// tag::delete[] -=== Deleting a person : `delete` +=== Deleting a deck / card : `delete` -Deletes the specified person from the address book. + -Format: `delete INDEX` +Deletes the specified deck from the library when in List mode, or deletes the specified card from a deck when in Show mode. + +Format: `delete ` **** -* Deletes the person at the specified `INDEX`. -* The index refers to the index number shown in the displayed person list. +* Deletes the deck / card at the specified `index`. +* The index refers to the index number shown in the displayed deck / card list. * The index *must be a positive integer* 1, 2, 3, ... **** @@ -130,15 +136,14 @@ Examples: * `list` + `delete 2` + -Deletes the 2nd person in the address book. -* `find Betsy` + +Deletes the 2nd deck in the library. +* `show 2` + `delete 1` + -Deletes the 1st person in the results of the `find` command. +Deletes the 1st card in the 2nd deck. -// end::delete[] -=== Clearing all entries : `clear` +=== Clearing all decks / cards : `clear` -Clears all entries from the address book. + +Clears all decks when in List mode, or clears all cards in a deck when in Show mode. + Format: `clear` === Exiting the program : `exit` @@ -148,30 +153,31 @@ Format: `exit` === Saving the data -Address book data are saved in the hard disk automatically after any command that changes the data. + +All data in FlashSpeed (e.g. decks, cards) are saved in the hard disk automatically after any command that changes the data. + There is no need to save manually. -// tag::dataencryption[] -=== Encrypting data files `[coming in v2.0]` +=== Studying a deck `[coming in v2.0]` -_{explain how the user can enable/disable data encryption}_ -// end::dataencryption[] +_{explain how the user can study a deck in Play mode}_ == FAQ *Q*: How do I transfer my data to another Computer? + -*A*: Install the app in the other computer and overwrite the empty data file it creates with the file that contains the data of your previous Address Book folder. +*A*: Install the app in the other computer and overwrite the empty data file it creates with the file that contains the data of your previous FlashSpeed folder. == Command Summary -* *Add* `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]...` + -e.g. `add n/James Ho p/22224444 e/jamesho@example.com a/123, Clementi Rd, 1234665 t/friend t/colleague` -* *Clear* : `clear` -* *Delete* : `delete INDEX` + -e.g. `delete 3` -* *Edit* : `edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [t/TAG]...` + -e.g. `edit 2 n/James Lee e/jameslee@example.com` -* *Find* : `find KEYWORD [MORE_KEYWORDS]` + -e.g. `find James Jake` -* *List* : `list` * *Help* : `help` +* *List* : `list` +* *Create* : `create ` + +e.g. `create Japanese 1` +* *Add* `add :` + +e.g. `add 1 ありがとう:thanks` +* *Show* `show ` + +e.g. `show 2` +* *Edit* : `edit :` or `edit :` or `edit :` + +e.g. `edit 1 ありがとう:thanks` or `edit 1 :thanks` or `edit 1 ありがとう:` +* *Delete* : `delete ` + +e.g. `delete 3` +* *Clear* : `clear` +* *Exit* : `exit` \ No newline at end of file From e5a54b548caade02d316a719c72a4038f1719e3b Mon Sep 17 00:00:00 2001 From: amrl Date: Thu, 20 Feb 2020 01:02:50 +0800 Subject: [PATCH 006/411] Remove previous AB3 UI screenshot --- docs/UserGuide.adoc | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/UserGuide.adoc b/docs/UserGuide.adoc index ed6003324a0..a025ccfad75 100644 --- a/docs/UserGuide.adoc +++ b/docs/UserGuide.adoc @@ -31,9 +31,6 @@ We hope you enjoy using our app. Happy FlashSpeeding! . Download the latest `flashspeed.jar` link:{https://github.com/AY1920S2-CS2103T-W17-1/main/releases}/releases[here]. . Copy the file to the folder you want to use as the home folder for FlashSpeed. . Double-click the file to start the app. The GUI should appear in a few seconds. -+ -image::Ui.png[width="790"] -+ . Type the command in the command box and press kbd:[Enter] to execute it. + e.g. typing *`help`* and pressing kbd:[Enter] will open the help window. . Some example commands you can try: From 2a89865c50964bb22e92b439d5a9d95c5036b437 Mon Sep 17 00:00:00 2001 From: amrl Date: Thu, 20 Feb 2020 01:22:19 +0800 Subject: [PATCH 007/411] Add newline at EOF --- docs/UserGuide.adoc | 161 ++++++++++++++++++++++---------------------- 1 file changed, 82 insertions(+), 79 deletions(-) diff --git a/docs/UserGuide.adoc b/docs/UserGuide.adoc index 4e5d297a19f..40f4470030c 100644 --- a/docs/UserGuide.adoc +++ b/docs/UserGuide.adoc @@ -1,4 +1,4 @@ -= AddressBook Level 3 - User Guide += FlashSpeed - User Guide :site-section: UserGuide :toc: :toc-title: @@ -12,30 +12,32 @@ ifdef::env-github[] :tip-caption: :bulb: :note-caption: :information_source: endif::[] -:repoURL: https://github.com/se-edu/addressbook-level3 +:repoURL: https://github.com/AY1920S2-CS2103T-W17-1/main -By: `Team SE-EDU` Since: `Jun 2016` Licence: `MIT` +By: `AY1920S2-CS2103T-W17-1` Since: `Feb 2020` Licence: `MIT` == Introduction -AddressBook Level 3 (AB3) is for those who *prefer to use a desktop app for managing contacts*. More importantly, AB3 is *optimized for those who prefer to work with a Command Line Interface* (CLI) while still having the benefits of a Graphical User Interface (GUI). If you can type fast, AB3 can get your contact management tasks done faster than traditional GUI apps. Interested? Jump to the <> to get started. Enjoy! +FlashSpeed is a text-based flashcard application specifically designed for university students who are learning a foreign language. University students often have hectic schedules. With this in mind, FlashSpeed was created to allow students to be able to study and revise foreign vocabulary on the fly. With a single command, you can start a quick study session on FlashSpeed whenever! + +FlashSpeed enhances the revision process by adopting the Space Repetition System (SRS) in its design. Users will be tested more frequently on new words, or words that they have gotten wrong in previous sessions. This system benefits from the psychological spacing effect. SRS has been scientifically proven to increase the rate of learning and memorisation [1]. By using FlashSpeed, you will learn faster and remember for longer! + +We hope you enjoy using our app. Happy FlashSpeeding! + == Quick Start . Ensure you have Java `11` or above installed in your Computer. -. Download the latest `addressbook.jar` link:{repoURL}/releases[here]. -. Copy the file to the folder you want to use as the home folder for your Address Book. +. Download the latest `flashspeed.jar` link:{https://github.com/AY1920S2-CS2103T-W17-1/main/releases}/releases[here]. +. Copy the file to the folder you want to use as the home folder for FlashSpeed. . Double-click the file to start the app. The GUI should appear in a few seconds. -+ -image::Ui.png[width="790"] -+ . Type the command in the command box and press kbd:[Enter] to execute it. + e.g. typing *`help`* and pressing kbd:[Enter] will open the help window. . Some example commands you can try: -* *`list`* : lists all contacts -* **`add`**`n/John Doe p/98765432 e/johnd@example.com a/John street, block 123, #01-01` : adds a contact named `John Doe` to the Address Book. -* **`delete`**`3` : deletes the 3rd contact shown in the current list +* *`list`* : lists all decks +* **`create`**`Japanese 1` : creates a deck named `Japanese 1` in the FlashSpeed library. +* **`delete`**`3` : deletes the 3rd deck shown in the deck list * *`exit`* : exits the app . Refer to <> for details of each command. @@ -46,83 +48,84 @@ e.g. typing *`help`* and pressing kbd:[Enter] will open the help window. ==== *Command Format* -* Words in `UPPER_CASE` are the parameters to be supplied by the user e.g. in `add n/NAME`, `NAME` is a parameter which can be used as `add n/John Doe`. -* Items in square brackets are optional e.g `n/NAME [t/TAG]` can be used as `n/John Doe t/friend` or as `n/John Doe`. -* Items with `…`​ after them can be used multiple times including zero times e.g. `[t/TAG]...` can be used as `{nbsp}` (i.e. 0 times), `t/friend`, `t/friend t/family` etc. -* Parameters can be in any order e.g. if the command specifies `n/NAME p/PHONE_NUMBER`, `p/PHONE_NUMBER n/NAME` is also acceptable. +* Words in `<>` are the parameters to be supplied by the user. + +e.g. in `create `, `` is a parameter which can be used as `create Japanese 1`. ==== === Viewing help : `help` Format: `help` -=== Adding a person: `add` +=== Listing all decks : `list` -Adds a person to the address book + -Format: `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]...` +Shows a list of all decks in the library. + +Format: `list` + +=== Creating a deck : `create` -[TIP] -A person can have any number of tags (including 0) +Creates a new deck in the library. + +Format: `create ` Examples: -* `add n/John Doe p/98765432 e/johnd@example.com a/John street, block 123, #01-01` -* `add n/Betsy Crowe t/friend e/betsycrowe@example.com a/Newgate Prison p/1234567 t/criminal` +* `create Japanese 1` +* `create Japanese Verbs` -=== Listing all persons : `list` +=== Adding a card : `add` -Shows a list of all persons in the address book. + -Format: `list` +Adds a new card to a deck. + +Format: `add :` + +**** +* Adds a card to the deck at the specified `index`. The index refers to the index number shown in the displayed decks list. The index *must be a positive integer* 1, 2, 3, ... +**** + +Examples: -=== Editing a person : `edit` +* `add 1 ありがとう:thanks` +* `add 2 いい[お]てんきですね。:Nice weather, isn't it?` -Edits an existing person in the address book. + -Format: `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [t/TAG]...` +=== Showing all cards in a deck : `show` + +Shows all cards in a deck. + +Format: `show ` **** -* Edits the person at the specified `INDEX`. The index refers to the index number shown in the displayed person list. The index *must be a positive integer* 1, 2, 3, ... -* At least one of the optional fields must be provided. -* Existing values will be updated to the input values. -* When editing tags, the existing tags of the person will be removed i.e adding of tags is not cumulative. -* You can remove all the person's tags by typing `t/` without specifying any tags after it. +* Shows all cards in the deck at the specified `index`. The index refers to the index number shown in the displayed decks list. The index *must be a positive integer* 1, 2, 3, ... **** -Examples: +Example: -* `edit 1 p/91234567 e/johndoe@example.com` + -Edits the phone number and email address of the 1st person to be `91234567` and `johndoe@example.com` respectively. -* `edit 2 n/Betsy Crower t/` + -Edits the name of the 2nd person to be `Betsy Crower` and clears all existing tags. +* `show 2` + +Shows all cards in the 2nd deck. -=== Locating persons by name: `find` +=== Editing a card : `edit` -Finds persons whose names contain any of the given keywords. + -Format: `find KEYWORD [MORE_KEYWORDS]` +Edits an existing card in a deck. + +Format: `edit :` or `edit :` or `edit :` **** -* The search is case insensitive. e.g `hans` will match `Hans` -* The order of the keywords does not matter. e.g. `Hans Bo` will match `Bo Hans` -* Only the name is searched. -* Only full words will be matched e.g. `Han` will not match `Hans` -* Persons matching at least one keyword will be returned (i.e. `OR` search). e.g. `Hans Bo` will return `Hans Gruber`, `Bo Yang` +* Edits the card in a deck at the specified `index`. The index refers to the index number shown in the displayed cards list. The index *must be a positive integer* 1, 2, 3, ... +* Existing values will be updated to the input values. **** Examples: -* `find John` + -Returns `john` and `John Doe` -* `find Betsy Tim John` + -Returns any person having names `Betsy`, `Tim`, or `John` +* `edit 1 ありがとう:thanks` + +Edits the front and back values of the 1st card in the deck to be `ありがとう` and `thanks` respectively. +* `edit 1 :thanks` + +Edits the back value of the 1st card in the deck to be `thanks`. +* `edit 1 ありがとう:` + +Edits the front value of the 1st card in the deck to be `ありがとう`. -// tag::delete[] -=== Deleting a person : `delete` +=== Deleting a deck / card : `delete` -Deletes the specified person from the address book. + -Format: `delete INDEX` +Deletes the specified deck from the library when in List mode, or deletes the specified card from a deck when in Show mode. + +Format: `delete ` **** -* Deletes the person at the specified `INDEX`. -* The index refers to the index number shown in the displayed person list. +* Deletes the deck / card at the specified `index`. +* The index refers to the index number shown in the displayed deck / card list. * The index *must be a positive integer* 1, 2, 3, ... **** @@ -130,15 +133,14 @@ Examples: * `list` + `delete 2` + -Deletes the 2nd person in the address book. -* `find Betsy` + +Deletes the 2nd deck in the library. +* `show 2` + `delete 1` + -Deletes the 1st person in the results of the `find` command. +Deletes the 1st card in the 2nd deck. -// end::delete[] -=== Clearing all entries : `clear` +=== Clearing all decks / cards : `clear` -Clears all entries from the address book. + +Clears all decks when in List mode, or clears all cards in a deck when in Show mode. + Format: `clear` === Exiting the program : `exit` @@ -148,30 +150,31 @@ Format: `exit` === Saving the data -Address book data are saved in the hard disk automatically after any command that changes the data. + +All data in FlashSpeed (e.g. decks, cards) are saved in the hard disk automatically after any command that changes the data. + There is no need to save manually. -// tag::dataencryption[] -=== Encrypting data files `[coming in v2.0]` +=== Studying a deck `[coming in v2.0]` -_{explain how the user can enable/disable data encryption}_ -// end::dataencryption[] +_{explain how the user can study a deck in Play mode}_ == FAQ *Q*: How do I transfer my data to another Computer? + -*A*: Install the app in the other computer and overwrite the empty data file it creates with the file that contains the data of your previous Address Book folder. +*A*: Install the app in the other computer and overwrite the empty data file it creates with the file that contains the data of your previous FlashSpeed folder. == Command Summary -* *Add* `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]...` + -e.g. `add n/James Ho p/22224444 e/jamesho@example.com a/123, Clementi Rd, 1234665 t/friend t/colleague` -* *Clear* : `clear` -* *Delete* : `delete INDEX` + -e.g. `delete 3` -* *Edit* : `edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [t/TAG]...` + -e.g. `edit 2 n/James Lee e/jameslee@example.com` -* *Find* : `find KEYWORD [MORE_KEYWORDS]` + -e.g. `find James Jake` -* *List* : `list` * *Help* : `help` +* *List* : `list` +* *Create* : `create ` + +e.g. `create Japanese 1` +* *Add* `add :` + +e.g. `add 1 ありがとう:thanks` +* *Show* `show ` + +e.g. `show 2` +* *Edit* : `edit :` or `edit :` or `edit :` + +e.g. `edit 1 ありがとう:thanks` or `edit 1 :thanks` or `edit 1 ありがとう:` +* *Delete* : `delete ` + +e.g. `delete 3` +* *Clear* : `clear` +* *Exit* : `exit` From f87551522340ba5113669740142ac3703461155c Mon Sep 17 00:00:00 2001 From: Robert Pham Date: Sat, 22 Feb 2020 16:07:06 +0800 Subject: [PATCH 008/411] tutorial-removing-field --- .../address/logic/commands/EditCommand.java | 16 ++++------------ .../logic/parser/AddCommandParser.java | 2 +- .../logic/parser/EditCommandParser.java | 4 +--- .../seedu/address/model/person/Person.java | 15 +++++---------- .../address/model/util/SampleDataUtil.java | 11 +++++------ .../address/storage/JsonAdaptedPerson.java | 19 +++++++------------ .../java/seedu/address/ui/PersonCard.java | 1 - src/main/resources/view/PersonListCard.fxml | 2 +- 8 files changed, 24 insertions(+), 46 deletions(-) diff --git a/src/main/java/seedu/address/logic/commands/EditCommand.java b/src/main/java/seedu/address/logic/commands/EditCommand.java index 7e36114902f..5b0b495168e 100644 --- a/src/main/java/seedu/address/logic/commands/EditCommand.java +++ b/src/main/java/seedu/address/logic/commands/EditCommand.java @@ -96,10 +96,9 @@ private static Person createEditedPerson(Person personToEdit, EditPersonDescript Name updatedName = editPersonDescriptor.getName().orElse(personToEdit.getName()); Phone updatedPhone = editPersonDescriptor.getPhone().orElse(personToEdit.getPhone()); Email updatedEmail = editPersonDescriptor.getEmail().orElse(personToEdit.getEmail()); - Address updatedAddress = editPersonDescriptor.getAddress().orElse(personToEdit.getAddress()); Set updatedTags = editPersonDescriptor.getTags().orElse(personToEdit.getTags()); - return new Person(updatedName, updatedPhone, updatedEmail, updatedAddress, updatedTags); + return new Person(updatedName, updatedPhone, updatedEmail, updatedTags); } @Override @@ -128,7 +127,7 @@ public static class EditPersonDescriptor { private Name name; private Phone phone; private Email email; - private Address address; + //private Address address; private Set tags; public EditPersonDescriptor() {} @@ -141,7 +140,6 @@ public EditPersonDescriptor(EditPersonDescriptor toCopy) { setName(toCopy.name); setPhone(toCopy.phone); setEmail(toCopy.email); - setAddress(toCopy.address); setTags(toCopy.tags); } @@ -149,7 +147,7 @@ public EditPersonDescriptor(EditPersonDescriptor toCopy) { * Returns true if at least one field is edited. */ public boolean isAnyFieldEdited() { - return CollectionUtil.isAnyNonNull(name, phone, email, address, tags); + return CollectionUtil.isAnyNonNull(name, phone, email, tags); } public void setName(Name name) { @@ -176,13 +174,8 @@ public Optional getEmail() { return Optional.ofNullable(email); } - public void setAddress(Address address) { - this.address = address; - } - public Optional
getAddress() { - return Optional.ofNullable(address); - } + /** * Sets {@code tags} to this object's {@code tags}. @@ -219,7 +212,6 @@ public boolean equals(Object other) { return getName().equals(e.getName()) && getPhone().equals(e.getPhone()) && getEmail().equals(e.getEmail()) - && getAddress().equals(e.getAddress()) && getTags().equals(e.getTags()); } } diff --git a/src/main/java/seedu/address/logic/parser/AddCommandParser.java b/src/main/java/seedu/address/logic/parser/AddCommandParser.java index 3b8bfa035e8..1d21270b78e 100644 --- a/src/main/java/seedu/address/logic/parser/AddCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/AddCommandParser.java @@ -44,7 +44,7 @@ public AddCommand parse(String args) throws ParseException { Address address = ParserUtil.parseAddress(argMultimap.getValue(PREFIX_ADDRESS).get()); Set tagList = ParserUtil.parseTags(argMultimap.getAllValues(PREFIX_TAG)); - Person person = new Person(name, phone, email, address, tagList); + Person person = new Person(name, phone, email, tagList); return new AddCommand(person); } diff --git a/src/main/java/seedu/address/logic/parser/EditCommandParser.java b/src/main/java/seedu/address/logic/parser/EditCommandParser.java index 845644b7dea..3b107dc80b4 100644 --- a/src/main/java/seedu/address/logic/parser/EditCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/EditCommandParser.java @@ -52,9 +52,7 @@ public EditCommand parse(String args) throws ParseException { if (argMultimap.getValue(PREFIX_EMAIL).isPresent()) { editPersonDescriptor.setEmail(ParserUtil.parseEmail(argMultimap.getValue(PREFIX_EMAIL).get())); } - if (argMultimap.getValue(PREFIX_ADDRESS).isPresent()) { - editPersonDescriptor.setAddress(ParserUtil.parseAddress(argMultimap.getValue(PREFIX_ADDRESS).get())); - } + parseTagsForEdit(argMultimap.getAllValues(PREFIX_TAG)).ifPresent(editPersonDescriptor::setTags); if (!editPersonDescriptor.isAnyFieldEdited()) { diff --git a/src/main/java/seedu/address/model/person/Person.java b/src/main/java/seedu/address/model/person/Person.java index 557a7a60cd5..175a5910706 100644 --- a/src/main/java/seedu/address/model/person/Person.java +++ b/src/main/java/seedu/address/model/person/Person.java @@ -21,18 +21,17 @@ public class Person { private final Email email; // Data fields - private final Address address; + private final Set tags = new HashSet<>(); /** * Every field must be present and not null. */ - public Person(Name name, Phone phone, Email email, Address address, Set tags) { - requireAllNonNull(name, phone, email, address, tags); + public Person(Name name, Phone phone, Email email, Set tags) { + requireAllNonNull(name, phone, email, tags); this.name = name; this.phone = phone; this.email = email; - this.address = address; this.tags.addAll(tags); } @@ -48,9 +47,7 @@ public Email getEmail() { return email; } - public Address getAddress() { - return address; - } + /** * Returns an immutable tag set, which throws {@code UnsupportedOperationException} @@ -92,14 +89,13 @@ public boolean equals(Object other) { return otherPerson.getName().equals(getName()) && otherPerson.getPhone().equals(getPhone()) && otherPerson.getEmail().equals(getEmail()) - && otherPerson.getAddress().equals(getAddress()) && otherPerson.getTags().equals(getTags()); } @Override public int hashCode() { // use this method for custom fields hashing instead of implementing your own - return Objects.hash(name, phone, email, address, tags); + return Objects.hash(name, phone, email, tags); } @Override @@ -111,7 +107,6 @@ public String toString() { .append(" Email: ") .append(getEmail()) .append(" Address: ") - .append(getAddress()) .append(" Tags: "); getTags().forEach(builder::append); return builder.toString(); diff --git a/src/main/java/seedu/address/model/util/SampleDataUtil.java b/src/main/java/seedu/address/model/util/SampleDataUtil.java index 1806da4facf..0f1602c4397 100644 --- a/src/main/java/seedu/address/model/util/SampleDataUtil.java +++ b/src/main/java/seedu/address/model/util/SampleDataUtil.java @@ -20,22 +20,21 @@ public class SampleDataUtil { public static Person[] getSamplePersons() { return new Person[] { new Person(new Name("Alex Yeoh"), new Phone("87438807"), new Email("alexyeoh@example.com"), - new Address("Blk 30 Geylang Street 29, #06-40"), getTagSet("friends")), new Person(new Name("Bernice Yu"), new Phone("99272758"), new Email("berniceyu@example.com"), - new Address("Blk 30 Lorong 3 Serangoon Gardens, #07-18"), + getTagSet("colleagues", "friends")), new Person(new Name("Charlotte Oliveiro"), new Phone("93210283"), new Email("charlotte@example.com"), - new Address("Blk 11 Ang Mo Kio Street 74, #11-04"), + getTagSet("neighbours")), new Person(new Name("David Li"), new Phone("91031282"), new Email("lidavid@example.com"), - new Address("Blk 436 Serangoon Gardens Street 26, #16-43"), + getTagSet("family")), new Person(new Name("Irfan Ibrahim"), new Phone("92492021"), new Email("irfan@example.com"), - new Address("Blk 47 Tampines Street 20, #17-35"), + getTagSet("classmates")), new Person(new Name("Roy Balakrishnan"), new Phone("92624417"), new Email("royb@example.com"), - new Address("Blk 45 Aljunied Street 85, #11-31"), + getTagSet("colleagues")) }; } diff --git a/src/main/java/seedu/address/storage/JsonAdaptedPerson.java b/src/main/java/seedu/address/storage/JsonAdaptedPerson.java index a6321cec2ea..d25acd30887 100644 --- a/src/main/java/seedu/address/storage/JsonAdaptedPerson.java +++ b/src/main/java/seedu/address/storage/JsonAdaptedPerson.java @@ -27,7 +27,7 @@ class JsonAdaptedPerson { private final String name; private final String phone; private final String email; - private final String address; + private final List tagged = new ArrayList<>(); /** @@ -35,12 +35,12 @@ class JsonAdaptedPerson { */ @JsonCreator public JsonAdaptedPerson(@JsonProperty("name") String name, @JsonProperty("phone") String phone, - @JsonProperty("email") String email, @JsonProperty("address") String address, + @JsonProperty("email") String email, @JsonProperty("tagged") List tagged) { this.name = name; this.phone = phone; this.email = email; - this.address = address; + if (tagged != null) { this.tagged.addAll(tagged); } @@ -53,12 +53,13 @@ public JsonAdaptedPerson(Person source) { name = source.getName().fullName; phone = source.getPhone().value; email = source.getEmail().value; - address = source.getAddress().value; + tagged.addAll(source.getTags().stream() .map(JsonAdaptedTag::new) .collect(Collectors.toList())); } + /** * Converts this Jackson-friendly adapted person object into the model's {@code Person} object. * @@ -94,16 +95,10 @@ public Person toModelType() throws IllegalValueException { } final Email modelEmail = new Email(email); - if (address == null) { - throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, Address.class.getSimpleName())); - } - if (!Address.isValidAddress(address)) { - throw new IllegalValueException(Address.MESSAGE_CONSTRAINTS); - } - final Address modelAddress = new Address(address); + final Set modelTags = new HashSet<>(personTags); - return new Person(modelName, modelPhone, modelEmail, modelAddress, modelTags); + return new Person(modelName, modelPhone, modelEmail, modelTags); } } diff --git a/src/main/java/seedu/address/ui/PersonCard.java b/src/main/java/seedu/address/ui/PersonCard.java index 0684b088868..85142fe6048 100644 --- a/src/main/java/seedu/address/ui/PersonCard.java +++ b/src/main/java/seedu/address/ui/PersonCard.java @@ -47,7 +47,6 @@ public PersonCard(Person person, int displayedIndex) { id.setText(displayedIndex + ". "); name.setText(person.getName().fullName); phone.setText(person.getPhone().value); - address.setText(person.getAddress().value); email.setText(person.getEmail().value); person.getTags().stream() .sorted(Comparator.comparing(tag -> tag.tagName)) diff --git a/src/main/resources/view/PersonListCard.fxml b/src/main/resources/view/PersonListCard.fxml index f08ea32ad55..07bac5ac2db 100644 --- a/src/main/resources/view/PersonListCard.fxml +++ b/src/main/resources/view/PersonListCard.fxml @@ -29,7 +29,7 @@