Skip to content

Commit

Permalink
Added mock up UI (AY1920S1-CS2113-T14-2#36)
Browse files Browse the repository at this point in the history
* B-Reminders

* B-reminders modification

* duke.java

* modified buidl.gradle and Command

* user guide

* user guide table of contents

* user guide link TOC

* user guide

* UI

* corrected mock UI

* rename UI

* UI update
  • Loading branch information
9hafidz6 authored Sep 28, 2019
1 parent addcdf5 commit e89979f
Show file tree
Hide file tree
Showing 25 changed files with 315 additions and 28 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ repositories {
}

shadowJar {
archiveBaseName = "mid-v1.1"
archiveVersion = "1.1"
archiveBaseName = "mid"
archiveVersion = "v1.1"
archiveClassifier = null
archiveAppendix = null
}
Expand All @@ -25,7 +25,7 @@ checkstyle {

application {
// Change this to your main class.
mainClassName = "src/main/java/duke/Duke"
mainClassName = "duke/Duke"
}

run {
Expand Down
113 changes: 93 additions & 20 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,96 @@
# Restaurant Manager - User Guide

### 1. Features

1. **bye:** Exit the program. \[Level-1\]
2. **list:** Show all the tasks. \[Level-2\]
3. **done:** Mark a task as done. \[Level-3\]
4. **todo:** Create a new todo task. \[Level-4\]
5. **deadline:** Create a new deadline task. \[Level-4\]
6. **event:** Create a new event task. \[Level-4\]
7. Handle errors and invalid inputs. \[Level-5\]
8. Load and save tasks to hard disk. \[Level-7\]
9. Identify dates and times. \[Level-8\]
10. **delete:** Delete a task. \[Level-6\]
11. Perform text UI testing. \[A-TestUiTesting\]
12. **find:** Find a task by searching for a keyword. \[Level-9\]
13. Object-oriented. \[A-MoreOOP\]
14. Perform JUnit testing. \[A-JUnit\]
15. Have comments. \[A-JavaDoc\]

### 2. Command Summary
1. Introduction
2. Quick Start
3. Features
- bye: Exit the program. [Level-1]
- list: Show all the tasks. [Level-2]
- done: Mark a task as done. [Level-3]
- todo: Create a new todo task. [Level-4]
- deadline: Create a new deadline task. [Level-4]
- event: Create a new event task. [Level-4]
- Handle errors and invalid inputs. [Level-5]
- Load and save tasks to hard disk. [Level-7]
- Identify dates and times. [Level-8]
- delete: Delete a task. [Level-6]
- Perform text UI testing. [A-TestUiTesting]
- find: Find a task by searching for a keyword. [Level-9]
- Object-oriented. [A-MoreOOP]
- Perform JUnit testing. [A-JUnit]
- Have comments. [A-JavaDoc]
4. Command Summary

## 1. Introduction

Duke is targeted towards restaurant chefs who wants to be able to consolidate most of the things happening in their kitchen such as recipes, ingredients, expiry dates etc.

## 2. Quick Start

1. Ensure you have Java `11` or above installed in your Computer.

2. Download the latest Duke.jar [here](https://github.com/AY1920S1-CS2113-T14-2/main/releases).

3. Copy the file to the folder you want to use as the home folder for your Duke application.

4. Double-click the file to start the app. The GUI should appear in a few seconds.

![UI](https://github.com/9hafidz6/main/blob/master/docs/images/UI.png)

5. Type into the INPUT box some commands and press ENTER to execute

6. Some example commands

1. **list**: lists out all the tasks
2. **deadline** prepare new recipe **/by** 1/1/2019: adds a deadline task "prepare new recipe" into your list by "1/1/2019"
3. **bye**: exits the program

7. Refer to Section 4 for the full list of features

## 3. Features

### 3.1 bye: Exit the program. [Level-1]

Saves data onto local storage and exits the program

Format: `bye`

### 3.2 list: Show all the tasks. [Level-2]

Shows all the task marked done/undone to the user

Format: `list`

### 3.3 done: Mark a task as done. [Level-3]

marks a task in list as done.

Format

### 3.4 todo: Create a new todo task. [Level-4]

### 3.5 deadline: Create a new deadline task. [Level-4]

### 3.6 event: Create a new event task. [Level-4]

### 3.7 Handle errors and invalid inputs. [Level-5]

### 3.8 Load and save tasks to hard disk. [Level-7]

### 3.9 Identify dates and times. [Level-8]

### 3.10 delete: Delete a task. [Level-6]

### 3.11 Perform text UI testing. [A-TestUiTesting]

### 3.12 find: Find a task by searching for a keyword. [Level-9]

### 3.13 Object-oriented. [A-MoreOOP]

### 3.14 Perform JUnit testing. [A-JUnit]

### 3.15 Have comments. [A-JavaDoc]

## 4. Command Summary

Index | Keyword | Usage
----- | -------- | ----------
Expand All @@ -29,4 +101,5 @@ Index | Keyword | Usage
5 | deadline | deadline \<desc\> /by \<date\>
6 | event | event \<desc\> /at \<date\>
7 | delete | delete \<indx\>
8 | find | find \<desc\>
8 | find | find \<desc\>
9 | remind | remind
Binary file added docs/images/UI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/main/.gradle/5.2.1/fileContent/fileContent.lock
Binary file not shown.
Binary file added src/main/.gradle/5.2.1/fileHashes/fileHashes.bin
Binary file not shown.
Binary file added src/main/.gradle/5.2.1/fileHashes/fileHashes.lock
Binary file not shown.
Empty file.
Binary file not shown.
2 changes: 2 additions & 0 deletions src/main/.gradle/buildOutputCleanup/cache.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Thu Sep 26 21:58:55 SGT 2019
gradle.version=5.2.1
Binary file not shown.
Empty file.
40 changes: 40 additions & 0 deletions src/main/.idea/$PRODUCT_WORKSPACE_FILE$

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/main/.idea/libraries/gradle_wrapper.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/main/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/main/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/main/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

81 changes: 81 additions & 0 deletions src/main/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added src/main/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions src/main/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 3 additions & 3 deletions src/main/java/duke/Duke.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public Duke(String filePath) {
/**
* The execution core of the Duke class.
*/
public void run() {
public void run() throws DukeException {
ui.showWelcome();
boolean isExit = false;
while (!isExit) {
Expand All @@ -55,8 +55,8 @@ public void run() {
/**
* =============== MAIN FUNCTION ===============.
*/
public static void main(String[] args) {
public static void main(String[] args) throws DukeException {
new Duke("data/tasks.txt").run();

}
}

51 changes: 51 additions & 0 deletions src/main/java/duke/command/RemindCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package duke.command;

import duke.exception.DukeException;
import duke.storage.Storage;
import duke.task.TaskList;
import duke.ui.Ui;

import java.time.LocalDate;
import java.time.ZoneId;
import java.util.Date;

public class RemindCommand extends Command{

public RemindCommand() {

}

@Override
public void execute(TaskList taskList, Ui ui, Storage storage) throws DukeException{
try {
int num = 1;
LocalDate date = LocalDate.now();
LocalDate endDate = date.plusDays(5);

Date StartDate = Date.from(date.atStartOfDay(ZoneId.systemDefault()).toInstant());
Date EndDate = Date.from(endDate.atStartOfDay(ZoneId.systemDefault()).toInstant());

if(taskList.size() == 0) {
System.out.println("You have no upcoming events/deadlines/todos");
}
else {
System.out.println("These are your Tasks in the next 5 days");
for(int a = 0; a < taskList.size(); a++) {
Date TaskDate = taskList.getTask(a).getCurrentDate();

if((isWithinRange(TaskDate, EndDate, StartDate))) {
System.out.println(num + ": " + taskList.getTask(a).toString());
num++;
}
}
}
} catch ( Exception e) {
//
}

}

private boolean isWithinRange(Date TaskDate, Date EndDate, Date StartDate) {
return TaskDate.before(EndDate) && TaskDate.after(StartDate);
}
}
Loading

0 comments on commit e89979f

Please sign in to comment.