Skip to content

Commit

Permalink
Merge pull request #249 from TanZhanMing/master
Browse files Browse the repository at this point in the history
Fixed help bug, commented out shortcut in helpWindow for now.
  • Loading branch information
TanZhanMing authored Oct 31, 2019
2 parents 37226c2 + 70166ba commit 53b83fb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class BudgetPlotter {

XYSeries plotBudget() {
double currentBudget;
for (int day = 1; day <= 31; day++) {
for (int day = 1; day <= 30; day++) {
currentBudget = incomeSeries.getDataItem(day - 1).getYValue()
- claimSeries.getDataItem(day - 1).getYValue();
budgetSeries.add(day, currentBudget);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/budget/ClaimPlotter.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ XYSeries plotClaims() {
claimSeries.add(1, startingExpenses);
double currentExpenses = startingExpenses;
List<Claim> approvedClaimsInCurrentMonthList = findApprovedClaimsInCurrentMonth();
for (int day = 2; day <= 31; day++) {
for (int day = 2; day <= 30; day++) {
for (Claim claim : approvedClaimsInCurrentMonthList) {
if (claim.getDate().date.getDayOfMonth() == day) {
currentExpenses += Double.parseDouble(claim.getAmount().value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ XYSeries plotIncomes() {
incomeSeries.add(1, startingIncome);
double currentIncome = startingIncome;
List<Income> approvedIncomesInCurrentMonthList = findIncomesInCurrentMonth();
for (int day = 2; day <= 31; day++) {
for (int day = 2; day <= 30; day++) {
for (Income income : approvedIncomesInCurrentMonthList) {
if (income.getDate().date.getDayOfMonth() == day) {
currentIncome += Double.parseDouble(income.getAmount().value);
Expand Down
18 changes: 16 additions & 2 deletions src/main/java/seedu/address/ui/HelpWindow.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package seedu.address.ui;

import java.io.IOException;
import java.util.TreeSet;
import java.util.logging.Logger;

import javafx.fxml.FXML;
Expand All @@ -18,9 +19,17 @@ public class HelpWindow extends UiPart<Stage> {

public static final String USERGUIDE_URL = "https://ay1920s1-cs2103t-w12-1.github.io/main/UserGuide.html";
public static final String HELP_MESSAGE = "The 'help' command format is as follows: "
+ "help cmd/COMMAND type/TYPE\n\nCommand List: \n"
+ FinSecParser.getCommandList().keySet().toString().replace(", ", "]\n[")
+ "help cmd/COMMAND type/TYPE"
+ "\n\n"
+ "Command List: \n"
+ getDefaultCommandList().toString().replace(", ", "]\n[")
+ "\n\n"
//+ "Shortcut List:\n"
//+ FinSecParser.getShortcutList().toString()
// .replace(", ", "]\n[")
// .replace(" Word", "Shortcut")
// .replace("Task", " Command")
//+ "\n\n"
+ "Type List:\n"
+ "[brief] (gives a brief description)\n"
+ "[guide] (opens up our user guide on your browser) \n"
Expand All @@ -30,6 +39,7 @@ public class HelpWindow extends UiPart<Stage> {

private static final Logger logger = LogsCenter.getLogger(HelpWindow.class);
private static final String FXML = "HelpWindow.fxml";
private static TreeSet<String> defaultCommandList = new TreeSet<>(FinSecParser.getCommandList().values());

@FXML
private Button gotoButton;
Expand Down Expand Up @@ -99,6 +109,10 @@ public void focus() {
getRoot().requestFocus();
}

public static TreeSet<String> getDefaultCommandList() {
return defaultCommandList;
}

/**
* Copies the URL to the user guide to the clipboard.
*/
Expand Down

0 comments on commit 53b83fb

Please sign in to comment.