Skip to content

Commit

Permalink
Merge branch 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
JJtan2002 committed Nov 7, 2024
2 parents 4d1c9da + 48cdab3 commit 1274c83
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 52 deletions.
56 changes: 30 additions & 26 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,25 +87,25 @@ Underneath each suggested command is the syntax for that command and what parame

## Command summary

| Action | Format, Examples |
|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Help** | `help` |
| **List** | `list` |
| **Add** | `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [g/GAME]… [t/TAG]… [pt/TIME]…​` <br> e.g., `add n/James Ho p/22224444 e/[email protected] a/123, Clementi Rd, 1234665 g/Overwatch t/friend t/colleague pt/2130-2359` |
| **Edit** | `edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [g/Game]… [t/TAG]… [pt/TIME]…​`<br> e.g.,`edit 2 n/James Lee e/[email protected]` |
| **AddGame** | `addgame INDEX g/GAME [u/USERNAME] [s/SKILLLEVEL] [r/ROLE]​`<br> e.g.,`addgame 1 g/Overwatch u/Potato` |
| **EditGame** | `editgame INDEX g/GAME [u/USERNAME] [s/SKILLLEVEL] [r/ROLE]​`<br> e.g.,`editgame 1 g/Overwatch u/Potato` |
| **DeleteGame** | `deletegame INDEX g/GAME`<br> e.g.,`deletegame 1 g/Overwatch` |
| **FavGame** | `favgame INDEX g/GAME`<br> e.g.,`favgame 2 g/Overwatch` |
| **UnFavGame** | `unfavgame INDEX g/GAME`<br> e.g.,`unfavgame 2 g/Overwatch` |
| **Find** | `find KEYWORD [MORE_KEYWORDS]`<br> e.g., `find James Jake` |
| **FindTime** | `find TIME-TIME [TIME-TIME]`<br> e.g., `findtime 1800-1900 2000-2200 ` |
| **Delete** | `delete INDEX`<br> e.g., `delete 3` |
| **Clear** | `clear` |
| **Undo** | `undo` |
| **Save** | `save` |
| **Load** | `load` |
| **Exit** | `exit` |
| Action | Format, Examples |
|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Help** | `help` |
| **List** | `list` |
| **Add** | `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [g/GAME]… [t/TAG]… [pt/TIME-TIME]…​` <br> e.g., `add n/James Ho p/22224444 e/[email protected] a/123, Clementi Rd, 1234665 g/Overwatch t/friend t/colleague pt/2130-2359` |
| **Edit** | `edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [g/Game]… [t/TAG]… [pt/TIME-TIME]…​`<br> e.g.,`edit 2 n/James Lee e/[email protected]` |
| **AddGame** | `addgame INDEX g/GAME [u/USERNAME] [s/SKILLLEVEL] [r/ROLE]​`<br> e.g.,`addgame 1 g/Overwatch u/Potato` |
| **EditGame** | `editgame INDEX g/GAME [u/USERNAME] [s/SKILLLEVEL] [r/ROLE]​`<br> e.g.,`editgame 1 g/Overwatch u/Potato` |
| **DeleteGame** | `deletegame INDEX g/GAME`<br> e.g.,`deletegame 1 g/Overwatch` |
| **FavGame** | `favgame INDEX g/GAME`<br> e.g.,`favgame 2 g/Overwatch` |
| **UnFavGame** | `unfavgame INDEX g/GAME`<br> e.g.,`unfavgame 2 g/Overwatch` |
| **Find** | `find KEYWORD [MORE_KEYWORDS]`<br> e.g., `find James Jake` |
| **FindTime** | `find TIME-TIME [TIME-TIME]`<br> e.g., `findtime 1800-1900 2000-2200 ` |
| **Delete** | `delete INDEX`<br> e.g., `delete 3` |
| **Clear** | `clear` |
| **Undo** | `undo` |
| **Save** | `save` |
| **Load** | `load` |
| **Exit** | `exit` |

--------------------------------------------------------------------------------------------------------------------
## Commands
Expand All @@ -130,17 +130,17 @@ Format: `list`

Adds a person to the address book.

Format: `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [g/GAME]... [t/TAG]... [pt/PREFERRED TIME]…​`
Format: `add n/NAME [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [g/GAME]... [t/TAG]... [pt/TIME-TIME]…​`

<box type="tip" seamless>

**Tip:** A person can have any number of tags, games and preferred times (including 0)
**Tip:** PREFERRED TIME should be in the form of "Day HHmm" with exactly 1 space in between
**Tip:** Preferred time `pt/` TIME-TIME should be in the form of "HHmm-HHmm" and a valid time range that is not overnight
</box>

Examples:
* `add n/John Doe p/98765432 e/[email protected] a/John street, block 123, #01-01`
* `add n/Betsy Crowe t/friend e/[email protected] a/Newgate Prison p/1234567 t/criminal pt/Monday 2100`
* `add n/Betsy Crowe t/friend e/[email protected] a/Newgate Prison p/1234567 t/criminal pt/2100-2300`



Expand Down Expand Up @@ -248,15 +248,19 @@ Examples:

Finds persons whose preferred time ranges overlap with any of given time range.

Format: `findtime RANGE [MORE_RANGE]`
Format: `findtime TIME-TIME...`

<box type="tip" seamless>

**Tip:** RANGE should be in the form of "HHmm-HHmm" with no extra space
and `HHmm` should be valid 0000-2359 4-digit number, while the first time should be before the second time
**Tips:** TIME-TIME should be in the form of "HHmm-HHmm" with no extra space
and `HHmm` should be a valid 4-digit number within 0000-2359, while the first time should be before the second time.

You can enter more than one time range to search for.

You can enter the same time twice e.g. `2300-2300` to only search that time.
</box>

* The search is border-insensitive. e.g. `1200-1300` will not match `1300-1400`
* The search is border-sensitive. e.g. `1200-1300` will match `1300-1400`
* The order of ranges does not matter.
* Persons matching at least one range will be returned(i.e. `OR` search).

Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@

* Libraries used: [JavaFX](https://openjfx.io/), [Jackson](https://github.com/FasterXML/jackson), [JUnit5](https://github.com/junit-team/junit5)
* This project is based on the AddressBook-Level3 project created by the [SE-EDU initiative](https://se-education.org/).
* Image credit - star png for favourite icon: https://www.pngegg.com/en/png-wzqts
6 changes: 3 additions & 3 deletions src/main/java/seedu/address/logic/commands/AddCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public class AddCommand extends Command {
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a person to the address book. "
+ "Parameters: "
+ PREFIX_NAME + "NAME "
+ PREFIX_PHONE + "PHONE "
+ PREFIX_EMAIL + "EMAIL "
+ PREFIX_ADDRESS + "ADDRESS "
+ "[" + PREFIX_PHONE + "PHONE] "
+ "[" + PREFIX_EMAIL + "EMAIL] "
+ "[" + PREFIX_ADDRESS + "ADDRESS] "
+ "[" + PREFIX_GAME + "GAME]... "
+ "[" + PREFIX_TAG + "TAG]... "
+ "[" + PREFIX_PREFERREDTIME + "PREFERRED TIME]...\n"
Expand Down
19 changes: 10 additions & 9 deletions src/main/java/seedu/address/ui/HelpWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,16 @@ protected void updateItem(String item, boolean empty) {
new HelpCommand("Add", "`add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS "
+ "[g/GAME]… [t/TAG]… [pt/TIME-TIME]…`"),
new HelpCommand("Edit", "`edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] "
+ "[a/ADDRESS] [g/GAME]… [t/TAG]… [pt/TIME-TIME]…`"),
new HelpCommand("AddGame", "`addgame INDEX g/GAME [u/USERNAME] [s/SKILLLEVEL] [r/ROLE]`"),
new HelpCommand("EditGame", "`editgame INDEX g/GAME [u/USERNAME] [s/SKILLLEVEL] [r/ROLE]`"),
new HelpCommand("DeleteGame", "`deletegame INDEX g/GAME`"),
new HelpCommand("FavGame", "`favgame INDEX g/GAME`"),
new HelpCommand("UnFavGame", "`unfavgame INDEX g/GAME`"),
new HelpCommand("Find", "`find KEYWORD [MORE_KEYWORDS]`"),
new HelpCommand("FindTime", "`findtime TIME-TIME [TIME-TIME]`"),
new HelpCommand("Delete", "`delete INDEX`"),
+ "[a/ADDRESS] [g/GAME]… [t/TAG]… [pt/TIME-TIME]…`\n"),
new HelpCommand("AddGame", "`addgame INDEX g/GAME [u/USERNAME] [s/SKILLLEVEL] [r/ROLE]`\n"),
new HelpCommand("EditGame", "`editgame INDEX g/GAME [u/USERNAME] [s/SKILLLEVEL] [r/ROLE]`\n"),
new HelpCommand("DeleteGame", "`deletegame INDEX g/GAME`\n"),
new HelpCommand("FavGame", "`favgame INDEX g/GAME`\n"),
new HelpCommand("UnFavGame", "`unfavgame INDEX g/GAME`\n"),
new HelpCommand("Find", "`find KEYWORD [MORE_KEYWORDS]`\n"),
new HelpCommand("FindTime", "`findtime TIME-TIME [TIME-TIME]`\n"),
new HelpCommand("FindGame", "`findgame KEYWORD [MORE_KEYWORDS]'\n"),
new HelpCommand("Delete", "`delete INDEX`\n"),
new HelpCommand("Clear", "`clear`"),
new HelpCommand("Undo", "`undo`"),
new HelpCommand("Save", "`save`"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@ private String getDetailForCommand(String command) {
return switch (command.toLowerCase()) {
case "help" -> "help - Shows program help instructions and command summary";
case "list" -> "list - Shows a list of all persons in the gamer address book";
case "add" -> "add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [g/GAME]... [t/TAG]... [pt/PREFERRED_TIME]...";
case "add" -> "add n/NAME [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [g/GAME]... [t/TAG]... [pt/TIME-TIME]...";
case "edit" -> "edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [g/GAME]... "
+ "[t/TAG]... [pt/PREFERRED_TIME]...";
+ "[t/TAG]... [pt/TIME-TIME]...";
case "addgame" -> "addgame INDEX g/GAME [u/USERNAME] [s/SKILLLEVEL] [r/ROLE]";
case "editgame" -> "editgame INDEX g/GAME [u/USERNAME] [s/SKILL_LEVEL] [r/ROLE]";
case "deletegame" -> "deletegame INDEX g/GAME";
case "favgame" -> "favgame INDEX g/GAME";
case "unfavgame" -> "unfavgame INDEX g/GAME";
case "find" -> "find KEYWORD [MORE_KEYWORDS] - Finds persons whose names contain any of the keywords";
case "findgame" -> "find KEYWORD [MORE_KEYWORDS] - Finds persons whose games contain any of the keywords";
case "findtime" -> "find HHmm-HHmm [HHmm-HHmm]";
case "findtime" -> "find TIME-TIME [TIME-TIME] - Finds persons whose preferred time contains any TIMES";
case "findgame" -> "findgame KEYWORD [MORE_KEYWORDS] - Finds persons whose games contain any of the keywords";
case "delete" -> "delete INDEX - Deletes the specified person (e.g., delete 3)";
case "clear" -> "clear - Clears all entries from the gamer address book";
case "undo" -> "undo - Undoes the previous command (aside from save and load)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public static SortedSet<String> commands() {
commandSet.add("find");
commandSet.add("findgame");
commandSet.add("findtime");
commandSet.add("findgame");
commandSet.add("delete");
commandSet.add("clear");
commandSet.add("undo");
Expand Down
Binary file removed src/main/resources/images/address_book_32old.png
Binary file not shown.
3 changes: 2 additions & 1 deletion src/main/resources/view/HelpWindow.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@
}

.table-view .table-row-cell {
-fx-font-weight: bold;
-fx-border-color: black;
-fx-border-width: 0 1 1 0; /* Only bottom border */
-fx-border-width: 0 0 1 0; /* Only bottom border */
-fx-pref-height: 30;
}

Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/view/HelpWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<?import javafx.scene.layout.VBox?>
<?import javafx.stage.Stage?>

<fx:root resizable="false" title="Help" type="javafx.stage.Stage" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
<fx:root minWidth="900" minHeight="700" resizable="true" title="Help" type="javafx.stage.Stage" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
<icons>
<Image url="@/images/help_icon.png" />
</icons>
Expand All @@ -20,8 +20,8 @@
<stylesheets>
<URL value="@HelpWindow.css" />
</stylesheets>
<VBox prefWidth="900.0" prefHeight="610">
<HBox alignment="TOP_RIGHT" fx:id="helpMessageContainer">
<VBox prefWidth="900.0" minHeight="650">
<HBox alignment="CENTER" fx:id="helpMessageContainer">
<children>
<Label fx:id="helpMessage" text="Label">
<HBox.margin>
Expand All @@ -41,7 +41,7 @@
<Insets bottom="0" left="5.0" right="10.0" top="5.0" />
</padding>
</HBox>
<TableView fx:id="helpTable" prefHeight="559"></TableView>
<TableView fx:id="helpTable" prefHeight="559" VBox.vgrow="ALWAYS"></TableView>
<VBox.margin>
<Insets top="10.0" right="10.0" bottom="10.0" left="10.0" />
</VBox.margin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public void setUp() {
public void testCommandTextFlowConstruction() {
assertNotNull(commandTextFlow);
assertEquals("add", commandTextFlow.getCommandText());
assertEquals("add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [g/GAME]... [t/TAG]... "
+ "[pt/PREFERRED_TIME]...", commandTextFlow.getDetailText());
assertEquals("add n/NAME [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [g/GAME]... [t/TAG]..."
+ " [pt/TIME-TIME]...", commandTextFlow.getDetailText());
}

@Test
Expand All @@ -52,8 +52,8 @@ public void testHighlightedCommandText() {
public void testDetailText() {
// Check that the detail text is correctly set
Text detailText = (Text) commandTextFlow.getChildren().get(2);
assertEquals("add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [g/GAME]... [t/TAG]... "
+ "[pt/PREFERRED_TIME]...", detailText.getText());
assertEquals("add n/NAME [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [g/GAME]... [t/TAG]..."
+ " [pt/TIME-TIME]...", detailText.getText());
}

@Test
Expand Down Expand Up @@ -93,7 +93,7 @@ public void testEditCommand() {
CommandTextFlow editCommandTextFlow = new CommandTextFlow("edit", "edit");
assertEquals("edit", editCommandTextFlow.getCommandText());
assertEquals("edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [g/GAME]... "
+ "[t/TAG]... [pt/PREFERRED_TIME]...", editCommandTextFlow.getDetailText());
+ "[t/TAG]... [pt/TIME-TIME]...", editCommandTextFlow.getDetailText());

// Check highlight for the "edit" command
Text highlightedText = (Text) editCommandTextFlow.getChildren().get(0);
Expand Down

0 comments on commit 1274c83

Please sign in to comment.