Skip to content

Commit

Permalink
Merge pull request #106 from JasonYapzx/feat-help
Browse files Browse the repository at this point in the history
Add help table
  • Loading branch information
ruihan00 authored Oct 27, 2022
2 parents c89ddcd + 73df69c commit 0a245bf
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 15 deletions.
18 changes: 8 additions & 10 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ clean Graphical User Interface (GUI) for easy comprehension of expenditure and s
![UserInterfaceExplaination](images/UserInterfaceExplaination.png)

- For **ALL** entries, categories are <ins>COMPULSORY</ins> and every entry can only contain <ins>one</ins> category.
The following table shows the`Expenditure` and `Income` entries categories. The category names are <ins>case sensitive</ins>.

The following table shows the`Expenditure` and `Income` entries categories. The category names are <ins>case insensitive</ins>.
| `Expenditure` | `Income` |
|:-----------------:|:---------------:|
| **Food** | **Salary** |
Expand Down Expand Up @@ -196,18 +196,16 @@ The default date is the current date on your computer!
1. Summary of all entries in the currently shown list
* Examples: `summary`
* Expected: <br/>
Financials Summarized <br/>
Total Expenditure: 154.49 <br/>
Total Income: 250.00 <br/>
Total Balance: 95.51 <br/>
Total Expenditure: $154.49 <br/>
Total Income: $250.00 <br/>
Total Balance: $95.51 <br/>
![SummaryCommand1](images/SummaryCommand1.png)
2. Summary of all entries the specified month
* Examples: `summary mo/2022-10`
* Expected: <br/>
Financials Summarized <br/>
Total Expenditure: 4.20 <br/>
Total Income: 250.00 <br/>
Total Balance: 245.80 <br/>
Total Expenditure: $4.20 <br/>
Total Income: $250.00 <br/>
Total Balance: $245.80 <br/>
![SummaryCommand2](images/SummaryCommand2.png)
* Provides a financial summary recorded by the user in a month. The month refers to the month that is displayed to the user.
* The `MONTH` field is optional, if no month is specified, the application displays the summary for all entries.
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/RemovingFields.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private Label address;
...
<Label fx:id="phone" styleClass="cell_small_label" text="\$phone" />
<Label fx:id="address" styleClass="cell_small_label" text="\$address" />
<Label fx:id="email" styleClass="cell_small_label" text="\$email" />
<Label fx:id="email" styleClass="cell_small_label" text="\email" />
...
```

Expand Down
49 changes: 49 additions & 0 deletions src/main/java/seedu/pennywise/ui/HelpWindowCell.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package seedu.pennywise.ui;

import javafx.scene.text.Text;

/**
* Table cell for help window.
*/
public class HelpWindowCell {
private final Text action = new Text();
private final Text format = new Text();
private final Text example = new Text();

public HelpWindowCell() {
this("", "", "");
}

/**
* Constructor for HelpWindowCell
*/
public HelpWindowCell(String action, String format, String example) {
setAction(action);
setFormat(format);
setExample(example);
}

public String getAction() {
return action.getText();
}

public void setAction(String fName) {
action.setText(fName);
}

public String getFormat() {
return format.getText();
}

public void setFormat(String fName) {
format.setText(fName);
}

public String getExample() {
return example.getText();
}

public void setExample(String fName) {
example.setText(fName);
}
}
7 changes: 7 additions & 0 deletions src/main/resources/view/HelpWindow.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,10 @@
-fx-padding: 8px;
-fx-background-color: -pw-surface;
}

#table {
-fx-border-color: -pw-secondary;
-fx-font-size: 12px;
-fx-font-family: "Poppins Regular";
}

54 changes: 50 additions & 4 deletions src/main/resources/view/HelpWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
<?import javafx.scene.layout.HBox?>
<?import javafx.stage.Stage?>

<?import javafx.scene.layout.VBox?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.cell.PropertyValueFactory?>
<?import javafx.collections.FXCollections?>
<?import seedu.pennywise.ui.HelpWindowCell?>
<fx:root resizable="false" title="Help" type="javafx.stage.Stage" xmlns="http://javafx.com/javafx/11" xmlns:fx="http://javafx.com/fxml/1">
<icons>
<Image url="@/images/help_icon.png" />
Expand All @@ -20,8 +26,48 @@
<URL value="@HelpWindow.css" />
</stylesheets>

<HBox alignment="CENTER" fx:id="helpMessageContainer">
<children>
<VBox alignment="CENTER" fx:id="helpMessageContainer">
<VBox>
<children>
<TableView fx:id="table" fixedCellSize="50.00">
<columns>
<TableColumn text="Action" prefWidth="130" style="-fx-wrap-text: true;">
<cellValueFactory><PropertyValueFactory property="action" />
</cellValueFactory>
</TableColumn>
<TableColumn text="Format" prefWidth="400" style="-fx-wrap-text: true;">
<cellValueFactory><PropertyValueFactory property="format" />
</cellValueFactory>
</TableColumn>
<TableColumn text="Example" prefWidth="260" style="-fx-wrap-text: true;">
<cellValueFactory><PropertyValueFactory property="example" />
</cellValueFactory>
</TableColumn>
</columns>
<items>
<FXCollections fx:factory="observableArrayList">
<HelpWindowCell action="Add" format="add t/ENTRY_TYPE d/DESCRIPTION a/AMOUNT da/DATE c/CATEGORY"
example="add t/e d/Lunch a/15.60 da/10-10-2022 c/Food"/>
<HelpWindowCell action="Delete" format="del INDEX_OF_ENTRY t/ENTRY_TYPE"
example="del 2 t/e"/>
<HelpWindowCell action="Edit" format="edit INDEX_OF_ENTRY t/ENTRY_TYPE [d/EDITED_DESCRIPTION a/EDITED_AMOUNT da/EDITED_DATE c/EDITED_CATEGORY]"
example="edit 2 t/i a/150.00 da/22-10-2022"/>
<HelpWindowCell action="Summary" format="summary [mo/MONTH]"
example="summary mo/2022-09"/>
<HelpWindowCell action="View (Category)" format="view t/ENTRY_TYPE"
example="view t/e"/>
<HelpWindowCell action="View (Month)" format="view t/ENTRY_TYPE [mo/MONTH]"
example="view t/e mo/2022-10"/>
<HelpWindowCell action="Clear" format="clear"
example="-"/>
<HelpWindowCell action="Exit" format="exit"
example="-"/>
</FXCollections>
</items>
</TableView>
</children>
</VBox>
<HBox>
<Label fx:id="helpMessage" text="Label">
<HBox.margin>
<Insets right="5.0" />
Expand All @@ -32,14 +78,14 @@
<Insets left="5.0" />
</HBox.margin>
</Button>
</children>
</HBox>
<opaqueInsets>
<Insets bottom="10.0" left="5.0" right="10.0" top="5.0" />
</opaqueInsets>
<padding>
<Insets bottom="10.0" left="5.0" right="10.0" top="5.0" />
</padding>
</HBox>
</VBox>
</Scene>
</scene>
</fx:root>

0 comments on commit 0a245bf

Please sign in to comment.