-
Notifications
You must be signed in to change notification settings - Fork 19
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
ZhengShijieNUS
wants to merge
70
commits into
nus-tic4001-AY2021S1:master
Choose a base branch
from
ZhengShijieNUS:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
86f37fb
level 0
zhengshijie 0a9b12b
level 1
zhengshijie 44cdf22
level 2
zhengshijie e165765
level 2
zhengshijie 8f50f25
level 3
zhengshijie 2e3e9e8
level 4
zhengshijie d2651e9
A-TextUiTesting
zhengshijie e64bd1c
A-CodingStandard
zhengshijie e20bb7e
Level-5
zhengshijie efedd9e
A-CodeQuality
zhengshijie 643c33d
A-Packages
zhengshijie cc37392
branch-A-CodeQuality
zhengshijie 0d8d34f
testing
zhengshijie 1ab3a67
testing branch
zhengshijie 7f7dc47
testing branch
zhengshijie b661851
testing branch
zhengshijie 654cf9d
Merge branch 'testBranch'
zhengshijie fc7f81f
restore from testing branch
zhengshijie 885931a
Level 6
zhengshijie adc8a92
Merge pull request #1 from ZhengShijieNUS/branch-Level-6
ZhengShijieNUS c302af2
Level 7
zhengshijie 4c7bfa5
A-JavaDoc
zhengshijie cdae526
Level-7
zhengshijie 5b12378
branch-Level-7-JavaDoc
zhengshijie 47f6123
add ignore list
zhengshijie 530c111
A-MoreOOP
zhengshijie dc266fb
Level-8
zhengshijie b2fc8c0
Merge pull request #2 from ZhengShijieNUS/branch-Level-8
ZhengShijieNUS e07ae20
Level-9
zhengshijie 537aeb5
Merge pull request #3 from ZhengShijieNUS/branch-Level-9
ZhengShijieNUS 341a3a9
A-JUnit & fixed bug in Parse
zhengshijie ac1d2dd
Merge pull request #4 from ZhengShijieNUS/branch-A-JUnit
ZhengShijieNUS 0c82d19
Set theme jekyll-theme-cayman
ZhengShijieNUS 6da872e
Update README.md
ZhengShijieNUS 9186836
Update README.md
ZhengShijieNUS 937b887
add gradle support
zhengshijie eda7444
code style upgrade
zhengshijie 2fe7eda
rename test folder
zhengshijie 927c5ff
Update settings.gradle
zhengshijie 5752f12
GUI 1st version
zhengshijie b42656b
GUI version 2
zhengshijie 5b26f29
Update build.gradle
zhengshijie fbe695f
Debug
zhengshijie 5c58d21
Create gradle.yml
zhengshijie 57e58cc
Update Duke.java
zhengshijie 94bd743
Update gradle.yml
zhengshijie de77639
Update gradle.yml
zhengshijie 7263543
Update gradle.yml
zhengshijie 862fddb
Update build.gradle
zhengshijie 7eba478
Add extension tag
zhengshijie ff2cae7
Make gradlew executable
zhengshijie 8c71981
Refactor tag file name
zhengshijie c7a7a4f
refactor file
zhengshijie 1b3d506
Refactor Duke and Parser
zhengshijie 0caf498
Update Parser.java
zhengshijie 8c04a64
Refine tag function
zhengshijie eb89423
Rectify bugs
zhengshijie cfab458
Refine GUI
zhengshijie 7223696
Resolve compatibility issue
zhengshijie 6561357
rectify checkstyle issue
zhengshijie 6420931
Update and rename README.md to User Guide.md
ZhengShijieNUS ee1602a
Update User Guide.md
ZhengShijieNUS 3ca4056
Update User Guide.md
ZhengShijieNUS ecb6597
Create README.md
ZhengShijieNUS 837eb02
Rename User Guide.md to UserGuide.md
ZhengShijieNUS c65ee00
Create DeveloperGuide.md
ZhengShijieNUS bffa3d5
Create Ui.png
zhengshijie 876218a
Update DeveloperGuide.md
ZhengShijieNUS 081024d
Update developer guide
zhengshijie 9bea966
Update architectureDiagram.png
zhengshijie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,8 +20,8 @@ public static void main(String[] args) { | |
ArrayList<Task> tasks = new ArrayList<>(); | ||
|
||
while (true) { | ||
String input = scanner.nextLine(); | ||
String[] cmd = input.split("\\s+"); | ||
String userInput = scanner.nextLine(); | ||
String[] cmd = userInput.split("\\s+"); | ||
|
||
if (cmd[0].equalsIgnoreCase("bye")) { | ||
break; | ||
|
@@ -39,7 +39,7 @@ public static void main(String[] args) { | |
break; | ||
case "done": | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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()); | ||
|
@@ -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){ | ||
|
@@ -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); | ||
|
@@ -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); | ||
|
@@ -94,6 +94,7 @@ public static void main(String[] args) { | |
} | ||
System.out.println("________________________________________________________"); | ||
} | ||
|
||
System.out.println(bye); | ||
System.out.println("________________________________________________________"); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = "[✗]"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.