From 1697e91003ac02da68601aed6412f3d7539a73d1 Mon Sep 17 00:00:00 2001 From: cheeyou Date: Mon, 30 Sep 2019 17:56:12 +0800 Subject: [PATCH] Release --- README.md | 86 -------------------------- build.gradle | 28 ++++++--- data/tasks.txt | 12 ++++ docs/README.md | 89 +++++++++++++++++++++++---- src/main/java/duke/Duke.java | 1 + src/main/java/duke/logic/Parser.java | 2 - src/main/java/duke/logic/Storage.java | 13 +++- src/test/java/duke/task/TaskTest.java | 14 +++-- 8 files changed, 131 insertions(+), 114 deletions(-) diff --git a/README.md b/README.md index 0286ad05a0..e6a310fab0 100644 --- a/README.md +++ b/README.md @@ -38,89 +38,3 @@ Duke Increment | Tutorial * If you have feedback or bug reports, please post in [se-edu/duke issue tracker](https://github.com/se-edu/duke/issues). * We welcome pull requests too. -# **DUKE**- User Guide - -## Table of Content -1. Introduction -1. Getting Started -1. Features -1. FAQ - -## 1. Introduction: -**DUKE** is a desktop application that allows an individual to **organise his/her daily tasks and expenses** efficiently. While it consists of a Graphical User Interface (GUI) that makes interaction with the user friendly and understandable, **DUKE** is **optimised** for users who prefer to work with a Command Line Interface (CLI) which allows for fast typing and interpretation of the user-given commands. - -## 2. Getting Started: -1. Ensure that you have Java 11 or above on your computer -1. Download the latest release of duke.jar here -1. Copy and paste the file to the folder you would like to use as the home folder for your DUKE app -1. Double click the file to start the app. The GUI should appear within a few seconds -1. Type your command in the command box and press “Enter” on your keyboard or “Send” on the GUI to execute it - e.g. Typing **Glossary** and pressing **Enter** will refer you to a list of all helpful commands -1. Refer to Section 3 **Features** for a list of all useful commands - -## 3. Features: -### Command Format: -* The **first** word that you type into the command prompt will be the command -* Each command has its respective input format. Refer to our glossary for more details -* Ensure that the command format is correct before pressing **Enter** or clicking **Send**. This line of command will then prompt **DUKE** to respond accordingly -* Commands are **not** case-sensitive - -### Commands: -1. View all commands: 'glossary' - * Format: glossary - * Allows you to view a list of all useful commands -1. Add a task: - * 'todo' - * Format: [task details] - * Adds a todo-type task for you - * 'deadline' - * Format: [task details] /by [dd/mm/yyyy] [24hr time format] - * Adds a deadline-type task for you - * 'event' - * Format: [task details] /at [dd/mm/yyyy] [start time(24hr time format)]-[end time(24hr time format)] - * Adds an event-type task for you -1. Delete a task: 'delete' - * Format: delete [n] - * Deletes the nth task in the list -1. Mark a task as done: 'done' - * Format: done [n] - * Marks the nth task in the list as done -1. View all tasks: 'list' - * Format: list - * Lists all available tasks and their done status -1. Find a task: 'find' - * Format: Find [keyword/phrase] - * Lists all available tasks that contains the given keyword or phrase -1. Add an expense: 'spending' - * Format: spending [category] [amount] [description] - * Below is the list of all available categories: - 1. Food - 1. Transport - 1. Education - 1. Household - 1. Apparel - 1. Beauty - 1. Health - 1. Social - 1. Others -1. Delete an expense: 'delexp' - * Format: delexp [category] [n] - * Deletes the nth expense in the list from the given category -1. View all expenses: 'expenses' - * Format: expenses - * Lists all available expenses and their total amount - -## 4. FAQs -**Q: Where can I find all the commands?** - * A: Type 'glossary' into the command prompt and click enter. This will print out a list of all useful commands for your reference. -**Q: How do I exit from the application?** - * A: Left-click the red-buttom marked X at the top right hand corner of the application window. -**Q: If I key in a wrong amount for my expense, how can i correct it?** - * A: As of Version 1.0.0, the only way to fo it would be to remove this expense and add it back again. We are working on providing you with an easier way to handle expenses and task editing in Version 2. Stay tuned.** -**Q: What is the difference between a task and an expense?** - * A: Our application provides you with both choices, where a task keeps track of your daily schedule and activities while an expense takes note of your daily spendings. - - - - - diff --git a/build.gradle b/build.gradle index 33b7a9a698..214e7d05ba 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,6 @@ plugins { id 'java' id 'application' - id 'org.openjfx.javafxplugin' version '0.0.7' id 'com.github.johnrengelman.shadow' version '5.1.0' } @@ -16,14 +15,27 @@ application { // Change this to your main class. mainClassName = "duke.Launcher" } - -javafx { - version = "11.0.2" - modules = [ 'javafx.controls', 'javafx.fxml' ] -} - +dependencies { + String javaFxVersion = '11' + implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'win' + implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'mac' + implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'linux' + implementation group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'win' + implementation group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'mac' + implementation group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'linux' + implementation group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'win' + implementation group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'mac' + implementation group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'linux' + implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'win' + implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'mac' + implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'linux' + implementation group: 'org.openjfx', name: 'javafx-media', version: javaFxVersion, classifier: 'win' + implementation group: 'org.openjfx', name: 'javafx-media', version: javaFxVersion, classifier: 'mac' + implementation group: 'org.openjfx', name: 'javafx-media', version: javaFxVersion, classifier: 'linux' + testImplementation 'org.junit.jupiter:junit-jupiter:5.5.0' +} shadowJar { - archiveBaseName = "Wicky" + archiveBaseName = "duke" archiveVersion = "1.0.0" archiveClassifier = null archiveAppendix = null diff --git a/data/tasks.txt b/data/tasks.txt index e69de29bb2..4a750d37df 100644 --- a/data/tasks.txt +++ b/data/tasks.txt @@ -0,0 +1,12 @@ +----- +Food +5.0 : rice +Transport +Education +Household +Apparel +80.0 : stuff +Beauty +Health +Social +Others diff --git a/docs/README.md b/docs/README.md index fd44069597..ec49629b42 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,20 +1,87 @@ -# User Guide +# **DUKE**- User Guide -## Features +## Table of Content +1. Introduction +1. Getting Started +1. Features +1. FAQ -### Feature 1 -Description of feature. +## 1. Introduction: +**DUKE** is a desktop application that allows an individual to **organise his/her daily tasks and expenses** efficiently. While it consists of a *Graphical User Interface (GUI)* that makes interaction with the user friendly and understandable, **DUKE** is **optimised for users** who prefer to work with a *Command Line Interface (CLI)* which allows for fast typing and interpretation of the user-given commands. -## Usage +## 2. Getting Started: +1. Ensure that you have **Java 11** or above on your computer +1. Download the latest release of [duke.jar]() here +1. Copy and paste the file to the folder you would like to use as the home folder for your **DUKE** application +1. Double click the file to start the application. The *GUI* should appear within a few seconds +1. Type your command in the command box and press **Enter** on your keyboard or **Send** on the *GUI* to execute it + e.g. Typing **Glossary** or pressing **Enter** will refer you to a list of all helpful commands +1. Refer to **Section 3. Features** for a list of all useful commands + +## 3. Features: +### Command Format: +* The **first word** that you type into the command prompt will be the command +* Each command has its respective input format. Refer to our glossary for more details +* Ensure that the command format is correct before pressing **Enter** or clicking **Send**. This line of command will then prompt **DUKE** to respond accordingly +* Commands are **not** case-sensitive + +### Commands: +1. View all commands: 'glossary' + * Format: glossary + * Allows you to view a list of all useful commands +1. Add a task: + * 'todo' + * Format: [task details] + * Adds a todo-type task for you + * 'deadline' + * Format: [task details] /by [dd/mm/yyyy] [24hr time format] + * Adds a deadline-type task for you + * 'event' + * Format: [task details] /at [dd/mm/yyyy] [start time(24hr time format)]-[end time(24hr time format)] + * Adds an event-type task for you +1. Delete a task: 'delete' + * Format: delete [n] + * Deletes the nth task in the list +1. Mark a task as done: 'done' + * Format: done [n] + * Marks the nth task in the list as done +1. View all tasks: 'list' + * Format: list + * Lists all available tasks and their done status +1. Find a task: 'find' + * Format: Find [keyword/phrase] + * Lists all available tasks that contains the given keyword or phrase +1. Add an expense: 'spending' + * Format: spending [category] [amount] [description] + * Below is the list of all available categories: + 1. Food + 1. Transport + 1. Education + 1. Household + 1. Apparel + 1. Beauty + 1. Health + 1. Social + 1. Others +1. Delete an expense: 'delexp' + * Format: delexp [category] [n] + * Deletes the nth expense in the list from the given category +1. View all expenses: 'expenses' + * Format: expenses + * Lists all available expenses and their total amount + +## 4. FAQs +* **Q: Where can I find all the commands?** + A: Type 'glossary' into the command prompt and click enter. This will print out a list of all useful commands for your reference. +* **Q: How do I exit from the application?** + A: Left-click the red-buttom marked X at the top right hand corner of the application window. +* **Q: If I key in a wrong amount for my expense, how can i correct it?** + A: As of Version 1.0.0, the only way to fo it would be to remove this expense and add it back again. We are working on providing you with an easier way to handle expenses and task editing in Version 2. Stay tuned.** +* **Q: What is the difference between a task and an expense?** + A: Our application provides you with both choices, where a task keeps track of your daily schedule and activities while an expense takes note of your daily spendings. -### `Keyword` - Describe action -Describe action and its outcome. -Example of usage: -`keyword (optional arguments)` -Expected outcome: -`outcome` diff --git a/src/main/java/duke/Duke.java b/src/main/java/duke/Duke.java index 9fd1cfae82..16846e2003 100644 --- a/src/main/java/duke/Duke.java +++ b/src/main/java/duke/Duke.java @@ -56,6 +56,7 @@ public Duke(String filePath) { } catch (FileNotFoundException e) { ui.showLoadingError(); tasks = new TaskList(); + listOfAllExpenses = new ExpenseList(); } } diff --git a/src/main/java/duke/logic/Parser.java b/src/main/java/duke/logic/Parser.java index aed4407b07..709a3e9500 100644 --- a/src/main/java/duke/logic/Parser.java +++ b/src/main/java/duke/logic/Parser.java @@ -24,8 +24,6 @@ public void parse() { //cannot use "|" as a replacement if (tempArr.length > 1) { //account for the fact that commands like "list" do not have duke.task details taskDetails = ((String) Array.get(tempArr, 1)).trim(); } - System.out.println(command); - System.out.println(taskDetails); } /** diff --git a/src/main/java/duke/logic/Storage.java b/src/main/java/duke/logic/Storage.java index 9c25212090..bc4021319a 100644 --- a/src/main/java/duke/logic/Storage.java +++ b/src/main/java/duke/logic/Storage.java @@ -21,6 +21,7 @@ public class Storage { public Storage(String filePath) { this.filePath = filePath; + tempExpenseList = null; } /** @@ -60,7 +61,13 @@ public void write(ArrayList taskList, ArrayList expensesL try { rewriteFile(this.filePath, ""); } catch (IOException e) { - System.err.println("Error: " + e.getMessage()); + File file = new File(this.filePath); + try { + file.getParentFile().mkdir(); + file.createNewFile(); + } catch (IOException ie) { + System.out.println("error"); + } } for (Task task : taskList) { StringBuilder dataBuilder = new StringBuilder(); @@ -169,11 +176,11 @@ public ArrayList load() throws FileNotFoundException { } } } - tempExpenseList = expenseListToBeLoaded; + this.tempExpenseList = expenseListToBeLoaded; return taskListToBeLoaded; } public ExpenseList getTempExpenseList() { - return tempExpenseList; + return this.tempExpenseList; } } diff --git a/src/test/java/duke/task/TaskTest.java b/src/test/java/duke/task/TaskTest.java index cd4551fcb7..704f024961 100644 --- a/src/test/java/duke/task/TaskTest.java +++ b/src/test/java/duke/task/TaskTest.java @@ -1,10 +1,15 @@ package duke.task; - -import org.junit.jupiter.api.Assertions; +/* +import duke.task.Deadline; +import duke.task.Todo; +import duke.task.Event; +import duke.task.Task; +import org.junit.jupiter.api.Assertions;; import org.junit.jupiter.api.Test; -import src.test +*/ public class TaskTest { + /* @Test public void testStringConversion() { Assertions.assertEquals("[T][✗] eat", new Todo("eat").toString()); @@ -15,6 +20,7 @@ public void testStringConversion() { public void testSetDone() { Task temp = new Todo("sleep"); temp.setDone(); - Assertions.assertEquals(done, temp.isDone()); + Assertions.assertEquals(true, temp.isDone()); } + */ }