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

[Zheng Shijie] iP #8

Open
wants to merge 70 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
86f37fb
level 0
zhengshijie Aug 21, 2020
0a9b12b
level 1
zhengshijie Aug 21, 2020
44cdf22
level 2
zhengshijie Aug 22, 2020
e165765
level 2
zhengshijie Aug 22, 2020
8f50f25
level 3
zhengshijie Aug 22, 2020
2e3e9e8
level 4
zhengshijie Aug 23, 2020
d2651e9
A-TextUiTesting
zhengshijie Aug 26, 2020
e64bd1c
A-CodingStandard
zhengshijie Aug 26, 2020
e20bb7e
Level-5
zhengshijie Aug 26, 2020
efedd9e
A-CodeQuality
zhengshijie Aug 29, 2020
643c33d
A-Packages
zhengshijie Aug 29, 2020
cc37392
branch-A-CodeQuality
zhengshijie Sep 4, 2020
0d8d34f
testing
zhengshijie Sep 4, 2020
1ab3a67
testing branch
zhengshijie Sep 4, 2020
7f7dc47
testing branch
zhengshijie Sep 4, 2020
b661851
testing branch
zhengshijie Sep 4, 2020
654cf9d
Merge branch 'testBranch'
zhengshijie Sep 4, 2020
fc7f81f
restore from testing branch
zhengshijie Sep 4, 2020
885931a
Level 6
zhengshijie Sep 5, 2020
adc8a92
Merge pull request #1 from ZhengShijieNUS/branch-Level-6
ZhengShijieNUS Sep 5, 2020
c302af2
Level 7
zhengshijie Sep 5, 2020
4c7bfa5
A-JavaDoc
zhengshijie Sep 5, 2020
cdae526
Level-7
zhengshijie Sep 5, 2020
5b12378
branch-Level-7-JavaDoc
zhengshijie Sep 5, 2020
47f6123
add ignore list
zhengshijie Sep 5, 2020
530c111
A-MoreOOP
zhengshijie Sep 13, 2020
dc266fb
Level-8
zhengshijie Sep 13, 2020
b2fc8c0
Merge pull request #2 from ZhengShijieNUS/branch-Level-8
ZhengShijieNUS Sep 13, 2020
e07ae20
Level-9
zhengshijie Sep 13, 2020
537aeb5
Merge pull request #3 from ZhengShijieNUS/branch-Level-9
ZhengShijieNUS Sep 13, 2020
341a3a9
A-JUnit & fixed bug in Parse
zhengshijie Sep 14, 2020
ac1d2dd
Merge pull request #4 from ZhengShijieNUS/branch-A-JUnit
ZhengShijieNUS Sep 14, 2020
0c82d19
Set theme jekyll-theme-cayman
ZhengShijieNUS Sep 19, 2020
6da872e
Update README.md
ZhengShijieNUS Sep 19, 2020
9186836
Update README.md
ZhengShijieNUS Sep 19, 2020
937b887
add gradle support
zhengshijie Jan 16, 2021
eda7444
code style upgrade
zhengshijie Jan 16, 2021
2fe7eda
rename test folder
zhengshijie Jan 16, 2021
927c5ff
Update settings.gradle
zhengshijie Jan 16, 2021
5752f12
GUI 1st version
zhengshijie Jan 28, 2021
b42656b
GUI version 2
zhengshijie Jan 29, 2021
5b26f29
Update build.gradle
zhengshijie Jan 29, 2021
fbe695f
Debug
zhengshijie Jan 31, 2021
5c58d21
Create gradle.yml
zhengshijie Feb 3, 2021
57e58cc
Update Duke.java
zhengshijie Feb 3, 2021
94bd743
Update gradle.yml
zhengshijie Feb 3, 2021
de77639
Update gradle.yml
zhengshijie Feb 3, 2021
7263543
Update gradle.yml
zhengshijie Feb 3, 2021
862fddb
Update build.gradle
zhengshijie Feb 3, 2021
7eba478
Add extension tag
zhengshijie Feb 3, 2021
ff2cae7
Make gradlew executable
zhengshijie Feb 3, 2021
8c71981
Refactor tag file name
zhengshijie Feb 4, 2021
c7a7a4f
refactor file
zhengshijie Feb 4, 2021
1b3d506
Refactor Duke and Parser
zhengshijie Feb 11, 2021
0caf498
Update Parser.java
zhengshijie Feb 11, 2021
8c04a64
Refine tag function
zhengshijie Feb 14, 2021
eb89423
Rectify bugs
zhengshijie Feb 15, 2021
cfab458
Refine GUI
zhengshijie Feb 15, 2021
7223696
Resolve compatibility issue
zhengshijie Feb 15, 2021
6561357
rectify checkstyle issue
zhengshijie Feb 15, 2021
6420931
Update and rename README.md to User Guide.md
ZhengShijieNUS Feb 16, 2021
ee1602a
Update User Guide.md
ZhengShijieNUS Feb 16, 2021
3ca4056
Update User Guide.md
ZhengShijieNUS Feb 16, 2021
ecb6597
Create README.md
ZhengShijieNUS Feb 16, 2021
837eb02
Rename User Guide.md to UserGuide.md
ZhengShijieNUS Feb 16, 2021
c65ee00
Create DeveloperGuide.md
ZhengShijieNUS Feb 16, 2021
bffa3d5
Create Ui.png
zhengshijie Feb 17, 2021
876218a
Update DeveloperGuide.md
ZhengShijieNUS Feb 17, 2021
081024d
Update developer guide
zhengshijie Feb 25, 2021
9bea966
Update architectureDiagram.png
zhengshijie Feb 25, 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
13 changes: 7 additions & 6 deletions src/main/java/Duke.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public static void main(String[] args) {
ArrayList<Task> tasks = new ArrayList<>();

while (true) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's a condition to exit the program, would it be better to place the condition inside here? In terms of readability.
while(! isByeCommand).
Not saying is wrong, but it would beneficial to people reading the code.

String input = scanner.nextLine();
String[] cmd = input.split("\\s+");
String userInput = scanner.nextLine();
String[] cmd = userInput.split("\\s+");

if (cmd[0].equalsIgnoreCase("bye")) {
break;
Expand All @@ -39,7 +39,7 @@ public static void main(String[] args) {
break;
case "done":

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should align switch statement and Case statement as suggested by Java Coding Standard?

try {
int index = Integer.parseInt(input.split(" ")[1]);
int index = Integer.parseInt(userInput.split(" ")[1]);
tasks.get(index - 1).setDone(true);
System.out.println("Nice! I've marked this task as done: ");
System.out.println(tasks.get(index - 1).toString());
Expand All @@ -51,7 +51,7 @@ public static void main(String[] args) {
break;
case "todo":
try {
ToDos t = new ToDos(input.substring(5, input.length()));
ToDos t = new ToDos(userInput.substring(5, userInput.length()));
tasks.add(t);
printTask(t, tasks);
}catch(StringIndexOutOfBoundsException e){
Expand All @@ -60,7 +60,7 @@ public static void main(String[] args) {
break;
case "deadline":
try {
String[] deadlineContent = input.split(" /by ");
String[] deadlineContent = userInput.split(" /by ");
Deadlines d = new Deadlines(deadlineContent[0].substring(9, deadlineContent[0].length()), deadlineContent[1]);
tasks.add(d);
printTask(d, tasks);
Expand All @@ -72,7 +72,7 @@ public static void main(String[] args) {
break;
case "event":
try {
String[] eventContent = input.split(" /at ");
String[] eventContent = userInput.split(" /at ");
Events e = new Events(eventContent[0].substring(6, eventContent[0].length()), eventContent[1]);
tasks.add(e);
printTask(e, tasks);
Expand All @@ -94,6 +94,7 @@ public static void main(String[] args) {
}
System.out.println("________________________________________________________");
}

System.out.println(bye);
System.out.println("________________________________________________________");

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/Tasks/Deadlines.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public class Deadlines extends Task {

public Deadlines(String taskDescription, String deadline) {
super(taskDescription);
super.type = "[D]";
super.taskType = "[D]";
this.deadline = deadline;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/Tasks/Events.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public class Events extends Task {

public Events(String taskDescription, String eventTime) {
super(taskDescription);
super.type = "[E]";
super.taskType = "[E]";
this.eventTime = eventTime;
}

Expand Down
16 changes: 8 additions & 8 deletions src/main/java/Tasks/Task.java
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
package Tasks;

public abstract class Task {
protected String type;
protected boolean done = false;
protected String taskType;
protected boolean isDone = false;
protected String taskDescription;
protected String symbol = "[✗]";
protected String taskSymbol = "[✗]";

public Task(String taskDescription) {
this.taskDescription = taskDescription;
}

@Override
public String toString() {
return type + symbol + " " + taskDescription;
return taskType + taskSymbol + " " + taskDescription;
}

public void setDone(boolean done) {
this.done = done;
this.isDone = done;
setSymbol();
}

private void setSymbol() {
if (done) {
this.symbol = "[✓]";
if (isDone) {
this.taskSymbol = "[✓]";
} else {
this.symbol = "[✗]";
this.taskSymbol = "[✗]";
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/Tasks/ToDos.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public class ToDos extends Task {

public ToDos(String taskDescription) {
super(taskDescription);
super.type = "[T]";
super.taskType = "[T]";
}

}