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

[Wang Guanlin] iP #468

Open
wants to merge 86 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
d839859
Add Gradle support
May 24, 2020
ab74434
Level-1: Added Greet, Echo, Exit functions for Duke
WangGLJoseph Aug 18, 2021
c8163cf
Included gitignore file, ignore all files with .class extension
WangGLJoseph Aug 18, 2021
7f6a9e4
Level-2: Added Add, List functions for Duke
WangGLJoseph Aug 18, 2021
073b8bc
Created a Task class to represent tasks added by user
WangGLJoseph Aug 18, 2021
94a2613
Changed Duke.java to represent userInputs as an ArrayList of Task obj…
WangGLJoseph Aug 18, 2021
29a7b43
Removed deprecated code representing userInputs as an ArrayList of St…
WangGLJoseph Aug 18, 2021
86734d8
Updated scanner to read userInput by using next() instead of nextLine()
WangGLJoseph Aug 18, 2021
0704af3
Level-3: Added Mark as Done function for Duke
WangGLJoseph Aug 18, 2021
840767d
Added field for task type and getter method for task type icon
WangGLJoseph Aug 18, 2021
bdeaad4
Updated instantiation of Task objects to include a taskType parameter
WangGLJoseph Aug 18, 2021
a792272
Abstracted out logic for beautifying task and list
WangGLJoseph Aug 18, 2021
1327162
Updated scanner to use nextLine after first command has been checked
WangGLJoseph Aug 18, 2021
541a1dd
Added constructor for Task that took in an additional string as remin…
WangGLJoseph Aug 18, 2021
c48c98d
Updated todo and deadline cases to be recognizable as userInput
WangGLJoseph Aug 18, 2021
57a57d3
Added task reminder for Deadline tasks
WangGLJoseph Aug 19, 2021
5b64f0e
Removed unnecesary use of delimiter for Deadline tasks
WangGLJoseph Aug 19, 2021
213d350
Updated listBeautify to use taskBeautify method
WangGLJoseph Aug 19, 2021
ff40331
Level-4: Added ToDos, Events, Deadlines functions for Duke
WangGLJoseph Aug 19, 2021
23a7854
Updated to use Inheritance to support multiple task types (ToDo, Even…
WangGLJoseph Aug 19, 2021
20904d1
Fixed bug where type of Event was displayed as [D]
WangGLJoseph Aug 19, 2021
abba5bc
A-TextUiTesting: Used the input/output redirection technique to semi-…
WangGLJoseph Aug 19, 2021
582d814
Removed deprecated method TaskBeautify() from Duke
WangGLJoseph Aug 19, 2021
0e724a6
Added DukeException to handle errors in Duke regarding invalid user i…
WangGLJoseph Aug 19, 2021
f854a11
Level-5: Added exceptions for unknown and incomplete user inputs
WangGLJoseph Aug 19, 2021
153032a
Level-6: Added Delete function to Duke, tasks stored in ArrayList<Task>
WangGLJoseph Aug 19, 2021
287a6b4
Updated text-ui-test to work with Duke Level-6
WangGLJoseph Aug 19, 2021
a008ab8
Change indentation for switch case to follow module coding standards
WangGLJoseph Aug 26, 2021
f2e7526
Add duke.txt with relative filePath
WangGLJoseph Aug 26, 2021
1a95507
Update Duke with filePath to duke.txt
WangGLJoseph Aug 26, 2021
51f6c23
Handle creation of folder and file if not already present
WangGLJoseph Aug 26, 2021
685755b
Add functinality to write to duke.txt
WangGLJoseph Aug 26, 2021
8688ae6
Add skeletal method for copying from duke.txt and parsing it
WangGLJoseph Aug 26, 2021
b12e45e
Updated constructor of various task types
WangGLJoseph Aug 26, 2021
845d1b1
Revert constructor of various task types
WangGLJoseph Aug 26, 2021
6da91b1
Add parse method to convert duke.txt to taskArrayList
WangGLJoseph Aug 26, 2021
54b588f
Fix bug where parse() was called twice incorrectly
WangGLJoseph Aug 26, 2021
d0a5a2e
Level-7: Add Save and Load duke.txt for Duke
WangGLJoseph Aug 26, 2021
bfb6cad
Update Deadline and Event to parse task description as string of date
WangGLJoseph Aug 27, 2021
609beb1
Level-8: Add Dates and Times functionality to Duke
WangGLJoseph Aug 27, 2021
ee37691
Increment Duke display level
WangGLJoseph Aug 27, 2021
281a595
Merge branch 'branch-Level-8'
WangGLJoseph Aug 27, 2021
9e9109a
Add skeletal classes for more OOP
WangGLJoseph Aug 27, 2021
7d0c2ff
Update skeletal class files to make Duke more OOP
WangGLJoseph Aug 31, 2021
6415efd
Put all classes into cs2103.duke package
WangGLJoseph Aug 31, 2021
1195f8d
Add JUnit Tests for Duke
WangGLJoseph Aug 31, 2021
9a5e6fc
Update duke.txt initialisation to enable use of .jar files
WangGLJoseph Aug 31, 2021
c276a32
Add complete JavaDoc for all classes in Duke
WangGLJoseph Aug 31, 2021
5524ba8
Remove unnecessary use of the 'this' keyword
WangGLJoseph Aug 31, 2021
c72dbd8
Level-9: Add find function for Duke
WangGLJoseph Aug 31, 2021
13d56db
Merge branch 'branch-A-CodingStandard'
WangGLJoseph Aug 31, 2021
596cb63
Merge branch 'branch-Level-9'
WangGLJoseph Aug 31, 2021
d6af729
Update README.md
WangGLJoseph Sep 1, 2021
e054745
Merge branch 'master' of https://github.com/WangGLJoseph/ip
WangGLJoseph Sep 2, 2021
0c633a2
Merge branch 'add-gradle-support' into branch-A-Gradle
WangGLJoseph Sep 2, 2021
613f9ce
Add DukeLauncher as part of JavaFX basics
WangGLJoseph Sep 2, 2021
60e607a
Update README.md
WangGLJoseph Sep 6, 2021
379ba30
Extract GUI logic out of Duke and into Main
WangGLJoseph Sep 8, 2021
1ac4e8f
Update README.md
WangGLJoseph Sep 8, 2021
40f61c6
Create new package for controllers
WangGLJoseph Sep 8, 2021
04bbebc
Merge branch 'master' of https://github.com/WangGLJoseph/ip
WangGLJoseph Sep 8, 2021
53dafd7
Level-10: Add GUI for Duke
WangGLJoseph Sep 8, 2021
8daf0b5
Merge branch 'branch-Level-10'
WangGLJoseph Sep 8, 2021
f83d529
Update Duke to use GUI
WangGLJoseph Sep 8, 2021
9c7e428
Set font in GUI as Courier New
WangGLJoseph Sep 18, 2021
b5c3742
Make Duke wait before closing the window
WangGLJoseph Sep 18, 2021
9821713
Add assertions for key assumptions in the code
WangGLJoseph Sep 19, 2021
3638fd6
Update method header comments to follow the coding standard
WangGLJoseph Sep 19, 2021
6af29d8
Update DialogBox to display more text
WangGLJoseph Sep 19, 2021
a70840f
TaskList class: Apply SLAP to shorten methods of adding tasks
WangGLJoseph Sep 19, 2021
c8a852a
Update .gitignore to ignore data/duke.txt
WangGLJoseph Sep 19, 2021
1e509d0
Remove data within data/duke.txt
WangGLJoseph Sep 19, 2021
bf8166f
DukeParser class: Apply SLAP to shorten methods of parsing data
WangGLJoseph Sep 19, 2021
0a6303e
Merge pull request #2 from WangGLJoseph/branch-A-Assertions
WangGLJoseph Sep 19, 2021
1d7cac7
Merge branch 'master' of https://github.com/WangGLJoseph/ip
WangGLJoseph Sep 19, 2021
b067a25
Merge branch 'master' into branch-A-CodeQuality
WangGLJoseph Sep 19, 2021
5721b1c
Merge pull request #3 from WangGLJoseph/branch-A-CodeQuality
WangGLJoseph Sep 19, 2021
e083605
Merge branch 'master' of https://github.com/WangGLJoseph/ip
WangGLJoseph Sep 19, 2021
75661c5
Add functionality to undo the last undo-able command
WangGLJoseph Sep 19, 2021
7f59eb6
Add Ui.png
WangGLJoseph Sep 19, 2021
49dca7b
Update user guide for Duke
WangGLJoseph Sep 19, 2021
e010b92
Set theme jekyll-theme-time-machine
WangGLJoseph Sep 19, 2021
5430e9f
Update formatting in user guide
WangGLJoseph Sep 19, 2021
86a2f73
Merge branch 'master' of https://github.com/WangGLJoseph/ip
WangGLJoseph Sep 19, 2021
4a7a59b
Remove emojis
WangGLJoseph Sep 19, 2021
cdb67d8
Update goodbye message
WangGLJoseph Sep 19, 2021
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ bin/

/text-ui-test/ACTUAL.txt
text-ui-test/EXPECTED-UNIX.TXT
*.class
/data/duke.txt
45 changes: 26 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
# Duke project template
# Duke v0.9.0
> *"Be not afraid of growing slowly, be afraid of standing still."* - Chinese proverb

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.
Duke offers you a:
- Hassle free
- Text based
- Minimalist
and completely **offline** experience of planning your tasks!

## Setting up in Intellij
## Duke's features
- [x] Adding and saving tasks
- [ ] GUI (coming soon!)
- [ ] Mystery features 😜

Prerequisites: JDK 11, update Intellij to the most recent version.
## Setting up Duke
1. Download it [here](https://github.com/WangGLJoseph/ip/releases/download/A-Jar/ip.jar)
2. Double-click to run it
3. Add your tasks
4. Enjoy **mastery** over your tasks 😆

1. Open Intellij (if you are not in the welcome screen, click `File` > `Close Project` to close the existing project first)
1. Open the project into Intellij as follows:
1. Click `Open`.
1. Select the project directory, and click `OK`.
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:
```
Hello from
____ _
| _ \ _ _| | _____
| | | | | | | |/ / _ \
| |_| | |_| | < __/
|____/ \__,_|_|\_\___|
A snippet of the workings of controlling your tasks. Behold, you've got the power!
```java
public String finishTask(int index) throws DukeException {
if (index > taskArrayList.size()) {
throw new DukeException("This task index is not in the task list!");
}
taskArrayList.get(index - 1).markAsDone();
return (sandwich("Congratulations! You have finished this task: "
+ taskArrayList.get(index - 1).toString()));
}
```
60 changes: 60 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
plugins {
id 'java'
id 'application'
id 'checkstyle'
id 'com.github.johnrengelman.shadow' version '5.1.0'
}

repositories {
mavenCentral()
}

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'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.5.0'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.5.0'
}

test {
useJUnitPlatform()

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

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

application {
mainClassName = "cs2103.duke.Duke"
}

shadowJar {
archiveBaseName = "duke"
archiveClassifier = null
}

checkstyle {
toolVersion = '8.29'
}

run {
standardInput = System.in
}
164 changes: 155 additions & 9 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,93 @@
# User Guide
# User Guide for Duke

## Features

### Feature-ABC
### Adding tasks

Description of the feature.
Duke allows you to add 3 types of tasks:
- Todo
- Deadline
- Event

### Feature-XYZ
### Saving tasks

Description of the feature.
Duke saves your tasks automatically when you exit the program.

## Usage
### Deleting tasks

Duke lets you delete any task from your task list.

### Finishing tasks

Duke lets you mark any task on your task list as complete, without deleting them.

### Undoing previous command

Duke lets you undo your last undo-able command, say goodbye to accidentally deleting a task!

### `Keyword` - Describe action
### List tasks on your task list

Describe the action and its outcome.
Duke lets you see everything on your task list at a glance.


## Usage

### `todo` - Adds a todo task

Example of usage:

`keyword (optional arguments)`
`todo nap`

Expected outcome:

The todo task 'nap' will be added to your task list.

```
New todo task added:
[T][ ] nap
You now have x item(s) in your task list.
```


### `deadline` - Adds a deadline task

Example of usage:

`ip due /by 2021-09-20`

Expected outcome:

The deadline task 'ip due' will be added to your task list.

```
New deadline task added:
[D][ ] ip due (by: 2021 09 20)
You now have x item(s) in your task list.
```


### `event` - Adds an event task

Example of usage:

`event family meal /at 2021-09-21`

Expected outcome:

The event task 'family meal' will be added to your task list.

```
New event task added:
[E][ ] family meal (by: 2021 09 21)
You now have x item(s) in your task list.
```


### `bye` - Saves tasks and exits the program

Example of usage:

`bye`

Expected outcome:

Expand All @@ -27,3 +96,80 @@ Description of the outcome.
```
expected output
```


### `delete` - Deletes a task from your task list

Deletes the task at the indicated index.

Example of usage:

`delete 3`

Expected outcome:

Description of the outcome.

```
1.[T][ ] nap
2.[D][ ] ip submit (by: 2021 09 20)
```


### `done` - Marks a task as done

Marks the task at the indicated index as done with an 'X'.

Example of usage:

`done 1`

Expected outcome:

The task at the indicated index will be marked as done.

```
Congratulations! You have finished this task:
[T][X] nap
```


### `undo` - Undoes the last command

Undoes the last valid undo-able command.

Example of usage:

`undo`

Expected outcome:

The previous command's effect will be reverted.

```
I undid your previous command:
done 1
Here is your current task list:
1.[T][ ] nap
2.[D][ ] ip due (by: 2021 09 20)
3.[E][ ] family meal (at: 2021 09 21)
```


### `list` - Lists all tasks in the task list.

Returns all the tasks in the task list

Example of usage:

`list`

Expected outcome:

A list of all the tasks on your task list.

```
1.[T][ ] nap
2.[D][ ] ip due (by: 2021 09 20)
3.[E][ ] family meal (at: 2021 09 21)
```
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.
1 change: 1 addition & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-time-machine
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions 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-6.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading