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

[Glenn Lee] iP #246

Open
wants to merge 59 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
b4d3ee0
Level 1
Jan 31, 2021
0d8195c
Level 2
Jan 31, 2021
186286b
Level 3
Jan 31, 2021
8872a62
Level 4 + A-Inheritance
Jan 31, 2021
1062bf0
A-TextUiTesting
Jan 31, 2021
1e1c1bc
Level 5 & A-Exceptions
Jan 31, 2021
fe1b8bc
Level 6 & A-Collections
Jan 31, 2021
b79809b
Level 7
Jan 31, 2021
3d8ef34
Level 8
Jan 31, 2021
926cea4
Merge branch 'branch-Level-7' into master
Jan 31, 2021
5d1667d
Merge branch 'branch-Level-8' into master
Jan 31, 2021
9cc5c7c
A-MoreOOP
Jan 31, 2021
060332a
A-Packages
Jan 31, 2021
f89db28
Added Gradle and JUnit Tests
Jan 31, 2021
10d5046
A-JAR
Jan 31, 2021
b3a3ec3
A-JavaDoc
Feb 1, 2021
6233fea
Level-9
Feb 1, 2021
df59dec
A-CodingStandard
Feb 1, 2021
0cffd9c
A-CodingStandard
Feb 1, 2021
5eb7979
Merge Level-9
Feb 1, 2021
4e62687
A-Gradle
Feb 2, 2021
18657cd
Merge branch 'branch-A-Gradle' into master
Feb 2, 2021
203b40d
A-CheckStyle
Feb 2, 2021
830c779
Level-10 Iteration 1
Feb 2, 2021
0dadc96
Iteration 2 & 3
Feb 3, 2021
b436b9c
Resolve PR reviews
Feb 3, 2021
3c35a48
Functional Level-10
Feb 4, 2021
5f85de4
Merge branch 'branch-Level-10' into master
Feb 4, 2021
9988c7c
Add save to exit
Feb 6, 2021
9af3367
Revamp Save Function
Feb 6, 2021
b67140c
Fixed formatting and updated Parser to use new Save
Feb 6, 2021
a9e9d23
Merge branch 'branch-Level-10' into master
Feb 6, 2021
2abdcf8
Level-10
Feb 6, 2021
003abaa
Fixed Checkstyle Violations
Feb 6, 2021
ab4d42d
Add assertions
Feb 15, 2021
e8c36f3
Improve Code Quality
Feb 15, 2021
a5446d8
Merge pull request #2 from glennljs/branch-A-CodeQuality
glennljs Feb 15, 2021
9b91e60
Remove Assertions for Redo Pull Request
Feb 15, 2021
878d6fa
Add Assert for Storage
Feb 15, 2021
09f0e53
Add Assertions for Parser
Feb 15, 2021
61a7a02
Merge branch 'master' into branch-A-Assertions
glennljs Feb 15, 2021
2cb3b45
Merge pull request #3 from glennljs/branch-A-Assertions
glennljs Feb 15, 2021
4a0e42e
Add Sort Feature
Feb 15, 2021
870f7bf
Add Detect Duplicates Function
Feb 15, 2021
ae3a1b9
Update git ignore
Feb 15, 2021
8c67031
Improve GUI
Feb 15, 2021
e6dc66c
Improve and Refactor GUI, add Error Messages
Feb 15, 2021
78f1794
Improve GUI and Code Quality
Feb 15, 2021
80603c9
Refactor Dialogs
Feb 16, 2021
5282904
Fixed formatting
Feb 16, 2021
650c28f
Refactor Parser and Improve Code Quality
Feb 16, 2021
91032c4
Update GUI
Feb 16, 2021
791c1d1
Add User Guide
Feb 16, 2021
858d78c
Add User Guide
Feb 16, 2021
c0cb780
Add User Guide
Feb 16, 2021
c92127e
Add User Guide
Feb 16, 2021
82c8628
Finalize release v0.2
Feb 17, 2021
80f4c51
Update Readme
Feb 21, 2021
54d1d8a
Update Readme
Feb 21, 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
25 changes: 25 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="bin/main" path="src/main/java">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/test" path="src/test/java">
<attributes>
<attribute name="gradle_scope" value="test"/>
<attribute name="gradle_used_by_scope" value="test"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/main" path="src/main/resources">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# These are explicitly windows files and should use crlf
*.bat text eol=crlf

9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,12 @@ bin/

/text-ui-test/ACTUAL.txt
text-ui-test/EXPECTED-UNIX.TXT

# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build

# Data Storage File
data/checklst.txt
34 changes: 34 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ip</name>
<comment>Project ip created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
<filter>
<id>1613581073555</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
13 changes: 13 additions & 0 deletions .settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=/Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true
4 changes: 4 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.source=11
22 changes: 22 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Launch External Terminal",
"request": "launch",
"console": "externalTerminal",
"mainClass": "checklst.main.Loader"
},
{
"type": "java",
"name": "Launch Loader",
"request": "launch",
"mainClass": "checklst.main.Loader",
"projectName": "ip_11f7286"
},
]
}
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"java.project.referencedLibraries": [
"lib/**/*.jar",
"/Users/glenn/.gradle/caches/modules-2/files-2.1/org.openjfx/**/*.jar"
]
}
107 changes: 84 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,84 @@
# 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.

## Setting up in Intellij

Prerequisites: JDK 11, update Intellij to the most recent version.

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).
1. After that, locate the `src/main/java/Duke.java` file, right-click it, and choose `Run Duke.main()`. If the setup is correct, you should see something like the below:
```
Hello from
____ _
| _ \ _ _| | _____
| | | | | | | |/ / _ \
| |_| | |_| | < __/
|____/ \__,_|_|\_\___|
```
# Checklst

Checklst is a basic Todo app, allowing users to store and track events, deadlines and todos. Checklst has gradually evolved from a basic CLI application to a fully ready GUI.

![](docs/main_ui.png)

# Command Syntax

| Command | Description | Example |
|--|--|--|
| `list` | Lists all Tasks | `list` |
| `todo NAME` | Creates a Todo | `todo Read Books` |
| `event NAME /at EVENT_DATE` | Creates an Event with a specific occurrence date| `event Concert /at 2020-12-04` |
| `deadline NAME /by DUE_DATE` | Creates a Deadline with a specific due date | `deadline Assignment /by 2020-12-03` |
| `done INDEX` | Completes the Task | `done 1` |
| `delete INDEX` | Deletes the Task | `delete 1` |
| `find KEYWORD` | Finds all Tasks whose name contains the Keyword | `find CS2103` |
| `sort` | Sorts all Tasks by Complete/Incomplete and then Task Type | `sort` |
| `help` | Shows all Commands | `help` |
| `bye` | Exits Checklst | `bye` |


# Features

## Creating a Task
Tasks can be one of 3 types - Todo, Event and Deadline. Todos are basic named Tasks while Events and Deadlines both contain a date which corresponds to their event date and due date respectively.

Tasks can be made using commands `todo`, `event`, `deadline` to create each type of task respectively. Tasks will be labelled according to their task type in the Checklst application as follows:

| Task Command | Task Representation
|--|--|
| `todo Read Books` | [T][ ] Read Books |
| `event Concert /at 2020-12-04` | [E][ ] Concert (at: Dec 4 2020) |
| `deadline Assignment /by 2020-12-03` | [D][ ] Assignment (by: Dec 3 2020) |


## Listing Tasks and Completing a Task
Tasks can be listed using the `list` command.

Once a Task is made, it will be by default labelled as incomplete. A task can then be completed using the `done` command to mark it as completed. The index value of the task starts from index 1 and can be referenced from the `list` command.

| Task Command | Expected Output
|--|--|
| `list` | These are your current tasks: <br> 1. [T][ ] Read Books |
| `done 1` | [T][X] Read Books |
| `list` | These are your current tasks: <br> 1. [T][X] Read Books |

## Deleting a Task
Tasks can be removed from Checklst by using the `delete` command. Similarly, the index value starts from index 1.

| Task Command | Expected Output
|--|--|
| `list` | These are your current tasks: <br> 1. [T][X] Read Books |
| `delete 1` | [T][X] Read Books |
| `list` | Task list is currently empty! |


## Finding Tasks
To easily retrieve tasks when the Task List gets convoluted, the `find` command may be used with a keyword that will be matched to tasks. As long as some part of a Task's name contains the keyword, it will be returned.

| Task Command | Expected Output
|--|--|
| `list` | These are your current tasks: <br> 1. [T][ ] Read Books <br> 2. [T][ ] Return Books <br> 3. [T][ ] Eat Lunch|
| `find books` | Here are the matching tasks in your list! <br> 1. [T][ ] Read Books <br> 2. [T][ ] Return Books |


## Sorting Tasks
Tasks are added to the bottom of the Task List via a Chronological input order. However, the tasks may be deliberately sorted on will via the `sort` command.

The sorting will be done via 2 conditions. Firstly, the tasks will be split into complete and incomplete. Secondly, the tasks will be sorted by Task type.

| Task Command | Expected Output
|--|--|
| `list` | These are your current tasks: <br> 1. [T][ ] Read Books <br> 2. [E][ ] Movie (at: Apr 24 2020) <br> 3. [T][X] Return Books <br> 4. [E][ ] Concert (at: Feb 13 2020) |
| `sort` | These are your current tasks: <br> 1. [T][ ] Read Books <br> 2. [E][ ] Movie (at: Apr 24 2020) <br> 3. [E][ ] Concert (at: Feb 13 2020) <br> 4. [T][X] Return Books |

## Errors
Checklst is is capable of handling errors in command or keyword inputs. Whenever an error is encounted, Checklst will return the error message with a clear red indicator.

![](docs/Ui.png)

## Credits
Icons in Checklst are made by and used with courtesy from Flat Icons.
<br> "https://www.flaticon.com/"
71 changes: 71 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
plugins {
id 'java'
id 'application'
id 'checkstyle'
id 'java-library'
id 'com.github.johnrengelman.shadow' version '5.1.0'
}

repositories {
mavenCentral()
}

dependencies {
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'

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

test {
useJUnitPlatform()

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

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

application {
mainClassName = "checklst.main.Loader"
}

shadowJar {
archiveBaseName = "checklst"
archiveClassifier = null
}

checkstyle {
toolVersion = '8.32'
}

run {
enableAssertions = true
standardInput = System.in
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}

version = '1.2.1'
Loading