Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tang-Moyan] iP #542

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
28ad2b8
Add Gradle support
May 24, 2020
ed6d4d2
Bump gradle and lib version
Eclipse-Dominator Aug 5, 2023
f88b6b3
Level 0 Rename, Greet, Exit
Tang-Moyan Aug 24, 2023
fedfbde
Added Level 1. Echo
Tang-Moyan Aug 30, 2023
30a8d0f
Added Level 2. Add, List
Tang-Moyan Aug 30, 2023
76e279d
Added Level 3. Mark as Done
Tang-Moyan Aug 30, 2023
05bfd79
Added Level 4. ToDos, Events, Deadlines
Tang-Moyan Aug 30, 2023
95571af
Added UI Testing
Tang-Moyan Sep 1, 2023
6b91d86
Level 5. Handle Errors
Tang-Moyan Sep 1, 2023
5bb12d4
Level 6. Delete
Tang-Moyan Sep 1, 2023
3df8678
Added Level 7. Save
Tang-Moyan Sep 4, 2023
e5419c6
Small changes
Tang-Moyan Sep 4, 2023
9cd2af3
Merge branch 'branch-Level-7'
Tang-Moyan Sep 4, 2023
61f2b5f
Added Leve 8. Dates and Time
Tang-Moyan Sep 4, 2023
e55e84a
Merge branch 'branch-Level-8'
Tang-Moyan Sep 4, 2023
748abf7
partial OOP
Tang-Moyan Sep 6, 2023
4f477ac
Added A-MoreOOP
Tang-Moyan Sep 6, 2023
20f6c35
Added A-Packages (already done in previous commit)
Tang-Moyan Sep 6, 2023
0b1dd0d
Merge remote-tracking branch 'origin/add-gradle-support' into A-branches
Tang-Moyan Sep 6, 2023
0e65df1
Fixed the bug that cannot get user command correctly
Tang-Moyan Sep 6, 2023
9eecffa
Added A-JUnit
Tang-Moyan Sep 7, 2023
5d8b7a3
Created A-Jar
Tang-Moyan Sep 7, 2023
8a215e5
Added JavaDoc
Tang-Moyan Sep 7, 2023
bf66d36
Modified Coding Standard
Tang-Moyan Sep 7, 2023
9f04997
Added Level 9. Find
Tang-Moyan Sep 7, 2023
44c08ab
Merge branch 'branch-A-JavaDoc' into branch-A-CodingStandard
Tang-Moyan Sep 7, 2023
944be72
Resolved conflict
Tang-Moyan Sep 7, 2023
3d841fc
small modification
Tang-Moyan Sep 8, 2023
525c359
Level 10. GUI
Tang-Moyan Sep 15, 2023
4a8adbc
Make getResponse() return correct String
Tang-Moyan Sep 22, 2023
80c4176
Add showTaskStatics() function
Tang-Moyan Sep 24, 2023
a853e6a
Add A-Assertions
Tang-Moyan Sep 24, 2023
fc087dd
Improved code quality
Tang-Moyan Sep 24, 2023
d513068
Improved code quality further
Tang-Moyan Sep 24, 2023
271c84f
Merge pull request #2 from Tang-Moyan/branch-A-Assertions
Tang-Moyan Sep 24, 2023
c3d3018
Merge branch 'branch-A-CodeQuality'
Tang-Moyan Sep 24, 2023
a2aa77d
Add sort function
Tang-Moyan Sep 24, 2023
fcd88d2
Add User Guide
Tang-Moyan Sep 25, 2023
3b1f871
Add Ui.png
Tang-Moyan Sep 25, 2023
2e43bf1
More improvement to the code
Tang-Moyan Sep 25, 2023
60d851f
More improvement to the code
Tang-Moyan Sep 25, 2023
fc3b8e1
More improvement to the code
Tang-Moyan Sep 25, 2023
62eb998
Apply SLAP to shorten methods
Tang-Moyan Oct 23, 2023
1442d20
Limit task names to be non-empty
Tang-Moyan Oct 23, 2023
996dee8
Command classes: extract command functions into classes
Tang-Moyan Oct 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
duke.gui.Main_temp-Class: duke.Duke

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Duke project template
# duke.Duke project template

This is a project template for a greenfield Java project. It's named after the Java mascot _Duke_. Given below are instructions on how to use it.

Expand All @@ -13,7 +13,7 @@ Prerequisites: JDK 11, update Intellij to the most recent version.
1. If there are any further prompts, accept the defaults.
1. Configure the project to use **JDK 11** (not other versions) as explained in [here](https://www.jetbrains.com/help/idea/sdk.html#set-up-jdk).<br>
In the same dialog, set the **Project language level** field to the `SDK default` option.
3. After that, locate the `src/main/java/Duke.java` file, right-click it, and choose `Run Duke.main()` (if the code editor is showing compile errors, try restarting the IDE). If the setup is correct, you should see something like the below as the output:
3. After that, locate the `src/main/java/duke.Duke.java` file, right-click it, and choose `Run duke.Duke.main()` (if the code editor is showing compile errors, try restarting the IDE). If the setup is correct, you should see something like the below as the output:
```
Hello from
____ _
Expand Down
61 changes: 61 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
plugins {
id 'java'
id 'application'
id 'com.github.johnrengelman.shadow' version '7.1.2'

}


repositories {
mavenCentral()
}

dependencies {
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.10.0'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.10.0'

String javaFxVersion = '17.0.7'

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'
}

test {
useJUnitPlatform()

testLogging {
events "passed", "skipped", "failed"

showExceptions true
exceptionFormat "full"
showCauses true
showStackTraces true
showStandardStreams = false
}
}

application {
//mainClass.set("seedu.duke.Duke")
mainClass.set("duke.gui.Launcher")
}

shadowJar {
archiveBaseName = "duke"
archiveClassifier = null
archiveFileName = 'duke.jar'
dependsOn("distZip", "distTar")
}

run{
standardInput = System.in
}
5 changes: 5 additions & 0 deletions data/list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
E | 1 | new movie release | 2023-09-12 | 2023-09-15
T | 1 | eat
T | 1 | buy milk
D | 0 | quiz | 2023-10-02
D | 0 | supermarket discount! | 2023-10-10
191 changes: 176 additions & 15 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,190 @@
# User Guide
# Duke User Guide

## Features

### Feature-ABC
This chatbot's name is Duke. You can tell him what ever
tasks you plan to do, and he will help you remember them!

Description of the feature.
In addition, it **_automatically saves your list on your computer even
if you accidentally close it_**. So, your tasks are "safe" and you can
get back to it anytime.

### Feature-XYZ
## Command Summary

Description of the feature.
add todo task: `todo [task name]`

## Usage
add deadline task: `deadline [task name] /by [yyyy-mm-dd]`

### `Keyword` - Describe action
add event task: `event [task name] /from [yyyy-mm-dd] /to [yyyy-mm-dd]`

Describe the action and its outcome.
show the whole list: `list`.

Example of usage:
mark task as done: `mark [index]`

`keyword (optional arguments)`
mark task as undone: `unmark [index]`

delete task: `delete [index]`

find task: `find [substring of the task name you want to find]`

show statistics: `stats`

sort the list: `sort by start date` or `sort by end date`

say goodbye: `bye`

## Command details

### "todo":

Format: `todo [task name]`

Example use: `todo eat`

Use this command to add a todo task which has no start date nor end
date.

Expected outcome:

Got it. I've added this task:
[T][ ] eat
Now you have 4 tasks in the list.


### "deadline":

Format: `deadline [task name] /by [yyyy-mm-dd]`

Example use: `deadline read book /by 2022-01-01`

Use this command to add a deadline task which has only end
date, but does not have a start date.

Expected outcome:

Got it. I've added this task:
[D][ ] read book (by: 12-29-2023)
Now you have 4 tasks in the list.

### "event":

Format: `event [task name] /from [yyyy-mm-dd] /to [yyyy-mm-dd]`

Example use: `event sleep /from 2022-01-01 /to 2022-01-02`

Use this command to add an event task which has both start and end
date.

Expected outcome:

Got it. I've added this task:
[E][ ] sleep (from 12-10-2023 to: 12-11-2023)
Now you have 4 tasks in the list.

### "list":

Format: `list`.

Example use: `list`

Use this command to view all the tasks currently in your list.

Expected outcome:

**Duke will show the whole list**

### "mark":

Format: `mark [index]`

Example use: `mark 1`

Use this command to mark the task at given index as "done".

Expected outcome:

Following task is marked as done:
1. [T][X] eat

### "unmark":

Format: `unmark [index]`

Example use: `unmark 1`

Use this command to mark the task at given index as "undone".

Expected outcome:

Following task is marked as undone:
1. [T][ ] eat

### "delete":

Format: `delete [index]`

Example use: `delete 1`

Use this command to delete the task at given index.

Expected outcome:

Noted. I've removed this task:
[T][ ] read book
Now you have 4 tasks in the list.

### "find":

Format: `find [substring of the task name you want to find]`

Example use: `find book`

Use this command to search tasks which contain given substring.
In the example given above, Duke shall return "read book" and "return
book" if these two tasks are in your list.

Expected outcome:

Here are the matching tasks in your list:
1. [T][ ] read book

### "stats":

Format: `stats`

Example use: `stats`

Use this command to see how many each type of task are in your list.

Expected outcome:

You have:
~ 1 todo.
~ 1 deadline.
~ 2 event.

### "sort":

Format: `sort by start date` or `sort by end date`

Example use: `sort by start date` or `sort by end date`

Use this command to sort your list in ascending order of start date
or end date

Expected outcome:

**Duke will display the new sorted list.**

### "bye":

Format: `bye`

Example use: `bye`

Duke will also say goodbye to you :).

Expected outcome:

Description of the outcome.
Bye. Hope to see you again soon!


```
expected output
```
Binary file added docs/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 added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading