From 65f72a8d7407cfc1d4ded97e87a8cbbbe6d16d8b Mon Sep 17 00:00:00 2001 From: Jeffry Lum <22460123+j-lum@users.noreply.github.com> Date: Tue, 6 Aug 2019 15:24:53 +0800 Subject: [PATCH 01/36] Add support for Gradle workflow --- build.gradle | 16 +++ gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 55190 bytes gradle/wrapper/gradle-wrapper.properties | 5 + gradlew | 172 +++++++++++++++++++++++ gradlew.bat | 84 +++++++++++ settings.gradle | 1 + 6 files changed, 278 insertions(+) create mode 100644 build.gradle create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100644 gradlew create mode 100644 gradlew.bat create mode 100644 settings.gradle diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000000..e5b8ce7e49 --- /dev/null +++ b/build.gradle @@ -0,0 +1,16 @@ +plugins { + id 'java' + id 'application' +} + +group 'seedu.duke' +version '0.1.0' + +repositories { + mavenCentral() +} + +application { + // Change this to your main class. + mainClassName = "seedu.duke.Duke" +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..87b738cbd051603d91cc39de6cb000dd98fe6b02 GIT binary patch literal 55190 zcmafaW0WS*vSoFbZQHhO+s0S6%`V%vZQJa!ZQHKus_B{g-pt%P_q|ywBQt-*Stldc z$+IJ3?^KWm27v+sf`9-50uuadKtMnL*BJ;1^6ynvR7H?hQcjE>7)art9Bu0Pcm@7C z@c%WG|JzYkP)<@zR9S^iR_sA`azaL$mTnGKnwDyMa;8yL_0^>Ba^)phg0L5rOPTbm7g*YIRLg-2^{qe^`rb!2KqS zk~5wEJtTdD?)3+}=eby3x6%i)sb+m??NHC^u=tcG8p$TzB<;FL(WrZGV&cDQb?O0GMe6PBV=V z?tTO*5_HTW$xea!nkc~Cnx#cL_rrUGWPRa6l+A{aiMY=<0@8y5OC#UcGeE#I>nWh}`#M#kIn-$A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#1o#P3%3_jq>icD@<`tqU6ICEgZrME(xX#?i^Z z%Id$_uyQGlFD-CcaiRtRdGn|K`Lq5L-rx7`vYYGH7I=eLfHRozPiUtSe~Tt;IN2^gCXmf2#D~g2@9bhzK}3nphhG%d?V7+Zq{I2?Gt*!NSn_r~dd$ zqkUOg{U=MI?Ehx@`(X%rQB?LP=CjJ*V!rec{#0W2WshH$X#9zep!K)tzZoge*LYd5 z@g?-j5_mtMp>_WW`p*UNUZTFN{_+#m*bJzt{hvAdkF{W40{#L3w6gzPztnsA_4?&0 z(+>pv!zB16rR-(nm(^c>Z(its{ny677vT8sF564^mlZvJ!h65}OW%Hn|2OXbOQM%b z{6C54Z2v;^hyMQ;UH+HwFD2!F!VlQ}6Z{L0_9g5~CH0@Mqz?ZC`^QkhOU#$Lx<4`B zyZsa9uPF!rZDo8ZVfzzR#raQ>5|)k~_Ef*wDqG^76o)j!C4 zykvT*o$!-MBko@?{b~*Zf2*YMlImrK`cEp|#D7f%Twm<|C|dWD \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000000..6d57edc706 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000000..d1e92fe5db --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'duke' From 0112efe4f745ecd1985e5362f85e8ddc5facb02c Mon Sep 17 00:00:00 2001 From: Jeffry Lum <22460123+j-lum@users.noreply.github.com> Date: Mon, 12 Aug 2019 18:09:24 +0800 Subject: [PATCH 02/36] Add sample checkstyle configuration Add toolVersion block in to Gradle code sample to prevent errors. --- config/checkstyle/checkstyle.xml | 257 +++++++++++++++++++++++++++++++ tutorials/gradleTutorial.md | 7 +- 2 files changed, 263 insertions(+), 1 deletion(-) create mode 100644 config/checkstyle/checkstyle.xml diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml new file mode 100644 index 0000000000..b1a57ba6c0 --- /dev/null +++ b/config/checkstyle/checkstyle.xml @@ -0,0 +1,257 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tutorials/gradleTutorial.md b/tutorials/gradleTutorial.md index d16b72179a..fd6b043bf7 100644 --- a/tutorials/gradleTutorial.md +++ b/tutorials/gradleTutorial.md @@ -74,11 +74,16 @@ plugins { id 'application' id 'checkstyle' } + +checkstyle { + toolVersion = '8.23' +} + // ... ``` Checkstyle expects configuration files for checkstyle to be in `./config/checkstyle/` by convention. -For example, you can copy [these files from se-edu/addressbook-level3](https://github.com/se-edu/addressbook-level3/blob/master/config/checkstyle/) to your project. +A sample checkstyle rule configuration is provided in the branch. The plugin adds a few _tasks_ to your project. Run `gradlew checkstyleMain checkstyleTest` to verify that you have set up Checkstyle properly (the command will check your main code and test code against the style rules). From cfd6da79bab287c74d4b7f5666e61e686674fb29 Mon Sep 17 00:00:00 2001 From: Jeffry Lum <22460123+j-lum@users.noreply.github.com> Date: Sun, 18 Aug 2019 23:25:53 +0800 Subject: [PATCH 03/36] Change file mode on `gradle` to be executable --- gradlew | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 gradlew diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 From a3ca5a4e3fe35013f5690cacd168b19f7370a013 Mon Sep 17 00:00:00 2001 From: Jeffry Lum <22460123+j-lum@users.noreply.github.com> Date: Wed, 21 Aug 2019 00:32:40 +0800 Subject: [PATCH 04/36] Add configuration for console applications Gradle defaults to an empty stdin which results in runtime exceptions when attempting to read from `System.in`. Let's add some sensible defaults for students who may still need to work with the standard input stream. --- build.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.gradle b/build.gradle index e5b8ce7e49..ce97c7ba2e 100644 --- a/build.gradle +++ b/build.gradle @@ -14,3 +14,7 @@ application { // Change this to your main class. mainClassName = "seedu.duke.Duke" } + +run { + standardInput = System.in +} \ No newline at end of file From c4678f7d8b2274a013b5a9c920fcfd6981f2122a Mon Sep 17 00:00:00 2001 From: Jeffry Lum <22460123+j-lum@users.noreply.github.com> Date: Fri, 20 Sep 2019 16:05:59 +0800 Subject: [PATCH 05/36] JavaFX tutorial: Support cross-platform JARs The OpenJFX plugin expects applications to be modular and bundled with jlink, resulting in fat jars that are not cross-platform. Let's manually include the required dependencies so that shadow can package them properly. --- tutorials/javaFxTutorialPart1.md | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/tutorials/javaFxTutorialPart1.md b/tutorials/javaFxTutorialPart1.md index 2f63317346..48691f7fa1 100644 --- a/tutorials/javaFxTutorialPart1.md +++ b/tutorials/javaFxTutorialPart1.md @@ -27,18 +27,25 @@ A JavaFX application is like a play you are directing. Instead of creating props Update your `build.gradle` to include the following lines: ```groovy -plugins { - id 'java' - id 'org.openjfx.javafxplugin' version '0.0.7' -} - repositories { mavenCentral() } -javafx { - version = "11.0.2" - modules = [ 'javafx.controls', 'javafx.fxml' ] +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' } ``` From 88d53b05029a79b3a4b7cc621dd0203074940e41 Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Thu, 30 Jan 2020 17:03:17 +0800 Subject: [PATCH 06/36] Level-1 --- src/main/java/Duke.java | 11 +++++++++++ src/main/java/display.java | 22 ++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 src/main/java/display.java diff --git a/src/main/java/Duke.java b/src/main/java/Duke.java index 5d313334cc..c7e51520ac 100644 --- a/src/main/java/Duke.java +++ b/src/main/java/Duke.java @@ -1,3 +1,4 @@ +import java.util.Scanner; public class Duke { public static void main(String[] args) { String logo = " ____ _ \n" @@ -6,5 +7,15 @@ public static void main(String[] args) { + "| |_| | |_| | < __/\n" + "|____/ \\__,_|_|\\_\\___|\n"; System.out.println("Hello from\n" + logo); + display adisplay = new display(); + + String responde; + Scanner in = new Scanner(System.in); + do { + responde = in.nextLine(); + adisplay.reply(responde); + + }while(!responde.equals("bye")); + } } diff --git a/src/main/java/display.java b/src/main/java/display.java new file mode 100644 index 0000000000..95956fce13 --- /dev/null +++ b/src/main/java/display.java @@ -0,0 +1,22 @@ +public class display { + public display(){ + System. out. print(System. lineSeparator()); + System.out.println("\tHello! I'm Duke"); + System.out.println("\tWhat can I do for you?"); + } + + public static void reply(String line){ + if (line.equals("bye")){ + bye(); + } + else{ + System.out.println("\t" + line); + } + } + + public static void bye(){ + System.out.println("\tBye. Hope to see you again soon!"); + } + + +} From 507e0c504551cf76e48fd530c4cc98aa4446018d Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Thu, 30 Jan 2020 17:45:32 +0800 Subject: [PATCH 07/36] Add List --- src/main/java/Display.java | 32 ++++++++++++++++++++++++++++++++ src/main/java/Duke.java | 4 ++-- src/main/java/display.java | 22 ---------------------- 3 files changed, 34 insertions(+), 24 deletions(-) create mode 100644 src/main/java/Display.java delete mode 100644 src/main/java/display.java diff --git a/src/main/java/Display.java b/src/main/java/Display.java new file mode 100644 index 0000000000..298e76eb84 --- /dev/null +++ b/src/main/java/Display.java @@ -0,0 +1,32 @@ +public class Display { + private static String[] tasks = new String[100]; + private static int taskCount = 0; + public Display(){ + System. out. print(System. lineSeparator()); + System.out.println("\tHello! I'm Duke"); + System.out.println("\tWhat can I do for you?"); + System.out.println(); + } + + public void addList(String line){ + if (line.equals("bye")){ + System.out.println("\tBye. Hope to see you again soon!"); + } + else if (line.equals("list")){ + int currentCount = 0; + while(currentCount < taskCount){ + System.out.println("\t" + Integer.toString(currentCount+1) + ". " + tasks[currentCount]); + currentCount++; + } + System.out.println(); + } + else{ + tasks[taskCount] = line; + taskCount++; + System.out.println("\tadded: " + line); + System.out.println(); + } + } + + +} diff --git a/src/main/java/Duke.java b/src/main/java/Duke.java index c7e51520ac..82ab20d7e0 100644 --- a/src/main/java/Duke.java +++ b/src/main/java/Duke.java @@ -7,13 +7,13 @@ public static void main(String[] args) { + "| |_| | |_| | < __/\n" + "|____/ \\__,_|_|\\_\\___|\n"; System.out.println("Hello from\n" + logo); - display adisplay = new display(); + Display adisplay = new Display(); String responde; Scanner in = new Scanner(System.in); do { responde = in.nextLine(); - adisplay.reply(responde); + adisplay.addList(responde); }while(!responde.equals("bye")); diff --git a/src/main/java/display.java b/src/main/java/display.java deleted file mode 100644 index 95956fce13..0000000000 --- a/src/main/java/display.java +++ /dev/null @@ -1,22 +0,0 @@ -public class display { - public display(){ - System. out. print(System. lineSeparator()); - System.out.println("\tHello! I'm Duke"); - System.out.println("\tWhat can I do for you?"); - } - - public static void reply(String line){ - if (line.equals("bye")){ - bye(); - } - else{ - System.out.println("\t" + line); - } - } - - public static void bye(){ - System.out.println("\tBye. Hope to see you again soon!"); - } - - -} From a76509aed72a170c8b2249efd153a904ebbc8827 Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Thu, 30 Jan 2020 18:00:26 +0800 Subject: [PATCH 08/36] Delete useless class and add horizontal lines, remain in Level 2 --- src/main/java/Display.java | 32 ----------------------------- src/main/java/Duke.java | 42 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 34 deletions(-) delete mode 100644 src/main/java/Display.java diff --git a/src/main/java/Display.java b/src/main/java/Display.java deleted file mode 100644 index 298e76eb84..0000000000 --- a/src/main/java/Display.java +++ /dev/null @@ -1,32 +0,0 @@ -public class Display { - private static String[] tasks = new String[100]; - private static int taskCount = 0; - public Display(){ - System. out. print(System. lineSeparator()); - System.out.println("\tHello! I'm Duke"); - System.out.println("\tWhat can I do for you?"); - System.out.println(); - } - - public void addList(String line){ - if (line.equals("bye")){ - System.out.println("\tBye. Hope to see you again soon!"); - } - else if (line.equals("list")){ - int currentCount = 0; - while(currentCount < taskCount){ - System.out.println("\t" + Integer.toString(currentCount+1) + ". " + tasks[currentCount]); - currentCount++; - } - System.out.println(); - } - else{ - tasks[taskCount] = line; - taskCount++; - System.out.println("\tadded: " + line); - System.out.println(); - } - } - - -} diff --git a/src/main/java/Duke.java b/src/main/java/Duke.java index 82ab20d7e0..52aecdd87e 100644 --- a/src/main/java/Duke.java +++ b/src/main/java/Duke.java @@ -1,5 +1,7 @@ import java.util.Scanner; public class Duke { + private static String[] tasks = new String[100]; + private static int taskCount = 0; public static void main(String[] args) { String logo = " ____ _ \n" + "| _ \\ _ _| | _____ \n" @@ -7,15 +9,51 @@ public static void main(String[] args) { + "| |_| | |_| | < __/\n" + "|____/ \\__,_|_|\\_\\___|\n"; System.out.println("Hello from\n" + logo); - Display adisplay = new Display(); + greet(); String responde; Scanner in = new Scanner(System.in); do { responde = in.nextLine(); - adisplay.addList(responde); + addList(responde); }while(!responde.equals("bye")); } + + public static void greet(){ + printLine(); + System.out.println("\tHello! I'm Duke"); + System.out.println("\tWhat can I do for you?"); + printLine(); + System.out.println(); + } + + public static void addList(String line){ + printLine(); + if (line.equals("bye")){ + System.out.println("\tBye. Hope to see you again soon!"); + } + else if (line.equals("list")){ + int currentCount = 0; + while(currentCount < taskCount){ + System.out.println("\t" + Integer.toString(currentCount+1) + ". " + tasks[currentCount]); + currentCount++; + } + } + else{ + tasks[taskCount] = line; + taskCount++; + System.out.println("\tadded: " + line); + } + printLine(); + System.out.println(); + } + + public static void printLine(){ + System.out.println("____________________________________________________________"); + } + + } + From fe534da7eb59088abdf9029d1e675bc41356c307 Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Thu, 30 Jan 2020 18:48:12 +0800 Subject: [PATCH 09/36] Add the ability to mark tasks as done. --- src/main/java/Task.java | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 src/main/java/Task.java diff --git a/src/main/java/Task.java b/src/main/java/Task.java new file mode 100644 index 0000000000..041d86c1f3 --- /dev/null +++ b/src/main/java/Task.java @@ -0,0 +1,4 @@ +package PACKAGE_NAME; + +public class Task { +} From 9cb4fc3808101c6328341d2ac4b29757bb1a0514 Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Thu, 30 Jan 2020 21:18:21 +0800 Subject: [PATCH 10/36] Add the ability to mark tasks as done. --- src/main/java/Duke.java | 18 +++++++++++++----- src/main/java/Task.java | 21 +++++++++++++++++++-- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/main/java/Duke.java b/src/main/java/Duke.java index 52aecdd87e..6b121dbca5 100644 --- a/src/main/java/Duke.java +++ b/src/main/java/Duke.java @@ -1,6 +1,6 @@ import java.util.Scanner; public class Duke { - private static String[] tasks = new String[100]; + private static Task[] tasks = new Task[100]; private static int taskCount = 0; public static void main(String[] args) { String logo = " ____ _ \n" @@ -31,18 +31,26 @@ public static void greet(){ public static void addList(String line){ printLine(); - if (line.equals("bye")){ + if(line.equals("bye")){ System.out.println("\tBye. Hope to see you again soon!"); } - else if (line.equals("list")){ + else if(line.equals("list")) { + System.out.println("\tHere are the tasks in your list:"); int currentCount = 0; while(currentCount < taskCount){ - System.out.println("\t" + Integer.toString(currentCount+1) + ". " + tasks[currentCount]); + System.out.println("\t" + currentCount+1 + ".[" + + tasks[currentCount].getStatusIcon() + "] " + tasks[currentCount].getDescription()); currentCount++; } } + else if(line.startsWith("done")) { + int doneCount = Integer.parseInt(line.substring(5)) - 1; + tasks[doneCount].markAsDone(); + System.out.println("Nice! I've marked this task as done:"); + System.out.println(" [\u2713] " + tasks[doneCount].getDescription()); + } else{ - tasks[taskCount] = line; + tasks[taskCount] = new Task(line); taskCount++; System.out.println("\tadded: " + line); } diff --git a/src/main/java/Task.java b/src/main/java/Task.java index 041d86c1f3..e57e996a7e 100644 --- a/src/main/java/Task.java +++ b/src/main/java/Task.java @@ -1,4 +1,21 @@ -package PACKAGE_NAME; - public class Task { + protected String description; + protected boolean isDone; + + public Task(String description) { + this.description = description; + this.isDone = false; + } + + public String getStatusIcon() { + return (isDone ? "\u2713" : "\u2718"); //return tick or X symbols + } + + public String getDescription(){ + return description; + } + + public void markAsDone(){ + isDone = true; + } } From c8d841cf5ada29fa1d3adf1f41bc2230edd57c7d Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Mon, 3 Feb 2020 17:29:48 +0800 Subject: [PATCH 11/36] Debug an error of listing task and Refactoring --- src/main/java/Duke.java | 58 +++++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/src/main/java/Duke.java b/src/main/java/Duke.java index 6b121dbca5..4ed31237f6 100644 --- a/src/main/java/Duke.java +++ b/src/main/java/Duke.java @@ -11,13 +11,13 @@ public static void main(String[] args) { System.out.println("Hello from\n" + logo); greet(); - String responde; + String userResponde; Scanner in = new Scanner(System.in); do { - responde = in.nextLine(); - addList(responde); + userResponde = in.nextLine(); + dukeResponde(userResponde); - }while(!responde.equals("bye")); + }while(!userResponde.equals("bye")); } @@ -29,37 +29,49 @@ public static void greet(){ System.out.println(); } - public static void addList(String line){ + public static void dukeResponde(String userResponde){ printLine(); - if(line.equals("bye")){ + if(userResponde.equals("bye")){ System.out.println("\tBye. Hope to see you again soon!"); } - else if(line.equals("list")) { - System.out.println("\tHere are the tasks in your list:"); - int currentCount = 0; - while(currentCount < taskCount){ - System.out.println("\t" + currentCount+1 + ".[" - + tasks[currentCount].getStatusIcon() + "] " + tasks[currentCount].getDescription()); - currentCount++; - } + else if(userResponde.equals("list")) { + listTask(); } - else if(line.startsWith("done")) { - int doneCount = Integer.parseInt(line.substring(5)) - 1; - tasks[doneCount].markAsDone(); - System.out.println("Nice! I've marked this task as done:"); - System.out.println(" [\u2713] " + tasks[doneCount].getDescription()); + else if(userResponde.startsWith("done")) { + markAsDone(userResponde); } else{ - tasks[taskCount] = new Task(line); - taskCount++; - System.out.println("\tadded: " + line); + addNewTask(userResponde); } printLine(); System.out.println(); } public static void printLine(){ - System.out.println("____________________________________________________________"); + System.out.println("\t____________________________________________________________"); + } + + public static void listTask(){ + System.out.println("\tHere are the tasks in your list:"); + int currentCount = 0; + while(currentCount < taskCount) { + System.out.println("\t" + (currentCount + 1) + ".[" + + tasks[currentCount].getStatusIcon() + "] " + + tasks[currentCount].getDescription()); + currentCount++; + } + } + public static void markAsDone(String userResponde){ + int doneCount = Integer.parseInt(userResponde.substring(5)) - 1; + tasks[doneCount].markAsDone(); + System.out.println("\tNice! I've marked this task as done:"); + System.out.println("\t [\u2713] " + tasks[doneCount].getDescription()); + } + + public static void addNewTask(String userResponde){ + tasks[taskCount] = new Task(userResponde); + taskCount++; + System.out.println("\tadded: " + userResponde); } From 8dd00b316fa87d05f52cf832efb80961aaa43644 Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Mon, 3 Feb 2020 18:28:56 +0800 Subject: [PATCH 12/36] Add support for tracking three types of tasks --- src/main/java/Deadline.java | 14 ++++++++++++++ src/main/java/Duke.java | 28 ++++++++++++++++++++-------- src/main/java/Event.java | 14 ++++++++++++++ src/main/java/Task.java | 7 +++++++ src/main/java/Todo.java | 11 +++++++++++ 5 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 src/main/java/Deadline.java create mode 100644 src/main/java/Event.java create mode 100644 src/main/java/Todo.java diff --git a/src/main/java/Deadline.java b/src/main/java/Deadline.java new file mode 100644 index 0000000000..d12b14b9c5 --- /dev/null +++ b/src/main/java/Deadline.java @@ -0,0 +1,14 @@ +public class Deadline extends Task{ + + protected String by; + + public Deadline(String description,String by){ + super(description); + this.by = by; + } + + @Override + public String toString(){ + return "[D]" + super.toString() + " (by: " + by + ")"; + } +} diff --git a/src/main/java/Duke.java b/src/main/java/Duke.java index 4ed31237f6..eff70f440c 100644 --- a/src/main/java/Duke.java +++ b/src/main/java/Duke.java @@ -53,12 +53,8 @@ public static void printLine(){ public static void listTask(){ System.out.println("\tHere are the tasks in your list:"); - int currentCount = 0; - while(currentCount < taskCount) { - System.out.println("\t" + (currentCount + 1) + ".[" - + tasks[currentCount].getStatusIcon() + "] " - + tasks[currentCount].getDescription()); - currentCount++; + for(int i = 0; i < taskCount; i++) { + System.out.println("\t" + (i + 1) + "." + tasks[i]); } } public static void markAsDone(String userResponde){ @@ -69,9 +65,25 @@ public static void markAsDone(String userResponde){ } public static void addNewTask(String userResponde){ - tasks[taskCount] = new Task(userResponde); + if(userResponde.startsWith("todo")){ + tasks[taskCount] = new Todo(userResponde.substring(5)); + } + else if(userResponde.startsWith("deadline")){ + int dividerPosition = userResponde.indexOf(" /by"); + String taskName = userResponde.substring(9,dividerPosition); + String deadlineTime = userResponde.substring(dividerPosition + 5); + tasks[taskCount] = new Deadline(taskName,deadlineTime); + } + else if(userResponde.startsWith("event")){ + int dividerPosition = userResponde.indexOf(" /at"); + String taskName = userResponde.substring(6,dividerPosition); + String deadlineTime = userResponde.substring(dividerPosition + 5); + tasks[taskCount] = new Event(taskName,deadlineTime); + } + System.out.println("\tGot it. I've added this task:"); + System.out.println("\t " + tasks[taskCount]); + System.out.println("\tNow you have " + (taskCount+1) + " tasks in the list"); taskCount++; - System.out.println("\tadded: " + userResponde); } diff --git a/src/main/java/Event.java b/src/main/java/Event.java new file mode 100644 index 0000000000..9416b7991b --- /dev/null +++ b/src/main/java/Event.java @@ -0,0 +1,14 @@ +public class Event extends Task{ + + protected String at; + + public Event(String description,String at){ + super(description); + this.at = at; + } + + @Override + public String toString(){ + return "[E]" + super.toString() + " (at: " + at + ")"; + } +} diff --git a/src/main/java/Task.java b/src/main/java/Task.java index e57e996a7e..1f329b4f5f 100644 --- a/src/main/java/Task.java +++ b/src/main/java/Task.java @@ -2,6 +2,9 @@ public class Task { protected String description; protected boolean isDone; + public Task(){ + + } public Task(String description) { this.description = description; this.isDone = false; @@ -18,4 +21,8 @@ public String getDescription(){ public void markAsDone(){ isDone = true; } + + public String toString(){ + return "[" + getStatusIcon() + "] " + this.description; + } } diff --git a/src/main/java/Todo.java b/src/main/java/Todo.java new file mode 100644 index 0000000000..73028bda38 --- /dev/null +++ b/src/main/java/Todo.java @@ -0,0 +1,11 @@ +public class Todo extends Task { + + public Todo(String description){ + super(description); + } + + @Override + public String toString(){ + return "[T]" + super.toString() ; + } +} From 10b91e71ebc4f94d1ec75532da6c5872df696ce6 Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Mon, 3 Feb 2020 20:15:12 +0800 Subject: [PATCH 13/36] Improve code quality --- src/main/java/Duke.java | 10 ++++++++-- src/main/java/Task.java | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/Duke.java b/src/main/java/Duke.java index eff70f440c..b6e2de6ab3 100644 --- a/src/main/java/Duke.java +++ b/src/main/java/Duke.java @@ -1,7 +1,9 @@ import java.util.Scanner; public class Duke { + private static Task[] tasks = new Task[100]; private static int taskCount = 0; + public static void main(String[] args) { String logo = " ____ _ \n" + "| _ \\ _ _| | _____ \n" @@ -32,7 +34,7 @@ public static void greet(){ public static void dukeResponde(String userResponde){ printLine(); if(userResponde.equals("bye")){ - System.out.println("\tBye. Hope to see you again soon!"); + sayBye(); } else if(userResponde.equals("list")) { listTask(); @@ -51,12 +53,17 @@ public static void printLine(){ System.out.println("\t____________________________________________________________"); } + public static void sayBye(){ + System.out.println("\tBye. Hope to see you again soon!"); + } + public static void listTask(){ System.out.println("\tHere are the tasks in your list:"); for(int i = 0; i < taskCount; i++) { System.out.println("\t" + (i + 1) + "." + tasks[i]); } } + public static void markAsDone(String userResponde){ int doneCount = Integer.parseInt(userResponde.substring(5)) - 1; tasks[doneCount].markAsDone(); @@ -86,6 +93,5 @@ else if(userResponde.startsWith("event")){ taskCount++; } - } diff --git a/src/main/java/Task.java b/src/main/java/Task.java index 1f329b4f5f..90f34e0cdf 100644 --- a/src/main/java/Task.java +++ b/src/main/java/Task.java @@ -5,6 +5,7 @@ public class Task { public Task(){ } + public Task(String description) { this.description = description; this.isDone = false; From 41b2e871f67c1f8184c30c90192a3180ac560fd9 Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Mon, 10 Feb 2020 11:04:09 +0800 Subject: [PATCH 14/36] Add automated text UI testing --- text-ui-test/ACTUAL.TXT | 58 +++++++++++++++++++++++++++++++++++++++ text-ui-test/EXPECTED.txt | 58 +++++++++++++++++++++++++++++++++++++++ text-ui-test/input.txt | 8 ++++++ text-ui-test/runtest.bat | 21 ++++++++++++++ 4 files changed, 145 insertions(+) create mode 100644 text-ui-test/ACTUAL.TXT create mode 100644 text-ui-test/EXPECTED.txt create mode 100644 text-ui-test/input.txt create mode 100644 text-ui-test/runtest.bat diff --git a/text-ui-test/ACTUAL.TXT b/text-ui-test/ACTUAL.TXT new file mode 100644 index 0000000000..dbfabc41e4 --- /dev/null +++ b/text-ui-test/ACTUAL.TXT @@ -0,0 +1,58 @@ +Hello from + ____ _ +| _ \ _ _| | _____ +| | | | | | | |/ / _ \ +| |_| | |_| | < __/ +|____/ \__,_|_|\_\___| + + ____________________________________________________________ + Hello! I'm Duke + What can I do for you? + ____________________________________________________________ + + ____________________________________________________________ + Got it. I've added this task: + [T][?] eat + Now you have 1 tasks in the list + ____________________________________________________________ + + ____________________________________________________________ + Got it. I've added this task: + [T][?] sleep + Now you have 2 tasks in the list + ____________________________________________________________ + + ____________________________________________________________ + Got it. I've added this task: + [D][?] cs2113 (by: Tuesday) + Now you have 3 tasks in the list + ____________________________________________________________ + + ____________________________________________________________ + Got it. I've added this task: + [E][?] project meeting (at: Mon 2-4pm) + Now you have 4 tasks in the list + ____________________________________________________________ + + ____________________________________________________________ + Nice! I've marked this task as done: + [?] sleep + ____________________________________________________________ + + ____________________________________________________________ + Nice! I've marked this task as done: + [?] cs2113 + ____________________________________________________________ + + ____________________________________________________________ + Here are the tasks in your list: + 1.[T][?] eat + 2.[T][?] sleep + 3.[D][?] cs2113 (by: Tuesday) + 4.[E][?] project meeting (at: Mon 2-4pm) + ____________________________________________________________ + + ____________________________________________________________ + Bye. Hope to see you again soon! + ____________________________________________________________ + diff --git a/text-ui-test/EXPECTED.txt b/text-ui-test/EXPECTED.txt new file mode 100644 index 0000000000..dbfabc41e4 --- /dev/null +++ b/text-ui-test/EXPECTED.txt @@ -0,0 +1,58 @@ +Hello from + ____ _ +| _ \ _ _| | _____ +| | | | | | | |/ / _ \ +| |_| | |_| | < __/ +|____/ \__,_|_|\_\___| + + ____________________________________________________________ + Hello! I'm Duke + What can I do for you? + ____________________________________________________________ + + ____________________________________________________________ + Got it. I've added this task: + [T][?] eat + Now you have 1 tasks in the list + ____________________________________________________________ + + ____________________________________________________________ + Got it. I've added this task: + [T][?] sleep + Now you have 2 tasks in the list + ____________________________________________________________ + + ____________________________________________________________ + Got it. I've added this task: + [D][?] cs2113 (by: Tuesday) + Now you have 3 tasks in the list + ____________________________________________________________ + + ____________________________________________________________ + Got it. I've added this task: + [E][?] project meeting (at: Mon 2-4pm) + Now you have 4 tasks in the list + ____________________________________________________________ + + ____________________________________________________________ + Nice! I've marked this task as done: + [?] sleep + ____________________________________________________________ + + ____________________________________________________________ + Nice! I've marked this task as done: + [?] cs2113 + ____________________________________________________________ + + ____________________________________________________________ + Here are the tasks in your list: + 1.[T][?] eat + 2.[T][?] sleep + 3.[D][?] cs2113 (by: Tuesday) + 4.[E][?] project meeting (at: Mon 2-4pm) + ____________________________________________________________ + + ____________________________________________________________ + Bye. Hope to see you again soon! + ____________________________________________________________ + diff --git a/text-ui-test/input.txt b/text-ui-test/input.txt new file mode 100644 index 0000000000..1ce054842f --- /dev/null +++ b/text-ui-test/input.txt @@ -0,0 +1,8 @@ +todo eat +todo sleep +deadline cs2113 /by Tuesday +event project meeting /at Mon 2-4pm +done 2 +done 3 +list +bye \ No newline at end of file diff --git a/text-ui-test/runtest.bat b/text-ui-test/runtest.bat new file mode 100644 index 0000000000..4279957574 --- /dev/null +++ b/text-ui-test/runtest.bat @@ -0,0 +1,21 @@ +@ECHO OFF + +REM create bin directory if it doesn't exist +if not exist ..\bin mkdir ..\bin + +REM delete output from previous run +del ACTUAL.TXT + +REM compile the code into the bin folder +javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\*.java +IF ERRORLEVEL 1 ( + echo ********** BUILD FAILURE ********** + exit /b 1 +) +REM no error here, errorlevel == 0 + +REM run the program, feed commands from input.txt file and redirect the output to the ACTUAL.TXT +java -classpath ..\bin Duke < input.txt > ACTUAL.TXT + +REM compare the output to the expected output +FC ACTUAL.TXT EXPECTED.TXT From b5dffc29c53a8b0593e69c32a5b7bd43fdc23801 Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Mon, 10 Feb 2020 20:45:07 +0800 Subject: [PATCH 15/36] Handle two types of errors: meaningless input and empty task description --- src/main/java/Duke.java | 40 +++++++++++++++++++++----------- src/main/java/DukeException.java | 5 ++++ 2 files changed, 31 insertions(+), 14 deletions(-) create mode 100644 src/main/java/DukeException.java diff --git a/src/main/java/Duke.java b/src/main/java/Duke.java index b6e2de6ab3..f546d26c57 100644 --- a/src/main/java/Duke.java +++ b/src/main/java/Duke.java @@ -3,7 +3,7 @@ public class Duke { private static Task[] tasks = new Task[100]; private static int taskCount = 0; - + public static void main(String[] args) { String logo = " ____ _ \n" + "| _ \\ _ _| | _____ \n" @@ -35,15 +35,16 @@ public static void dukeResponde(String userResponde){ printLine(); if(userResponde.equals("bye")){ sayBye(); - } - else if(userResponde.equals("list")) { + } else if(userResponde.equals("list")) { listTask(); - } - else if(userResponde.startsWith("done")) { + } else if(userResponde.startsWith("done")) { markAsDone(userResponde); - } - else{ - addNewTask(userResponde); + } else{ + try{ + addNewTask(userResponde); + }catch(DukeException e){ + System.out.println("\t☹ OOPS!!! " + e.getMessage()); + } } printLine(); System.out.println(); @@ -71,21 +72,32 @@ public static void markAsDone(String userResponde){ System.out.println("\t [\u2713] " + tasks[doneCount].getDescription()); } - public static void addNewTask(String userResponde){ - if(userResponde.startsWith("todo")){ + public static void addNewTask(String userResponde) throws DukeException{ + String[] responses = userResponde.split(" "); + + if(responses[0].equals("todo")){ + if( responses.length < 2){ + throw new DukeException("The description of a todo cannot be empty."); + } tasks[taskCount] = new Todo(userResponde.substring(5)); - } - else if(userResponde.startsWith("deadline")){ + } else if(responses[0].equals("deadline")){ + if( responses.length < 2){ + throw new DukeException("The description of a deadline cannot be empty."); + } int dividerPosition = userResponde.indexOf(" /by"); String taskName = userResponde.substring(9,dividerPosition); String deadlineTime = userResponde.substring(dividerPosition + 5); tasks[taskCount] = new Deadline(taskName,deadlineTime); - } - else if(userResponde.startsWith("event")){ + } else if(responses[0].equals("event")){ + if( responses.length < 2){ + throw new DukeException("The description of a event cannot be empty."); + } int dividerPosition = userResponde.indexOf(" /at"); String taskName = userResponde.substring(6,dividerPosition); String deadlineTime = userResponde.substring(dividerPosition + 5); tasks[taskCount] = new Event(taskName,deadlineTime); + } else{ + throw new DukeException("I'm sorry, but I don't know what that means :-("); } System.out.println("\tGot it. I've added this task:"); System.out.println("\t " + tasks[taskCount]); diff --git a/src/main/java/DukeException.java b/src/main/java/DukeException.java new file mode 100644 index 0000000000..effa7f15ba --- /dev/null +++ b/src/main/java/DukeException.java @@ -0,0 +1,5 @@ +public class DukeException extends Exception { + public DukeException(String s){ + super(s); + } +} From 49c4e443b62c170c7f3be9f5f4c70f0d64887abe Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Mon, 10 Feb 2020 20:48:12 +0800 Subject: [PATCH 16/36] Handle errors of list, done and wrong format of deadline and event --- src/main/java/Duke.java | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/main/java/Duke.java b/src/main/java/Duke.java index f546d26c57..95fda23102 100644 --- a/src/main/java/Duke.java +++ b/src/main/java/Duke.java @@ -36,9 +36,21 @@ public static void dukeResponde(String userResponde){ if(userResponde.equals("bye")){ sayBye(); } else if(userResponde.equals("list")) { - listTask(); + try{ + listTask(); + }catch( DukeException e){ + System.out.println("\t☹ OOPS!!! " + e.getMessage()); + } } else if(userResponde.startsWith("done")) { - markAsDone(userResponde); + try { + markAsDone(userResponde); + }catch(NumberFormatException e){ + System.out.println("\t☹ OOPS!!! Please enter the task number."); + }catch(NullPointerException e){ + System.out.println("\t☹ OOPS!!! Please first input the task then mark done."); + }catch(StringIndexOutOfBoundsException e){ + System.out.println("\t☹ OOPS!!! Please enter the task number."); + } } else{ try{ addNewTask(userResponde); @@ -58,7 +70,10 @@ public static void sayBye(){ System.out.println("\tBye. Hope to see you again soon!"); } - public static void listTask(){ + public static void listTask() throws DukeException{ + if( taskCount == 0){ + throw new DukeException("No tasks!!!"); + } System.out.println("\tHere are the tasks in your list:"); for(int i = 0; i < taskCount; i++) { System.out.println("\t" + (i + 1) + "." + tasks[i]); @@ -85,6 +100,9 @@ public static void addNewTask(String userResponde) throws DukeException{ throw new DukeException("The description of a deadline cannot be empty."); } int dividerPosition = userResponde.indexOf(" /by"); + if (dividerPosition == -1){ + throw new DukeException("Please follow the format: deadline thingsToDo /by time"); + } String taskName = userResponde.substring(9,dividerPosition); String deadlineTime = userResponde.substring(dividerPosition + 5); tasks[taskCount] = new Deadline(taskName,deadlineTime); @@ -93,6 +111,9 @@ public static void addNewTask(String userResponde) throws DukeException{ throw new DukeException("The description of a event cannot be empty."); } int dividerPosition = userResponde.indexOf(" /at"); + if (dividerPosition == -1){ + throw new DukeException("Please follow the format: event thingsToDo /at time"); + } String taskName = userResponde.substring(6,dividerPosition); String deadlineTime = userResponde.substring(dividerPosition + 5); tasks[taskCount] = new Event(taskName,deadlineTime); From 21746f926bcb29ed60903e862c1183191bfad973 Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Mon, 10 Feb 2020 21:02:49 +0800 Subject: [PATCH 17/36] Add packages: duke and duke.task; Update ui-test --- README.md | 4 +- src/main/java/{ => duke}/Duke.java | 267 ++++++++++---------- src/main/java/{ => duke}/DukeException.java | 2 + src/main/java/{ => duke/task}/Deadline.java | 6 +- src/main/java/{ => duke/task}/Event.java | 2 + src/main/java/{ => duke/task}/Task.java | 2 + src/main/java/{ => duke/task}/Todo.java | 2 + text-ui-test/ACTUAL.TXT | 22 +- text-ui-test/EXPECTED.txt | 22 +- text-ui-test/input.txt | 5 + text-ui-test/runtest.bat | 4 +- tutorials/gradleTutorial.md | 6 +- tutorials/javaFxTutorialPart1.md | 6 +- tutorials/javaFxTutorialPart2.md | 16 +- tutorials/javaFxTutorialPart3.md | 14 +- tutorials/javaFxTutorialPart4.md | 12 +- tutorials/textUiTestingTutorial.md | 8 +- 17 files changed, 232 insertions(+), 168 deletions(-) rename src/main/java/{ => duke}/Duke.java (86%) rename src/main/java/{ => duke}/DukeException.java (83%) rename src/main/java/{ => duke/task}/Deadline.java (71%) rename src/main/java/{ => duke/task}/Event.java (88%) rename src/main/java/{ => duke/task}/Task.java (91%) rename src/main/java/{ => duke/task}/Todo.java (85%) diff --git a/README.md b/README.md index 84755485a7..5dc79b47cb 100644 --- a/README.md +++ b/README.md @@ -22,11 +22,11 @@ # Tutorials -Duke Increment | Tutorial +duke.Duke Increment | Tutorial ---------------|--------------- `A-Gradle` | [Gradle Tutorial](tutorials/gradleTutorial.md) `A-TextUiTesting` | [Text UI Testing Tutorial](tutorials/textUiTestingTutorial.md) -`Level-10` | JavaFX tutorials:
→ [Part 1: Introduction to JavaFX][fx1]
→ [Part 2: Creating a GUI for Duke][fx2]
→ [Part 3: Interacting with the user][fx3]
→ [Part 4: Introduction to FXML][fx4] +`Level-10` | JavaFX tutorials:
→ [Part 1: Introduction to JavaFX][fx1]
→ [Part 2: Creating a GUI for duke.Duke][fx2]
→ [Part 3: Interacting with the user][fx3]
→ [Part 4: Introduction to FXML][fx4] [fx1]: [fx2]: diff --git a/src/main/java/Duke.java b/src/main/java/duke/Duke.java similarity index 86% rename from src/main/java/Duke.java rename to src/main/java/duke/Duke.java index 95fda23102..8f40b80cbd 100644 --- a/src/main/java/Duke.java +++ b/src/main/java/duke/Duke.java @@ -1,130 +1,137 @@ -import java.util.Scanner; -public class Duke { - - private static Task[] tasks = new Task[100]; - private static int taskCount = 0; - - public static void main(String[] args) { - String logo = " ____ _ \n" - + "| _ \\ _ _| | _____ \n" - + "| | | | | | | |/ / _ \\\n" - + "| |_| | |_| | < __/\n" - + "|____/ \\__,_|_|\\_\\___|\n"; - System.out.println("Hello from\n" + logo); - greet(); - - String userResponde; - Scanner in = new Scanner(System.in); - do { - userResponde = in.nextLine(); - dukeResponde(userResponde); - - }while(!userResponde.equals("bye")); - - } - - public static void greet(){ - printLine(); - System.out.println("\tHello! I'm Duke"); - System.out.println("\tWhat can I do for you?"); - printLine(); - System.out.println(); - } - - public static void dukeResponde(String userResponde){ - printLine(); - if(userResponde.equals("bye")){ - sayBye(); - } else if(userResponde.equals("list")) { - try{ - listTask(); - }catch( DukeException e){ - System.out.println("\t☹ OOPS!!! " + e.getMessage()); - } - } else if(userResponde.startsWith("done")) { - try { - markAsDone(userResponde); - }catch(NumberFormatException e){ - System.out.println("\t☹ OOPS!!! Please enter the task number."); - }catch(NullPointerException e){ - System.out.println("\t☹ OOPS!!! Please first input the task then mark done."); - }catch(StringIndexOutOfBoundsException e){ - System.out.println("\t☹ OOPS!!! Please enter the task number."); - } - } else{ - try{ - addNewTask(userResponde); - }catch(DukeException e){ - System.out.println("\t☹ OOPS!!! " + e.getMessage()); - } - } - printLine(); - System.out.println(); - } - - public static void printLine(){ - System.out.println("\t____________________________________________________________"); - } - - public static void sayBye(){ - System.out.println("\tBye. Hope to see you again soon!"); - } - - public static void listTask() throws DukeException{ - if( taskCount == 0){ - throw new DukeException("No tasks!!!"); - } - System.out.println("\tHere are the tasks in your list:"); - for(int i = 0; i < taskCount; i++) { - System.out.println("\t" + (i + 1) + "." + tasks[i]); - } - } - - public static void markAsDone(String userResponde){ - int doneCount = Integer.parseInt(userResponde.substring(5)) - 1; - tasks[doneCount].markAsDone(); - System.out.println("\tNice! I've marked this task as done:"); - System.out.println("\t [\u2713] " + tasks[doneCount].getDescription()); - } - - public static void addNewTask(String userResponde) throws DukeException{ - String[] responses = userResponde.split(" "); - - if(responses[0].equals("todo")){ - if( responses.length < 2){ - throw new DukeException("The description of a todo cannot be empty."); - } - tasks[taskCount] = new Todo(userResponde.substring(5)); - } else if(responses[0].equals("deadline")){ - if( responses.length < 2){ - throw new DukeException("The description of a deadline cannot be empty."); - } - int dividerPosition = userResponde.indexOf(" /by"); - if (dividerPosition == -1){ - throw new DukeException("Please follow the format: deadline thingsToDo /by time"); - } - String taskName = userResponde.substring(9,dividerPosition); - String deadlineTime = userResponde.substring(dividerPosition + 5); - tasks[taskCount] = new Deadline(taskName,deadlineTime); - } else if(responses[0].equals("event")){ - if( responses.length < 2){ - throw new DukeException("The description of a event cannot be empty."); - } - int dividerPosition = userResponde.indexOf(" /at"); - if (dividerPosition == -1){ - throw new DukeException("Please follow the format: event thingsToDo /at time"); - } - String taskName = userResponde.substring(6,dividerPosition); - String deadlineTime = userResponde.substring(dividerPosition + 5); - tasks[taskCount] = new Event(taskName,deadlineTime); - } else{ - throw new DukeException("I'm sorry, but I don't know what that means :-("); - } - System.out.println("\tGot it. I've added this task:"); - System.out.println("\t " + tasks[taskCount]); - System.out.println("\tNow you have " + (taskCount+1) + " tasks in the list"); - taskCount++; - } - -} - +package duke; + +import duke.task.Deadline; +import duke.task.Event; +import duke.task.Task; +import duke.task.Todo; + +import java.util.Scanner; +public class Duke { + + private static Task[] tasks = new Task[100]; + private static int taskCount = 0; + + public static void main(String[] args) { + String logo = " ____ _ \n" + + "| _ \\ _ _| | _____ \n" + + "| | | | | | | |/ / _ \\\n" + + "| |_| | |_| | < __/\n" + + "|____/ \\__,_|_|\\_\\___|\n"; + System.out.println("Hello from\n" + logo); + greet(); + + String userResponde; + Scanner in = new Scanner(System.in); + do { + userResponde = in.nextLine(); + dukeResponde(userResponde); + + }while(!userResponde.equals("bye")); + + } + + public static void greet(){ + printLine(); + System.out.println("\tHello! I'm duke.Duke"); + System.out.println("\tWhat can I do for you?"); + printLine(); + System.out.println(); + } + + public static void dukeResponde(String userResponde){ + printLine(); + if(userResponde.equals("bye")){ + sayBye(); + } else if(userResponde.equals("list")) { + try{ + listTask(); + }catch( DukeException e){ + System.out.println("\t:(OOPS!!! " + e.getMessage()); + } + } else if(userResponde.startsWith("done")) { + try { + markAsDone(userResponde); + }catch(NumberFormatException e){ + System.out.println("\t:(OOPS!!! Please enter the task number."); + }catch(NullPointerException e){ + System.out.println("\t:(OOPS!!! Please first input the task then mark done."); + }catch(StringIndexOutOfBoundsException e){ + System.out.println("\t:(OOPS!!! Please enter the task number."); + } + } else{ + try{ + addNewTask(userResponde); + }catch(DukeException e){ + System.out.println("\t:(OOPS!!! " + e.getMessage()); + } + } + printLine(); + System.out.println(); + } + + public static void printLine(){ + System.out.println("\t____________________________________________________________"); + } + + public static void sayBye(){ + System.out.println("\tBye. Hope to see you again soon!"); + } + + public static void listTask() throws DukeException{ + if( taskCount == 0){ + throw new DukeException("No tasks!!!"); + } + System.out.println("\tHere are the tasks in your list:"); + for(int i = 0; i < taskCount; i++) { + System.out.println("\t" + (i + 1) + "." + tasks[i]); + } + } + + public static void markAsDone(String userResponde){ + int doneCount = Integer.parseInt(userResponde.substring(5)) - 1; + tasks[doneCount].markAsDone(); + System.out.println("\tNice! I've marked this task as done:"); + System.out.println("\t [\u2713] " + tasks[doneCount].getDescription()); + } + + public static void addNewTask(String userResponde) throws DukeException{ + String[] responses = userResponde.split(" "); + + if(responses[0].equals("todo")){ + if( responses.length < 2){ + throw new DukeException("The description of a todo cannot be empty."); + } + tasks[taskCount] = new Todo(userResponde.substring(5)); + } else if(responses[0].equals("deadline")){ + if( responses.length < 2){ + throw new DukeException("The description of a deadline cannot be empty."); + } + int dividerPosition = userResponde.indexOf(" /by"); + if (dividerPosition == -1){ + throw new DukeException("Please follow the format: deadline thingsToDo /by time"); + } + String taskName = userResponde.substring(9,dividerPosition); + String deadlineTime = userResponde.substring(dividerPosition + 5); + tasks[taskCount] = new Deadline(taskName,deadlineTime); + } else if(responses[0].equals("event")){ + if( responses.length < 2){ + throw new DukeException("The description of a event cannot be empty."); + } + int dividerPosition = userResponde.indexOf(" /at"); + if (dividerPosition == -1){ + throw new DukeException("Please follow the format: event thingsToDo /at time"); + } + String taskName = userResponde.substring(6,dividerPosition); + String deadlineTime = userResponde.substring(dividerPosition + 5); + tasks[taskCount] = new Event(taskName,deadlineTime); + } else{ + throw new DukeException("I'm sorry, but I don't know what that means :-("); + } + System.out.println("\tGot it. I've added this task:"); + System.out.println("\t " + tasks[taskCount]); + System.out.println("\tNow you have " + (taskCount+1) + " tasks in the list"); + taskCount++; + } + +} + diff --git a/src/main/java/DukeException.java b/src/main/java/duke/DukeException.java similarity index 83% rename from src/main/java/DukeException.java rename to src/main/java/duke/DukeException.java index effa7f15ba..0dde1db47a 100644 --- a/src/main/java/DukeException.java +++ b/src/main/java/duke/DukeException.java @@ -1,3 +1,5 @@ +package duke; + public class DukeException extends Exception { public DukeException(String s){ super(s); diff --git a/src/main/java/Deadline.java b/src/main/java/duke/task/Deadline.java similarity index 71% rename from src/main/java/Deadline.java rename to src/main/java/duke/task/Deadline.java index d12b14b9c5..3d72856557 100644 --- a/src/main/java/Deadline.java +++ b/src/main/java/duke/task/Deadline.java @@ -1,4 +1,8 @@ -public class Deadline extends Task{ +package duke.task; + +import duke.task.Task; + +public class Deadline extends Task { protected String by; diff --git a/src/main/java/Event.java b/src/main/java/duke/task/Event.java similarity index 88% rename from src/main/java/Event.java rename to src/main/java/duke/task/Event.java index 9416b7991b..62161d0210 100644 --- a/src/main/java/Event.java +++ b/src/main/java/duke/task/Event.java @@ -1,3 +1,5 @@ +package duke.task; + public class Event extends Task{ protected String at; diff --git a/src/main/java/Task.java b/src/main/java/duke/task/Task.java similarity index 91% rename from src/main/java/Task.java rename to src/main/java/duke/task/Task.java index 90f34e0cdf..bbb9fcf50a 100644 --- a/src/main/java/Task.java +++ b/src/main/java/duke/task/Task.java @@ -1,3 +1,5 @@ +package duke.task; + public class Task { protected String description; protected boolean isDone; diff --git a/src/main/java/Todo.java b/src/main/java/duke/task/Todo.java similarity index 85% rename from src/main/java/Todo.java rename to src/main/java/duke/task/Todo.java index 73028bda38..fb0218b848 100644 --- a/src/main/java/Todo.java +++ b/src/main/java/duke/task/Todo.java @@ -1,3 +1,5 @@ +package duke.task; + public class Todo extends Task { public Todo(String description){ diff --git a/text-ui-test/ACTUAL.TXT b/text-ui-test/ACTUAL.TXT index dbfabc41e4..7bf9a3a667 100644 --- a/text-ui-test/ACTUAL.TXT +++ b/text-ui-test/ACTUAL.TXT @@ -6,10 +6,18 @@ Hello from |____/ \__,_|_|\_\___| ____________________________________________________________ - Hello! I'm Duke + Hello! I'm duke.Duke What can I do for you? ____________________________________________________________ + ____________________________________________________________ + :(OOPS!!! Please enter the task number. + ____________________________________________________________ + + ____________________________________________________________ + :(OOPS!!! No tasks!!! + ____________________________________________________________ + ____________________________________________________________ Got it. I've added this task: [T][?] eat @@ -22,6 +30,14 @@ Hello from Now you have 2 tasks in the list ____________________________________________________________ + ____________________________________________________________ + :(OOPS!!! The description of a todo cannot be empty. + ____________________________________________________________ + + ____________________________________________________________ + :(OOPS!!! I'm sorry, but I don't know what that means :-( + ____________________________________________________________ + ____________________________________________________________ Got it. I've added this task: [D][?] cs2113 (by: Tuesday) @@ -34,6 +50,10 @@ Hello from Now you have 4 tasks in the list ____________________________________________________________ + ____________________________________________________________ + :(OOPS!!! The description of a event cannot be empty. + ____________________________________________________________ + ____________________________________________________________ Nice! I've marked this task as done: [?] sleep diff --git a/text-ui-test/EXPECTED.txt b/text-ui-test/EXPECTED.txt index dbfabc41e4..7bf9a3a667 100644 --- a/text-ui-test/EXPECTED.txt +++ b/text-ui-test/EXPECTED.txt @@ -6,10 +6,18 @@ Hello from |____/ \__,_|_|\_\___| ____________________________________________________________ - Hello! I'm Duke + Hello! I'm duke.Duke What can I do for you? ____________________________________________________________ + ____________________________________________________________ + :(OOPS!!! Please enter the task number. + ____________________________________________________________ + + ____________________________________________________________ + :(OOPS!!! No tasks!!! + ____________________________________________________________ + ____________________________________________________________ Got it. I've added this task: [T][?] eat @@ -22,6 +30,14 @@ Hello from Now you have 2 tasks in the list ____________________________________________________________ + ____________________________________________________________ + :(OOPS!!! The description of a todo cannot be empty. + ____________________________________________________________ + + ____________________________________________________________ + :(OOPS!!! I'm sorry, but I don't know what that means :-( + ____________________________________________________________ + ____________________________________________________________ Got it. I've added this task: [D][?] cs2113 (by: Tuesday) @@ -34,6 +50,10 @@ Hello from Now you have 4 tasks in the list ____________________________________________________________ + ____________________________________________________________ + :(OOPS!!! The description of a event cannot be empty. + ____________________________________________________________ + ____________________________________________________________ Nice! I've marked this task as done: [?] sleep diff --git a/text-ui-test/input.txt b/text-ui-test/input.txt index 1ce054842f..42fe02bdb4 100644 --- a/text-ui-test/input.txt +++ b/text-ui-test/input.txt @@ -1,7 +1,12 @@ +done +list todo eat todo sleep +todo +heyhey deadline cs2113 /by Tuesday event project meeting /at Mon 2-4pm +event done 2 done 3 list diff --git a/text-ui-test/runtest.bat b/text-ui-test/runtest.bat index 4279957574..0832f65fc6 100644 --- a/text-ui-test/runtest.bat +++ b/text-ui-test/runtest.bat @@ -7,7 +7,7 @@ REM delete output from previous run del ACTUAL.TXT REM compile the code into the bin folder -javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\*.java +javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\duke\*.java ..\src\main\java\duke\task\*.java IF ERRORLEVEL 1 ( echo ********** BUILD FAILURE ********** exit /b 1 @@ -15,7 +15,7 @@ IF ERRORLEVEL 1 ( REM no error here, errorlevel == 0 REM run the program, feed commands from input.txt file and redirect the output to the ACTUAL.TXT -java -classpath ..\bin Duke < input.txt > ACTUAL.TXT +java -classpath ..\bin duke.Duke < input.txt > ACTUAL.TXT REM compare the output to the expected output FC ACTUAL.TXT EXPECTED.TXT diff --git a/tutorials/gradleTutorial.md b/tutorials/gradleTutorial.md index 08292b118d..2d60727f2b 100644 --- a/tutorials/gradleTutorial.md +++ b/tutorials/gradleTutorial.md @@ -30,10 +30,10 @@ As a developer, you write a _build file_ that describes the project. A build fil git checkout master git merge gradle ``` -1. Open the `build.gradle` file in an editor. Update the following code block to point to the main class (i.e., the one containing the `main` method) of your application. The code below assumes your main class is `seedu.duke.Duke` +1. Open the `build.gradle` file in an editor. Update the following code block to point to the main class (i.e., the one containing the `main` method) of your application. The code below assumes your main class is `seedu.duke.duke.Duke` ```groovy application { - mainClassName = "seedu.duke.Duke" + mainClassName = "seedu.duke.duke.Duke" } ``` 1. To check if Gradle has been added to the project correctly, open a terminal window, navigate to the root directory of your project and run the command `gradlew run`. This should result in Gradle running the main method of your project. @@ -146,7 +146,7 @@ By convention, java tests belong in `src/test/java` folder. Create a new `test/j src ├─main │ └─java -│ └─seedu/duke/Duke.java +│ └─seedu/duke/duke.Duke.java └─test └─java └─seedu/duke/DukeTest.java diff --git a/tutorials/javaFxTutorialPart1.md b/tutorials/javaFxTutorialPart1.md index 561daeca43..ee9db15e82 100644 --- a/tutorials/javaFxTutorialPart1.md +++ b/tutorials/javaFxTutorialPart1.md @@ -44,7 +44,7 @@ javafx { ## Writing your first program -As customary, let’s start off with a simple “Hello World” program. Modify your `Duke` class to extend `javafx.application.Application`. This requires you to override the `Application#start()` method and provide a concrete implementation. Notice that the method signature for `Application#start()` has a parameter `Stage`. This is the _primary stage_ that JavaFX provides. +As customary, let’s start off with a simple “Hello World” program. Modify your `duke.Duke` class to extend `javafx.application.Application`. This requires you to override the `Application#start()` method and provide a concrete implementation. Notice that the method signature for `Application#start()` has a parameter `Stage`. This is the _primary stage_ that JavaFX provides. ```java import javafx.application.Application; @@ -52,7 +52,7 @@ import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.stage.Stage; -public class Duke extends Application { +public class duke.Duke extends Application { // ... @@ -73,7 +73,7 @@ Next, we create another Java class, `Launcher`, as an entry point to our applica The `Launcher` class is reproduced below in its entirety. ```java -import javafx.application.Application; +import duke.Duke;import javafx.application.Application; /** * A launcher class to workaround classpath issues. diff --git a/tutorials/javaFxTutorialPart2.md b/tutorials/javaFxTutorialPart2.md index f24a0cd6ad..ade0b458cd 100644 --- a/tutorials/javaFxTutorialPart2.md +++ b/tutorials/javaFxTutorialPart2.md @@ -1,8 +1,8 @@ -# JavaFX Tutorial Part 2 - Creating a GUI for Duke +# JavaFX Tutorial Part 2 - Creating a GUI for duke.Duke -In this tutorial, we will be creating a GUI for Duke from scratch based on the following mockup. +In this tutorial, we will be creating a GUI for duke.Duke from scratch based on the following mockup. -![Mockup for Duke](assets/DukeMockup.png) +![Mockup for duke.Duke](assets/DukeMockup.png) ## JavaFX controls @@ -34,7 +34,7 @@ But how do we get the exact layout we want in the UI? JavaFX provides that funct One way to obtain the layout in the mockup is as follows. -![Duke's layout](assets/DukeSceneGraph.png) +![duke.Duke's layout](assets/DukeSceneGraph.png) To get that layout, we create a new `AnchorPane` and add our controls to it. Similarly, we create a new `VBox` to hold the contents of the `ScrollPane`. The code should look something like this: @@ -49,7 +49,7 @@ import javafx.scene.layout.VBox; import javafx.stage.Stage; -public class Duke extends Application { +public class duke.Duke extends Application { private ScrollPane scrollPane; private VBox dialogContainer; @@ -88,7 +88,7 @@ public class Duke extends Application { Run the application and you should see something like this: -![Duke's raw layout](assets/RawLayout.png) +![duke.Duke's raw layout](assets/RawLayout.png) That is not what we were expecting, what did we forget to do? @@ -106,7 +106,7 @@ Add the following code to the bottom of the `start` method. You'll have to add ` //... //Step 2. Formatting the window to look as expected - stage.setTitle("Duke"); + stage.setTitle("duke.Duke"); stage.setResizable(false); stage.setMinHeight(600.0); stage.setMinWidth(400.0); @@ -141,7 +141,7 @@ Add the following code to the bottom of the `start` method. You'll have to add ` Run the application again. It should now look like this: -![Duke's Final layout](assets/FinalLayout.png) +![duke.Duke's Final layout](assets/FinalLayout.png) ## Exercises diff --git a/tutorials/javaFxTutorialPart3.md b/tutorials/javaFxTutorialPart3.md index a9e1bdddd3..813079f3fa 100644 --- a/tutorials/javaFxTutorialPart3.md +++ b/tutorials/javaFxTutorialPart3.md @@ -8,7 +8,7 @@ Rather than to do everything in one try, let’s iterate and build up towards ou JavaFX has an _event-driven architecture style_. As such, we programmatically define _handler_ methods to execute as a response to certain _events_. When an event is detected, JavaFX will call the respective handlers. -For Duke, there are two events that we want to respond to, namely the user pressing `Enter` in the `TextField` and left-clicking the `Button`. These are the `onAction` event for the `TextField` and the `onMouseClicked` event for the `Button`. +For duke.Duke, there are two events that we want to respond to, namely the user pressing `Enter` in the `TextField` and left-clicking the `Button`. These are the `onAction` event for the `TextField` and the `onMouseClicked` event for the `Button`. For now, let’s have the application add a new `Label` with the text from the `TextField`. Update the `Main` class as follows. You'll need to add an `import javafx.scene.control.Label;` too. ```java @@ -103,7 +103,7 @@ import javafx.scene.image.ImageView; ``` Next, add two images to the `main/resources/images` folder. -For this tutorial, we have two images `DaUser.png` and `DaDuke.png` to represent the user avatar and Duke's avatar respectively but you can use any image you want. +For this tutorial, we have two images `DaUser.png` and `DaDuke.png` to represent the user avatar and duke.Duke's avatar respectively but you can use any image you want. Image|Filename ---|--- @@ -112,7 +112,7 @@ Image|Filename ```java -public class Duke extends Application { +public class duke.Duke extends Application { // ... private Image user = new Image(this.getClass().getResourceAsStream("/images/DaUser.png")); private Image duke = new Image(this.getClass().getResourceAsStream("/images/DaDuke.png")); @@ -124,7 +124,7 @@ Add a new method to handle user input: ```java /** * Iteration 2: - * Creates two dialog boxes, one echoing user input and the other containing Duke's reply and then appends them to + * Creates two dialog boxes, one echoing user input and the other containing duke.Duke's reply and then appends them to * the dialog container. Clears the user input after processing. */ private void handleUserInput() { @@ -142,7 +142,7 @@ private void handleUserInput() { * Replace this stub with your completed method. */ private String getResponse(String input) { - return "Duke heard: " + input; + return "duke.Duke heard: " + input; } ``` @@ -170,7 +170,7 @@ Run the program and see how it works. ## Iteration 3 – Adding custom behavior to DialogBox -One additional benefit of defining a custom control is that we can add behavior specific to our `DialogBox`. Let’s add a method to flip a dialog box such that the image on the left to differentiate between user input and Duke’s output. +One additional benefit of defining a custom control is that we can add behavior specific to our `DialogBox`. Let’s add a method to flip a dialog box such that the image on the left to differentiate between user input and duke.Duke’s output. ```java /** @@ -224,7 +224,7 @@ Run the application and play around with it. ![DialogBoxes Iteration 3](assets/DialogBoxesIteration3.png) Congratulations! -You have successfully implemented a fully functional GUI for Duke! +You have successfully implemented a fully functional GUI for duke.Duke! ## Exercises diff --git a/tutorials/javaFxTutorialPart4.md b/tutorials/javaFxTutorialPart4.md index 0e0ab280c4..638505a99b 100644 --- a/tutorials/javaFxTutorialPart4.md +++ b/tutorials/javaFxTutorialPart4.md @@ -29,7 +29,7 @@ FXML is a XML-based language that allows us to define our user interface. Proper The FXML snippet define a TextField similar to the one that we programmatically defined previous in Tutorial 2. Notice how concise FXML is compared to the plain Java version. -Let's return to Duke and convert it to use FXML instead. +Let's return to duke.Duke and convert it to use FXML instead. # Rebuilding the Scene using FXML @@ -101,14 +101,14 @@ We will get to that later. ## Using Controllers -As part of the effort to separate the code handling Duke's logic and UI, let's _refactor_ the UI-related code to its own class. +As part of the effort to separate the code handling duke.Duke's logic and UI, let's _refactor_ the UI-related code to its own class. We call these UI classes _controllers_. Let's implement the `MainWindow` controller class that we specified in `MainWindow.fxml`. **MainWindow.java** ```java -import javafx.fxml.FXML; +import duke.Duke;import javafx.fxml.FXML; import javafx.scene.control.Button; import javafx.scene.control.ScrollPane; import javafx.scene.control.TextField; @@ -143,7 +143,7 @@ public class MainWindow extends AnchorPane { } /** - * Creates two dialog boxes, one echoing user input and the other containing Duke's reply and then appends them to + * Creates two dialog boxes, one echoing user input and the other containing duke.Duke's reply and then appends them to * the dialog container. Clears the user input after processing. */ @FXML @@ -168,7 +168,7 @@ Similarly, methods like private methods like `handleUserInput` can be used in FX ## Using FXML in our application -Let's create a new `Main` class as the bridge between the existing logic in `Duke` and the UI in `MainWindow`. +Let's create a new `Main` class as the bridge between the existing logic in `duke.Duke` and the UI in `MainWindow`. **Main.java** ```java @@ -182,7 +182,7 @@ import javafx.scene.layout.AnchorPane; import javafx.stage.Stage; /** - * A GUI for Duke using FXML. + * A GUI for duke.Duke using FXML. */ public class Main extends Application { diff --git a/tutorials/textUiTestingTutorial.md b/tutorials/textUiTestingTutorial.md index f397d76aef..b421fa37da 100644 --- a/tutorials/textUiTestingTutorial.md +++ b/tutorials/textUiTestingTutorial.md @@ -13,7 +13,7 @@ del ACTUAL.TXT REM compile the code into the bin folder - javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\Duke.java + javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\duke.Duke.java IF ERRORLEVEL 1 ( echo ********** BUILD FAILURE ********** exit /b 1 @@ -21,7 +21,7 @@ REM no error here, errorlevel == 0 REM run the program, feed commands from input.txt file and redirect the output to the ACTUAL.TXT - java -classpath ..\bin Duke < input.txt > ACTUAL.TXT + java -classpath ..\bin duke.Duke < input.txt > ACTUAL.TXT REM compare the output to the expected output FC ACTUAL.TXT EXPECTED.TXT @@ -44,14 +44,14 @@ fi # compile the code into the bin folder, terminates if error occurred - if ! javac -cp ../src -Xlint:none -d ../bin ../src/main/java/Duke.java + if ! javac -cp ../src -Xlint:none -d ../bin ../src/main/java/duke.Duke.java then echo "********** BUILD FAILURE **********" exit 1 fi # run the program, feed commands from input.txt file and redirect the output to the ACTUAL.TXT - java -classpath ../bin Duke < input.txt > ACTUAL.TXT + java -classpath ../bin duke.Duke < input.txt > ACTUAL.TXT # compare the output to the expected output diff ACTUAL.TXT EXPECTED.TXT From 79a49ba0bef9d4f00a94923e548be062a65746a3 Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Sun, 16 Feb 2020 15:42:40 +0800 Subject: [PATCH 18/36] Delete: Add support for deleting tasks from the list. --- src/main/java/duke/Duke.java | 24 ++++++++++++++++++++++++ text-ui-test/ACTUAL.TXT | 13 +++++++++++++ text-ui-test/EXPECTED.txt | 13 +++++++++++++ text-ui-test/input.txt | 2 ++ 4 files changed, 52 insertions(+) diff --git a/src/main/java/duke/Duke.java b/src/main/java/duke/Duke.java index 8f40b80cbd..f80da41880 100644 --- a/src/main/java/duke/Duke.java +++ b/src/main/java/duke/Duke.java @@ -58,6 +58,16 @@ public static void dukeResponde(String userResponde){ }catch(StringIndexOutOfBoundsException e){ System.out.println("\t:(OOPS!!! Please enter the task number."); } + } else if(userResponde.startsWith("delete")){ + try{ + deleteTask(userResponde); + } catch(NumberFormatException e) { + System.out.println("\t:(OOPS!!! Please enter the task number you want to delete."); + } catch(StringIndexOutOfBoundsException e){ + System.out.println("\t:(OOPS!!! Please enter the task number you want to delete."); + } catch(DukeException e){ + System.out.println("\t:(OOPS!!! " + e.getMessage()); + } } else{ try{ addNewTask(userResponde); @@ -94,6 +104,20 @@ public static void markAsDone(String userResponde){ System.out.println("\t [\u2713] " + tasks[doneCount].getDescription()); } + public static void deleteTask(String userResponde) throws DukeException{ + int deleteCount = Integer.parseInt(userResponde.substring(7)) - 1; + if(deleteCount > taskCount){ + throw new DukeException("There is no task " + (deleteCount + 1) + ". Please reconsider the index."); + } + System.out.println("\tNoted. I've removed this task:"); + System.out.println("\t " + tasks[deleteCount]); + taskCount--; + for(int i = deleteCount; i Date: Sun, 16 Feb 2020 15:44:49 +0800 Subject: [PATCH 19/36] Use Java Collections classes: ArrayList to store the tasks. --- src/main/java/duke/Duke.java | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/main/java/duke/Duke.java b/src/main/java/duke/Duke.java index f80da41880..03f4fda2b6 100644 --- a/src/main/java/duke/Duke.java +++ b/src/main/java/duke/Duke.java @@ -4,11 +4,12 @@ import duke.task.Event; import duke.task.Task; import duke.task.Todo; - +import java.util.ArrayList; import java.util.Scanner; + public class Duke { - private static Task[] tasks = new Task[100]; + private static ArrayList tasks = new ArrayList<>(); private static int taskCount = 0; public static void main(String[] args) { @@ -93,15 +94,15 @@ public static void listTask() throws DukeException{ } System.out.println("\tHere are the tasks in your list:"); for(int i = 0; i < taskCount; i++) { - System.out.println("\t" + (i + 1) + "." + tasks[i]); + System.out.println("\t" + (i + 1) + "." + tasks.get(i)); } } public static void markAsDone(String userResponde){ int doneCount = Integer.parseInt(userResponde.substring(5)) - 1; - tasks[doneCount].markAsDone(); + tasks.get(doneCount).markAsDone(); System.out.println("\tNice! I've marked this task as done:"); - System.out.println("\t [\u2713] " + tasks[doneCount].getDescription()); + System.out.println("\t [\u2713] " + tasks.get(doneCount).getDescription()); } public static void deleteTask(String userResponde) throws DukeException{ @@ -110,11 +111,9 @@ public static void deleteTask(String userResponde) throws DukeException{ throw new DukeException("There is no task " + (deleteCount + 1) + ". Please reconsider the index."); } System.out.println("\tNoted. I've removed this task:"); - System.out.println("\t " + tasks[deleteCount]); + System.out.println("\t " + tasks.get(deleteCount)); taskCount--; - for(int i = deleteCount; i Date: Sun, 16 Feb 2020 15:56:03 +0800 Subject: [PATCH 20/36] Load the data from hard disk when Duke starts up --- data/duke.txt | 4 ++++ src/main/java/duke/Duke.java | 39 +++++++++++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 data/duke.txt diff --git a/data/duke.txt b/data/duke.txt new file mode 100644 index 0000000000..34eebc882e --- /dev/null +++ b/data/duke.txt @@ -0,0 +1,4 @@ +T | 1 | read book +D | 0 | return book | June 6th +E | 0 | project meeting | Aug 6th 2-4pm +T | 1 | join sports club \ No newline at end of file diff --git a/src/main/java/duke/Duke.java b/src/main/java/duke/Duke.java index 8f40b80cbd..37e7e43f5f 100644 --- a/src/main/java/duke/Duke.java +++ b/src/main/java/duke/Duke.java @@ -6,6 +6,8 @@ import duke.task.Todo; import java.util.Scanner; +import java.io.File; +import java.io.FileNotFoundException; public class Duke { private static Task[] tasks = new Task[100]; @@ -19,7 +21,7 @@ public static void main(String[] args) { + "|____/ \\__,_|_|\\_\\___|\n"; System.out.println("Hello from\n" + logo); greet(); - + loadTasks(); String userResponde; Scanner in = new Scanner(System.in); do { @@ -38,6 +40,41 @@ public static void greet(){ System.out.println(); } + public static void loadTasks(){ + + File f = new File("data/duke.txt"); + try{ + Scanner s = new Scanner(f); + while(s.hasNext()){ + String aTask; + aTask = s.nextLine(); + loadATask(aTask); + } + } catch(FileNotFoundException e){ + System.out.println("No duke history. Please input task. "); + } + + } + + public static void loadATask(String aTask){ + String[] aTaskSplit = aTask.split(" \\| "); + switch(aTaskSplit[0]){ + case "T": + tasks[taskCount] = new Todo(aTaskSplit[2]); + break; + case "D": + tasks[taskCount] = new Deadline(aTaskSplit[2],aTaskSplit[3]); + break; + case "E": + tasks[taskCount] = new Event(aTaskSplit[2],aTaskSplit[3]); + break; + } + if(aTaskSplit[1].equals("1")){ + tasks[taskCount].markAsDone(); + } + taskCount++; + } + public static void dukeResponde(String userResponde){ printLine(); if(userResponde.equals("bye")){ From 8c5fe95f3889943d6d9457f9451fb2125d37fdc7 Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Sun, 16 Feb 2020 15:59:28 +0800 Subject: [PATCH 21/36] Save the tasks in the hard disk automatically whenever the task list changes. --- data/duke.txt | 5 +++-- src/main/java/duke/Duke.java | 17 +++++++++++++++++ src/main/java/duke/task/Deadline.java | 5 +++++ src/main/java/duke/task/Event.java | 5 +++++ src/main/java/duke/task/Task.java | 4 ++++ src/main/java/duke/task/Todo.java | 5 +++++ 6 files changed, 39 insertions(+), 2 deletions(-) diff --git a/data/duke.txt b/data/duke.txt index 34eebc882e..2d84da48f7 100644 --- a/data/duke.txt +++ b/data/duke.txt @@ -1,4 +1,5 @@ T | 1 | read book D | 0 | return book | June 6th -E | 0 | project meeting | Aug 6th 2-4pm -T | 1 | join sports club \ No newline at end of file +E | 1 | project meeting | Aug 6th 2-4pm +T | 1 | join sports club +E | 0 | dancing | Tuesday evening diff --git a/src/main/java/duke/Duke.java b/src/main/java/duke/Duke.java index 37e7e43f5f..e796d27729 100644 --- a/src/main/java/duke/Duke.java +++ b/src/main/java/duke/Duke.java @@ -8,6 +8,8 @@ import java.util.Scanner; import java.io.File; import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.IOException; public class Duke { private static Task[] tasks = new Task[100]; @@ -95,12 +97,14 @@ public static void dukeResponde(String userResponde){ }catch(StringIndexOutOfBoundsException e){ System.out.println("\t:(OOPS!!! Please enter the task number."); } + outputTasks(); } else{ try{ addNewTask(userResponde); }catch(DukeException e){ System.out.println("\t:(OOPS!!! " + e.getMessage()); } + outputTasks(); } printLine(); System.out.println(); @@ -170,5 +174,18 @@ public static void addNewTask(String userResponde) throws DukeException{ taskCount++; } + public static void outputTasks(){ + try{ + FileWriter fw = new FileWriter("data/duke.txt"); + for(int i = 0; i Date: Mon, 17 Feb 2020 10:24:48 +0800 Subject: [PATCH 22/36] Create a JAR and set up gradle so that you can build and run Duke using gradle --- build.gradle | 23 ++++++++++++++++++++++- gradle/wrapper/gradle-wrapper.properties | 5 +++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index ce97c7ba2e..064f33b36e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,8 @@ plugins { id 'java' id 'application' + id 'checkstyle' + id 'com.github.johnrengelman.shadow' version '5.1.0' } group 'seedu.duke' @@ -12,9 +14,28 @@ repositories { application { // Change this to your main class. - mainClassName = "seedu.duke.Duke" + mainClassName = "duke.Duke" } run { standardInput = System.in +} + +checkstyle { + toolVersion = '8.23' +} + +shadowJar { + archiveBaseName = "duke" + archiveVersion = "0.1.3" + archiveClassifier = null + archiveAppendix = null +} + +dependencies { + testImplementation 'org.junit.jupiter:junit-jupiter:5.5.0' +} + +test { + useJUnitPlatform() } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4b7e1f3d38..aaa8f5cb02 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Mon Feb 17 10:19:33 SGT 2020 +distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME From e149a6ae98935a55c4498341a520766f98d6d7a3 Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Mon, 17 Feb 2020 22:22:57 +0800 Subject: [PATCH 23/36] Create back up file when there is no such file exists. --- build.gradle | 2 +- src/main/java/duke/Duke.java | 16 ++++++++++++---- src/main/java/duke/task/Task.java | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 064f33b36e..a924fdab92 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { id 'com.github.johnrengelman.shadow' version '5.1.0' } -group 'seedu.duke' +group 'duke' version '0.1.0' repositories { diff --git a/src/main/java/duke/Duke.java b/src/main/java/duke/Duke.java index d84aaa9db4..117cfc1f7a 100644 --- a/src/main/java/duke/Duke.java +++ b/src/main/java/duke/Duke.java @@ -44,7 +44,7 @@ public static void greet(){ } public static void loadTasks(){ - + File f = new File("data/duke.txt"); try{ Scanner s = new Scanner(f); @@ -54,7 +54,14 @@ public static void loadTasks(){ loadATask(aTask); } } catch(FileNotFoundException e){ - System.out.println("No duke history. Please input task. "); + System.out.println("\tCreating back up file in hard disk... "); + System.out.println(); + try{ + f.createNewFile(); + }catch(IOException error){ + + System.out.println("\tSomething went wrong: " + error.getMessage()); + } } } @@ -98,6 +105,7 @@ public static void dukeResponde(String userResponde){ }catch(StringIndexOutOfBoundsException e){ System.out.println("\t:(OOPS!!! Please enter the task number."); } + outputTasks(); } else if(userResponde.startsWith("delete")){ try{ deleteTask(userResponde); @@ -143,7 +151,7 @@ public static void markAsDone(String userResponde){ int doneCount = Integer.parseInt(userResponde.substring(5)) - 1; tasks.get(doneCount).markAsDone(); System.out.println("\tNice! I've marked this task as done:"); - System.out.println("\t [\u2713] " + tasks.get(doneCount).getDescription()); + System.out.println("\t yes! " + tasks.get(doneCount).getDescription()); } public static void deleteTask(String userResponde) throws DukeException{ @@ -205,7 +213,7 @@ public static void outputTasks(){ } fw.close(); }catch (IOException e){ - System.out.println("No backup file in the hard disk."); + System.out.println("\tNo backup file in the hard disk."); } } diff --git a/src/main/java/duke/task/Task.java b/src/main/java/duke/task/Task.java index b87c570b4f..b5dc9ceac9 100644 --- a/src/main/java/duke/task/Task.java +++ b/src/main/java/duke/task/Task.java @@ -14,7 +14,7 @@ public Task(String description) { } public String getStatusIcon() { - return (isDone ? "\u2713" : "\u2718"); //return tick or X symbols + return (isDone ? "/" : " "); //return tick or X symbols } public String getDescription(){ From 099dc7ebe24ab0e1651cdfbc8eafde9f273ad7c1 Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Tue, 25 Feb 2020 14:44:51 +0800 Subject: [PATCH 24/36] Follow Java Coding Standard --- src/main/java/duke/Duke.java | 125 +++++++++++++------------- src/main/java/duke/DukeException.java | 2 +- src/main/java/duke/task/Deadline.java | 6 +- src/main/java/duke/task/Event.java | 8 +- src/main/java/duke/task/Task.java | 10 +-- src/main/java/duke/task/Todo.java | 8 +- 6 files changed, 77 insertions(+), 82 deletions(-) diff --git a/src/main/java/duke/Duke.java b/src/main/java/duke/Duke.java index 117cfc1f7a..01633e7d49 100644 --- a/src/main/java/duke/Duke.java +++ b/src/main/java/duke/Duke.java @@ -30,12 +30,10 @@ public static void main(String[] args) { do { userResponde = in.nextLine(); dukeResponde(userResponde); - - }while(!userResponde.equals("bye")); - + } while (!userResponde.equals("bye")); } - public static void greet(){ + public static void greet() { printLine(); System.out.println("\tHello! I'm duke.Duke"); System.out.println("\tWhat can I do for you?"); @@ -43,84 +41,84 @@ public static void greet(){ System.out.println(); } - public static void loadTasks(){ - + public static void loadTasks() { File f = new File("data/duke.txt"); - try{ + try { Scanner s = new Scanner(f); - while(s.hasNext()){ - String aTask; - aTask = s.nextLine(); - loadATask(aTask); + while (s.hasNext()) { + String oneTask; + oneTask = s.nextLine(); + loadATask(oneTask); } - } catch(FileNotFoundException e){ + } catch (FileNotFoundException e) { System.out.println("\tCreating back up file in hard disk... "); System.out.println(); - try{ + try { f.createNewFile(); - }catch(IOException error){ + } catch (IOException error) { System.out.println("\tSomething went wrong: " + error.getMessage()); } } - } - public static void loadATask(String aTask){ - String[] aTaskSplit = aTask.split(" \\| "); - switch(aTaskSplit[0]){ + public static void loadATask(String oneTask) { + String[] taskSplit = oneTask.split(" \\| "); + switch (taskSplit[0]) { case "T": - tasks.add(new Todo(aTaskSplit[2])); + tasks.add(new Todo(taskSplit[2])); break; case "D": - tasks.add(new Deadline(aTaskSplit[2],aTaskSplit[3])); + tasks.add(new Deadline(taskSplit[2],taskSplit[3])); break; case "E": - tasks.add(new Event(aTaskSplit[2],aTaskSplit[3])); + tasks.add(new Event(taskSplit[2],taskSplit[3])); + break; + default: break; } - if(aTaskSplit[1].equals("1")){ + if (taskSplit[1].equals("1")) { tasks.get(taskCount).markAsDone(); } taskCount++; } - public static void dukeResponde(String userResponde){ + public static void dukeResponde(String userResponde) { printLine(); - if(userResponde.equals("bye")){ + if (userResponde.equals("bye")) { sayBye(); - } else if(userResponde.equals("list")) { - try{ + } else if (userResponde.equals("list")) { + try { listTask(); - }catch( DukeException e){ + } catch (DukeException e) { System.out.println("\t:(OOPS!!! " + e.getMessage()); } - } else if(userResponde.startsWith("done")) { + } else if (userResponde.startsWith("done")) { try { markAsDone(userResponde); - }catch(NumberFormatException e){ + } catch (NumberFormatException e) { System.out.println("\t:(OOPS!!! Please enter the task number."); - }catch(NullPointerException e){ + } catch (NullPointerException e) { System.out.println("\t:(OOPS!!! Please first input the task then mark done."); - }catch(StringIndexOutOfBoundsException e){ + } catch (StringIndexOutOfBoundsException e) { System.out.println("\t:(OOPS!!! Please enter the task number."); } outputTasks(); - } else if(userResponde.startsWith("delete")){ - try{ + } else if (userResponde.startsWith("delete")) { + try { deleteTask(userResponde); - } catch(NumberFormatException e) { + } catch (NumberFormatException e) { System.out.println("\t:(OOPS!!! Please enter the task number you want to delete."); - } catch(StringIndexOutOfBoundsException e){ + } catch (StringIndexOutOfBoundsException e) { System.out.println("\t:(OOPS!!! Please enter the task number you want to delete."); - } catch(DukeException e){ + } catch (DukeException e) { System.out.println("\t:(OOPS!!! " + e.getMessage()); } outputTasks(); - } else{ - try{ + } else { + try { addNewTask(userResponde); - }catch(DukeException e){ + } catch (DukeException e) { System.out.println("\t:(OOPS!!! " + e.getMessage()); } outputTasks(); @@ -129,34 +127,34 @@ public static void dukeResponde(String userResponde){ System.out.println(); } - public static void printLine(){ + public static void printLine() { System.out.println("\t____________________________________________________________"); } - public static void sayBye(){ + public static void sayBye() { System.out.println("\tBye. Hope to see you again soon!"); } - public static void listTask() throws DukeException{ - if( taskCount == 0){ + public static void listTask() throws DukeException { + if (taskCount == 0) { throw new DukeException("No tasks!!!"); } System.out.println("\tHere are the tasks in your list:"); - for(int i = 0; i < taskCount; i++) { + for (int i = 0; i < taskCount; i++) { System.out.println("\t" + (i + 1) + "." + tasks.get(i)); } } - public static void markAsDone(String userResponde){ + public static void markAsDone(String userResponde) { int doneCount = Integer.parseInt(userResponde.substring(5)) - 1; tasks.get(doneCount).markAsDone(); System.out.println("\tNice! I've marked this task as done:"); System.out.println("\t yes! " + tasks.get(doneCount).getDescription()); } - public static void deleteTask(String userResponde) throws DukeException{ + public static void deleteTask(String userResponde) throws DukeException { int deleteCount = Integer.parseInt(userResponde.substring(7)) - 1; - if(deleteCount > taskCount){ + if (deleteCount > taskCount) { throw new DukeException("There is no task " + (deleteCount + 1) + ". Please reconsider the index."); } System.out.println("\tNoted. I've removed this task:"); @@ -166,57 +164,54 @@ public static void deleteTask(String userResponde) throws DukeException{ System.out.println("\tNow you have " + taskCount + " tasks in the list."); } - public static void addNewTask(String userResponde) throws DukeException{ + public static void addNewTask(String userResponde) throws DukeException { String[] responses = userResponde.split(" "); - - if(responses[0].equals("todo")){ - if( responses.length < 2){ + if (responses[0].equals("todo")) { + if (responses.length < 2) { throw new DukeException("The description of a todo cannot be empty."); } tasks.add(new Todo(userResponde.substring(5))); - } else if(responses[0].equals("deadline")){ - if( responses.length < 2){ + } else if (responses[0].equals("deadline")) { + if (responses.length < 2) { throw new DukeException("The description of a deadline cannot be empty."); } int dividerPosition = userResponde.indexOf(" /by"); - if (dividerPosition == -1){ + if (dividerPosition == -1) { throw new DukeException("Please follow the format: deadline thingsToDo /by time"); } String taskName = userResponde.substring(9,dividerPosition); String deadlineTime = userResponde.substring(dividerPosition + 5); tasks.add(new Deadline(taskName,deadlineTime)); - } else if(responses[0].equals("event")){ - if( responses.length < 2){ + } else if (responses[0].equals("event")) { + if (responses.length < 2) { throw new DukeException("The description of a event cannot be empty."); } int dividerPosition = userResponde.indexOf(" /at"); - if (dividerPosition == -1){ + if (dividerPosition == -1) { throw new DukeException("Please follow the format: event thingsToDo /at time"); } String taskName = userResponde.substring(6,dividerPosition); String deadlineTime = userResponde.substring(dividerPosition + 5); tasks.add(new Event(taskName,deadlineTime)); - } else{ + } else { throw new DukeException("I'm sorry, but I don't know what that means :-("); } System.out.println("\tGot it. I've added this task:"); System.out.println("\t " + tasks.get(taskCount)); - System.out.println("\tNow you have " + (taskCount+1) + " tasks in the list"); + System.out.println("\tNow you have " + (taskCount + 1) + " tasks in the list"); taskCount++; } - public static void outputTasks(){ - try{ + public static void outputTasks() { + try { FileWriter fw = new FileWriter("data/duke.txt"); - for(int i = 0; i Date: Tue, 25 Feb 2020 16:12:15 +0800 Subject: [PATCH 25/36] Add constants file --- data/duke.txt | 2 +- src/main/java/duke/Constants.java | 25 +++++++++++++++++++++++ src/main/java/duke/Duke.java | 33 ++++++++++++++++--------------- 3 files changed, 43 insertions(+), 17 deletions(-) create mode 100644 src/main/java/duke/Constants.java diff --git a/data/duke.txt b/data/duke.txt index 2d84da48f7..6e5291e2ba 100644 --- a/data/duke.txt +++ b/data/duke.txt @@ -2,4 +2,4 @@ T | 1 | read book D | 0 | return book | June 6th E | 1 | project meeting | Aug 6th 2-4pm T | 1 | join sports club -E | 0 | dancing | Tuesday evening +E | 1 | dancing | Tuesday evening diff --git a/src/main/java/duke/Constants.java b/src/main/java/duke/Constants.java new file mode 100644 index 0000000000..38780e6822 --- /dev/null +++ b/src/main/java/duke/Constants.java @@ -0,0 +1,25 @@ +package duke; + +public final class Constants { + public static final String LOGO = " ____ _ \n" + + "| _ \\ _ _| | _____ \n" + + "| | | | | | | |/ / _ \\\n" + + "| |_| | |_| | < __/\n" + + "|____/ \\__,_|_|\\_\\___|\n"; + + public static final String BYE = "bye"; + public static final String LIST = "list"; + public static final String DONE = "done"; + public static final String DELETE = "delete"; + + public static final String LINE_BREAK = "\t____________________________________________________________"; + + public static final int DONE_LENGTH = 5; + public static final int DELETE_LENGTH = 7; + public static final int TODO_LENGTH = 5; + public static final int DEADLINE_LENGTH = 9; + public static final int EVENT_LENGTH = 6; + public static final int FORMAT_LENGTH = 5; + + public static final String FILE_PATH = "data/duke.txt"; +} diff --git a/src/main/java/duke/Duke.java b/src/main/java/duke/Duke.java index 01633e7d49..2b65f51100 100644 --- a/src/main/java/duke/Duke.java +++ b/src/main/java/duke/Duke.java @@ -4,6 +4,7 @@ import duke.task.Event; import duke.task.Task; import duke.task.Todo; +import static duke.Constants.*; import java.util.ArrayList; import java.util.Scanner; import java.io.File; @@ -22,7 +23,7 @@ public static void main(String[] args) { + "| | | | | | | |/ / _ \\\n" + "| |_| | |_| | < __/\n" + "|____/ \\__,_|_|\\_\\___|\n"; - System.out.println("Hello from\n" + logo); + System.out.println("Hello from\n" + LOGO); greet(); loadTasks(); String userResponde; @@ -30,7 +31,7 @@ public static void main(String[] args) { do { userResponde = in.nextLine(); dukeResponde(userResponde); - } while (!userResponde.equals("bye")); + } while (!userResponde.equals(BYE)); } public static void greet() { @@ -42,7 +43,7 @@ public static void greet() { } public static void loadTasks() { - File f = new File("data/duke.txt"); + File f = new File(FILE_PATH); try { Scanner s = new Scanner(f); while (s.hasNext()) { @@ -85,15 +86,15 @@ public static void loadATask(String oneTask) { public static void dukeResponde(String userResponde) { printLine(); - if (userResponde.equals("bye")) { + if (userResponde.equals(BYE)) { sayBye(); - } else if (userResponde.equals("list")) { + } else if (userResponde.equals(LIST)) { try { listTask(); } catch (DukeException e) { System.out.println("\t:(OOPS!!! " + e.getMessage()); } - } else if (userResponde.startsWith("done")) { + } else if (userResponde.startsWith(DONE)) { try { markAsDone(userResponde); } catch (NumberFormatException e) { @@ -104,7 +105,7 @@ public static void dukeResponde(String userResponde) { System.out.println("\t:(OOPS!!! Please enter the task number."); } outputTasks(); - } else if (userResponde.startsWith("delete")) { + } else if (userResponde.startsWith(DELETE)) { try { deleteTask(userResponde); } catch (NumberFormatException e) { @@ -128,7 +129,7 @@ public static void dukeResponde(String userResponde) { } public static void printLine() { - System.out.println("\t____________________________________________________________"); + System.out.println(LINE_BREAK); } public static void sayBye() { @@ -146,14 +147,14 @@ public static void listTask() throws DukeException { } public static void markAsDone(String userResponde) { - int doneCount = Integer.parseInt(userResponde.substring(5)) - 1; + int doneCount = Integer.parseInt(userResponde.substring(DONE_LENGTH)) - 1; tasks.get(doneCount).markAsDone(); System.out.println("\tNice! I've marked this task as done:"); System.out.println("\t yes! " + tasks.get(doneCount).getDescription()); } public static void deleteTask(String userResponde) throws DukeException { - int deleteCount = Integer.parseInt(userResponde.substring(7)) - 1; + int deleteCount = Integer.parseInt(userResponde.substring(DELETE_LENGTH)) - 1; if (deleteCount > taskCount) { throw new DukeException("There is no task " + (deleteCount + 1) + ". Please reconsider the index."); } @@ -170,7 +171,7 @@ public static void addNewTask(String userResponde) throws DukeException { if (responses.length < 2) { throw new DukeException("The description of a todo cannot be empty."); } - tasks.add(new Todo(userResponde.substring(5))); + tasks.add(new Todo(userResponde.substring(TODO_LENGTH))); } else if (responses[0].equals("deadline")) { if (responses.length < 2) { throw new DukeException("The description of a deadline cannot be empty."); @@ -179,8 +180,8 @@ public static void addNewTask(String userResponde) throws DukeException { if (dividerPosition == -1) { throw new DukeException("Please follow the format: deadline thingsToDo /by time"); } - String taskName = userResponde.substring(9,dividerPosition); - String deadlineTime = userResponde.substring(dividerPosition + 5); + String taskName = userResponde.substring(DEADLINE_LENGTH,dividerPosition); + String deadlineTime = userResponde.substring(dividerPosition + FORMAT_LENGTH); tasks.add(new Deadline(taskName,deadlineTime)); } else if (responses[0].equals("event")) { if (responses.length < 2) { @@ -190,8 +191,8 @@ public static void addNewTask(String userResponde) throws DukeException { if (dividerPosition == -1) { throw new DukeException("Please follow the format: event thingsToDo /at time"); } - String taskName = userResponde.substring(6,dividerPosition); - String deadlineTime = userResponde.substring(dividerPosition + 5); + String taskName = userResponde.substring(EVENT_LENGTH,dividerPosition); + String deadlineTime = userResponde.substring(dividerPosition + FORMAT_LENGTH); tasks.add(new Event(taskName,deadlineTime)); } else { throw new DukeException("I'm sorry, but I don't know what that means :-("); @@ -204,7 +205,7 @@ public static void addNewTask(String userResponde) throws DukeException { public static void outputTasks() { try { - FileWriter fw = new FileWriter("data/duke.txt"); + FileWriter fw = new FileWriter(FILE_PATH); for (int i = 0; i < taskCount; i++) { fw.write(tasks.get(i).toFile() + "\n"); } From 4116a143e6b08e8bd3a49c1d002854997c11a742 Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Wed, 26 Feb 2020 23:52:48 +0800 Subject: [PATCH 26/36] Use more OOP and update the test-ui --- data/duke.txt | 1 - src/main/java/duke/Duke.java | 242 +++++------------- src/main/java/duke/command/AddCommand.java | 22 ++ src/main/java/duke/command/Command.java | 23 ++ src/main/java/duke/command/DeleteCommand.java | 25 ++ src/main/java/duke/command/DoneCommand.java | 27 ++ src/main/java/duke/command/ExitCommand.java | 12 + .../java/duke/command/InvalidCommand.java | 17 ++ src/main/java/duke/command/ListCommand.java | 17 ++ .../java/duke/{ => common}/Constants.java | 52 ++-- .../java/duke/{ => common}/DukeException.java | 2 +- src/main/java/duke/parser/Parser.java | 88 +++++++ src/main/java/duke/storage/Storage.java | 76 ++++++ src/main/java/duke/taskList/TaskList.java | 37 +++ .../duke/{ => taskList}/task/Deadline.java | 9 +- .../java/duke/{ => taskList}/task/Event.java | 9 +- .../java/duke/{ => taskList}/task/Task.java | 8 +- .../java/duke/{ => taskList}/task/Todo.java | 9 +- src/main/java/duke/ui/Ui.java | 89 +++++++ text-ui-test/ACTUAL.TXT | 55 ++-- text-ui-test/EXPECTED.txt | 55 ++-- text-ui-test/data/duke.txt | 3 + text-ui-test/runtest.bat | 2 +- 23 files changed, 593 insertions(+), 287 deletions(-) create mode 100644 src/main/java/duke/command/AddCommand.java create mode 100644 src/main/java/duke/command/Command.java create mode 100644 src/main/java/duke/command/DeleteCommand.java create mode 100644 src/main/java/duke/command/DoneCommand.java create mode 100644 src/main/java/duke/command/ExitCommand.java create mode 100644 src/main/java/duke/command/InvalidCommand.java create mode 100644 src/main/java/duke/command/ListCommand.java rename src/main/java/duke/{ => common}/Constants.java (75%) rename src/main/java/duke/{ => common}/DukeException.java (79%) create mode 100644 src/main/java/duke/parser/Parser.java create mode 100644 src/main/java/duke/storage/Storage.java create mode 100644 src/main/java/duke/taskList/TaskList.java rename src/main/java/duke/{ => taskList}/task/Deadline.java (69%) rename src/main/java/duke/{ => taskList}/task/Event.java (69%) rename src/main/java/duke/{ => taskList}/task/Task.java (81%) rename src/main/java/duke/{ => taskList}/task/Todo.java (63%) create mode 100644 src/main/java/duke/ui/Ui.java create mode 100644 text-ui-test/data/duke.txt diff --git a/data/duke.txt b/data/duke.txt index 6e5291e2ba..3650a1a14f 100644 --- a/data/duke.txt +++ b/data/duke.txt @@ -2,4 +2,3 @@ T | 1 | read book D | 0 | return book | June 6th E | 1 | project meeting | Aug 6th 2-4pm T | 1 | join sports club -E | 1 | dancing | Tuesday evening diff --git a/src/main/java/duke/Duke.java b/src/main/java/duke/Duke.java index 2b65f51100..2f9eede059 100644 --- a/src/main/java/duke/Duke.java +++ b/src/main/java/duke/Duke.java @@ -1,48 +1,72 @@ package duke; -import duke.task.Deadline; -import duke.task.Event; -import duke.task.Task; -import duke.task.Todo; -import static duke.Constants.*; -import java.util.ArrayList; -import java.util.Scanner; +import duke.command.Command; +import duke.common.DukeException; +import duke.parser.Parser; +import duke.storage.Storage; +import duke.taskList.TaskList; +import duke.ui.Ui; + import java.io.File; import java.io.FileNotFoundException; -import java.io.FileWriter; import java.io.IOException; +import static duke.common.Constants.CREATE_FILE_PATH; +import static duke.common.Constants.FILE_PATH; + public class Duke { - private static ArrayList tasks = new ArrayList<>(); - private static int taskCount = 0; + private Storage storage; + private TaskList tasks; + private Ui ui; - public static void main(String[] args) { - String logo = " ____ _ \n" - + "| _ \\ _ _| | _____ \n" - + "| | | | | | | |/ / _ \\\n" - + "| |_| | |_| | < __/\n" - + "|____/ \\__,_|_|\\_\\___|\n"; - System.out.println("Hello from\n" + LOGO); - greet(); - loadTasks(); - String userResponde; - Scanner in = new Scanner(System.in); - do { - userResponde = in.nextLine(); - dukeResponde(userResponde); - } while (!userResponde.equals(BYE)); + public Duke(String filePath) { + ui = new Ui(); + tasks = new TaskList(); + storage = new Storage(filePath); + try { + storage.load(tasks); + } catch (FileNotFoundException e) { + ui.showLoadingError(); + File newFolder = new File(CREATE_FILE_PATH); + newFolder.mkdirs(); + try{ + File f = new File(FILE_PATH); + f.createNewFile(); + } catch (IOException error) { + System.out.println("\tUnknown errors: " + error.getMessage()); + } + } + } + + public void run() { + ui.showWelcome(); + boolean isExit = false; + while (!isExit) { + try { + String fullCommand = ui.readCommand(); + ui.showLine(); // show the divider line ("_______") + Command c = Parser.parse(fullCommand); + c.execute(tasks, ui, storage); + isExit = c.isExit(); + } catch (DukeException e) { + ui.showError(e.getMessage()); + } catch (IOException e) { + ui.showError(e.getMessage()); + } finally { + ui.showLine(); + } + } + ui.showGoodByeMessage(); + ui.showLine(); } - public static void greet() { - printLine(); - System.out.println("\tHello! I'm duke.Duke"); - System.out.println("\tWhat can I do for you?"); - printLine(); - System.out.println(); + public static void main(String[] args) { + new Duke(FILE_PATH).run(); } - public static void loadTasks() { + + /*public static void loadTasks() { File f = new File(FILE_PATH); try { Scanner s = new Scanner(f); @@ -61,158 +85,6 @@ public static void loadTasks() { System.out.println("\tSomething went wrong: " + error.getMessage()); } } - } - - public static void loadATask(String oneTask) { - String[] taskSplit = oneTask.split(" \\| "); - switch (taskSplit[0]) { - case "T": - tasks.add(new Todo(taskSplit[2])); - break; - case "D": - tasks.add(new Deadline(taskSplit[2],taskSplit[3])); - break; - case "E": - tasks.add(new Event(taskSplit[2],taskSplit[3])); - break; - default: - break; - } - if (taskSplit[1].equals("1")) { - tasks.get(taskCount).markAsDone(); - } - taskCount++; - } - - public static void dukeResponde(String userResponde) { - printLine(); - if (userResponde.equals(BYE)) { - sayBye(); - } else if (userResponde.equals(LIST)) { - try { - listTask(); - } catch (DukeException e) { - System.out.println("\t:(OOPS!!! " + e.getMessage()); - } - } else if (userResponde.startsWith(DONE)) { - try { - markAsDone(userResponde); - } catch (NumberFormatException e) { - System.out.println("\t:(OOPS!!! Please enter the task number."); - } catch (NullPointerException e) { - System.out.println("\t:(OOPS!!! Please first input the task then mark done."); - } catch (StringIndexOutOfBoundsException e) { - System.out.println("\t:(OOPS!!! Please enter the task number."); - } - outputTasks(); - } else if (userResponde.startsWith(DELETE)) { - try { - deleteTask(userResponde); - } catch (NumberFormatException e) { - System.out.println("\t:(OOPS!!! Please enter the task number you want to delete."); - } catch (StringIndexOutOfBoundsException e) { - System.out.println("\t:(OOPS!!! Please enter the task number you want to delete."); - } catch (DukeException e) { - System.out.println("\t:(OOPS!!! " + e.getMessage()); - } - outputTasks(); - } else { - try { - addNewTask(userResponde); - } catch (DukeException e) { - System.out.println("\t:(OOPS!!! " + e.getMessage()); - } - outputTasks(); - } - printLine(); - System.out.println(); - } - - public static void printLine() { - System.out.println(LINE_BREAK); - } - - public static void sayBye() { - System.out.println("\tBye. Hope to see you again soon!"); - } - - public static void listTask() throws DukeException { - if (taskCount == 0) { - throw new DukeException("No tasks!!!"); - } - System.out.println("\tHere are the tasks in your list:"); - for (int i = 0; i < taskCount; i++) { - System.out.println("\t" + (i + 1) + "." + tasks.get(i)); - } - } - - public static void markAsDone(String userResponde) { - int doneCount = Integer.parseInt(userResponde.substring(DONE_LENGTH)) - 1; - tasks.get(doneCount).markAsDone(); - System.out.println("\tNice! I've marked this task as done:"); - System.out.println("\t yes! " + tasks.get(doneCount).getDescription()); - } - - public static void deleteTask(String userResponde) throws DukeException { - int deleteCount = Integer.parseInt(userResponde.substring(DELETE_LENGTH)) - 1; - if (deleteCount > taskCount) { - throw new DukeException("There is no task " + (deleteCount + 1) + ". Please reconsider the index."); - } - System.out.println("\tNoted. I've removed this task:"); - System.out.println("\t " + tasks.get(deleteCount)); - taskCount--; - tasks.remove(deleteCount); - System.out.println("\tNow you have " + taskCount + " tasks in the list."); - } - - public static void addNewTask(String userResponde) throws DukeException { - String[] responses = userResponde.split(" "); - if (responses[0].equals("todo")) { - if (responses.length < 2) { - throw new DukeException("The description of a todo cannot be empty."); - } - tasks.add(new Todo(userResponde.substring(TODO_LENGTH))); - } else if (responses[0].equals("deadline")) { - if (responses.length < 2) { - throw new DukeException("The description of a deadline cannot be empty."); - } - int dividerPosition = userResponde.indexOf(" /by"); - if (dividerPosition == -1) { - throw new DukeException("Please follow the format: deadline thingsToDo /by time"); - } - String taskName = userResponde.substring(DEADLINE_LENGTH,dividerPosition); - String deadlineTime = userResponde.substring(dividerPosition + FORMAT_LENGTH); - tasks.add(new Deadline(taskName,deadlineTime)); - } else if (responses[0].equals("event")) { - if (responses.length < 2) { - throw new DukeException("The description of a event cannot be empty."); - } - int dividerPosition = userResponde.indexOf(" /at"); - if (dividerPosition == -1) { - throw new DukeException("Please follow the format: event thingsToDo /at time"); - } - String taskName = userResponde.substring(EVENT_LENGTH,dividerPosition); - String deadlineTime = userResponde.substring(dividerPosition + FORMAT_LENGTH); - tasks.add(new Event(taskName,deadlineTime)); - } else { - throw new DukeException("I'm sorry, but I don't know what that means :-("); - } - System.out.println("\tGot it. I've added this task:"); - System.out.println("\t " + tasks.get(taskCount)); - System.out.println("\tNow you have " + (taskCount + 1) + " tasks in the list"); - taskCount++; - } - - public static void outputTasks() { - try { - FileWriter fw = new FileWriter(FILE_PATH); - for (int i = 0; i < taskCount; i++) { - fw.write(tasks.get(i).toFile() + "\n"); - } - fw.close(); - } catch (IOException e) { - System.out.println("\tNo backup file in the hard disk."); - } - } + }*/ } diff --git a/src/main/java/duke/command/AddCommand.java b/src/main/java/duke/command/AddCommand.java new file mode 100644 index 0000000000..774c56c893 --- /dev/null +++ b/src/main/java/duke/command/AddCommand.java @@ -0,0 +1,22 @@ +package duke.command; + +import duke.taskList.TaskList; +import duke.storage.Storage; +import duke.taskList.task.Task; +import duke.ui.Ui; + +import java.io.IOException; + +public class AddCommand extends Command{ + private Task newtask; + public AddCommand(Task newtask) { + this.newtask = newtask; + } + + @Override + public void execute(TaskList tasks, Ui ui, Storage storage) throws IOException { + tasks.addTask(newtask); + ui.showAddTaskMessage(tasks); + storage.write(tasks); + } +} diff --git a/src/main/java/duke/command/Command.java b/src/main/java/duke/command/Command.java new file mode 100644 index 0000000000..b5027357e7 --- /dev/null +++ b/src/main/java/duke/command/Command.java @@ -0,0 +1,23 @@ +//package duke.command; +package duke.command; +import duke.common.DukeException; +import duke.taskList.TaskList; +import duke.storage.Storage; +import duke.ui.Ui; + +import java.io.IOException; + +public class Command { + public Command(){ + + } + + public void execute (TaskList tasks, Ui ui, Storage storage) throws IOException, DukeException { + + } + + public Boolean isExit() { + return false; + } + +} diff --git a/src/main/java/duke/command/DeleteCommand.java b/src/main/java/duke/command/DeleteCommand.java new file mode 100644 index 0000000000..ef590fc4e9 --- /dev/null +++ b/src/main/java/duke/command/DeleteCommand.java @@ -0,0 +1,25 @@ +package duke.command; + +import duke.common.DukeException; +import duke.taskList.TaskList; +import duke.storage.Storage; +import duke.ui.Ui; + +import java.io.IOException; + +public class DeleteCommand extends Command { + private int deleteCount; + + public DeleteCommand(int deleteCount) { + // The array index will be actual count minus one + this.deleteCount = deleteCount - 1; + } + + @Override + public void execute(TaskList tasks, Ui ui, Storage storage) throws IOException, DukeException{ + if (deleteCount + 1 > tasks.size()) + throw new DukeException("\tThere is no task " + (deleteCount + 1) + ". Please reconsider the index."); + ui.showDeleteMessage(tasks.deleteTask(deleteCount),tasks); + storage.write(tasks); + } +} diff --git a/src/main/java/duke/command/DoneCommand.java b/src/main/java/duke/command/DoneCommand.java new file mode 100644 index 0000000000..6ab0f102e3 --- /dev/null +++ b/src/main/java/duke/command/DoneCommand.java @@ -0,0 +1,27 @@ +package duke.command; + +import duke.common.DukeException; +import duke.taskList.TaskList; +import duke.storage.Storage; +import duke.ui.Ui; + +import java.io.IOException; + +public class DoneCommand extends Command{ + private int doneCount; + + public DoneCommand(int doneCount) { + // The array index will be actual count minus one + this.doneCount = doneCount - 1; + } + + @Override + public void execute (TaskList tasks, Ui ui, Storage storage) throws IOException, DukeException { + if(doneCount + 1 > tasks.size()) { + throw new DukeException("\tThere is no task " + (doneCount + 1) + ". Please reconsider the index."); + } + tasks.getATask(this.doneCount).markAsDone(); + ui.showMarkAsDoneMessage(tasks,this.doneCount); + storage.write(tasks); + } +} diff --git a/src/main/java/duke/command/ExitCommand.java b/src/main/java/duke/command/ExitCommand.java new file mode 100644 index 0000000000..303323bd32 --- /dev/null +++ b/src/main/java/duke/command/ExitCommand.java @@ -0,0 +1,12 @@ +package duke.command; + +public class ExitCommand extends Command{ + public ExitCommand() { + + } + + @Override + public Boolean isExit() { + return true; + } +} diff --git a/src/main/java/duke/command/InvalidCommand.java b/src/main/java/duke/command/InvalidCommand.java new file mode 100644 index 0000000000..41c60b3191 --- /dev/null +++ b/src/main/java/duke/command/InvalidCommand.java @@ -0,0 +1,17 @@ +package duke.command; + +import duke.common.DukeException; +import duke.taskList.TaskList; +import duke.storage.Storage; +import duke.ui.Ui; + +public class InvalidCommand extends Command { + + public InvalidCommand(){ + + } + @Override + public void execute(TaskList tasks, Ui ui, Storage storage) throws DukeException { + throw new DukeException("\t Sorry.I do not understand you."); + } +} diff --git a/src/main/java/duke/command/ListCommand.java b/src/main/java/duke/command/ListCommand.java new file mode 100644 index 0000000000..384cfad7bd --- /dev/null +++ b/src/main/java/duke/command/ListCommand.java @@ -0,0 +1,17 @@ +package duke.command; + +import duke.common.DukeException; +import duke.taskList.TaskList; +import duke.storage.Storage; +import duke.ui.Ui; + +public class ListCommand extends Command { + + @Override + public void execute (TaskList tasks, Ui ui, Storage storage) throws DukeException { + if (tasks.size() == 0) { + throw new DukeException("\tCurrently, there is no task in the list!"); + } + ui.showListOfTasks(tasks); + } +} diff --git a/src/main/java/duke/Constants.java b/src/main/java/duke/common/Constants.java similarity index 75% rename from src/main/java/duke/Constants.java rename to src/main/java/duke/common/Constants.java index 38780e6822..11941c5532 100644 --- a/src/main/java/duke/Constants.java +++ b/src/main/java/duke/common/Constants.java @@ -1,25 +1,27 @@ -package duke; - -public final class Constants { - public static final String LOGO = " ____ _ \n" - + "| _ \\ _ _| | _____ \n" - + "| | | | | | | |/ / _ \\\n" - + "| |_| | |_| | < __/\n" - + "|____/ \\__,_|_|\\_\\___|\n"; - - public static final String BYE = "bye"; - public static final String LIST = "list"; - public static final String DONE = "done"; - public static final String DELETE = "delete"; - - public static final String LINE_BREAK = "\t____________________________________________________________"; - - public static final int DONE_LENGTH = 5; - public static final int DELETE_LENGTH = 7; - public static final int TODO_LENGTH = 5; - public static final int DEADLINE_LENGTH = 9; - public static final int EVENT_LENGTH = 6; - public static final int FORMAT_LENGTH = 5; - - public static final String FILE_PATH = "data/duke.txt"; -} +package duke.common; + +public final class Constants { + public static final String LOGO = " ____ _ \n" + + "| _ \\ _ _| | _____ \n" + + "| | | | | | | |/ / _ \\\n" + + "| |_| | |_| | < __/\n" + + "|____/ \\__,_|_|\\_\\___|\n"; + + public static final String BYE = "bye"; + public static final String LIST = "list"; + public static final String DONE = "done"; + public static final String DELETE = "delete"; + public static final String TODO = "todo"; + public static final String DEADLINE = "deadline"; + public static final String EVENT = "event"; + + public static final String LINE_BREAK = "\t____________________________________________________________"; + + public static final int TODO_LENGTH = 5; + public static final int DEADLINE_LENGTH = 9; + public static final int EVENT_LENGTH = 6; + public static final int FORMAT_LENGTH = 5; + + public static final String FILE_PATH = "data/duke.txt"; + public static final String CREATE_FILE_PATH = System.getProperty("user.dir") + "/data"; +} diff --git a/src/main/java/duke/DukeException.java b/src/main/java/duke/common/DukeException.java similarity index 79% rename from src/main/java/duke/DukeException.java rename to src/main/java/duke/common/DukeException.java index 3fcbe42c46..13a2e981ef 100644 --- a/src/main/java/duke/DukeException.java +++ b/src/main/java/duke/common/DukeException.java @@ -1,4 +1,4 @@ -package duke; +package duke.common; public class DukeException extends Exception { public DukeException(String s) { diff --git a/src/main/java/duke/parser/Parser.java b/src/main/java/duke/parser/Parser.java new file mode 100644 index 0000000000..24dfa3361f --- /dev/null +++ b/src/main/java/duke/parser/Parser.java @@ -0,0 +1,88 @@ +package duke.parser; + +import duke.common.DukeException; +import duke.command.*; +import duke.taskList.task.Deadline; +import duke.taskList.task.Event; +import duke.taskList.task.Todo; + +import static duke.common.Constants.*; +import static duke.common.Constants.FORMAT_LENGTH; + +public class Parser { + public Parser() { + + } + + /** + * Helps to check is a string is number + * @param str input string + * @return returns true if it is integer, else returns false + */ + public static boolean isNumeric(String str) { + try { + Integer.parseInt(str); + return true; + } catch(NumberFormatException e){ + return false; + } + } + + /** + * deals with making sense of the user command + * @param fullCommand user input + * @return returns different command type + * @throws DukeException when user's command does not match with command standard + */ + public static Command parse(String fullCommand) throws DukeException{ + String[] responses = fullCommand.split(" "); + switch (responses[0]) { + case TODO: + if (responses.length < 2) { + throw new DukeException("\tThe description of a todo cannot be empty."); + } + return new AddCommand(new Todo(fullCommand.substring(TODO_LENGTH))); + case DEADLINE: + if (responses.length < 2) { + throw new DukeException("\tThe description of a deadline cannot be empty."); + } + int deadlineDividerPosition = fullCommand.indexOf(" /by"); + if (deadlineDividerPosition == -1) { + throw new DukeException("\tPlease follow the format: deadline thingsToDo /by time"); + } + String deadlineName = fullCommand.substring(DEADLINE_LENGTH,deadlineDividerPosition); + String deadlineTime = fullCommand.substring(deadlineDividerPosition + FORMAT_LENGTH); + return new AddCommand(new Deadline(deadlineName,deadlineTime)); + case EVENT: + if (responses.length < 2) { + throw new DukeException("\tThe description of a event cannot be empty."); + } + int eventDividerPosition = fullCommand.indexOf(" /at"); + if (eventDividerPosition == -1) { + throw new DukeException("\tPlease follow the format: event thingsToDo /at time"); + } + String eventName = fullCommand.substring(EVENT_LENGTH,eventDividerPosition); + String EventTime = fullCommand.substring(eventDividerPosition + FORMAT_LENGTH); + return new AddCommand(new Event(eventName,EventTime)); + case DONE: + if (responses.length < 2 || !isNumeric(responses[1])) { + throw new DukeException("\tPlease input a task number that you want to mark as done"); + } + return new DoneCommand(Integer.parseInt(responses[1])); + case DELETE: + if (responses.length < 2 || !isNumeric(responses[1])) { + throw new DukeException("\tPlease input a task number that you want to delete"); + } + int deleteCount = Integer.parseInt(responses[1]); + return new DeleteCommand(deleteCount); + case LIST: + return new ListCommand(); + case BYE: + return new ExitCommand(); + default: + return new InvalidCommand(); + } + + } + +} diff --git a/src/main/java/duke/storage/Storage.java b/src/main/java/duke/storage/Storage.java new file mode 100644 index 0000000000..c732d40ca2 --- /dev/null +++ b/src/main/java/duke/storage/Storage.java @@ -0,0 +1,76 @@ +package duke.storage; + +import duke.taskList.TaskList; +import duke.taskList.task.Deadline; +import duke.taskList.task.Event; +import duke.taskList.task.Todo; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.IOException; +import java.util.Scanner; + + +public class Storage { + private static String filePath; + + public Storage() { + } + + public Storage(String filePath) { + this.filePath = filePath; + } + + /** + * Helper function that change the format of a task in file to correct format of a task in taskList + * @param oneTask a line in the hard disk + */ + public static void loadATask(String oneTask, TaskList tasks) { + String[] taskSplit = oneTask.split(" \\| "); + switch (taskSplit[0]) { + case "T": + tasks.addTask(new Todo(taskSplit[2])); + break; + case "D": + tasks.addTask(new Deadline(taskSplit[2],taskSplit[3])); + break; + case "E": + tasks.addTask(new Event(taskSplit[2],taskSplit[3])); + break; + default: + break; + } + if (taskSplit[1].equals("1")) { + tasks.getATask(tasks.size() - 1).markAsDone(); + } + } + + /** + * Load the content in the file to storage + * @return a list of tasks + */ + public void load(TaskList tasks) throws FileNotFoundException { + File f = new File(filePath); + if (!f.exists()) { + throw new FileNotFoundException(); + } + Scanner s = new Scanner(f); + while (s.hasNext()) { + String oneTask; + loadATask(s.nextLine(),tasks); + } + } + + public static void write(TaskList tasks) throws IOException { + File f = new File(filePath); + if(!f.exists()) { + throw new IOException(); + } + FileWriter fw = new FileWriter(filePath); + for (int i = 0; i < tasks.size(); i++) { + fw.write(tasks.getATask(i).toFile() + "\n"); + } + fw.close(); + } +} diff --git a/src/main/java/duke/taskList/TaskList.java b/src/main/java/duke/taskList/TaskList.java new file mode 100644 index 0000000000..d0c194563c --- /dev/null +++ b/src/main/java/duke/taskList/TaskList.java @@ -0,0 +1,37 @@ +package duke.taskList; + +import duke.taskList.task.Task; + +import java.util.ArrayList; + +public class TaskList { + private static ArrayList tasks; + + public TaskList() { + this.tasks = new ArrayList<>(); + } + + public TaskList(ArrayList storage) { + this.tasks = storage; + } + + public static void addTask(Task task) { + tasks.add(task); + } + + public static Task deleteTask(int deleteCount) { + return tasks.remove(deleteCount); + } + + public ArrayList getTaskList() { + return this.tasks; + } + + public Task getATask(int taskCount) { + return this.tasks.get(taskCount); + } + + public int size() { + return tasks.size(); + } +} diff --git a/src/main/java/duke/task/Deadline.java b/src/main/java/duke/taskList/task/Deadline.java similarity index 69% rename from src/main/java/duke/task/Deadline.java rename to src/main/java/duke/taskList/task/Deadline.java index 98f907c31a..6ca178a78c 100644 --- a/src/main/java/duke/task/Deadline.java +++ b/src/main/java/duke/taskList/task/Deadline.java @@ -1,6 +1,6 @@ -package duke.task; +package duke.taskList.task; -import duke.task.Task; +import static duke.common.Constants.DEADLINE; public class Deadline extends Task { @@ -20,4 +20,9 @@ public String toString() { public String toFile() { return "D | " + super.toFile() + " | " + by; } + + @Override + public String type() { + return DEADLINE; + } } diff --git a/src/main/java/duke/task/Event.java b/src/main/java/duke/taskList/task/Event.java similarity index 69% rename from src/main/java/duke/task/Event.java rename to src/main/java/duke/taskList/task/Event.java index 868db06bf9..3b4de32edd 100644 --- a/src/main/java/duke/task/Event.java +++ b/src/main/java/duke/taskList/task/Event.java @@ -1,4 +1,6 @@ -package duke.task; +package duke.taskList.task; + +import static duke.common.Constants.EVENT; public class Event extends Task { @@ -18,4 +20,9 @@ public String toString() { public String toFile() { return "E | " + super.toFile() + " | " + at; } + + @Override + public String type() { + return EVENT; + } } diff --git a/src/main/java/duke/task/Task.java b/src/main/java/duke/taskList/task/Task.java similarity index 81% rename from src/main/java/duke/task/Task.java rename to src/main/java/duke/taskList/task/Task.java index 31a81521b1..460d4aaf18 100644 --- a/src/main/java/duke/task/Task.java +++ b/src/main/java/duke/taskList/task/Task.java @@ -1,6 +1,6 @@ -package duke.task; +package duke.taskList.task; -public class Task { +public abstract class Task { protected String description; protected boolean isDone; @@ -32,4 +32,8 @@ public String toString() { public String toFile() { return ((isDone ? "1" : "0") + " | " + this.description); } + + public String type() { + return null; + } } diff --git a/src/main/java/duke/task/Todo.java b/src/main/java/duke/taskList/task/Todo.java similarity index 63% rename from src/main/java/duke/task/Todo.java rename to src/main/java/duke/taskList/task/Todo.java index f29d8ce558..9dd9b8ea1f 100644 --- a/src/main/java/duke/task/Todo.java +++ b/src/main/java/duke/taskList/task/Todo.java @@ -1,4 +1,6 @@ -package duke.task; +package duke.taskList.task; + +import static duke.common.Constants.TODO; public class Todo extends Task { @@ -15,4 +17,9 @@ public String toString() { public String toFile() { return "T | " + super.toFile(); } + + @Override + public String type() { + return TODO; + } } diff --git a/src/main/java/duke/ui/Ui.java b/src/main/java/duke/ui/Ui.java new file mode 100644 index 0000000000..a7c688c9bd --- /dev/null +++ b/src/main/java/duke/ui/Ui.java @@ -0,0 +1,89 @@ +package duke.ui; + +import duke.common.DukeException; +import duke.taskList.TaskList; +import duke.taskList.task.Task; + +import java.util.Scanner; + +import static duke.common.Constants.LINE_BREAK; +import static duke.common.Constants.LOGO; + +public class Ui { + private static Scanner in = new Scanner(System.in); + + public Ui() { + System.out.println("Hello from\n" + LOGO); + } + + public String readCommand() { + return in.nextLine(); + } + + public void showLine() { + System.out.println(LINE_BREAK); + } + + /** + * Generates and prints the welcome message upon the start of the application. + */ + public void showWelcome() { + showLine(); + System.out.println("\tHello! I'm duke.Duke"); + System.out.println("\tWhat can I do for you?"); + showLine(); + System.out.println(); + } + + public void showGoodByeMessage() { + System.out.println("\tBye. Hope to see you again soon!"); + } + + /** + * Displays list of tasks and if they are done + * @param tasks store the task list + * @throws DukeException If there is no tasks, throws the exception + */ + public void showListOfTasks (TaskList tasks) throws DukeException { + System.out.println("\tHere are the tasks in your list:"); + for (int i = 0; i < tasks.size(); i++) { + System.out.println("\t" + (i + 1) + "." + tasks.getATask(i)); + } + } + + /** + * Displays prompt message that a task is marked as done + * @param tasks store the task list + * @param doneCount the task that is done + */ + public void showMarkAsDoneMessage(TaskList tasks, int doneCount) { + System.out.println("\tNice! I've marked this task as done:"); + System.out.println("\t yes! " + tasks.getATask(doneCount).getDescription()); + } + + public void showDeleteMessage(Task deleteTask, TaskList tasks) { + System.out.println("\tNoted. I've removed this task:"); + System.out.println("\t " + deleteTask); + System.out.println("\tNow you have " + tasks.size() + " tasks in the list."); + } + + /** + * Displays prompt message that a new task is added in the task list + * @param tasks store the task list + */ + public void showAddTaskMessage(TaskList tasks) { + System.out.println("\tGot it. I've added this task:"); + System.out.println("\t " + tasks.getATask(tasks.size() - 1)); + System.out.println("\tNow you have " + tasks.size() + " tasks in the list"); + } + + public void showLoadingError() { + System.out.println("\tCreating back up file in the hard disk..."); + } + + public void showError(String error) { + System.out.println(error); + } + +} + diff --git a/text-ui-test/ACTUAL.TXT b/text-ui-test/ACTUAL.TXT index 5bcbeda13b..5d4ff5274e 100644 --- a/text-ui-test/ACTUAL.TXT +++ b/text-ui-test/ACTUAL.TXT @@ -5,87 +5,74 @@ Hello from | |_| | |_| | < __/ |____/ \__,_|_|\_\___| + Creating back up file in the hard disk... ____________________________________________________________ Hello! I'm duke.Duke What can I do for you? ____________________________________________________________ ____________________________________________________________ - :(OOPS!!! Please enter the task number. + Please input a task number that you want to mark as done ____________________________________________________________ - ____________________________________________________________ - :(OOPS!!! No tasks!!! + Currently, there is no task in the list! ____________________________________________________________ - ____________________________________________________________ Got it. I've added this task: - [T][?] eat + [T][ ] eat Now you have 1 tasks in the list ____________________________________________________________ - ____________________________________________________________ Got it. I've added this task: - [T][?] sleep + [T][ ] sleep Now you have 2 tasks in the list ____________________________________________________________ - ____________________________________________________________ - :(OOPS!!! The description of a todo cannot be empty. + The description of a todo cannot be empty. ____________________________________________________________ - ____________________________________________________________ - :(OOPS!!! I'm sorry, but I don't know what that means :-( + Sorry.I do not understand you. ____________________________________________________________ - ____________________________________________________________ Got it. I've added this task: - [D][?] cs2113 (by: Tuesday) + [D][ ] cs2113 (by: Tuesday) Now you have 3 tasks in the list ____________________________________________________________ - ____________________________________________________________ Got it. I've added this task: - [E][?] project meeting (at: Mon 2-4pm) + [E][ ] project meeting (at: Mon 2-4pm) Now you have 4 tasks in the list ____________________________________________________________ - ____________________________________________________________ - :(OOPS!!! The description of a event cannot be empty. + The description of a event cannot be empty. ____________________________________________________________ - ____________________________________________________________ Nice! I've marked this task as done: - [?] sleep + yes! sleep ____________________________________________________________ - ____________________________________________________________ Nice! I've marked this task as done: - [?] cs2113 + yes! cs2113 ____________________________________________________________ - ____________________________________________________________ Here are the tasks in your list: - 1.[T][?] eat - 2.[T][?] sleep - 3.[D][?] cs2113 (by: Tuesday) - 4.[E][?] project meeting (at: Mon 2-4pm) + 1.[T][ ] eat + 2.[T][/] sleep + 3.[D][/] cs2113 (by: Tuesday) + 4.[E][ ] project meeting (at: Mon 2-4pm) ____________________________________________________________ - ____________________________________________________________ Noted. I've removed this task: - [T][?] sleep + [T][/] sleep Now you have 3 tasks in the list. ____________________________________________________________ - ____________________________________________________________ Here are the tasks in your list: - 1.[T][?] eat - 2.[D][?] cs2113 (by: Tuesday) - 3.[E][?] project meeting (at: Mon 2-4pm) + 1.[T][ ] eat + 2.[D][/] cs2113 (by: Tuesday) + 3.[E][ ] project meeting (at: Mon 2-4pm) + ____________________________________________________________ ____________________________________________________________ - ____________________________________________________________ Bye. Hope to see you again soon! ____________________________________________________________ - diff --git a/text-ui-test/EXPECTED.txt b/text-ui-test/EXPECTED.txt index 5bcbeda13b..5d4ff5274e 100644 --- a/text-ui-test/EXPECTED.txt +++ b/text-ui-test/EXPECTED.txt @@ -5,87 +5,74 @@ Hello from | |_| | |_| | < __/ |____/ \__,_|_|\_\___| + Creating back up file in the hard disk... ____________________________________________________________ Hello! I'm duke.Duke What can I do for you? ____________________________________________________________ ____________________________________________________________ - :(OOPS!!! Please enter the task number. + Please input a task number that you want to mark as done ____________________________________________________________ - ____________________________________________________________ - :(OOPS!!! No tasks!!! + Currently, there is no task in the list! ____________________________________________________________ - ____________________________________________________________ Got it. I've added this task: - [T][?] eat + [T][ ] eat Now you have 1 tasks in the list ____________________________________________________________ - ____________________________________________________________ Got it. I've added this task: - [T][?] sleep + [T][ ] sleep Now you have 2 tasks in the list ____________________________________________________________ - ____________________________________________________________ - :(OOPS!!! The description of a todo cannot be empty. + The description of a todo cannot be empty. ____________________________________________________________ - ____________________________________________________________ - :(OOPS!!! I'm sorry, but I don't know what that means :-( + Sorry.I do not understand you. ____________________________________________________________ - ____________________________________________________________ Got it. I've added this task: - [D][?] cs2113 (by: Tuesday) + [D][ ] cs2113 (by: Tuesday) Now you have 3 tasks in the list ____________________________________________________________ - ____________________________________________________________ Got it. I've added this task: - [E][?] project meeting (at: Mon 2-4pm) + [E][ ] project meeting (at: Mon 2-4pm) Now you have 4 tasks in the list ____________________________________________________________ - ____________________________________________________________ - :(OOPS!!! The description of a event cannot be empty. + The description of a event cannot be empty. ____________________________________________________________ - ____________________________________________________________ Nice! I've marked this task as done: - [?] sleep + yes! sleep ____________________________________________________________ - ____________________________________________________________ Nice! I've marked this task as done: - [?] cs2113 + yes! cs2113 ____________________________________________________________ - ____________________________________________________________ Here are the tasks in your list: - 1.[T][?] eat - 2.[T][?] sleep - 3.[D][?] cs2113 (by: Tuesday) - 4.[E][?] project meeting (at: Mon 2-4pm) + 1.[T][ ] eat + 2.[T][/] sleep + 3.[D][/] cs2113 (by: Tuesday) + 4.[E][ ] project meeting (at: Mon 2-4pm) ____________________________________________________________ - ____________________________________________________________ Noted. I've removed this task: - [T][?] sleep + [T][/] sleep Now you have 3 tasks in the list. ____________________________________________________________ - ____________________________________________________________ Here are the tasks in your list: - 1.[T][?] eat - 2.[D][?] cs2113 (by: Tuesday) - 3.[E][?] project meeting (at: Mon 2-4pm) + 1.[T][ ] eat + 2.[D][/] cs2113 (by: Tuesday) + 3.[E][ ] project meeting (at: Mon 2-4pm) + ____________________________________________________________ ____________________________________________________________ - ____________________________________________________________ Bye. Hope to see you again soon! ____________________________________________________________ - diff --git a/text-ui-test/data/duke.txt b/text-ui-test/data/duke.txt new file mode 100644 index 0000000000..ee3a9c81d2 --- /dev/null +++ b/text-ui-test/data/duke.txt @@ -0,0 +1,3 @@ +T | 0 | eat +D | 1 | cs2113 | Tuesday +E | 0 | project meeting | Mon 2-4pm diff --git a/text-ui-test/runtest.bat b/text-ui-test/runtest.bat index 0832f65fc6..591121e6b8 100644 --- a/text-ui-test/runtest.bat +++ b/text-ui-test/runtest.bat @@ -7,7 +7,7 @@ REM delete output from previous run del ACTUAL.TXT REM compile the code into the bin folder -javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\duke\*.java ..\src\main\java\duke\task\*.java +javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\duke\*.java ..\src\main\java\duke\command\*.java ..\src\main\java\duke\common\*.java ..\src\main\java\duke\parser\*.java ..\src\main\java\duke\storage\*.java ..\src\main\java\duke\taskList\*.java ..\src\main\java\duke\taskList\task\*.java ..\src\main\java\duke\ui\*.java IF ERRORLEVEL 1 ( echo ********** BUILD FAILURE ********** exit /b 1 From 51dc5412c0670b9be5cbd6292de681afffaac509 Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Thu, 27 Feb 2020 15:21:22 +0800 Subject: [PATCH 27/36] Change command to be abstract class and modify the exitcommand. --- src/main/java/duke/Duke.java | 24 --------------------- src/main/java/duke/command/Command.java | 6 ++---- src/main/java/duke/command/ExitCommand.java | 12 +++++++++++ src/main/java/duke/taskList/TaskList.java | 4 ---- text-ui-test/ACTUAL.TXT | 1 - text-ui-test/EXPECTED.txt | 1 - 6 files changed, 14 insertions(+), 34 deletions(-) diff --git a/src/main/java/duke/Duke.java b/src/main/java/duke/Duke.java index 2f9eede059..7f7f378ec8 100644 --- a/src/main/java/duke/Duke.java +++ b/src/main/java/duke/Duke.java @@ -57,34 +57,10 @@ public void run() { ui.showLine(); } } - ui.showGoodByeMessage(); - ui.showLine(); } public static void main(String[] args) { new Duke(FILE_PATH).run(); } - - - /*public static void loadTasks() { - File f = new File(FILE_PATH); - try { - Scanner s = new Scanner(f); - while (s.hasNext()) { - String oneTask; - oneTask = s.nextLine(); - loadATask(oneTask); - } - } catch (FileNotFoundException e) { - System.out.println("\tCreating back up file in hard disk... "); - System.out.println(); - try { - f.createNewFile(); - } catch (IOException error) { - - System.out.println("\tSomething went wrong: " + error.getMessage()); - } - } - }*/ } diff --git a/src/main/java/duke/command/Command.java b/src/main/java/duke/command/Command.java index b5027357e7..5b7e8ba6fe 100644 --- a/src/main/java/duke/command/Command.java +++ b/src/main/java/duke/command/Command.java @@ -7,14 +7,12 @@ import java.io.IOException; -public class Command { +public abstract class Command { public Command(){ } - public void execute (TaskList tasks, Ui ui, Storage storage) throws IOException, DukeException { - - } + public abstract void execute (TaskList tasks, Ui ui, Storage storage) throws IOException, DukeException ; public Boolean isExit() { return false; diff --git a/src/main/java/duke/command/ExitCommand.java b/src/main/java/duke/command/ExitCommand.java index 303323bd32..badef51cf5 100644 --- a/src/main/java/duke/command/ExitCommand.java +++ b/src/main/java/duke/command/ExitCommand.java @@ -1,5 +1,12 @@ package duke.command; +import duke.common.DukeException; +import duke.storage.Storage; +import duke.taskList.TaskList; +import duke.ui.Ui; + +import java.io.IOException; + public class ExitCommand extends Command{ public ExitCommand() { @@ -9,4 +16,9 @@ public ExitCommand() { public Boolean isExit() { return true; } + + @Override + public void execute (TaskList tasks, Ui ui, Storage storage) throws IOException, DukeException { + ui.showGoodByeMessage(); + } } diff --git a/src/main/java/duke/taskList/TaskList.java b/src/main/java/duke/taskList/TaskList.java index d0c194563c..d5202f0740 100644 --- a/src/main/java/duke/taskList/TaskList.java +++ b/src/main/java/duke/taskList/TaskList.java @@ -23,10 +23,6 @@ public static Task deleteTask(int deleteCount) { return tasks.remove(deleteCount); } - public ArrayList getTaskList() { - return this.tasks; - } - public Task getATask(int taskCount) { return this.tasks.get(taskCount); } diff --git a/text-ui-test/ACTUAL.TXT b/text-ui-test/ACTUAL.TXT index 5d4ff5274e..e821ee9ed5 100644 --- a/text-ui-test/ACTUAL.TXT +++ b/text-ui-test/ACTUAL.TXT @@ -73,6 +73,5 @@ Hello from 3.[E][ ] project meeting (at: Mon 2-4pm) ____________________________________________________________ ____________________________________________________________ - ____________________________________________________________ Bye. Hope to see you again soon! ____________________________________________________________ diff --git a/text-ui-test/EXPECTED.txt b/text-ui-test/EXPECTED.txt index 5d4ff5274e..e821ee9ed5 100644 --- a/text-ui-test/EXPECTED.txt +++ b/text-ui-test/EXPECTED.txt @@ -73,6 +73,5 @@ Hello from 3.[E][ ] project meeting (at: Mon 2-4pm) ____________________________________________________________ ____________________________________________________________ - ____________________________________________________________ Bye. Hope to see you again soon! ____________________________________________________________ From 80a856b3acbbd8c4be008933bbed2948ac3e0735 Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Thu, 27 Feb 2020 15:27:55 +0800 Subject: [PATCH 28/36] Find: Give users a way to find a task by searching for a keyword in descriptions --- src/main/java/duke/command/FindCommand.java | 28 ++++++++++++++++++ src/main/java/duke/common/Constants.java | 1 + src/main/java/duke/parser/Parser.java | 7 ++++- src/main/java/duke/ui/Ui.java | 12 ++++++++ text-ui-test/ACTUAL.TXT | 32 ++++++++++++++++++--- text-ui-test/EXPECTED.txt | 32 ++++++++++++++++++--- text-ui-test/data/duke.txt | 3 -- text-ui-test/input.txt | 8 +++++- 8 files changed, 110 insertions(+), 13 deletions(-) create mode 100644 src/main/java/duke/command/FindCommand.java delete mode 100644 text-ui-test/data/duke.txt diff --git a/src/main/java/duke/command/FindCommand.java b/src/main/java/duke/command/FindCommand.java new file mode 100644 index 0000000000..d10246cd63 --- /dev/null +++ b/src/main/java/duke/command/FindCommand.java @@ -0,0 +1,28 @@ +package duke.command; + +import duke.common.DukeException; +import duke.storage.Storage; +import duke.taskList.TaskList; +import duke.ui.Ui; + +import java.io.IOException; +import java.util.ArrayList; + +public class FindCommand extends Command{ + private static String findString; + private static ArrayList findCount; + + public FindCommand (String findString) { + this.findString = findString; + findCount = new ArrayList<>(); + } + + public void execute (TaskList tasks, Ui ui, Storage storage) throws IOException, DukeException { + for(int i = 0; i findCount) { + if (findCount.size() > 0) { + System.out.println("\tHere are the matching tasks in your list:"); + for (Integer i : findCount) { + System.out.println("\t" + (i + 1) + "." + tasks.getATask(i)); + } + } else { + System.out.println("\t No matching tasks."); + } + } + public void showLoadingError() { System.out.println("\tCreating back up file in the hard disk..."); } diff --git a/text-ui-test/ACTUAL.TXT b/text-ui-test/ACTUAL.TXT index e821ee9ed5..ad11e861c2 100644 --- a/text-ui-test/ACTUAL.TXT +++ b/text-ui-test/ACTUAL.TXT @@ -19,7 +19,7 @@ Hello from ____________________________________________________________ ____________________________________________________________ Got it. I've added this task: - [T][ ] eat + [T][ ] read book Now you have 1 tasks in the list ____________________________________________________________ ____________________________________________________________ @@ -44,9 +44,25 @@ Hello from Now you have 4 tasks in the list ____________________________________________________________ ____________________________________________________________ + Got it. I've added this task: + [D][ ] book review (by: Friday) + Now you have 5 tasks in the list + ____________________________________________________________ + ____________________________________________________________ The description of a event cannot be empty. ____________________________________________________________ ____________________________________________________________ + Here are the matching tasks in your list: + 1.[T][ ] read book + 5.[D][ ] book review (by: Friday) + ____________________________________________________________ + ____________________________________________________________ + Please input the thing you want to find + ____________________________________________________________ + ____________________________________________________________ + No matching tasks. + ____________________________________________________________ + ____________________________________________________________ Nice! I've marked this task as done: yes! sleep ____________________________________________________________ @@ -55,22 +71,30 @@ Hello from yes! cs2113 ____________________________________________________________ ____________________________________________________________ + There is no task 10. Please reconsider the index. + ____________________________________________________________ + ____________________________________________________________ Here are the tasks in your list: - 1.[T][ ] eat + 1.[T][ ] read book 2.[T][/] sleep 3.[D][/] cs2113 (by: Tuesday) 4.[E][ ] project meeting (at: Mon 2-4pm) + 5.[D][ ] book review (by: Friday) ____________________________________________________________ ____________________________________________________________ Noted. I've removed this task: [T][/] sleep - Now you have 3 tasks in the list. + Now you have 4 tasks in the list. + ____________________________________________________________ + ____________________________________________________________ + Please input a task number that you want to delete ____________________________________________________________ ____________________________________________________________ Here are the tasks in your list: - 1.[T][ ] eat + 1.[T][ ] read book 2.[D][/] cs2113 (by: Tuesday) 3.[E][ ] project meeting (at: Mon 2-4pm) + 4.[D][ ] book review (by: Friday) ____________________________________________________________ ____________________________________________________________ Bye. Hope to see you again soon! diff --git a/text-ui-test/EXPECTED.txt b/text-ui-test/EXPECTED.txt index e821ee9ed5..ad11e861c2 100644 --- a/text-ui-test/EXPECTED.txt +++ b/text-ui-test/EXPECTED.txt @@ -19,7 +19,7 @@ Hello from ____________________________________________________________ ____________________________________________________________ Got it. I've added this task: - [T][ ] eat + [T][ ] read book Now you have 1 tasks in the list ____________________________________________________________ ____________________________________________________________ @@ -44,9 +44,25 @@ Hello from Now you have 4 tasks in the list ____________________________________________________________ ____________________________________________________________ + Got it. I've added this task: + [D][ ] book review (by: Friday) + Now you have 5 tasks in the list + ____________________________________________________________ + ____________________________________________________________ The description of a event cannot be empty. ____________________________________________________________ ____________________________________________________________ + Here are the matching tasks in your list: + 1.[T][ ] read book + 5.[D][ ] book review (by: Friday) + ____________________________________________________________ + ____________________________________________________________ + Please input the thing you want to find + ____________________________________________________________ + ____________________________________________________________ + No matching tasks. + ____________________________________________________________ + ____________________________________________________________ Nice! I've marked this task as done: yes! sleep ____________________________________________________________ @@ -55,22 +71,30 @@ Hello from yes! cs2113 ____________________________________________________________ ____________________________________________________________ + There is no task 10. Please reconsider the index. + ____________________________________________________________ + ____________________________________________________________ Here are the tasks in your list: - 1.[T][ ] eat + 1.[T][ ] read book 2.[T][/] sleep 3.[D][/] cs2113 (by: Tuesday) 4.[E][ ] project meeting (at: Mon 2-4pm) + 5.[D][ ] book review (by: Friday) ____________________________________________________________ ____________________________________________________________ Noted. I've removed this task: [T][/] sleep - Now you have 3 tasks in the list. + Now you have 4 tasks in the list. + ____________________________________________________________ + ____________________________________________________________ + Please input a task number that you want to delete ____________________________________________________________ ____________________________________________________________ Here are the tasks in your list: - 1.[T][ ] eat + 1.[T][ ] read book 2.[D][/] cs2113 (by: Tuesday) 3.[E][ ] project meeting (at: Mon 2-4pm) + 4.[D][ ] book review (by: Friday) ____________________________________________________________ ____________________________________________________________ Bye. Hope to see you again soon! diff --git a/text-ui-test/data/duke.txt b/text-ui-test/data/duke.txt deleted file mode 100644 index ee3a9c81d2..0000000000 --- a/text-ui-test/data/duke.txt +++ /dev/null @@ -1,3 +0,0 @@ -T | 0 | eat -D | 1 | cs2113 | Tuesday -E | 0 | project meeting | Mon 2-4pm diff --git a/text-ui-test/input.txt b/text-ui-test/input.txt index 38b914ce55..40127fc7a6 100644 --- a/text-ui-test/input.txt +++ b/text-ui-test/input.txt @@ -1,15 +1,21 @@ done list -todo eat +todo read book todo sleep todo heyhey deadline cs2113 /by Tuesday event project meeting /at Mon 2-4pm +deadline book review /by Friday event +find book +find +find exam done 2 done 3 +done 10 list delete 2 +delete list bye \ No newline at end of file From 9232bc8599a27c193c36b88301443d271679b328 Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Thu, 27 Feb 2020 16:15:08 +0800 Subject: [PATCH 29/36] Dates and Times: Teach Duke to understand dates and times. --- .../java/duke/taskList/task/Deadline.java | 19 ++++++++++++++-- src/main/java/duke/taskList/task/Event.java | 19 ++++++++++++++-- text-ui-test/ACTUAL.TXT | 22 +++++++++++++++---- text-ui-test/EXPECTED.txt | 22 +++++++++++++++---- text-ui-test/data/duke.txt | 2 ++ text-ui-test/input.txt | 2 ++ 6 files changed, 74 insertions(+), 12 deletions(-) diff --git a/src/main/java/duke/taskList/task/Deadline.java b/src/main/java/duke/taskList/task/Deadline.java index 6ca178a78c..6791d47a4f 100644 --- a/src/main/java/duke/taskList/task/Deadline.java +++ b/src/main/java/duke/taskList/task/Deadline.java @@ -1,14 +1,29 @@ package duke.taskList.task; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; +import java.util.Locale; + import static duke.common.Constants.DEADLINE; public class Deadline extends Task { - protected String by; + protected String by; + protected LocalDate time; public Deadline(String description,String by) { super(description); - this.by = by; + try{ + this.time = LocalDate.parse(by); + this.by = time.format(DateTimeFormatter.ofPattern("MMM d yyyy", Locale.US)) + ", " + time.getDayOfWeek(); + } catch (DateTimeParseException e) { + this.by = by; + } + } + + public LocalDate getTime() { + return this.time; } @Override diff --git a/src/main/java/duke/taskList/task/Event.java b/src/main/java/duke/taskList/task/Event.java index 3b4de32edd..1bbe1626ce 100644 --- a/src/main/java/duke/taskList/task/Event.java +++ b/src/main/java/duke/taskList/task/Event.java @@ -1,14 +1,29 @@ package duke.taskList.task; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; +import java.util.Locale; + import static duke.common.Constants.EVENT; public class Event extends Task { - protected String at; + protected String at; + protected LocalDate time; public Event(String description,String at) { super(description); - this.at = at; + try{ + this.time = LocalDate.parse(at); + this.at = time.format(DateTimeFormatter.ofPattern("MMM d yyyy", Locale.US)) + ", " + time.getDayOfWeek(); + } catch (DateTimeParseException e) { + this.at = at; + } + } + + public LocalDate getTime() { + return this.time; } @Override diff --git a/text-ui-test/ACTUAL.TXT b/text-ui-test/ACTUAL.TXT index e821ee9ed5..1f0bb578b6 100644 --- a/text-ui-test/ACTUAL.TXT +++ b/text-ui-test/ACTUAL.TXT @@ -40,10 +40,20 @@ Hello from ____________________________________________________________ ____________________________________________________________ Got it. I've added this task: - [E][ ] project meeting (at: Mon 2-4pm) + [D][ ] assignment (by: Feb 28 2020, FRIDAY) Now you have 4 tasks in the list ____________________________________________________________ ____________________________________________________________ + Got it. I've added this task: + [E][ ] project meeting (at: Mon 2-4pm) + Now you have 5 tasks in the list + ____________________________________________________________ + ____________________________________________________________ + Got it. I've added this task: + [E][ ] concert (at: Mar 21 2020, SATURDAY) + Now you have 6 tasks in the list + ____________________________________________________________ + ____________________________________________________________ The description of a event cannot be empty. ____________________________________________________________ ____________________________________________________________ @@ -59,18 +69,22 @@ Hello from 1.[T][ ] eat 2.[T][/] sleep 3.[D][/] cs2113 (by: Tuesday) - 4.[E][ ] project meeting (at: Mon 2-4pm) + 4.[D][ ] assignment (by: Feb 28 2020, FRIDAY) + 5.[E][ ] project meeting (at: Mon 2-4pm) + 6.[E][ ] concert (at: Mar 21 2020, SATURDAY) ____________________________________________________________ ____________________________________________________________ Noted. I've removed this task: [T][/] sleep - Now you have 3 tasks in the list. + Now you have 5 tasks in the list. ____________________________________________________________ ____________________________________________________________ Here are the tasks in your list: 1.[T][ ] eat 2.[D][/] cs2113 (by: Tuesday) - 3.[E][ ] project meeting (at: Mon 2-4pm) + 3.[D][ ] assignment (by: Feb 28 2020, FRIDAY) + 4.[E][ ] project meeting (at: Mon 2-4pm) + 5.[E][ ] concert (at: Mar 21 2020, SATURDAY) ____________________________________________________________ ____________________________________________________________ Bye. Hope to see you again soon! diff --git a/text-ui-test/EXPECTED.txt b/text-ui-test/EXPECTED.txt index e821ee9ed5..1f0bb578b6 100644 --- a/text-ui-test/EXPECTED.txt +++ b/text-ui-test/EXPECTED.txt @@ -40,10 +40,20 @@ Hello from ____________________________________________________________ ____________________________________________________________ Got it. I've added this task: - [E][ ] project meeting (at: Mon 2-4pm) + [D][ ] assignment (by: Feb 28 2020, FRIDAY) Now you have 4 tasks in the list ____________________________________________________________ ____________________________________________________________ + Got it. I've added this task: + [E][ ] project meeting (at: Mon 2-4pm) + Now you have 5 tasks in the list + ____________________________________________________________ + ____________________________________________________________ + Got it. I've added this task: + [E][ ] concert (at: Mar 21 2020, SATURDAY) + Now you have 6 tasks in the list + ____________________________________________________________ + ____________________________________________________________ The description of a event cannot be empty. ____________________________________________________________ ____________________________________________________________ @@ -59,18 +69,22 @@ Hello from 1.[T][ ] eat 2.[T][/] sleep 3.[D][/] cs2113 (by: Tuesday) - 4.[E][ ] project meeting (at: Mon 2-4pm) + 4.[D][ ] assignment (by: Feb 28 2020, FRIDAY) + 5.[E][ ] project meeting (at: Mon 2-4pm) + 6.[E][ ] concert (at: Mar 21 2020, SATURDAY) ____________________________________________________________ ____________________________________________________________ Noted. I've removed this task: [T][/] sleep - Now you have 3 tasks in the list. + Now you have 5 tasks in the list. ____________________________________________________________ ____________________________________________________________ Here are the tasks in your list: 1.[T][ ] eat 2.[D][/] cs2113 (by: Tuesday) - 3.[E][ ] project meeting (at: Mon 2-4pm) + 3.[D][ ] assignment (by: Feb 28 2020, FRIDAY) + 4.[E][ ] project meeting (at: Mon 2-4pm) + 5.[E][ ] concert (at: Mar 21 2020, SATURDAY) ____________________________________________________________ ____________________________________________________________ Bye. Hope to see you again soon! diff --git a/text-ui-test/data/duke.txt b/text-ui-test/data/duke.txt index ee3a9c81d2..c94532aadc 100644 --- a/text-ui-test/data/duke.txt +++ b/text-ui-test/data/duke.txt @@ -1,3 +1,5 @@ T | 0 | eat D | 1 | cs2113 | Tuesday +D | 0 | assignment | Feb 28 2020, FRIDAY E | 0 | project meeting | Mon 2-4pm +E | 0 | concert | Mar 21 2020, SATURDAY diff --git a/text-ui-test/input.txt b/text-ui-test/input.txt index 38b914ce55..79ddd6400e 100644 --- a/text-ui-test/input.txt +++ b/text-ui-test/input.txt @@ -5,7 +5,9 @@ todo sleep todo heyhey deadline cs2113 /by Tuesday +deadline assignment /by 2020-02-28 event project meeting /at Mon 2-4pm +event concert /at 2020-03-21 event done 2 done 3 From c93b0d61ab014b13d58506815caeabbb96fb4418 Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Thu, 27 Feb 2020 16:57:03 +0800 Subject: [PATCH 30/36] Stretch goal: add a command CHECK to print deadlines/events occurring on a specific date. --- src/main/java/duke/command/CheckCommand.java | 51 +++++++++++++++++++ src/main/java/duke/common/Constants.java | 1 + src/main/java/duke/parser/Parser.java | 5 ++ .../java/duke/taskList/task/Deadline.java | 1 + src/main/java/duke/taskList/task/Event.java | 1 + src/main/java/duke/taskList/task/Task.java | 6 +++ src/main/java/duke/ui/Ui.java | 12 +++++ text-ui-test/ACTUAL.TXT | 11 ++-- text-ui-test/EXPECTED.txt | 11 ++-- text-ui-test/data/duke.txt | 5 -- text-ui-test/input.txt | 3 +- 11 files changed, 95 insertions(+), 12 deletions(-) create mode 100644 src/main/java/duke/command/CheckCommand.java delete mode 100644 text-ui-test/data/duke.txt diff --git a/src/main/java/duke/command/CheckCommand.java b/src/main/java/duke/command/CheckCommand.java new file mode 100644 index 0000000000..7605a3cc10 --- /dev/null +++ b/src/main/java/duke/command/CheckCommand.java @@ -0,0 +1,51 @@ +package duke.command; + +import duke.Duke; +import duke.common.DukeException; +import duke.storage.Storage; +import duke.taskList.TaskList; +import duke.ui.Ui; + +import java.io.IOException; +import java.time.LocalDate; +import java.time.format.DateTimeParseException; +import java.util.ArrayList; +import java.util.function.ToDoubleBiFunction; + +import static duke.common.Constants.TODO; + +public class CheckCommand extends Command{ + + private static String checkString; + private static ArrayList checkCount; + + public CheckCommand (String checkString) { + this.checkString = checkString; + checkCount = new ArrayList<>(); + } + + private Boolean isLocalDateFormat() { + try { + LocalDate.parse(this.checkString); + } catch (DateTimeParseException e) { + return false; + } + return true; + } + + public void execute (TaskList tasks, Ui ui, Storage storage) throws IOException, DukeException { + if (!isLocalDateFormat()) { + throw new DukeException("\t Please follow the format: check yyyy-mm-dd"); + } + LocalDate date = LocalDate.parse(checkString); + for(int i = 0; i findCount) { + if (findCount.size() > 0) { + System.out.println("\tHere are the matching tasks in your list:"); + for (Integer i : findCount) { + System.out.println("\t" + (i + 1) + "." + tasks.getATask(i)); + } + } else { + System.out.println("\t No matching tasks."); + } + } + /** * Displays prompt message that a new task is added in the task list * @param tasks store the task list diff --git a/text-ui-test/ACTUAL.TXT b/text-ui-test/ACTUAL.TXT index 1f0bb578b6..e2e0fa9320 100644 --- a/text-ui-test/ACTUAL.TXT +++ b/text-ui-test/ACTUAL.TXT @@ -40,7 +40,7 @@ Hello from ____________________________________________________________ ____________________________________________________________ Got it. I've added this task: - [D][ ] assignment (by: Feb 28 2020, FRIDAY) + [D][ ] assignment (by: Mar 21 2020, SATURDAY) Now you have 4 tasks in the list ____________________________________________________________ ____________________________________________________________ @@ -54,6 +54,11 @@ Hello from Now you have 6 tasks in the list ____________________________________________________________ ____________________________________________________________ + Here are the matching tasks in your list: + 4.[D][ ] assignment (by: Mar 21 2020, SATURDAY) + 6.[E][ ] concert (at: Mar 21 2020, SATURDAY) + ____________________________________________________________ + ____________________________________________________________ The description of a event cannot be empty. ____________________________________________________________ ____________________________________________________________ @@ -69,7 +74,7 @@ Hello from 1.[T][ ] eat 2.[T][/] sleep 3.[D][/] cs2113 (by: Tuesday) - 4.[D][ ] assignment (by: Feb 28 2020, FRIDAY) + 4.[D][ ] assignment (by: Mar 21 2020, SATURDAY) 5.[E][ ] project meeting (at: Mon 2-4pm) 6.[E][ ] concert (at: Mar 21 2020, SATURDAY) ____________________________________________________________ @@ -82,7 +87,7 @@ Hello from Here are the tasks in your list: 1.[T][ ] eat 2.[D][/] cs2113 (by: Tuesday) - 3.[D][ ] assignment (by: Feb 28 2020, FRIDAY) + 3.[D][ ] assignment (by: Mar 21 2020, SATURDAY) 4.[E][ ] project meeting (at: Mon 2-4pm) 5.[E][ ] concert (at: Mar 21 2020, SATURDAY) ____________________________________________________________ diff --git a/text-ui-test/EXPECTED.txt b/text-ui-test/EXPECTED.txt index 1f0bb578b6..e2e0fa9320 100644 --- a/text-ui-test/EXPECTED.txt +++ b/text-ui-test/EXPECTED.txt @@ -40,7 +40,7 @@ Hello from ____________________________________________________________ ____________________________________________________________ Got it. I've added this task: - [D][ ] assignment (by: Feb 28 2020, FRIDAY) + [D][ ] assignment (by: Mar 21 2020, SATURDAY) Now you have 4 tasks in the list ____________________________________________________________ ____________________________________________________________ @@ -54,6 +54,11 @@ Hello from Now you have 6 tasks in the list ____________________________________________________________ ____________________________________________________________ + Here are the matching tasks in your list: + 4.[D][ ] assignment (by: Mar 21 2020, SATURDAY) + 6.[E][ ] concert (at: Mar 21 2020, SATURDAY) + ____________________________________________________________ + ____________________________________________________________ The description of a event cannot be empty. ____________________________________________________________ ____________________________________________________________ @@ -69,7 +74,7 @@ Hello from 1.[T][ ] eat 2.[T][/] sleep 3.[D][/] cs2113 (by: Tuesday) - 4.[D][ ] assignment (by: Feb 28 2020, FRIDAY) + 4.[D][ ] assignment (by: Mar 21 2020, SATURDAY) 5.[E][ ] project meeting (at: Mon 2-4pm) 6.[E][ ] concert (at: Mar 21 2020, SATURDAY) ____________________________________________________________ @@ -82,7 +87,7 @@ Hello from Here are the tasks in your list: 1.[T][ ] eat 2.[D][/] cs2113 (by: Tuesday) - 3.[D][ ] assignment (by: Feb 28 2020, FRIDAY) + 3.[D][ ] assignment (by: Mar 21 2020, SATURDAY) 4.[E][ ] project meeting (at: Mon 2-4pm) 5.[E][ ] concert (at: Mar 21 2020, SATURDAY) ____________________________________________________________ diff --git a/text-ui-test/data/duke.txt b/text-ui-test/data/duke.txt deleted file mode 100644 index c94532aadc..0000000000 --- a/text-ui-test/data/duke.txt +++ /dev/null @@ -1,5 +0,0 @@ -T | 0 | eat -D | 1 | cs2113 | Tuesday -D | 0 | assignment | Feb 28 2020, FRIDAY -E | 0 | project meeting | Mon 2-4pm -E | 0 | concert | Mar 21 2020, SATURDAY diff --git a/text-ui-test/input.txt b/text-ui-test/input.txt index 79ddd6400e..e11cf5f799 100644 --- a/text-ui-test/input.txt +++ b/text-ui-test/input.txt @@ -5,9 +5,10 @@ todo sleep todo heyhey deadline cs2113 /by Tuesday -deadline assignment /by 2020-02-28 +deadline assignment /by 2020-03-21 event project meeting /at Mon 2-4pm event concert /at 2020-03-21 +check 2020-03-21 event done 2 done 3 From 5a8a3589ae0efc29e597fda50d038579fecca2f4 Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Thu, 27 Feb 2020 19:15:45 +0800 Subject: [PATCH 31/36] Add JavaDoc comments to the code. --- src/main/java/duke/{taskList => tasklist}/TaskList.java | 0 src/main/java/duke/{taskList => tasklist}/task/Deadline.java | 0 src/main/java/duke/{taskList => tasklist}/task/Event.java | 0 src/main/java/duke/{taskList => tasklist}/task/Task.java | 0 src/main/java/duke/{taskList => tasklist}/task/Todo.java | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename src/main/java/duke/{taskList => tasklist}/TaskList.java (100%) rename src/main/java/duke/{taskList => tasklist}/task/Deadline.java (100%) rename src/main/java/duke/{taskList => tasklist}/task/Event.java (100%) rename src/main/java/duke/{taskList => tasklist}/task/Task.java (100%) rename src/main/java/duke/{taskList => tasklist}/task/Todo.java (100%) diff --git a/src/main/java/duke/taskList/TaskList.java b/src/main/java/duke/tasklist/TaskList.java similarity index 100% rename from src/main/java/duke/taskList/TaskList.java rename to src/main/java/duke/tasklist/TaskList.java diff --git a/src/main/java/duke/taskList/task/Deadline.java b/src/main/java/duke/tasklist/task/Deadline.java similarity index 100% rename from src/main/java/duke/taskList/task/Deadline.java rename to src/main/java/duke/tasklist/task/Deadline.java diff --git a/src/main/java/duke/taskList/task/Event.java b/src/main/java/duke/tasklist/task/Event.java similarity index 100% rename from src/main/java/duke/taskList/task/Event.java rename to src/main/java/duke/tasklist/task/Event.java diff --git a/src/main/java/duke/taskList/task/Task.java b/src/main/java/duke/tasklist/task/Task.java similarity index 100% rename from src/main/java/duke/taskList/task/Task.java rename to src/main/java/duke/tasklist/task/Task.java diff --git a/src/main/java/duke/taskList/task/Todo.java b/src/main/java/duke/tasklist/task/Todo.java similarity index 100% rename from src/main/java/duke/taskList/task/Todo.java rename to src/main/java/duke/tasklist/task/Todo.java From bf391b209a0fc6e77e884b57fe5d5a3f3abe15d1 Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Thu, 27 Feb 2020 19:16:40 +0800 Subject: [PATCH 32/36] Add more JavaDoc comments to the code. --- src/main/java/duke/Duke.java | 12 +++- src/main/java/duke/command/AddCommand.java | 18 +++++- src/main/java/duke/command/Command.java | 20 +++++-- src/main/java/duke/command/DeleteCommand.java | 21 +++++-- src/main/java/duke/command/DoneCommand.java | 22 ++++++-- src/main/java/duke/command/ExitCommand.java | 19 +++++-- .../java/duke/command/InvalidCommand.java | 15 ++++- src/main/java/duke/command/ListCommand.java | 16 +++++- src/main/java/duke/common/Constants.java | 3 + src/main/java/duke/parser/Parser.java | 56 ++++++++++++------- src/main/java/duke/storage/Storage.java | 33 +++++++---- src/main/java/duke/tasklist/TaskList.java | 12 ++-- .../java/duke/tasklist/task/Deadline.java | 12 ++-- src/main/java/duke/tasklist/task/Event.java | 12 ++-- src/main/java/duke/tasklist/task/Task.java | 24 +++++--- src/main/java/duke/tasklist/task/Todo.java | 12 ++-- src/main/java/duke/ui/Ui.java | 41 ++++++++++---- 17 files changed, 241 insertions(+), 107 deletions(-) diff --git a/src/main/java/duke/Duke.java b/src/main/java/duke/Duke.java index 7f7f378ec8..9f2df525bf 100644 --- a/src/main/java/duke/Duke.java +++ b/src/main/java/duke/Duke.java @@ -4,7 +4,7 @@ import duke.common.DukeException; import duke.parser.Parser; import duke.storage.Storage; -import duke.taskList.TaskList; +import duke.tasklist.TaskList; import duke.ui.Ui; import java.io.File; @@ -20,6 +20,11 @@ public class Duke { private TaskList tasks; private Ui ui; + /** + * Initializes Duke object. + * + * @param filePath place where hard disk data stores + */ public Duke(String filePath) { ui = new Ui(); tasks = new TaskList(); @@ -30,7 +35,7 @@ public Duke(String filePath) { ui.showLoadingError(); File newFolder = new File(CREATE_FILE_PATH); newFolder.mkdirs(); - try{ + try { File f = new File(FILE_PATH); f.createNewFile(); } catch (IOException error) { @@ -39,6 +44,9 @@ public Duke(String filePath) { } } + /** + * Runs the Duke object. + */ public void run() { ui.showWelcome(); boolean isExit = false; diff --git a/src/main/java/duke/command/AddCommand.java b/src/main/java/duke/command/AddCommand.java index 774c56c893..031c32ab8f 100644 --- a/src/main/java/duke/command/AddCommand.java +++ b/src/main/java/duke/command/AddCommand.java @@ -1,18 +1,30 @@ package duke.command; -import duke.taskList.TaskList; +import duke.tasklist.TaskList; import duke.storage.Storage; -import duke.taskList.task.Task; +import duke.tasklist.task.Task; import duke.ui.Ui; import java.io.IOException; -public class AddCommand extends Command{ +/** + * Deals with commands related to adding tasks. + */ +public class AddCommand extends Command { private Task newtask; + public AddCommand(Task newtask) { this.newtask = newtask; } + /** + * Adds a new task in taskList, updates ui and backup file. + * + * @param tasks stores all tasks. + * @param ui deals with user interface. + * @param storage deals with back up file. + * @throws IOException if cannot find back up file in the hard disk. + */ @Override public void execute(TaskList tasks, Ui ui, Storage storage) throws IOException { tasks.addTask(newtask); diff --git a/src/main/java/duke/command/Command.java b/src/main/java/duke/command/Command.java index 5b7e8ba6fe..9aea902d26 100644 --- a/src/main/java/duke/command/Command.java +++ b/src/main/java/duke/command/Command.java @@ -1,18 +1,30 @@ -//package duke.command; package duke.command; + import duke.common.DukeException; -import duke.taskList.TaskList; +import duke.tasklist.TaskList; import duke.storage.Storage; import duke.ui.Ui; import java.io.IOException; +/** + * Deals with user Command. + * Abstract class since there can not be general command. + */ public abstract class Command { public Command(){ - } - public abstract void execute (TaskList tasks, Ui ui, Storage storage) throws IOException, DukeException ; + /** + * Deals with iteration between tasks, ui and storage. + * + * @param tasks stores all tasks. + * @param ui deals with user interface. + * @param storage deals with back up file. + * @throws IOException if cannot find back up file in the hard disk. + * @throws DukeException deals with other exception. + */ + public abstract void execute(TaskList tasks, Ui ui, Storage storage) throws IOException, DukeException; public Boolean isExit() { return false; diff --git a/src/main/java/duke/command/DeleteCommand.java b/src/main/java/duke/command/DeleteCommand.java index ef590fc4e9..b0411002e3 100644 --- a/src/main/java/duke/command/DeleteCommand.java +++ b/src/main/java/duke/command/DeleteCommand.java @@ -1,24 +1,37 @@ package duke.command; import duke.common.DukeException; -import duke.taskList.TaskList; +import duke.tasklist.TaskList; import duke.storage.Storage; import duke.ui.Ui; import java.io.IOException; +/** + * Deals with commands related to deleting tasks. + */ public class DeleteCommand extends Command { private int deleteCount; public DeleteCommand(int deleteCount) { - // The array index will be actual count minus one + // The array index will be actual count minus one. this.deleteCount = deleteCount - 1; } + /** + * Delete tasks, asks ui to show deleted task, and updates backup files. + * + * @param tasks stores all tasks. + * @param ui deals with user interface. + * @param storage deals with back up file. + * @throws IOException if cannot find back up file in the hard disk. + * @throws DukeException if the intended delete index is invalid e.g. not exist. + */ @Override - public void execute(TaskList tasks, Ui ui, Storage storage) throws IOException, DukeException{ - if (deleteCount + 1 > tasks.size()) + public void execute(TaskList tasks, Ui ui, Storage storage) throws IOException, DukeException { + if (deleteCount + 1 > tasks.size()) { throw new DukeException("\tThere is no task " + (deleteCount + 1) + ". Please reconsider the index."); + } ui.showDeleteMessage(tasks.deleteTask(deleteCount),tasks); storage.write(tasks); } diff --git a/src/main/java/duke/command/DoneCommand.java b/src/main/java/duke/command/DoneCommand.java index 6ab0f102e3..a1b05624bb 100644 --- a/src/main/java/duke/command/DoneCommand.java +++ b/src/main/java/duke/command/DoneCommand.java @@ -1,23 +1,35 @@ package duke.command; import duke.common.DukeException; -import duke.taskList.TaskList; +import duke.tasklist.TaskList; import duke.storage.Storage; import duke.ui.Ui; import java.io.IOException; -public class DoneCommand extends Command{ +/** + * Deals with command related to mark tasks as done. + */ +public class DoneCommand extends Command { private int doneCount; public DoneCommand(int doneCount) { - // The array index will be actual count minus one + /** The array index will be actual count minus one */ this.doneCount = doneCount - 1; } + /** + * Marks a task as done, asks ui to show task marked as done, and updates back up file. + * + * @param tasks stores all tasks. + * @param ui deals with user interface. + * @param storage deals with back up file. + * @throws IOException if cannot find back up file in the hard disk. + * @throws DukeException if the intended task to mark as done is invalid e.g. not exist. + */ @Override - public void execute (TaskList tasks, Ui ui, Storage storage) throws IOException, DukeException { - if(doneCount + 1 > tasks.size()) { + public void execute(TaskList tasks, Ui ui, Storage storage) throws IOException, DukeException { + if (doneCount + 1 > tasks.size()) { throw new DukeException("\tThere is no task " + (doneCount + 1) + ". Please reconsider the index."); } tasks.getATask(this.doneCount).markAsDone(); diff --git a/src/main/java/duke/command/ExitCommand.java b/src/main/java/duke/command/ExitCommand.java index badef51cf5..64de198173 100644 --- a/src/main/java/duke/command/ExitCommand.java +++ b/src/main/java/duke/command/ExitCommand.java @@ -1,13 +1,13 @@ package duke.command; -import duke.common.DukeException; import duke.storage.Storage; -import duke.taskList.TaskList; +import duke.tasklist.TaskList; import duke.ui.Ui; -import java.io.IOException; - -public class ExitCommand extends Command{ +/** + * Deals with command related to exit the Duke. + */ +public class ExitCommand extends Command { public ExitCommand() { } @@ -17,8 +17,15 @@ public Boolean isExit() { return true; } + /** + * Updates ui to show Goodbye. + * + * @param tasks stores all tasks, useless here. + * @param ui deals with user interface. + * @param storage deals with back up file, useless here. + */ @Override - public void execute (TaskList tasks, Ui ui, Storage storage) throws IOException, DukeException { + public void execute(TaskList tasks, Ui ui, Storage storage) { ui.showGoodByeMessage(); } } diff --git a/src/main/java/duke/command/InvalidCommand.java b/src/main/java/duke/command/InvalidCommand.java index 41c60b3191..548e271dee 100644 --- a/src/main/java/duke/command/InvalidCommand.java +++ b/src/main/java/duke/command/InvalidCommand.java @@ -1,15 +1,26 @@ package duke.command; import duke.common.DukeException; -import duke.taskList.TaskList; +import duke.tasklist.TaskList; import duke.storage.Storage; import duke.ui.Ui; +/** + * Deals with command that cannot be recognized. + */ public class InvalidCommand extends Command { public InvalidCommand(){ - } + + /** + * Throws exception since there is invalid command. + * + * @param tasks stores all tasks, useless here. + * @param ui deals with user interface, useless here. + * @param storage deals with back up file, useless here. + * @throws DukeException exists since the command is invalid. + */ @Override public void execute(TaskList tasks, Ui ui, Storage storage) throws DukeException { throw new DukeException("\t Sorry.I do not understand you."); diff --git a/src/main/java/duke/command/ListCommand.java b/src/main/java/duke/command/ListCommand.java index 384cfad7bd..47c2ade973 100644 --- a/src/main/java/duke/command/ListCommand.java +++ b/src/main/java/duke/command/ListCommand.java @@ -1,14 +1,24 @@ package duke.command; import duke.common.DukeException; -import duke.taskList.TaskList; +import duke.tasklist.TaskList; import duke.storage.Storage; import duke.ui.Ui; +/** + * Deals with command related to list all tasks. + */ public class ListCommand extends Command { - + /** + * Lists all tasks and asks ui to show tasks. + * + * @param tasks stores all tasks. + * @param ui deals with user interface. + * @param storage deals with back up file, useless here. + * @throws DukeException exists since there is no task in list. + */ @Override - public void execute (TaskList tasks, Ui ui, Storage storage) throws DukeException { + public void execute(TaskList tasks, Ui ui, Storage storage) throws DukeException { if (tasks.size() == 0) { throw new DukeException("\tCurrently, there is no task in the list!"); } diff --git a/src/main/java/duke/common/Constants.java b/src/main/java/duke/common/Constants.java index 11941c5532..cd3fa3ec78 100644 --- a/src/main/java/duke/common/Constants.java +++ b/src/main/java/duke/common/Constants.java @@ -1,5 +1,8 @@ package duke.common; +/** + * Stores all constant values. + */ public final class Constants { public static final String LOGO = " ____ _ \n" + "| _ \\ _ _| | _____ \n" diff --git a/src/main/java/duke/parser/Parser.java b/src/main/java/duke/parser/Parser.java index 24dfa3361f..9dc2c05d39 100644 --- a/src/main/java/duke/parser/Parser.java +++ b/src/main/java/duke/parser/Parser.java @@ -1,45 +1,65 @@ package duke.parser; import duke.common.DukeException; -import duke.command.*; -import duke.taskList.task.Deadline; -import duke.taskList.task.Event; -import duke.taskList.task.Todo; +import duke.command.AddCommand; +import duke.command.ExitCommand; +import duke.command.InvalidCommand; +import duke.command.DeleteCommand; +import duke.command.DoneCommand; +import duke.command.ListCommand; +import duke.command.Command; +import duke.tasklist.task.Deadline; +import duke.tasklist.task.Event; +import duke.tasklist.task.Todo; -import static duke.common.Constants.*; +import static duke.common.Constants.TODO; +import static duke.common.Constants.DEADLINE; +import static duke.common.Constants.EVENT; +import static duke.common.Constants.LIST; +import static duke.common.Constants.DELETE; +import static duke.common.Constants.DONE; +import static duke.common.Constants.BYE; +import static duke.common.Constants.TODO_LENGTH; +import static duke.common.Constants.DEADLINE_LENGTH; +import static duke.common.Constants.EVENT_LENGTH; import static duke.common.Constants.FORMAT_LENGTH; +/** + * Deals with making sense of the user command. + */ public class Parser { public Parser() { } /** - * Helps to check is a string is number - * @param str input string - * @return returns true if it is integer, else returns false + * Checks if a string is integer. + * + * @param str input string. + * @return returns true if it is integer, else returns false. */ public static boolean isNumeric(String str) { try { Integer.parseInt(str); return true; - } catch(NumberFormatException e){ + } catch (NumberFormatException e) { return false; } } /** - * deals with making sense of the user command - * @param fullCommand user input - * @return returns different command type - * @throws DukeException when user's command does not match with command standard + * Deals with making sense of the user command. + * + * @param fullCommand user input. + * @return returns different types of command. + * @throws DukeException when user's command does not match with command standard. */ - public static Command parse(String fullCommand) throws DukeException{ + public static Command parse(String fullCommand) throws DukeException { String[] responses = fullCommand.split(" "); switch (responses[0]) { case TODO: if (responses.length < 2) { - throw new DukeException("\tThe description of a todo cannot be empty."); + throw new DukeException("\tThe description of a todo cannot be empty."); } return new AddCommand(new Todo(fullCommand.substring(TODO_LENGTH))); case DEADLINE: @@ -62,8 +82,8 @@ public static Command parse(String fullCommand) throws DukeException{ throw new DukeException("\tPlease follow the format: event thingsToDo /at time"); } String eventName = fullCommand.substring(EVENT_LENGTH,eventDividerPosition); - String EventTime = fullCommand.substring(eventDividerPosition + FORMAT_LENGTH); - return new AddCommand(new Event(eventName,EventTime)); + String eventTime = fullCommand.substring(eventDividerPosition + FORMAT_LENGTH); + return new AddCommand(new Event(eventName,eventTime)); case DONE: if (responses.length < 2 || !isNumeric(responses[1])) { throw new DukeException("\tPlease input a task number that you want to mark as done"); @@ -82,7 +102,5 @@ public static Command parse(String fullCommand) throws DukeException{ default: return new InvalidCommand(); } - } - } diff --git a/src/main/java/duke/storage/Storage.java b/src/main/java/duke/storage/Storage.java index c732d40ca2..ad6da341fb 100644 --- a/src/main/java/duke/storage/Storage.java +++ b/src/main/java/duke/storage/Storage.java @@ -1,9 +1,9 @@ package duke.storage; -import duke.taskList.TaskList; -import duke.taskList.task.Deadline; -import duke.taskList.task.Event; -import duke.taskList.task.Todo; +import duke.tasklist.TaskList; +import duke.tasklist.task.Deadline; +import duke.tasklist.task.Event; +import duke.tasklist.task.Todo; import java.io.File; import java.io.FileNotFoundException; @@ -11,7 +11,9 @@ import java.io.IOException; import java.util.Scanner; - +/** + * Deals with loading tasks from the file and saving tasks in the file. + */ public class Storage { private static String filePath; @@ -23,8 +25,11 @@ public Storage(String filePath) { } /** - * Helper function that change the format of a task in file to correct format of a task in taskList - * @param oneTask a line in the hard disk + * Changes the format of a task in file to correct format of a task in taskList. + * Then stores the right format task to list. + * + * @param oneTask a line in the hard disk. + * @param tasks stores taskList. */ public static void loadATask(String oneTask, TaskList tasks) { String[] taskSplit = oneTask.split(" \\| "); @@ -47,8 +52,10 @@ public static void loadATask(String oneTask, TaskList tasks) { } /** - * Load the content in the file to storage - * @return a list of tasks + * Loads the content in the file to taskList. + * + * @param tasks stores taskList. + * @throws FileNotFoundException if there is no back up file. */ public void load(TaskList tasks) throws FileNotFoundException { File f = new File(filePath); @@ -62,9 +69,15 @@ public void load(TaskList tasks) throws FileNotFoundException { } } + /** + * Writes a list of tasks to hard disk file. + * + * @param tasks stores taskList. + * @throws IOException there is no back up file. + */ public static void write(TaskList tasks) throws IOException { File f = new File(filePath); - if(!f.exists()) { + if (!f.exists()) { throw new IOException(); } FileWriter fw = new FileWriter(filePath); diff --git a/src/main/java/duke/tasklist/TaskList.java b/src/main/java/duke/tasklist/TaskList.java index d5202f0740..215f08bc4d 100644 --- a/src/main/java/duke/tasklist/TaskList.java +++ b/src/main/java/duke/tasklist/TaskList.java @@ -1,9 +1,13 @@ -package duke.taskList; +package duke.tasklist; -import duke.taskList.task.Task; +import duke.tasklist.task.Task; import java.util.ArrayList; +/** + * Contains the task list. + * It has operations to add/delete tasks in the list. + */ public class TaskList { private static ArrayList tasks; @@ -11,10 +15,6 @@ public TaskList() { this.tasks = new ArrayList<>(); } - public TaskList(ArrayList storage) { - this.tasks = storage; - } - public static void addTask(Task task) { tasks.add(task); } diff --git a/src/main/java/duke/tasklist/task/Deadline.java b/src/main/java/duke/tasklist/task/Deadline.java index 6ca178a78c..400ef77bb3 100644 --- a/src/main/java/duke/tasklist/task/Deadline.java +++ b/src/main/java/duke/tasklist/task/Deadline.java @@ -1,7 +1,8 @@ -package duke.taskList.task; - -import static duke.common.Constants.DEADLINE; +package duke.tasklist.task; +/** + * Stores a deadline task. + */ public class Deadline extends Task { protected String by; @@ -20,9 +21,4 @@ public String toString() { public String toFile() { return "D | " + super.toFile() + " | " + by; } - - @Override - public String type() { - return DEADLINE; - } } diff --git a/src/main/java/duke/tasklist/task/Event.java b/src/main/java/duke/tasklist/task/Event.java index 3b4de32edd..ae77124d44 100644 --- a/src/main/java/duke/tasklist/task/Event.java +++ b/src/main/java/duke/tasklist/task/Event.java @@ -1,7 +1,8 @@ -package duke.taskList.task; - -import static duke.common.Constants.EVENT; +package duke.tasklist.task; +/** + * Stores an event class. + */ public class Event extends Task { protected String at; @@ -20,9 +21,4 @@ public String toString() { public String toFile() { return "E | " + super.toFile() + " | " + at; } - - @Override - public String type() { - return EVENT; - } } diff --git a/src/main/java/duke/tasklist/task/Task.java b/src/main/java/duke/tasklist/task/Task.java index 460d4aaf18..1d40fb0b96 100644 --- a/src/main/java/duke/tasklist/task/Task.java +++ b/src/main/java/duke/tasklist/task/Task.java @@ -1,11 +1,14 @@ -package duke.taskList.task; +package duke.tasklist.task; +/** + * Stores a task. + * Since there is no task without type, this super class is an abstract class. + */ public abstract class Task { protected String description; protected boolean isDone; public Task(){ - } public Task(String description) { @@ -14,7 +17,8 @@ public Task(String description) { } public String getStatusIcon() { - return (isDone ? "/" : " "); //return tick or X symbols + /** Return tick or X symbols. */ + return (isDone ? "/" : " "); } public String getDescription() { @@ -25,15 +29,21 @@ public void markAsDone() { isDone = true; } + /** + * Prints a task appropriately. + * + * @return a string. + */ public String toString() { return "[" + getStatusIcon() + "] " + this.description; } + /** + * Stores a task according to back up file standard. + * + * @return a string. + */ public String toFile() { return ((isDone ? "1" : "0") + " | " + this.description); } - - public String type() { - return null; - } } diff --git a/src/main/java/duke/tasklist/task/Todo.java b/src/main/java/duke/tasklist/task/Todo.java index 9dd9b8ea1f..ccc3c55887 100644 --- a/src/main/java/duke/tasklist/task/Todo.java +++ b/src/main/java/duke/tasklist/task/Todo.java @@ -1,7 +1,8 @@ -package duke.taskList.task; - -import static duke.common.Constants.TODO; +package duke.tasklist.task; +/** + * Stores a todo task. + */ public class Todo extends Task { public Todo(String description) { @@ -17,9 +18,4 @@ public String toString() { public String toFile() { return "T | " + super.toFile(); } - - @Override - public String type() { - return TODO; - } } diff --git a/src/main/java/duke/ui/Ui.java b/src/main/java/duke/ui/Ui.java index a7c688c9bd..bd33421924 100644 --- a/src/main/java/duke/ui/Ui.java +++ b/src/main/java/duke/ui/Ui.java @@ -1,14 +1,17 @@ package duke.ui; import duke.common.DukeException; -import duke.taskList.TaskList; -import duke.taskList.task.Task; +import duke.tasklist.TaskList; +import duke.tasklist.task.Task; import java.util.Scanner; import static duke.common.Constants.LINE_BREAK; import static duke.common.Constants.LOGO; +/** + * Deals with interactions with the user. + */ public class Ui { private static Scanner in = new Scanner(System.in); @@ -35,16 +38,20 @@ public void showWelcome() { System.out.println(); } + /** + * Generates and prints the goodbye message upon the end of the application. + */ public void showGoodByeMessage() { System.out.println("\tBye. Hope to see you again soon!"); } /** - * Displays list of tasks and if they are done - * @param tasks store the task list - * @throws DukeException If there is no tasks, throws the exception + * Displays list of tasks and if they are done. + * + * @param tasks store the task list. + * @throws DukeException If there is no tasks, throws the exception. */ - public void showListOfTasks (TaskList tasks) throws DukeException { + public void showListOfTasks(TaskList tasks) throws DukeException { System.out.println("\tHere are the tasks in your list:"); for (int i = 0; i < tasks.size(); i++) { System.out.println("\t" + (i + 1) + "." + tasks.getATask(i)); @@ -52,15 +59,24 @@ public void showListOfTasks (TaskList tasks) throws DukeException { } /** - * Displays prompt message that a task is marked as done - * @param tasks store the task list - * @param doneCount the task that is done + * Displays prompt message that a task is marked as done. + * Displays the task that is marked done. + * + * @param tasks store the task list. + * @param doneCount the task that is done. */ public void showMarkAsDoneMessage(TaskList tasks, int doneCount) { System.out.println("\tNice! I've marked this task as done:"); System.out.println("\t yes! " + tasks.getATask(doneCount).getDescription()); } + /** + * Displays prompt message that a task is deleted. + * Displays the task that is deleted and the task count. + * + * @param deleteTask the task that is deleted. + * @param tasks stored the taskList. + */ public void showDeleteMessage(Task deleteTask, TaskList tasks) { System.out.println("\tNoted. I've removed this task:"); System.out.println("\t " + deleteTask); @@ -68,8 +84,10 @@ public void showDeleteMessage(Task deleteTask, TaskList tasks) { } /** - * Displays prompt message that a new task is added in the task list - * @param tasks store the task list + * Displays prompt message that a new task is added in the task list. + * Displays the newly added task and current task count. + * + * @param tasks store the taskList. */ public void showAddTaskMessage(TaskList tasks) { System.out.println("\tGot it. I've added this task:"); @@ -84,6 +102,5 @@ public void showLoadingError() { public void showError(String error) { System.out.println(error); } - } From 05c3f9f57f5a0272ee0fa46903e1abe1090e90db Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Sat, 29 Feb 2020 13:15:02 +0800 Subject: [PATCH 33/36] Add JAVADoc for newly merged classes and cording coding standard issues. --- src/main/java/duke/Duke.java | 2 +- src/main/java/duke/command/AddCommand.java | 8 ++-- src/main/java/duke/command/CheckCommand.java | 40 +++++++++++----- src/main/java/duke/command/Command.java | 10 ++-- src/main/java/duke/command/DeleteCommand.java | 12 ++--- src/main/java/duke/command/DoneCommand.java | 10 ++-- src/main/java/duke/command/ExitCommand.java | 6 +-- src/main/java/duke/command/FindCommand.java | 26 +++++++--- .../java/duke/command/InvalidCommand.java | 8 ++-- src/main/java/duke/command/ListCommand.java | 8 ++-- src/main/java/duke/common/Constants.java | 2 + src/main/java/duke/parser/Parser.java | 48 ++++++++++++------- src/main/java/duke/storage/Storage.java | 12 ++--- .../java/duke/tasklist/task/Deadline.java | 9 +++- src/main/java/duke/tasklist/task/Event.java | 9 +++- src/main/java/duke/tasklist/task/Task.java | 4 +- src/main/java/duke/ui/Ui.java | 31 +++++------- text-ui-test/ACTUAL.TXT | 9 +++- text-ui-test/EXPECTED.txt | 9 +++- text-ui-test/data/duke.txt | 5 ++ text-ui-test/input.txt | 2 + 21 files changed, 171 insertions(+), 99 deletions(-) create mode 100644 text-ui-test/data/duke.txt diff --git a/src/main/java/duke/Duke.java b/src/main/java/duke/Duke.java index 9f2df525bf..0624539112 100644 --- a/src/main/java/duke/Duke.java +++ b/src/main/java/duke/Duke.java @@ -23,7 +23,7 @@ public class Duke { /** * Initializes Duke object. * - * @param filePath place where hard disk data stores + * @param filePath Place where hard disk data stores */ public Duke(String filePath) { ui = new Ui(); diff --git a/src/main/java/duke/command/AddCommand.java b/src/main/java/duke/command/AddCommand.java index 031c32ab8f..8734d7eea3 100644 --- a/src/main/java/duke/command/AddCommand.java +++ b/src/main/java/duke/command/AddCommand.java @@ -20,10 +20,10 @@ public AddCommand(Task newtask) { /** * Adds a new task in taskList, updates ui and backup file. * - * @param tasks stores all tasks. - * @param ui deals with user interface. - * @param storage deals with back up file. - * @throws IOException if cannot find back up file in the hard disk. + * @param tasks Stores all tasks. + * @param ui Deals with user interface. + * @param storage Deals with back up file. + * @throws IOException If cannot find back up file in the hard disk. */ @Override public void execute(TaskList tasks, Ui ui, Storage storage) throws IOException { diff --git a/src/main/java/duke/command/CheckCommand.java b/src/main/java/duke/command/CheckCommand.java index 7605a3cc10..bae68ee016 100644 --- a/src/main/java/duke/command/CheckCommand.java +++ b/src/main/java/duke/command/CheckCommand.java @@ -1,29 +1,35 @@ package duke.command; -import duke.Duke; import duke.common.DukeException; import duke.storage.Storage; -import duke.taskList.TaskList; +import duke.tasklist.TaskList; import duke.ui.Ui; import java.io.IOException; import java.time.LocalDate; import java.time.format.DateTimeParseException; import java.util.ArrayList; -import java.util.function.ToDoubleBiFunction; -import static duke.common.Constants.TODO; - -public class CheckCommand extends Command{ +/** + * Deals with command that can check deadline/event by time. + */ +public class CheckCommand extends Command { + /** User input time.*/ private static String checkString; + /** Stores the task index that matches.*/ private static ArrayList checkCount; - public CheckCommand (String checkString) { + public CheckCommand(String checkString) { this.checkString = checkString; checkCount = new ArrayList<>(); } + /** + * Checks if a string follows an identified time format. + * + * @return True if it follows, false if it does not follow. + */ private Boolean isLocalDateFormat() { try { LocalDate.parse(this.checkString); @@ -33,19 +39,29 @@ private Boolean isLocalDateFormat() { return true; } - public void execute (TaskList tasks, Ui ui, Storage storage) throws IOException, DukeException { + /** + * Checks tasks occuring on a specific date. + * + * @param tasks Stores all tasks. + * @param ui Deals with user interface. + * @param storage Deals with back up file. + * @throws DukeException If the format of time is not correct. + */ + @Override + public void execute(TaskList tasks, Ui ui, Storage storage) throws DukeException { if (!isLocalDateFormat()) { throw new DukeException("\t Please follow the format: check yyyy-mm-dd"); } LocalDate date = LocalDate.parse(checkString); - for(int i = 0; i findCount; - public FindCommand (String findString) { + public FindCommand(String findString) { this.findString = findString; findCount = new ArrayList<>(); } - public void execute (TaskList tasks, Ui ui, Storage storage) throws IOException, DukeException { - for(int i = 0; i findCount) { - if (findCount.size() > 0) { - System.out.println("\tHere are the matching tasks in your list:"); - for (Integer i : findCount) { - System.out.println("\t" + (i + 1) + "." + tasks.getATask(i)); - } - } else { - System.out.println("\t No matching tasks."); - } - } - /** * Displays prompt message that a new task is added in the task list. * Displays the newly added task and current task count. * - * @param tasks store the taskList. + * @param tasks Store the taskList. */ public void showAddTaskMessage(TaskList tasks) { System.out.println("\tGot it. I've added this task:"); @@ -107,7 +96,13 @@ public void showAddTaskMessage(TaskList tasks) { System.out.println("\tNow you have " + tasks.size() + " tasks in the list"); } - public void showFindTask (TaskList tasks, ArrayList findCount) { + /** + * Displays tasks that has been found either by keyword/time. + * + * @param tasks Stores the taskList. + * @param findCount Stores the matching task index. + */ + public void showFindTask(TaskList tasks, ArrayList findCount) { if (findCount.size() > 0) { System.out.println("\tHere are the matching tasks in your list:"); for (Integer i : findCount) { diff --git a/text-ui-test/ACTUAL.TXT b/text-ui-test/ACTUAL.TXT index 1d34e78f0a..4bbdb200af 100644 --- a/text-ui-test/ACTUAL.TXT +++ b/text-ui-test/ACTUAL.TXT @@ -64,10 +64,12 @@ Hello from ____________________________________________________________ Here are the matching tasks in your list: 1.[T][ ] read book - 5.[D][ ] book review (by: Friday) ____________________________________________________________ ____________________________________________________________ - Please input the thing you want to find + The description of a deadline cannot be empty. + ____________________________________________________________ + ____________________________________________________________ + Please input the thing you want to find. ____________________________________________________________ ____________________________________________________________ No matching tasks. @@ -77,6 +79,9 @@ Hello from yes! sleep ____________________________________________________________ ____________________________________________________________ + Please input a task number that you want to mark as done + ____________________________________________________________ + ____________________________________________________________ Nice! I've marked this task as done: yes! cs2113 ____________________________________________________________ diff --git a/text-ui-test/EXPECTED.txt b/text-ui-test/EXPECTED.txt index 1d34e78f0a..4bbdb200af 100644 --- a/text-ui-test/EXPECTED.txt +++ b/text-ui-test/EXPECTED.txt @@ -64,10 +64,12 @@ Hello from ____________________________________________________________ Here are the matching tasks in your list: 1.[T][ ] read book - 5.[D][ ] book review (by: Friday) ____________________________________________________________ ____________________________________________________________ - Please input the thing you want to find + The description of a deadline cannot be empty. + ____________________________________________________________ + ____________________________________________________________ + Please input the thing you want to find. ____________________________________________________________ ____________________________________________________________ No matching tasks. @@ -77,6 +79,9 @@ Hello from yes! sleep ____________________________________________________________ ____________________________________________________________ + Please input a task number that you want to mark as done + ____________________________________________________________ + ____________________________________________________________ Nice! I've marked this task as done: yes! cs2113 ____________________________________________________________ diff --git a/text-ui-test/data/duke.txt b/text-ui-test/data/duke.txt new file mode 100644 index 0000000000..26f5e35dd7 --- /dev/null +++ b/text-ui-test/data/duke.txt @@ -0,0 +1,5 @@ +T | 0 | read book +D | 1 | cs2113 | Tuesday +D | 0 | assignment | Mar 21 2020, SATURDAY +E | 0 | project meeting | Mon 2-4pm +E | 0 | concert | Mar 21 2020, SATURDAY diff --git a/text-ui-test/input.txt b/text-ui-test/input.txt index 10f68f5322..dd825019f6 100644 --- a/text-ui-test/input.txt +++ b/text-ui-test/input.txt @@ -11,9 +11,11 @@ event concert /at 2020-03-21 check 2020-03-21 event find book +deadline find find exam done 2 +done done 3 done 10 list From 99610855f1f0e8dd32d77580dda6b86d6beeb593 Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Sat, 29 Feb 2020 13:50:55 +0800 Subject: [PATCH 34/36] Add HELP command for users to understand Duke. --- src/main/java/duke/command/HelpCommand.java | 18 ++++++ src/main/java/duke/common/Constants.java | 9 +-- src/main/java/duke/parser/Parser.java | 50 ++++++++------- src/main/java/duke/ui/Ui.java | 68 +++++++++++++-------- text-ui-test/ACTUAL.TXT | 12 ++++ text-ui-test/EXPECTED.txt | 12 ++++ text-ui-test/input.txt | 1 + 7 files changed, 117 insertions(+), 53 deletions(-) create mode 100644 src/main/java/duke/command/HelpCommand.java diff --git a/src/main/java/duke/command/HelpCommand.java b/src/main/java/duke/command/HelpCommand.java new file mode 100644 index 0000000000..5bc7a97c11 --- /dev/null +++ b/src/main/java/duke/command/HelpCommand.java @@ -0,0 +1,18 @@ +package duke.command; + +import duke.storage.Storage; +import duke.tasklist.TaskList; +import duke.ui.Ui; + +/** + * Deals with command that shows help message. + */ +public class HelpCommand extends Command { + public HelpCommand() { + } + + @Override + public void execute(TaskList tasks, Ui ui, Storage storage) { + ui.showHelpMessage(); + } +} diff --git a/src/main/java/duke/common/Constants.java b/src/main/java/duke/common/Constants.java index dab8f7364b..45313c306b 100644 --- a/src/main/java/duke/common/Constants.java +++ b/src/main/java/duke/common/Constants.java @@ -10,15 +10,16 @@ public final class Constants { + "| |_| | |_| | < __/\n" + "|____/ \\__,_|_|\\_\\___|\n"; - public static final String BYE = "bye"; - public static final String LIST = "list"; - public static final String DONE = "done"; - public static final String DELETE = "delete"; public static final String TODO = "todo"; public static final String DEADLINE = "deadline"; public static final String EVENT = "event"; + public static final String BYE = "bye"; public static final String CHECK = "check"; + public static final String DELETE = "delete"; + public static final String DONE = "done"; public static final String FIND = "find"; + public static final String HELP = "help"; + public static final String LIST = "list"; public static final String LINE_BREAK = "\t____________________________________________________________"; diff --git a/src/main/java/duke/parser/Parser.java b/src/main/java/duke/parser/Parser.java index e93d92a249..f2797827db 100644 --- a/src/main/java/duke/parser/Parser.java +++ b/src/main/java/duke/parser/Parser.java @@ -1,31 +1,33 @@ package duke.parser; import duke.command.Command; -import duke.command.ListCommand; -import duke.command.DoneCommand; -import duke.command.DeleteCommand; -import duke.command.InvalidCommand; -import duke.command.ExitCommand; import duke.command.AddCommand; -import duke.command.FindCommand; +import duke.command.ExitCommand; import duke.command.CheckCommand; +import duke.command.DeleteCommand; +import duke.command.DoneCommand; +import duke.command.FindCommand; +import duke.command.HelpCommand; +import duke.command.ListCommand; +import duke.command.InvalidCommand; import duke.common.DukeException; import duke.tasklist.task.Deadline; import duke.tasklist.task.Event; import duke.tasklist.task.Todo; -import static duke.common.Constants.LIST; -import static duke.common.Constants.DONE; import static duke.common.Constants.TODO; -import static duke.common.Constants.TODO_LENGTH; import static duke.common.Constants.DEADLINE; -import static duke.common.Constants.DEADLINE_LENGTH; import static duke.common.Constants.EVENT; -import static duke.common.Constants.EVENT_LENGTH; -import static duke.common.Constants.DELETE; import static duke.common.Constants.BYE; import static duke.common.Constants.CHECK; +import static duke.common.Constants.DELETE; +import static duke.common.Constants.DONE; import static duke.common.Constants.FIND; +import static duke.common.Constants.HELP; +import static duke.common.Constants.LIST; +import static duke.common.Constants.TODO_LENGTH; +import static duke.common.Constants.DEADLINE_LENGTH; +import static duke.common.Constants.EVENT_LENGTH; import static duke.common.Constants.FORMAT_LENGTH; /** @@ -88,31 +90,33 @@ public static Command parse(String fullCommand) throws DukeException { String eventName = fullCommand.substring(EVENT_LENGTH,eventDividerPosition); String eventTime = fullCommand.substring(eventDividerPosition + FORMAT_LENGTH); return new AddCommand(new Event(eventName,eventTime)); - case DONE: - if (responses.length < 2 || !isNumeric(responses[1])) { - throw new DukeException("\tPlease input a task number that you want to mark as done"); + case BYE: + return new ExitCommand(); + case CHECK: + if (responses.length < 2) { + throw new DukeException("\tPlease input the thing you want to check."); } - return new DoneCommand(Integer.parseInt(responses[1])); + return new CheckCommand(responses[1]); case DELETE: if (responses.length < 2 || !isNumeric(responses[1])) { throw new DukeException("\tPlease input a task number that you want to delete"); } int deleteCount = Integer.parseInt(responses[1]); return new DeleteCommand(deleteCount); + case DONE: + if (responses.length < 2 || !isNumeric(responses[1])) { + throw new DukeException("\tPlease input a task number that you want to mark as done"); + } + return new DoneCommand(Integer.parseInt(responses[1])); case FIND: if (responses.length < 2) { throw new DukeException("\tPlease input the thing you want to find."); } return new FindCommand(responses[1]); - case CHECK: - if (responses.length < 2) { - throw new DukeException("\tPlease input the thing you want to check."); - } - return new CheckCommand(responses[1]); + case HELP: + return new HelpCommand(); case LIST: return new ListCommand(); - case BYE: - return new ExitCommand(); default: return new InvalidCommand(); } diff --git a/src/main/java/duke/ui/Ui.java b/src/main/java/duke/ui/Ui.java index 2d6f333916..75d76aae25 100644 --- a/src/main/java/duke/ui/Ui.java +++ b/src/main/java/duke/ui/Ui.java @@ -39,6 +39,18 @@ public void showWelcome() { System.out.println(); } + /** + * Displays prompt message that a new task is added in the task list. + * Displays the newly added task and current task count. + * + * @param tasks Store the taskList. + */ + public void showAddTaskMessage(TaskList tasks) { + System.out.println("\tGot it. I've added this task:"); + System.out.println("\t " + tasks.getATask(tasks.size() - 1)); + System.out.println("\tNow you have " + tasks.size() + " tasks in the list"); + } + /** * Generates and prints the goodbye message upon the end of the application. */ @@ -47,15 +59,19 @@ public void showGoodByeMessage() { } /** - * Displays list of tasks and if they are done. + * Displays tasks that has been found either by keyword/time. * - * @param tasks Store the task list. - * @throws DukeException If there is no tasks, throws the exception. + * @param tasks Stores the taskList. + * @param findCount Stores the matching task index. */ - public void showListOfTasks(TaskList tasks) throws DukeException { - System.out.println("\tHere are the tasks in your list:"); - for (int i = 0; i < tasks.size(); i++) { - System.out.println("\t" + (i + 1) + "." + tasks.getATask(i)); + public void showFindTask(TaskList tasks, ArrayList findCount) { + if (findCount.size() > 0) { + System.out.println("\tHere are the matching tasks in your list:"); + for (Integer i : findCount) { + System.out.println("\t" + (i + 1) + "." + tasks.getATask(i)); + } + } else { + System.out.println("\t No matching tasks."); } } @@ -85,31 +101,31 @@ public void showDeleteMessage(Task deleteTask, TaskList tasks) { } /** - * Displays prompt message that a new task is added in the task list. - * Displays the newly added task and current task count. - * - * @param tasks Store the taskList. + * Displays all usage and format of this program. */ - public void showAddTaskMessage(TaskList tasks) { - System.out.println("\tGot it. I've added this task:"); - System.out.println("\t " + tasks.getATask(tasks.size() - 1)); - System.out.println("\tNow you have " + tasks.size() + " tasks in the list"); + public void showHelpMessage() { + System.out.println("\tBelow is what Duke can do for you:"); + System.out.println("\t todo task : add a task that needs to do"); + System.out.println("\t deadline task /by time(dddd-mm-yy) : add a task that has a certain deadline"); + System.out.println("\t event task /at time(dddd-mm-yy) : add a task that happens on a day"); + System.out.println("\t bye : exit the program"); + System.out.println("\t check dddd-mm-yy : check deadline/event occuring on that day"); + System.out.println("\t delete index : delete a task by its number index"); + System.out.println("\t done index : mark a task as done by its number index"); + System.out.println("\t find keyword : find a task by its keyword"); + System.out.println("\t list : list all tasks"); } /** - * Displays tasks that has been found either by keyword/time. + * Displays all list of tasks and if they are done. * - * @param tasks Stores the taskList. - * @param findCount Stores the matching task index. + * @param tasks Stores taskList. + * @throws DukeException If there is no tasks in current taskList. */ - public void showFindTask(TaskList tasks, ArrayList findCount) { - if (findCount.size() > 0) { - System.out.println("\tHere are the matching tasks in your list:"); - for (Integer i : findCount) { - System.out.println("\t" + (i + 1) + "." + tasks.getATask(i)); - } - } else { - System.out.println("\t No matching tasks."); + public void showListOfTasks(TaskList tasks) throws DukeException { + System.out.println("\tHere are the tasks in your list:"); + for (int i = 0; i < tasks.size(); i++) { + System.out.println("\t" + (i + 1) + "." + tasks.getATask(i)); } } diff --git a/text-ui-test/ACTUAL.TXT b/text-ui-test/ACTUAL.TXT index 4bbdb200af..e3cf05e244 100644 --- a/text-ui-test/ACTUAL.TXT +++ b/text-ui-test/ACTUAL.TXT @@ -11,6 +11,18 @@ Hello from What can I do for you? ____________________________________________________________ + ____________________________________________________________ + Below is what Duke can do for you: + todo task : add a task that needs to do + deadline task /by time(dddd-mm-yy) : add a task that has a certain deadline + event task /at time(dddd-mm-yy) : add a task that happens on a day + bye : exit the program + check dddd-mm-yy : check deadline/event occuring on that day + delete index : delete a task by its number index + done index : mark a task as done by its number index + find keyword : find a task by its keyword + list : list all tasks + ____________________________________________________________ ____________________________________________________________ Please input a task number that you want to mark as done ____________________________________________________________ diff --git a/text-ui-test/EXPECTED.txt b/text-ui-test/EXPECTED.txt index 4bbdb200af..e3cf05e244 100644 --- a/text-ui-test/EXPECTED.txt +++ b/text-ui-test/EXPECTED.txt @@ -11,6 +11,18 @@ Hello from What can I do for you? ____________________________________________________________ + ____________________________________________________________ + Below is what Duke can do for you: + todo task : add a task that needs to do + deadline task /by time(dddd-mm-yy) : add a task that has a certain deadline + event task /at time(dddd-mm-yy) : add a task that happens on a day + bye : exit the program + check dddd-mm-yy : check deadline/event occuring on that day + delete index : delete a task by its number index + done index : mark a task as done by its number index + find keyword : find a task by its keyword + list : list all tasks + ____________________________________________________________ ____________________________________________________________ Please input a task number that you want to mark as done ____________________________________________________________ diff --git a/text-ui-test/input.txt b/text-ui-test/input.txt index dd825019f6..f1be38bf74 100644 --- a/text-ui-test/input.txt +++ b/text-ui-test/input.txt @@ -1,3 +1,4 @@ +help done list todo read book From e74dc07a8fc361038acbe33a93557aaa26f3584a Mon Sep 17 00:00:00 2001 From: JWang2000 Date: Sat, 29 Feb 2020 15:14:33 +0800 Subject: [PATCH 35/36] Add User Guide --- docs/README.md | 111 +++++++++++++++++++++++++++++++--- docs/enter.png | Bin 0 -> 12237 bytes src/main/java/duke/ui/Ui.java | 14 ++--- 3 files changed, 108 insertions(+), 17 deletions(-) create mode 100644 docs/enter.png diff --git a/docs/README.md b/docs/README.md index fd44069597..3ac3988052 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,20 +1,111 @@ -# User Guide +# Duke - User Guide +By: `WANG JINGTAN` Since: `Jan 2020` +* [Introduction](#1-introduction) +* [Quick Start](#2-quick-start) +* [Features](#3-features) + * [Viewing help](#31-viewing-help--help) + * [Adding tasks](#32-adding-tasks) + * [Checking data](#33-checking-date-check) + * [Finding a task](#34-finding-a-task-find) + * [Having done a task](#35-having-done-a-task-done) + * [Deleting a task](#36-deleting-a-task-delete) + * [Listing all tasks](#37-listing-all-tasks-list) + * [Exiting duke](#38-exiting-duke-bye) + * [Saving the tasks](#39-saving-the-tasks) +* [FAQ](#4-faq) +* [Command Summary](#5-command-summary) -## Features +## 1. Introduction +Duke is for those who wants to **record daily life tasks on desktop**. +It is a Personal Assistant Chatbot that helps a person to keep track of various things. +As a **Command Line Interface (CLI) application**, it is suitable for those who type fast. -### Feature 1 +## 2. Quick Start +1. Ensure you have JAVA '11' or above installed in your Computer. +2. Download the latest duke.jar [here](https://github.com/JTWang2000/duke). +3. Copy the file to an empty folder where you want to use as the home folder for your Duke. +4. Open a command window in that folder. +5. Run the command `java -jar duke.jar`. The CLI should appear in a few seconds. +![Enter page](enter.png) +6. Some example commands you can try: + * `help` : shows all the command you can try + * `todo clean the house`: add `clean the house` to duke + * `bye` : exit the app +7. Refer to [Section 3. Features](#3-features) for details of each command. Description of feature. -## Usage +## 3. Features +### 3.1 Viewing help : `help` +Format: `help` -### `Keyword` - Describe action +### 3.2 Adding tasks: +All the tasks are not done when they are first created. +##### 3.2.1 Adding to do: `todo` +Adds a task that needs to be done

+Format: `todo TASK`

+Examples: +* `todo Clean the house` +* `todo laundry` +##### 3.2.3 Adding deadline: `deadline` +Adds a task that has deadline

+Format: `deadline TASK /by TIME`

+*The `TIME` is suggested to follow format:`yyyy-mm-dd`*

+Examples: +* `deadline assignment /by 2020-03-01` +* `deadline coding exercise /by tomorrow midnight` +##### 3.2.3 Adding event : `event` +Adds a task that happens on a specific day

+Format: `event TASK /at TIME`

+*The `TIME` is suggested to follow format:`yyyy-mm-dd`*

+Examples: +* `event read book /at 2020-03-06` +* `event group meeting /at 6pm` -Describe action and its outcome. +### 3.3 Checking date: `check` +Checks deadline/event occurs on that day

+Format: `check yyyy-mm-dd`

+Example: `check 2020-03-01` -Example of usage: +### 3.4 Finding a task: `find` +Finds a task by its keyword in the task description

+Format: `find KEYWORD`

+Example: `find book` -`keyword (optional arguments)` +### 3.5 Having done a task: `done` +Marks a task as done.

+Format: `done INDEX`

+*INDEX is a number starts from 1* -Expected outcome: +### 3.6 Deleting a task: `delete` +Deletes a task.

+Format: `delete INDEX`

+*INDEX is a number starts from 1* + +### 3.7 Listing all tasks: `list` +Lists all the tasks.

+Format: `list` + +### 3.8 Exiting duke: `bye` +Exits the app.

+Format: `bye` + +### 3.9 Saving the tasks +Tasks in duke are saved in the hard disk automatically. You can find all the existing tasks in the data folder in the Duke folder. + +## 4. FAQ +**Q**: How do I transfer my data to another Computer?

+**A**: Install the app in the other computer and copy the data folder in previous Duke folder to the new Duke Folder. + +**Q**: What if I accidentally input something wrong?

+**A**: Duke can handle such error. No worry. + +## 5. Command Summary +* **Help** `help` +* **Add**

`todo TASK`

`deadline TASK /by yyyy-mm-dd`

`event TASK /at yyyy-mm-dd` +* **Check** `check yyyy-mm-dd` +* **Find** `find KEYWORD` +* **Done** `done INDEX` +* **Delete** `delete INDEX` +* **List** `list` +* **Exit** `bye` -`outcome` diff --git a/docs/enter.png b/docs/enter.png new file mode 100644 index 0000000000000000000000000000000000000000..beb96e77276b46e2908a5eba80c2a9b56035b6f1 GIT binary patch literal 12237 zcmdsdS6EY9*X{zh6$K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;2+zc#N>xyRx zdSVaSIvr2nH+(bJFc0iU4QTCEI|%%QH^VnSl^6&!#ql4+=2Xo`=<8eA?zT{o9PLO` zQ&g1vNX3vEwRkWMsAc?SQjv>KeL0_)9n`g}$qPqo^ju}U*;UHEKU9<|}SzO4j z+iCJam`pnUg!-@Jtc?n-T)a0bBWRXp!Spmlh>lIs!{3chB)1ae((9IKQIh^S-E1-^EOIAY$sf; zvrEeO7^xWB;ROBS|D?W<3U%b1Fb#Y5>wU}ZoMX2v(4Ly*KOmy9h8;Oow+-Y7y`?^8 zu2YejZiWWfEdb11c0)~TZWwqx?sN{k{W2BFM?!lPHwZ=7J#LClBBB)*aNHIUJ1#*p*XQs4xKefB#h5Yc`UNs|Q#A0yOhBEIaD;Qpf<&+J`Y8F;}450AwDTR4eq@Rbm_biv|${<)j~{4XIRRmuPW literal 0 HcmV?d00001 diff --git a/src/main/java/duke/ui/Ui.java b/src/main/java/duke/ui/Ui.java index 75d76aae25..0cd05cfd97 100644 --- a/src/main/java/duke/ui/Ui.java +++ b/src/main/java/duke/ui/Ui.java @@ -105,14 +105,14 @@ public void showDeleteMessage(Task deleteTask, TaskList tasks) { */ public void showHelpMessage() { System.out.println("\tBelow is what Duke can do for you:"); - System.out.println("\t todo task : add a task that needs to do"); - System.out.println("\t deadline task /by time(dddd-mm-yy) : add a task that has a certain deadline"); - System.out.println("\t event task /at time(dddd-mm-yy) : add a task that happens on a day"); + System.out.println("\t todo TASK : add a task that needs to do"); + System.out.println("\t deadline TASK /by TIME(yyyy-mm-dd) : add a task that has a certain deadline"); + System.out.println("\t event TASK /at TIME(yyyy-mm-dd) : add a task that happens on a day"); System.out.println("\t bye : exit the program"); - System.out.println("\t check dddd-mm-yy : check deadline/event occuring on that day"); - System.out.println("\t delete index : delete a task by its number index"); - System.out.println("\t done index : mark a task as done by its number index"); - System.out.println("\t find keyword : find a task by its keyword"); + System.out.println("\t check yyyy-mm-dd : check deadline/event occuring on that day"); + System.out.println("\t delete INDEX : delete a task by its number index"); + System.out.println("\t done INDEX : mark a task as done by its number index"); + System.out.println("\t find KEYWORD : find a task by its keyword"); System.out.println("\t list : list all tasks"); } From d87fa9b3d89a0abd60937cfb8f3389feed0836d9 Mon Sep 17 00:00:00 2001 From: JINGTAN WANG <49268567+JTWang2000@users.noreply.github.com> Date: Sat, 29 Feb 2020 15:17:13 +0800 Subject: [PATCH 36/36] Set theme jekyll-theme-cayman --- _config.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 _config.yml diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000000..c4192631f2 --- /dev/null +++ b/_config.yml @@ -0,0 +1 @@ +theme: jekyll-theme-cayman \ No newline at end of file