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/37] 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/37] 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/37] 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 ba1170108939c14ec17138a5279c286aaba17dca Mon Sep 17 00:00:00 2001 From: fadisng Date: Wed, 21 Aug 2019 15:31:44 +0800 Subject: [PATCH 04/37] Level - 1 --- src/main/java/Duke.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/Duke.java b/src/main/java/Duke.java index 5d313334cc..dae42a9ae4 100644 --- a/src/main/java/Duke.java +++ b/src/main/java/Duke.java @@ -1,3 +1,5 @@ +import java.util.Scanner; + public class Duke { public static void main(String[] args) { String logo = " ____ _ \n" @@ -6,5 +8,14 @@ public static void main(String[] args) { + "| |_| | |_| | < __/\n" + "|____/ \\__,_|_|\\_\\___|\n"; System.out.println("Hello from\n" + logo); + Scanner sc = new Scanner(System.in); + System.out.println("Hello! I'm Duke \nWhat can I do for you?"); + String next = sc.nextLine(); + while (!next.equals("bye")) { + System.out.println(next); + next = sc.nextLine(); + } + System.out.println("Bye. Hope to see you again soon!"); } -} + +} \ No newline at end of file From c80085c069a2e26706e5b694c6e4ae97024219de Mon Sep 17 00:00:00 2001 From: fadisng Date: Wed, 21 Aug 2019 15:56:23 +0800 Subject: [PATCH 05/37] Level - 2 --- src/main/java/Duke.class | Bin 0 -> 1860 bytes src/main/java/Duke.java | 13 ++++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/main/java/Duke.class diff --git a/src/main/java/Duke.class b/src/main/java/Duke.class new file mode 100644 index 0000000000000000000000000000000000000000..2df0998fcffdee2ed57ce21d6415abf7c7b028b5 GIT binary patch literal 1860 zcmaJ?-%}e^6#i}q*=1QuN%+zDqh2bMK!H@NMG0*!R7z@~)zBg>HeQkoENph;?xtf# zo*dtOZTsNp6VLVmMmpp8>|fyD;yB{D8z`h?+)VC0d(J)IIp@3Q-u?66{oeshVADVn zgE}s@VF;->=|&BVVO&F6X)YUx;XMuS8)#F@uBi79bbM$afvY+ul>Vc3T)@X_nADJo zgW;M|Uymb#Q5~OXxT#^9AvR?>R&br6B{lqjAv)uhBtvJ;a^ym_yehp#v1*ehS{9bW z(3^Uc+Z0bk+7`}wIv;qJvz}3o9r-{Mx8_A9T(4n9!z~6Q?^eB{oV650+pX%B99P~Z z-oTp-J}=P251&_pvCVmbuh5_7ZN43@DsWOa{L(zFmML|(sy=c)MP7xpv8}Mve5Ftr zEs$xYKvH4b(D12=S=?qgJMFrGA9$iNFM|!Yos`iYknZhl)hUf zjGlU5SZ?|rHAO(JAw@Z3;A;p5GbDtsd2ZQY41Hy>C1+fxD1s#`*dWOdgcJA-7gJ5z z>$K{K_{L}qT1CaSsZo2H0a2euR2LuTnsqAGqg)xz9Xb*0NrUQd-I3o0>Qpdvr-qwl z6qDang-taygsxMZ8Gc9*)+-i!k08RnI$}3N1#Ad^fg*+Hk$j>m?CT*9G0DotIng>qvt8e$Sy80TuW8tz3nS;cTh$8f zX;vME8C&?iq^h5uB>WJgez4|*Q?jK$Piy2WUGi{9R*nbF)jvIq7n35-;rds!)?bn%|Y zJ0#OmmO=}3(*6>UWfCEkussH?AoJ}hT2LT{IG7FW=P zYqaJzeSnG-%R>*U1p6Ja^*!-n;W!nJH~s@-M9h}} literal 0 HcmV?d00001 diff --git a/src/main/java/Duke.java b/src/main/java/Duke.java index dae42a9ae4..1d3c78272a 100644 --- a/src/main/java/Duke.java +++ b/src/main/java/Duke.java @@ -1,4 +1,5 @@ import java.util.Scanner; +import java.util.ArrayList; public class Duke { public static void main(String[] args) { @@ -9,10 +10,20 @@ public static void main(String[] args) { + "|____/ \\__,_|_|\\_\\___|\n"; System.out.println("Hello from\n" + logo); Scanner sc = new Scanner(System.in); + ArrayList list = new ArrayList<>(); System.out.println("Hello! I'm Duke \nWhat can I do for you?"); String next = sc.nextLine(); + int count = 1; while (!next.equals("bye")) { - System.out.println(next); + if (next.equals("list")) { + for (String text : list) { + System.out.println(count + ". " + text); + count++; + } + } else { + list.add(next); + System.out.println("added: " + next); + } next = sc.nextLine(); } System.out.println("Bye. Hope to see you again soon!"); From 244fb4cde39d68ef8835202e9600420fe8c20f3e Mon Sep 17 00:00:00 2001 From: fadisng Date: Wed, 21 Aug 2019 16:33:05 +0800 Subject: [PATCH 06/37] Level - 3 --- src/main/java/Duke.class | Bin 1860 -> 2274 bytes src/main/java/Duke.java | 21 +++++++++++++++------ src/main/java/Task.class | Bin 0 -> 1136 bytes src/main/java/Task.java | 26 ++++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 src/main/java/Task.class create mode 100644 src/main/java/Task.java diff --git a/src/main/java/Duke.class b/src/main/java/Duke.class index 2df0998fcffdee2ed57ce21d6415abf7c7b028b5..efa32eefd73e3a855cd95f4790189b05e1b1a6c1 100644 GIT binary patch delta 1072 zcmaJWYQZyT~h`Om-sS-j|;7Ue9jg(c@O~r~G>ZW1^bcqn*J|jU^%;L;_=bro3 z-P-lAu5|CO$`1ez;;M#c5L5A74ff;tAaQYx=zf7il1XS#Fd%SPLyeRjk?$8(yriKU zFRK`o{LmBV!LWo8fmecHII3b)DwEQEOhY}62jRoGcIbigP;7 z<81*`$1G9|b#vyD8C!I7`Pg*Iv~8=XBMnPOE8g*Lv!PN3SqA^?3Q;-CG4OoOadpfi zuj2x29T^meJ!LxcDi&n+i}XwvYzipC(cxlI#}e99yeqxSI#!TXaY;VjlXX%$-p8DZ z4;YN06|2`6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(BVC(&}I8^h-w;TQOMAU zz84)l%~r)MpGyuTJMMky9ju?Qd>8Npzv#{jc&Z4 zbzadLZ;5Y{%K*&`L2V%kmE$l+hka!W@Ht5R*b0t#PC+coY_8oz^R%j5QJ* RrhY&D$B2!zW4ayB{|8#rY{mcp diff --git a/src/main/java/Duke.java b/src/main/java/Duke.java index 1d3c78272a..45f8f859d6 100644 --- a/src/main/java/Duke.java +++ b/src/main/java/Duke.java @@ -10,21 +10,30 @@ public static void main(String[] args) { + "|____/ \\__,_|_|\\_\\___|\n"; System.out.println("Hello from\n" + logo); Scanner sc = new Scanner(System.in); - ArrayList list = new ArrayList<>(); + ArrayList list = new ArrayList<>(); System.out.println("Hello! I'm Duke \nWhat can I do for you?"); - String next = sc.nextLine(); + String next = sc.next(); int count = 1; while (!next.equals("bye")) { if (next.equals("list")) { - for (String text : list) { - System.out.println(count + ". " + text); + for (Task task : list) { + System.out.println(count + "." + task); count++; } + } else if (next.equals("done")) { + int number = sc.nextInt() - 1; + Task taskDone = list.get(number); + taskDone.markAsDone(); + System.out.println("Nice! I've marked this task as done:\n " + taskDone); } else { - list.add(next); + if (sc.hasNext()) { + next += sc.nextLine(); + } + Task nextTask = new Task(next); + list.add(nextTask); System.out.println("added: " + next); } - next = sc.nextLine(); + next = sc.next(); } System.out.println("Bye. Hope to see you again soon!"); } diff --git a/src/main/java/Task.class b/src/main/java/Task.class new file mode 100644 index 0000000000000000000000000000000000000000..48c837dc933ab78a44d59428115cac0d2c87cb91 GIT binary patch literal 1136 zcmaJ@>Sm5`Kp- znE39iCZGuq{s4c5Kg4*ayMbaGA9gVAjN(iF*uvH4%BC-&DQ~7z&jGe#Dm=JlI>Rs?ZPiN(@;)T9<)fVDIVj+z)*9 zf?=fCjh%nXkS@y_Ve=I~5U*Q@yCU4?yA6u;?+H~^T(zQ2Pv;sg&UY&ij4)n(i#OXe z6GesrVy<`Ev=4b$UrSu2iaM>OWNethuF6*Ei49+8&296jzNo8mFn}=!Hu@Ym=x0d% z{`|4Mo;WCAh+*)hlqymoZ*B>-FKbagi+KyKg9Y5D%Cr=rE?e|w_ds~+N+>pA;{g^K zGCS*bAM;{P~I(d_4F^bMr-5YQ>D=YaMMXvUDI zb&zh$gfM8&yFb9(g)I|uG6k@nWYk`QGltz{WO`=-#LKBn-tkBNd0;foQf>lU= zL8g%TN+F{ykZnKrVVEK&3}?;62!*a+D2yix8TS;1=EaF)p7uG4F3LcTtG~IQ Date: Wed, 21 Aug 2019 17:42:13 +0800 Subject: [PATCH 07/37] Level - 4 --- src/main/java/Deadline.class | Bin 0 -> 868 bytes src/main/java/Deadline.java | 14 ++++++++++++++ src/main/java/Duke.class | Bin 2274 -> 2734 bytes src/main/java/Duke.java | 30 ++++++++++++++++++++++-------- src/main/java/Event.class | Bin 0 -> 862 bytes src/main/java/Event.java | 13 +++++++++++++ src/main/java/Todos.class | Bin 0 -> 737 bytes src/main/java/Todos.java | 11 +++++++++++ 8 files changed, 60 insertions(+), 8 deletions(-) create mode 100644 src/main/java/Deadline.class create mode 100644 src/main/java/Deadline.java create mode 100644 src/main/java/Event.class create mode 100644 src/main/java/Event.java create mode 100644 src/main/java/Todos.class create mode 100644 src/main/java/Todos.java diff --git a/src/main/java/Deadline.class b/src/main/java/Deadline.class new file mode 100644 index 0000000000000000000000000000000000000000..d88e61b963aa5915720358c28be7fbfe12dda095 GIT binary patch literal 868 zcmaJ<(M}UV6g_v5-L@7V!+ zl4wYH@B{oP!riuN$!>VqnLBsSIrrQ<^XK~NH-K003b1iMk6DzG=s}6ID-IqxSS48g zkWgx#igU3S3U$2KGEtz8>je94paS!buw706PG`JB!o7y>NPPINae z+IXD96Bkdh&c*(+*-%@=J;HKE2i{=;&rl|~NBiHXT=j=<%H$DN&O}c(wCV`+H83X} z#YQL-6JBSiq+7}8&cQ}vZIe*>Kj%Q5>zv!X@!H?DEXUaF2+&f1W$9WWZo#WFEpJ#ZVtL@&< literal 0 HcmV?d00001 diff --git a/src/main/java/Deadline.java b/src/main/java/Deadline.java new file mode 100644 index 0000000000..2de70b7540 --- /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 + ")"; + } +} \ No newline at end of file diff --git a/src/main/java/Duke.class b/src/main/java/Duke.class index efa32eefd73e3a855cd95f4790189b05e1b1a6c1..289544a1b7bdf1e3d401033ea697c4b04f32a2b0 100644 GIT binary patch delta 1332 zcmZuxOLG)e6#ni!`rhfZhD;cs^P+(~CeKM?GT=l5#vmjlK}`UIFDB_uW?<;SOeZ8F z1T}y!)YyUs6eC!bl@w|@DMFQxE&c%)E-V+8JJ(bp@!T$!>BYI{`So|sJ>7p5-HgoM zeX#NqfbIB3MI#ad9U(k{C&T1>N<|l*=IEB5-6|A3!?8z2NT%(Tc8@@>ia7QO^htkz z0Rat2v7h7FFc_W}7?hbqGJHTqF%E{|!wb?kEO26F&NsyOSl;ahFR|SqpJ1ND8 z6r&ubiYizfV=8K3NwD!S{74HNV}Ol)v8Y1`I>hSzaQLlfR` z|72aWr*VeCKQd!!n8jI!Kqj3dkT>y`hPN@N;WW;XcPN=VCU9P&Um(-W+Enlk-qr9P z-q-K}VgeUs^g|6FNyzd&S;t5_O-4`6lw~AM(=rVwmChLsAteaH$(mV)!Qc>`ISn7< zj3h;rg=rSWLq_KGERHH+_mr6zzT(mD!gWg1e_In+Sh~vjU$>1`F;*-%bA& zT)olh_Z0@5iS%&>p0-VEdjFVv%fGR;he63$_PCQ`2<0Y6XpCuloMA(>r>C~hn^-1k zkH-c*e+NU2+a0VvaF7N?jWARh22%&JCyklxq>)Nef6QwuXQXXv(lX=>n;1%?eR6Ic zYk_inA;~Vfmx8tIy8CnR$G{Cjb{CZj_p(yo+d#`JA0O=;-95=>vdZaXbO!5|!M-Df zp@pR4IRmsrt$2)dO7&R?pnwu4-2&b`;ExCOK=_e79=*a^Nh>660f|6dY0P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ke.java b/src/main/java/Duke.java index 45f8f859d6..e27173a706 100644 --- a/src/main/java/Duke.java +++ b/src/main/java/Duke.java @@ -13,12 +13,13 @@ public static void main(String[] args) { ArrayList list = new ArrayList<>(); System.out.println("Hello! I'm Duke \nWhat can I do for you?"); String next = sc.next(); - int count = 1; + int count = 0; while (!next.equals("bye")) { if (next.equals("list")) { + int listCount = 1; for (Task task : list) { - System.out.println(count + "." + task); - count++; + System.out.println(listCount + "." + task); + listCount++; } } else if (next.equals("done")) { int number = sc.nextInt() - 1; @@ -26,12 +27,25 @@ public static void main(String[] args) { taskDone.markAsDone(); System.out.println("Nice! I've marked this task as done:\n " + taskDone); } else { - if (sc.hasNext()) { - next += sc.nextLine(); + count++; + String description = sc.nextLine(); + Task t; + System.out.println("Got it. I've added this task:"); + if (next.equals("todo")) { + t = new Todos(description.trim()); + } else if (next.equals("deadline")) { + int index = description.indexOf("/"); + String byWhen = description.substring(index + 4, description.length()); + String desc = description.substring(1, index - 1); + t = new Deadline(desc, byWhen); + } else { + int index = description.indexOf("/"); + String at = description.substring(index + 4, description.length()); + String desc = description.substring(1, index - 1); + t = new Event(desc, at); } - Task nextTask = new Task(next); - list.add(nextTask); - System.out.println("added: " + next); + list.add(t); + System.out.println(" " + t + "\nNow you have " + count + " tasks in the list."); } next = sc.next(); } diff --git a/src/main/java/Event.class b/src/main/java/Event.class new file mode 100644 index 0000000000000000000000000000000000000000..ff1540599ba964a26804eaf8e476439c9253f04e GIT binary patch literal 862 zcmaJfgc5PjnkJ8@0ZrY)s>v?-)*oFaMz5yXM06-WUNiOQkkut`>}8+SLdH<9{J z_!%I9D)qn*;71|GP6R==ICytv{NCF)v-|Vc%?|+2;JdJ~QbGZhBwDR-b;H432b%;- z7(%6eAtvH56zc4-W1>KvH3|01Kn3O%VZWaJovrvMgj+2=kc4tOQ1bowvL~ai=!IM< z8a>q|tkwN2nc#NxIO@yeAc4C_6RFJ8#FU2;?s;%f^l%$Xgyq*-o7hBR^iG;{J&4OT z?icaE!$WKl3MrMXbVWQQtmk<5Ph4!HO7KpPK2fzU%!?}dgpErvlr63L!h8(OIY+S( z%EW}{IV#yEa{6+xlla;t)c#I5P!m0rvq4YKI~IMTqbmpdJomQN!|{miy;Vv^tx&|V zWD}p~P0Tc=BX}d!Ae3=!N^EAG%~k#(cCSV<2Yxz-|IoXTebb!pZ6?tYVb}?bY&xhD zb~F9uc_VE7ABP=&rZzuNzQN?uIkGq|!R2+4vjff-cwcNBT!R`(qDyC z!eu%oPi98kONAKIxW+=`8>|~X0bl-bZN{-IE0lS+u#6h-$+3^HhsW5&8s|mM*ZI5i E8(-$yga7~l literal 0 HcmV?d00001 diff --git a/src/main/java/Event.java b/src/main/java/Event.java new file mode 100644 index 0000000000..953aa48199 --- /dev/null +++ b/src/main/java/Event.java @@ -0,0 +1,13 @@ +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/Todos.class b/src/main/java/Todos.class new file mode 100644 index 0000000000000000000000000000000000000000..399fc6936f739b40ad9625d6441c951af486a646 GIT binary patch literal 737 zcmaJCDUUv2`cM+nCbWHEqYtDH159*fogq5|iT|WO zqkSUbp+CSMWxNXnX&~KX@7{anoclF<|1kaw;1op2AYx6Qzgi@b|nf^!zC(0(H9 zmKrx=D5{ZASJkGCLv>XvUl7*ox+@8}MyTZX!EIZ{foMmJWUQXj2>DWZSxoSndJuQy zd6>|>KzFtInAGs$!1dwb8DZ}6=L*)vusYY6XGjk4UJi^HVKYeMm9@=y(RPtF!F&3-OAR>yZP zPIz4nt$Tw$!T+k1jO&pwMsmqtizR0{rUQKusvAjDoC<5pZ7d-F2!p%6TtROw@PD*# zWXIMPmp@BU7g5vTjS$N%Ty4c7SwN}d#W7jW5TI6C1t#b2lLVFdca z9wE!to1lp%%?RK3oKNiWd1Zvu7;C`qxyG5CWEu1sOJM`ACYcCFT>lvR*y1?Dtmpi0 FKLRu;xsLz< literal 0 HcmV?d00001 diff --git a/src/main/java/Todos.java b/src/main/java/Todos.java new file mode 100644 index 0000000000..0f3a4268db --- /dev/null +++ b/src/main/java/Todos.java @@ -0,0 +1,11 @@ +public class Todos extends Task { + + public Todos(String description) { + super(description); + } + + @Override + public String toString() { + return "[T]" + super.toString(); + } +} From 47514be09d74cb9ea10c967e8378222bff6b74bd Mon Sep 17 00:00:00 2001 From: fadisng Date: Thu, 22 Aug 2019 14:30:36 +0800 Subject: [PATCH 08/37] Level - 5 --- src/main/java/Duke.class | Bin 2734 -> 3512 bytes src/main/java/Duke.java | 61 ++++++++++++------ src/main/java/DukeException.class | Bin 0 -> 226 bytes src/main/java/DukeException.java | 5 ++ src/main/java/EmptyDescriptionException.class | Bin 0 -> 244 bytes src/main/java/EmptyDescriptionException.java | 5 ++ src/main/java/UnknownTaskException.class | Bin 0 -> 234 bytes src/main/java/UnknownTaskException.java | 5 ++ 8 files changed, 56 insertions(+), 20 deletions(-) create mode 100644 src/main/java/DukeException.class create mode 100644 src/main/java/DukeException.java create mode 100644 src/main/java/EmptyDescriptionException.class create mode 100644 src/main/java/EmptyDescriptionException.java create mode 100644 src/main/java/UnknownTaskException.class create mode 100644 src/main/java/UnknownTaskException.java diff --git a/src/main/java/Duke.class b/src/main/java/Duke.class index 289544a1b7bdf1e3d401033ea697c4b04f32a2b0..d1f93dfcaf520bca263a3d8e32944d5cad18559a 100644 GIT binary patch delta 2017 zcma)7S#T6p6g_XIXI^)w6GCT((1fLf!34-c0t_$&WC=)w01_4>E)1C_8Ay7+uFP(;{jVXu+#go^oS zknyDWu9fkWSbsVTHF!pdXF1mCU|27sQAHG%Sl*x_h$bB##8NUg%Ge~MMMf)!t-~w& znrPD@A;FQ9;ixD=n~Zjj4$)}2p)@4m9S>Q#={I9_K^7j!mSZB8t1C&{RfwbVM}FM76t+buNBG!<%@EA$MLp?j)T=q^-_!n&Z*r5I^3Q@s5UF*v+v=gNwZk zLq&E)yAx}vsBeteww2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_J@sJAq<^2~Tg}6N{@eHMZ}0u@`M%;S zBYW%a%1rfCRBY$ip&=mKcFMRm&wctT)Mb`Ht%u!bV+3nCBuWo}g9z)pcDISxvar!-XIX@Nrmhh-d> z=7=<790?6|usFswG{BN%6G8Zp6gbK;#gV%3_kp@&95zRqK^siZOpjUHlPQZK&^t3_ zwH}Sn#&xtJ;+|!5yN~O52Ga}$J?XTQai-(P2P|hYoye?Fkr8lo%wU$|gpN6!WGIyA z$c&RrMFz*>wrx%8cowH5-*awXUeCVMm}l@EIce$0;tYe5N@j@UdAy+GMJ(tzjh84p z6wgcvoR#e7C`_bn0=$g#I$pu6I$lFW;B{GjL&uw#chCE3_A5?0L0j?<(I=zhEzHYh zNt8%f@kA9oi{gBM&A5LBTC*|57xkM; z@V*@Gzr;GoTSML=VoFqP$)O;|O@1AP42!6hUXbAj6vf0h@ENKpR!|J&;9pSL((12E z_=5-xk09KfLy3|g7DLUURDy^qhcZH%d388tc&p_I8<8il{T4busVmDs4!JS@WZleLk_jEfT=2mP!iJDZlG?|)Xcy#>LtAE zKcM0NM>X6-g<`x#if$b7R2%*kGoe3h2xW zu^B<^pqIRhj%pkR-C+qmlTw^Q84a^ZBU+BjsK6Ce;!Aqd*RU4fVjZrd8b6{2KVt)a zLoI%%C;cbtv5E$kj}R+EBdb6Yt3{Y~qM2<)3mZU$4WW&Vp<|w<(8(Nhp_4>Kp{eg|PnZn=YYj-uNz1pQ}h@;3G$KBlimBlICY!AB%} V3&rI$N)J list = new ArrayList<>(); System.out.println("Hello! I'm Duke \nWhat can I do for you?"); - String next = sc.next(); + String[] arr = sc.nextLine().split(" "); + String next = arr[0]; int count = 0; while (!next.equals("bye")) { if (next.equals("list")) { @@ -22,32 +23,52 @@ public static void main(String[] args) { listCount++; } } else if (next.equals("done")) { - int number = sc.nextInt() - 1; + int number = Integer.parseInt(arr[1]) - 1; Task taskDone = list.get(number); taskDone.markAsDone(); System.out.println("Nice! I've marked this task as done:\n " + taskDone); } else { count++; - String description = sc.nextLine(); + String description = ""; Task t; - System.out.println("Got it. I've added this task:"); - if (next.equals("todo")) { - t = new Todos(description.trim()); - } else if (next.equals("deadline")) { - int index = description.indexOf("/"); - String byWhen = description.substring(index + 4, description.length()); - String desc = description.substring(1, index - 1); - t = new Deadline(desc, byWhen); - } else { - int index = description.indexOf("/"); - String at = description.substring(index + 4, description.length()); - String desc = description.substring(1, index - 1); - t = new Event(desc, at); + try { + if (next.equals("todo") || next.equals("deadline") || next.equals("event")) { + if (arr.length == 1) { + throw new EmptyDescriptionException("☹ OOPS!!! The description of a " + next + " cannot be empty."); + } else { + for (int i = 1; i < arr.length; i++) { + description += " " + arr[i]; + } + } + } else { + throw new UnknownTaskException("☹ OOPS!!! I'm sorry, but I don't know what that means :-("); + } + System.out.println("Got it. I've added this task:"); + if (next.equals("todo")) { + t = new Todos(description.trim()); + } else if (next.equals("deadline")) { + int index = description.indexOf("/"); + String byWhen = description.substring(index + 4, description.length()); + String desc = description.substring(1, index - 1); + t = new Deadline(desc, byWhen); + } else { + int index = description.indexOf("/"); + String at = description.substring(index + 4, description.length()); + String desc = description.substring(1, index - 1); + t = new Event(desc, at); + } + list.add(t); + if (count == 1) { + System.out.println(" " + t + "\nNow you have " + count + " task in the list."); + } else { + System.out.println(" " + t + "\nNow you have " + count + " tasks in the list."); + } + } catch (DukeException e) { + System.out.println(e.getMessage()); } - list.add(t); - System.out.println(" " + t + "\nNow you have " + count + " tasks in the list."); } - next = sc.next(); + arr = sc.nextLine().split(" "); + next = arr[0]; } System.out.println("Bye. Hope to see you again soon!"); } diff --git a/src/main/java/DukeException.class b/src/main/java/DukeException.class new file mode 100644 index 0000000000000000000000000000000000000000..24fdd1d968267e6e52d9f6fb280d3014b905fd7f GIT binary patch literal 226 zcmX^0Z`VEs1_pBmUM>b^1}=66ZgvJ9Mg}&U%)HDJJ4Oak4WF#UvPAuy#JqI<;F6-u zymV{LFh&Lz=lqmZMh1SL%)C^;(%hufqL9R-9H0nSaDHh~a;jSb^1}=66ZgvJ9Mg}&U%)HDJJ4Oak4WF#UvPAuy#JqI<;F6-u zymV{LFh&Lz=lqmZMh1SL%)C^;(%hufqL9R-9H0nSaDHh~a;jS%<=z&b-VPIikWn_@Vsfv+-*QGQ&6|Rdxk%0;5Ob}oMLZEIS$p+*p k0mYesG@F+8b_T|cV0m^R$psc=2C8ELs^kEQFfnif02s(N_5c6? literal 0 HcmV?d00001 diff --git a/src/main/java/EmptyDescriptionException.java b/src/main/java/EmptyDescriptionException.java new file mode 100644 index 0000000000..da2269e927 --- /dev/null +++ b/src/main/java/EmptyDescriptionException.java @@ -0,0 +1,5 @@ +public class EmptyDescriptionException extends DukeException { + public EmptyDescriptionException(String message) { + super(message); + } +} diff --git a/src/main/java/UnknownTaskException.class b/src/main/java/UnknownTaskException.class new file mode 100644 index 0000000000000000000000000000000000000000..a9046f985031db07f67f5c3e66edda2b69fa81e8 GIT binary patch literal 234 zcmX^0Z`VEs1_pBmUM>b^1}=66ZgvJ9Mg}&U%)HDJJ4Oak4WF#UvPAuy#JqI<;F6-u zymV{LFh&Lz=lqmZMh1SL%)C^;(%hufqL9R-9H0nSaDHh~a;jS zob6hXoLW$lnV+WzGLVOXg@KikK?IuuMh0G&((F{Y1_nh2CZOX$fDs6R8i6Dmkf#I` iX9Ch}TH4zg7&n6D*?}Y%SdWa11Q48zzG1_<}%Cx literal 0 HcmV?d00001 diff --git a/src/main/java/UnknownTaskException.java b/src/main/java/UnknownTaskException.java new file mode 100644 index 0000000000..f80c096496 --- /dev/null +++ b/src/main/java/UnknownTaskException.java @@ -0,0 +1,5 @@ +public class UnknownTaskException extends DukeException { + public UnknownTaskException(String message) { + super(message); + } +} From 6cc2e4d3bf979d17aa41ec6f414eddc631c62b78 Mon Sep 17 00:00:00 2001 From: fadisng Date: Thu, 22 Aug 2019 15:00:07 +0800 Subject: [PATCH 09/37] Level - 6 --- src/main/java/Duke.class | Bin 3512 -> 3741 bytes src/main/java/Duke.java | 22 ++++++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/main/java/Duke.class b/src/main/java/Duke.class index d1f93dfcaf520bca263a3d8e32944d5cad18559a..33eb282a3eae7d812995e9e686277e670ab7b0a9 100644 GIT binary patch delta 1663 zcma)6YgANK6#mYg%basB7o%&FT}2&469hqdiGzqD2#9FpE9{{obJbCtA!Z=8bjnOC z%e0#nmS$R!We;Bif}uSuvv;k2wN`8O$NJT()pEIXp|sCP{pnBl$3A=Sv-ke?+2^~b zd&Itxu?yFG`T$J9_d2Fyp1^z!cc8%}-y$80v4rC;>1ovA#!`;Eb!al|9%;& zbfG`8mNqhL=SrTjvHqpQP#$W3m%D9~YGFJ9t!*}y*RXSi8r=e0$H&3Ox&{GpKDYTy+dko8`5 zYL$xEK^$UWUIVY;bq3dp4Yq+d(8-`S2P07fZ{o0lxA3-sBY20rvQvR~CCqzd2Erk_ zlJ^Z9#W4fNal*h!%n*pnfG!4iz;3pqRI?i=7)H$tN9{naw|0EH?QON!h1*R#;Ek>h zM!Zp~>oYJ1b5x;h!~Ft1vQDov*|nwSbfVKd10P7JKAbUd79TQ*O4}c34u%M% z93L?xRkhn8>ilDQiWE7*e=)&!1)MCw}(bhpq;+E>sV);E75BT_2jdc$E+KH52WHy>vU6^o2 zB4;O%*&tR2Zs|o%qeab4>_VVeC!lT*=bB; z=TOFe#B}xx%GvLj$u6OS^`nYfnWZpP#uNk9$}rR@Ud&N4QHLt(ZY9hCVjAa|%~8$a z=Fo2FM6qi~V;nVCFhMCS>_<99c&^d0*cFUWv~kn>F`2_NfK(8V|C3MAp!AZfFovQQ zG09j)W6|UvDfvwB4a9GS){NmqrJ*#$?BP8q1!$6;NFB7NCG4XVc4MOQnFZ$2(>R|V z=>{6*g2Y)=C?10f&P_zt<11Qq0{Q~q;7b%(xRV??;1tfVFdeYG0ROttk67Q686$odhsfQ)h0F68$9UQ zH3koP=WBDQB-&F=ZLLXnpDOTIQso|3TbJy%c!`%4!>ilc zQpr?DynSgRwXv-sIV{8;gI6r}vQP7>h0A`$Et}$9@siF|Q%lM64e{32M2E#|ylzp+ z8*YcMdhMI^C{&@v0p3#h*KbQ$yv;#Hprt99vUrDgEe`RX#bJ&JyCR;H5xwuV`9Q*k zw$_B^LyKNMviO*z7N1aMaLh~i)UESZ=6&Wh+i!5(qds@{_;)Nnk!@OHanh?g#TOQ* z$taB4M7*J;sZ}&o(x(X4btPIw#2F46ob~Ga4F(jswVln0n**}=k{)+;V4S-%u-pF? zgQxO?^**;t|KWBR%@LVpV8kFKvPZ_W6SPNV7=D0T#T%XVa>W}XUJsQ{U@&k9dw{}vC)m&J(8t(w zfoM1qmZQT`q@6${T-MJxi0SUI>b-HPm)rry*V{#X+;Q$CetSZO;833)@&}k$@1%8x zNqtO?8NH;2I`=Tk(e{)K#nG^%BVoPHk*uj1ro~K0OPfH0=jRMiQt#wAW*^hN@|pj$ zsC1~PEM`n~(nf|Et0EzJyNF11j7X@TauB7x*f*J(L(K44*yF+(DkP&ggJtJt$cqJ> zfWIsj?7bfK-gB0moscbDP?ywY`J#N;z5FDew;ew@43ll#MlNIBqgG9NkTHBsAs1wN zKg*|lnIf(*K?RtoY_SCtt0JbUsg$S+rmKaNs%4a^HOx@Wl&dYwRNX|?E-KVsW~oEW zR>z2`vs9_`%uyGatA1pjx_jkxEm0g~`71tBjX~$TjaqUZKDj9y|9crJBg-yc@z9|M39HN9v=0V~wCr yngwJ+QJKd4g%XGqz7cB*d7kfN91eF&T#RO^aQ9>}p2dw>Y|G;2EIyOP9sdA&h8+O_ diff --git a/src/main/java/Duke.java b/src/main/java/Duke.java index 31c96fad1e..2bf344981a 100644 --- a/src/main/java/Duke.java +++ b/src/main/java/Duke.java @@ -17,6 +17,7 @@ public static void main(String[] args) throws DukeException { int count = 0; while (!next.equals("bye")) { if (next.equals("list")) { + System.out.println("Here are the tasks in your list:"); int listCount = 1; for (Task task : list) { System.out.println(listCount + "." + task); @@ -27,8 +28,12 @@ public static void main(String[] args) throws DukeException { Task taskDone = list.get(number); taskDone.markAsDone(); System.out.println("Nice! I've marked this task as done:\n " + taskDone); + } else if(next.equals("delete")) { + int number = Integer.parseInt(arr[1]) - 1; + Task taskRemoved = list.remove(number); + System.out.println("Noted. I've removed this task:"); + printTask(--count, taskRemoved); } else { - count++; String description = ""; Task t; try { @@ -44,6 +49,7 @@ public static void main(String[] args) throws DukeException { throw new UnknownTaskException("☹ OOPS!!! I'm sorry, but I don't know what that means :-("); } System.out.println("Got it. I've added this task:"); + count++; if (next.equals("todo")) { t = new Todos(description.trim()); } else if (next.equals("deadline")) { @@ -58,11 +64,7 @@ public static void main(String[] args) throws DukeException { t = new Event(desc, at); } list.add(t); - if (count == 1) { - System.out.println(" " + t + "\nNow you have " + count + " task in the list."); - } else { - System.out.println(" " + t + "\nNow you have " + count + " tasks in the list."); - } + printTask(count, t); } catch (DukeException e) { System.out.println(e.getMessage()); } @@ -73,4 +75,12 @@ public static void main(String[] args) throws DukeException { System.out.println("Bye. Hope to see you again soon!"); } + public static void printTask(int count, Task t) { + if (count == 1) { + System.out.println(" " + t + "\nNow you have " + count + " task in the list."); + } else { + System.out.println(" " + t + "\nNow you have " + count + " tasks in the list."); + } + } + } \ No newline at end of file From b382bd3e454f22f4aa8b1c0e03257b00af38accb Mon Sep 17 00:00:00 2001 From: fadisng Date: Mon, 26 Aug 2019 19:23:39 +0800 Subject: [PATCH 10/37] Level-7 --- Duke.txt | 0 src/main/java/Deadline.class | Bin 868 -> 1226 bytes src/main/java/Deadline.java | 14 +++++++++ src/main/java/Duke.class | Bin 3741 -> 4999 bytes src/main/java/Duke.java | 55 +++++++++++++++++++++++++++++++---- src/main/java/Duke_List.txt | 4 +++ src/main/java/Event.class | Bin 862 -> 1219 bytes src/main/java/Event.java | 14 +++++++++ src/main/java/Task.class | Bin 1136 -> 1281 bytes src/main/java/Task.java | 9 ++++++ src/main/java/Todos.class | Bin 737 -> 1047 bytes src/main/java/Todos.java | 12 ++++++++ 12 files changed, 102 insertions(+), 6 deletions(-) create mode 100644 Duke.txt create mode 100644 src/main/java/Duke_List.txt diff --git a/Duke.txt b/Duke.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/main/java/Deadline.class b/src/main/java/Deadline.class index d88e61b963aa5915720358c28be7fbfe12dda095..912dad2d8dfa6bc5a1f9f015c3fc5faceb5f5708 100644 GIT binary patch delta 642 zcmZuvO-~b16g_u3%uL(Yp{-CvYZ;}~&J-;8t!SdAOISfzup4OuRnlqNiCgyW>a1M& z4_s&>AtA;ez&~*Be{g3!uOOJ{;+=Qjx%b?A-+k|gb&`I1^6U5;fCqSzK^C)VWN<}W zS2dK2ba|S)uHi-z0S;Zp4FbZ+CV3U&`May{(oe z`t-+w+(sPkyj~Cco8im-&gkRZa~C%i6mkkK>I#=ICCI;sqIeh&!v1re*}=-_XHXH8{@0DamBDS?Novw=39Rn074R{N|G3j@yNgtnffA}oJrfo zBr%_SH_8VEaxPLt3lp$8QD+>X$C@X*NT11F1%Qo+(8jL$p^E|ghn6`v+YmP0yI z*7zpENH;iw8GM0p%mVmyuC=uHfN2EN=c2VU(L4p#dlb0Yr&@>Fi&OeElkryLOfn*NQbIbO?RKOd#vH|T7q_#;_sC^taGi3T6O-g@ z(=@d2s;ZvXuTL-c&-JXD&RY?^gnrI|6E`zum@(wkt;{ruIrH+^J=lr4bZ_>fab?sl z?btmAMK9E^U}*S!F)N;uscyMt(64f7O#;h9zc;~|kKEk?gS1_pH4h0`oaHouqg^|ZbR^qxa0yre&6AJE9v51v^ zQpVk^_fsmC@cPrd7~51OoL=%o3Q=7`LsaRBwlsY&AO)v=itx~wVcK2QEnYHi zchxatVT)&W_G~o!e0mv=%J_ziZwjbu_jX!+Ufi)=8IK9%_YsfRYPvmiR^HIaGhf2g zgk#3m#S>P&V|$kExdIjCrz%VDq`Y{ddQ~!M4m8GH&*#r?iFetimr9bgHUB5$^0fLD zz5unwNhLciHi67slj^am*i{W%ajAf7w9}uF`J0%i`wXMq*iJus?lboJRP6?BPx@DF zR5KZG`&8-C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hxjDSqPKFik+_2rbpTB3@C4#>__1{yAZsanSu7F6q(xS1Ul*H4aVx?BK0XZ z&=SdNHGF9w(^`Vk!0lnWfj4{)DE}3z;R32LWlu7VoU!h!ZcrYLByft%`mQM#J|AsL zNr~>5EYip7yy};iCWcw9cbOF}Se#M@%0dmJj4=#gqDT#tlb=n6Y^EJblYNtWnL}OkZWQMw%nd%6$)DxuCX=bZun4_L$t~$p& z^)~a>`z%x+u}Ga~iPW|@rf7S@c^g(l rmMi(6d|mPSJTLNsOkj=3b!f3xTprOa5zR()PegBIt%2Mb3BUXTL2r9P diff --git a/src/main/java/Duke.java b/src/main/java/Duke.java index 2bf344981a..7aa1c1b150 100644 --- a/src/main/java/Duke.java +++ b/src/main/java/Duke.java @@ -1,22 +1,37 @@ +import java.lang.reflect.Array; import java.util.Scanner; import java.util.ArrayList; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.IOException; public class Duke { - public static void main(String[] args) throws DukeException { + public static void main(String[] args) throws IOException { String logo = " ____ _ \n" + "| _ \\ _ _| | _____ \n" + "| | | | | | | |/ / _ \\\n" + "| |_| | |_| | < __/\n" + "|____/ \\__,_|_|\\_\\___|\n"; System.out.println("Hello from\n" + logo); + System.out.println("Hello! I'm Duke \nWhat can I do for you?"); Scanner sc = new Scanner(System.in); ArrayList list = new ArrayList<>(); - System.out.println("Hello! I'm Duke \nWhat can I do for you?"); + String filePath = "Duke_List.txt"; + try { + loadFileContents(filePath, list); + } catch (FileNotFoundException e) { + System.out.println("File not found"); + } String[] arr = sc.nextLine().split(" "); String next = arr[0]; - int count = 0; + int count = list.size(); + File f = new File(filePath); + while (!next.equals("bye")) { + boolean changed = true; if (next.equals("list")) { + changed = false; System.out.println("Here are the tasks in your list:"); int listCount = 1; for (Task task : list) { @@ -54,12 +69,12 @@ public static void main(String[] args) throws DukeException { t = new Todos(description.trim()); } else if (next.equals("deadline")) { int index = description.indexOf("/"); - String byWhen = description.substring(index + 4, description.length()); + String byWhen = description.substring(index + 4); String desc = description.substring(1, index - 1); t = new Deadline(desc, byWhen); } else { int index = description.indexOf("/"); - String at = description.substring(index + 4, description.length()); + String at = description.substring(index + 4); String desc = description.substring(1, index - 1); t = new Event(desc, at); } @@ -71,11 +86,18 @@ public static void main(String[] args) throws DukeException { } arr = sc.nextLine().split(" "); next = arr[0]; + FileWriter fw = new FileWriter(filePath); + String textToAdd = ""; + for (Task task : list) { + textToAdd += task.print() + "\n"; + } + fw.write(textToAdd); + fw.close(); } System.out.println("Bye. Hope to see you again soon!"); } - public static void printTask(int count, Task t) { + private static void printTask(int count, Task t) { if (count == 1) { System.out.println(" " + t + "\nNow you have " + count + " task in the list."); } else { @@ -83,4 +105,25 @@ public static void printTask(int count, Task t) { } } + private static void loadFileContents(String filePath, ArrayList list) throws FileNotFoundException { + File f = new File(filePath); // create a File for the given file path + Scanner sc = new Scanner(f); // create a Scanner using the File as the source + Task t; + while (sc.hasNext()) { + String next = sc.nextLine(); + String[] arr = next.split("@"); + boolean isDone = arr[1].equals("1"); + String description = arr[2]; + if (arr[0].contains("T")) { + t = new Todos(description.trim(), isDone); + } else if (arr[0].contains("D")) { + t = new Deadline(description.trim(), isDone, arr[3].trim()); + } else { + t = new Event(description.trim(), isDone, arr[3].trim()); + } + + list.add(t); + } + } + } \ No newline at end of file diff --git a/src/main/java/Duke_List.txt b/src/main/java/Duke_List.txt new file mode 100644 index 0000000000..caded7e1ae --- /dev/null +++ b/src/main/java/Duke_List.txt @@ -0,0 +1,4 @@ +E @ 0 @ project meeting @ Aug 6th 2-4pm +T @ 1 @ join sports club +T @ 0 @ sleep +T @ 0 @ play ball diff --git a/src/main/java/Event.class b/src/main/java/Event.class index ff1540599ba964a26804eaf8e476439c9253f04e..893e04cc23037dd33f9a522573655ae4e05d00e7 100644 GIT binary patch delta 640 zcmZutzf%)o5Pf@uyX0~?l1QRx#1jJKF2R7mK+zcy>_P=YL3fZ0L^HWea${j*@7QFn z@_(?<88I^yHg^6I{tXt^j_h-3!}6 zmuo$9o;a&~qTYGD@+UTMS501z-ij*^qt9|G8&OAVtgBOjr%9*}&`Z#_F-6QWs`6eF zv}vz8f_Sx4XdmP9T=YXLytbjPstRi?OVC$Ov*oJh;cr~@^4z1V8j3b delta 279 zcmW-ay-veG5QM)wW1nqI62fnOAP@o}5e*d;4K)-z0#YKSGa~MIis%}ifrXb{(z7{~Pj*--*Vr*rlR)kzxqD ci8^vd)YUBw2I?WduiYbBY-&z5Z|QIU0RToIY5)KL diff --git a/src/main/java/Event.java b/src/main/java/Event.java index 953aa48199..79c9a11439 100644 --- a/src/main/java/Event.java +++ b/src/main/java/Event.java @@ -6,8 +6,22 @@ public Event(String description, String at) { this.at = at; } + public Event(String description, boolean isDone, String at) { + super(description, isDone); + this.at = at; + } + @Override public String toString() { return "[E]" + super.toString() + " (at: " + at + ")"; } + + @Override + public String print() { + if (this.isDone) { + return "E @ 1 @ " + this.description + " @ " + this.at; + } else { + return "E @ 0 @ " + this.description + " @ " + this.at; + } + } } diff --git a/src/main/java/Task.class b/src/main/java/Task.class index 48c837dc933ab78a44d59428115cac0d2c87cb91..842c0b55a091648e8edb98625648ef27e0312168 100644 GIT binary patch delta 537 zcmZ9H%Su~O6o&tGc9L`P)R=gU@e(gpbG*b$ty(AQpmd-k#eoQN&_JVNB#F+QI|+ND z(1)mC5FGdb&Pv~)4CiXQs&=y5)$1jhsQ#V_qo<|9Nk!mo7SBri`LBiJyujTG z%STg(;d$sIj&2`K@O^whvq1g%q3ia_M;qD&Eo;SMrCce6ryKdo_u@f09>b)ADIYmZ z3!rx-r)Ds#FJ&(_XR-_WMY6J_(^gHs=wH_QkjoPQ3lSqkFJiR#+Ysuv&?fYX%1Ba& zD)lXnR+C|Ujx&mXJh+1d<26`8PYvpZDS^2@NfZb-V3+7-g2n7zM_#DRhUtni0%baA zZCL)QjZUVz8f{GWGBPdE;1{-@U$>EC_R pGti#@5@|+8LM5H|0t39Umn92*_*{nzK4B5_gnwl0aBzfg^c5QhK!pGR delta 437 zcmYLD%`O8`7(I7pI&I7 z7|8p&ez%$fc+n#evHykGiDJ?E}}l9bFlh%MQ$%AbPNZZ4Z;A(mytm8Ft2!C_low zVM#_=v~JK NYMjWiH`nL+3g7o4FS7su diff --git a/src/main/java/Task.java b/src/main/java/Task.java index 6b71a4c025..51a1050b69 100644 --- a/src/main/java/Task.java +++ b/src/main/java/Task.java @@ -7,6 +7,11 @@ public Task(String description) { this.isDone = false; } + public Task(String description, boolean isDone) { + this.description = description; + this.isDone = isDone; + } + public String getStatusIcon() { return (isDone ? "\u2713" : "\u2718"); //return tick or X symbols } @@ -23,4 +28,8 @@ public void markAsDone() { public String toString() { return "[" + this.getStatusIcon() + "] " + this.description; } + + public String print() { + return ""; + }; } \ No newline at end of file diff --git a/src/main/java/Todos.class b/src/main/java/Todos.class index 399fc6936f739b40ad9625d6441c951af486a646..8a7bfb3f11c67ecba025a282b569e62bb579fb81 100644 GIT binary patch delta 578 zcmZWl%TB^j5Is}qgHl8);;Skms1z07nCQZVE2G9lVj{aLgrEk95H~LPhK7Z4(h>5fd;XVASMWD}Vqd1x%SB zSSBP`DrQt9-09ts*uvqJbLV7loN76H+Ptk)%R7binR}j$$#p(838B-bb9sH_)bq~8 zP078tLO~b?f(RQJM8tiHEzN338c1Qzz&sWVq+x5wXjml3`C75oAo%l6<66fOmfg>T z6M|A{?ANL#0u>0sVySU?Td6lIwJO2z% z>OlG{P@zEMR9;43kYG%xVTdx7FpM?!Iw*k^Y+w~*Y~Y{|KTD7puE<02BuvM%nS@0;Ck4=GMqp`9-tT# f122O-*d#^v1_7V|2T++H5DNhS`r0Gv diff --git a/src/main/java/Todos.java b/src/main/java/Todos.java index 0f3a4268db..b797663e3a 100644 --- a/src/main/java/Todos.java +++ b/src/main/java/Todos.java @@ -3,9 +3,21 @@ public class Todos extends Task { public Todos(String description) { super(description); } + public Todos(String description, boolean isDone) { + super(description, isDone); + } @Override public String toString() { return "[T]" + super.toString(); } + + @Override + public String print() { + if (this.isDone) { + return "T @ 1 @ " + this.description; + } else { + return "T @ 0 @ " + this.description; + } + } } From 7fc08ec86e77e854d30b9a40bd45afc44f6bb1a5 Mon Sep 17 00:00:00 2001 From: fadisng Date: Mon, 26 Aug 2019 21:35:44 +0800 Subject: [PATCH 11/37] Level-8 --- src/main/java/Deadline.class | Bin 868 -> 1006 bytes src/main/java/Deadline.java | 11 ++++++++--- src/main/java/Duke.class | Bin 3741 -> 3976 bytes src/main/java/Duke.java | 11 ++++++++--- src/main/java/Duke_List.txt | 4 ++++ src/main/java/Event.class | Bin 862 -> 1000 bytes src/main/java/Event.java | 11 ++++++++--- 7 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 src/main/java/Duke_List.txt diff --git a/src/main/java/Deadline.class b/src/main/java/Deadline.class index d88e61b963aa5915720358c28be7fbfe12dda095..e057170ac333719224c1d6c73b4c9ac81cd264a4 100644 GIT binary patch delta 470 zcmZ8dxlRI66g_W%nPD7OMcG7DKsFsUF%}pKW2~T}valG!Hij+mG*bBuIJN&^p^~8S z1N;MfYg;?@ju;DH^6tCuo^#J#-o$t5RISxDGV zteAuq32_FYI%4pa&h!giJLg7QJJNZ*z#twNU4s`Hl4+vBU=>2k?w|cdq zM?^wKQbh_I> delta 324 zcmW+xyH3ME5S+cU&yScmm}kg?H%Sa4B|;zy+CW8v=!}5iD6%23kf`_ubPb0R+|wTatMHnlCcYc}5o5G<37>~_QN zcj)ohM$X|~W!zVqO4F6%ne8iA@4Ed<$ zV-BZ0nmK03y_%1Etl>V*CpIzH*}sRVIOCnU7fng=uwhMw9x_cNM@ zG@n&?9mD%`gT>x~{E+5z;jn6swbKzku71foh3sHgu6S^uXQ--z zFF1VB=S!T?jQKpuV~SaavPZM&BgNjn^v?a+d_Gt3`7&SeY3Hk9!D=ggjjt<4WR91e)gYwG`9Ue;c=2IgBM+zx}$oM?TH+`O>>@&_e z5!@vpho_Av6Tu+Ox&n z=7Bg??A_xTw=S2*ptY)@ZrUM#os3q`!+Xf9v$`K1Z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>Go{c8}PS9{6vEaajpQA;etE(2)EYt`hRs_G(i=X56 zW1M!|*Q%eS-BW@*OVUK06GA3_s%7p4gmZ^d2$4^&x>LI%wR3tWR zYbupy6o{G+^$@>6=xx6hS!PtSzvBa#&+~8b_ znj=uu8bW*)a*t!V_%it_$p(upywsmDC>pUQ8o`LZAjUiaAOBv-I&O>5K!t%o6^ESj Sx%&ukfEt#V+sv2wt^5N2#VnTq diff --git a/src/main/java/Event.java b/src/main/java/Event.java index 953aa48199..21412fedd5 100644 --- a/src/main/java/Event.java +++ b/src/main/java/Event.java @@ -1,13 +1,18 @@ +import java.util.Date; +import java.text.SimpleDateFormat; + public class Event extends Task { - protected String at; + protected Date at; - public Event(String description, String at) { + public Event(String description, Date at) { super(description); this.at = at; } @Override public String toString() { - return "[E]" + super.toString() + " (at: " + at + ")"; + SimpleDateFormat formatter = new SimpleDateFormat("d MMMM yyyy, hmma"); + String date = formatter.format(at); + return "[E]" + super.toString() + " (at: " + date + ")"; } } From a9033c23dc2bfddc658f0e8b4bb04275cf250cb8 Mon Sep 17 00:00:00 2001 From: fadisng Date: Wed, 28 Aug 2019 14:13:24 +0800 Subject: [PATCH 12/37] A-MoreOOP --- src/main/java/AddCommand.class | Bin 0 -> 2510 bytes src/main/java/AddCommand.java | 50 +++++++++++ src/main/java/Command.class | Bin 0 -> 235 bytes src/main/java/Command.java | 5 ++ src/main/java/Deadline.class | Bin 1660 -> 1594 bytes src/main/java/Deadline.java | 6 +- src/main/java/DeleteCommand.class | Bin 0 -> 818 bytes src/main/java/DeleteCommand.java | 15 ++++ src/main/java/DoneCommand.class | Bin 0 -> 1515 bytes src/main/java/DoneCommand.java | 31 +++++++ src/main/java/Duke.class | Bin 5033 -> 996 bytes src/main/java/Duke.java | 136 +++++------------------------- src/main/java/Duke_List.txt | 6 +- src/main/java/ExitCommand.class | Bin 0 -> 446 bytes src/main/java/ExitCommand.java | 6 ++ src/main/java/ListCommand.class | Bin 0 -> 1224 bytes src/main/java/ListCommand.java | 12 +++ src/main/java/Parser.class | Bin 0 -> 1071 bytes src/main/java/Parser.java | 26 ++++++ src/main/java/Storage.class | Bin 0 -> 2680 bytes src/main/java/Storage.java | 59 +++++++++++++ src/main/java/TaskList.class | Bin 0 -> 499 bytes src/main/java/TaskList.java | 13 +++ src/main/java/Ui.class | Bin 0 -> 1514 bytes src/main/java/Ui.java | 28 ++++++ 25 files changed, 271 insertions(+), 122 deletions(-) create mode 100644 src/main/java/AddCommand.class create mode 100644 src/main/java/AddCommand.java create mode 100644 src/main/java/Command.class create mode 100644 src/main/java/Command.java create mode 100644 src/main/java/DeleteCommand.class create mode 100644 src/main/java/DeleteCommand.java create mode 100644 src/main/java/DoneCommand.class create mode 100644 src/main/java/DoneCommand.java create mode 100644 src/main/java/ExitCommand.class create mode 100644 src/main/java/ExitCommand.java create mode 100644 src/main/java/ListCommand.class create mode 100644 src/main/java/ListCommand.java create mode 100644 src/main/java/Parser.class create mode 100644 src/main/java/Parser.java create mode 100644 src/main/java/Storage.class create mode 100644 src/main/java/Storage.java create mode 100644 src/main/java/TaskList.class create mode 100644 src/main/java/TaskList.java create mode 100644 src/main/java/Ui.class create mode 100644 src/main/java/Ui.java diff --git a/src/main/java/AddCommand.class b/src/main/java/AddCommand.class new file mode 100644 index 0000000000000000000000000000000000000000..cfdc4098ad453de9d88c8d989a444114fff91c10 GIT binary patch literal 2510 zcma)8TT>iG6#jZyws*%Nmjwcw>yQvwE&(JF!=h0FBtapdKq5v>hMfimc4x>;FPC_a z@qWKm8OtiIyx?oREM=%ls`O2*^40hJ0N<@t;^}2cxRv@aXHIvY^PSVDzdkd+-oADn zz=QZqLp2UZP=(eo5@EDyxE~LN@o*SNI39_TQHO>wI-_7X#&JB16B=}MM$nDN!gyRm z4|+LHD!)DrQFMmUuLe&j@uU(19D^ES7~(jkVF!jZG~={}r!cI<(;5!q497DXD)21F zb77p-a0ur(OpXzT0@L#tiqG^+nA2us%5=sW2c%~^V{Htfhiu1|M;NxnH(0MZ#S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~nji843^{WfYjjp!-6 zg#h~-djgTYt#^nyoTG}Pnd2bGAzJ5nKw07rCAM}=`Gav(^l|Kq5UE-SJwShGAJSVR XLcNcV@c}tLO5;tm(oS`>i!_vgeq!3>a$v?e*v;1E!F@4 literal 0 HcmV?d00001 diff --git a/src/main/java/Command.java b/src/main/java/Command.java new file mode 100644 index 0000000000..9b6adaf5ed --- /dev/null +++ b/src/main/java/Command.java @@ -0,0 +1,5 @@ +public abstract class Command { + + public abstract void execute(TaskList tasks, Ui ui, Storage storage); + +} diff --git a/src/main/java/Deadline.class b/src/main/java/Deadline.class index 74247da83c4c6497a4d81b9e87311a174812ad18..6420a806aabb1bf37d6d3481a45008e84c759b28 100644 GIT binary patch delta 243 zcmeyvvx|r8)W2Q(7#JAL8GmGnh||>Swf=_^OT3a&jS~nVJ=Y zH4lR*gBTBkID-u%gJ6n+FAykH0)dV~Ms98*4}&d(-Q=^3(vtQZ3=TXDjtovb49*NL zJPfW3A{-2E91QN0*_ie-doXxTKEb37G<%lXcENEEclCcYD0-`Qw1jdp^C2m!UTwpZ4%^EX%s zY9N9Zc7nf15$`?22WJk$nXdX(?$=-U9Y7ha$PH8}0fCZ@vW-e~bZgBL#(730@93Q7 z_=5b=c`PWTF{qHiA|Za_g<9T~)}(jZZXYWwVVS=vo2xpgDXd^sA;6l#I#LccOtR@< zi%ERQZS3%;D3WiU@PioUF*!vQvqg_dPRmqgpcQykZ(2hJ8+FsL$7gba_W54ESO&cS;4-=y} ATL1t6 diff --git a/src/main/java/Deadline.java b/src/main/java/Deadline.java index c72073dfa2..620e979136 100644 --- a/src/main/java/Deadline.java +++ b/src/main/java/Deadline.java @@ -22,8 +22,8 @@ public Deadline(String description, boolean isDone, String by) throws ParseExcep @Override public String toString() { SimpleDateFormat formatter = new SimpleDateFormat("d MMMM yyyy, hmma"); - String date = formatter.format(this.date); - return "[D]" + super.toString() + " (by: " + this.date + ")"; + String formattedDate = formatter.format(this.date); + return "[D]" + super.toString() + " (by: " + formattedDate + ")"; } @Override @@ -31,7 +31,7 @@ public String print() { if (this.isDone) { return "D @ 1 @ " + this.description + " @ " + this.by; } else { - return "TD @ 0 @ " + this.description + " @ " + this.by; + return "D @ 0 @ " + this.description + " @ " + this.by; } } } \ No newline at end of file diff --git a/src/main/java/DeleteCommand.class b/src/main/java/DeleteCommand.class new file mode 100644 index 0000000000000000000000000000000000000000..cd75820ba629cdb4309bbab8ca736e07a0e8d04e GIT binary patch literal 818 zcmZuvZEq4m5PlYpE?kcmskF4!O4Ztf7Vy0awQ6ciNG{ccmhT5_a4UCbjs>m%N~4(g z!T8x9Wt_dkXpPxqUuNc+=b4%P@$>690DE|1B8y@M7FJEHVco4f-PUa9n6fx>q?*o&Y&vZfgzi8zHQsCobL->;pz z6W2lxI~EqO$gyjoiW*1V!cE*FZk?9nwuL*m%dl}2DABK#TH6y*3WXO;M8Bk7$x%rc z(crje;Xd{(JitSahJ_~fIUZR!z+;B&Id0NFQ^An5wb1nM8pt&eN>{_MVwWAQvOZRF zSbrLZ?pahO!_t4u)V)|1LxH*%BZsa(sK4l*ik@mRRC{#60KCr0|Un8v2^(FB(Ege-QQE7|Hk4ajK1mnmCaRnFyn+q^a1gXl79; zpUsOx-iA`mW>uUe{-^SC2b=WMvh?#Pubvy-5_Heu0_}NvRp_0d)2w^}tE_)U;zJa@ zMEe4gv>UWi$Y72T7g3nuI^;`{x3)7yvhoRuDU9z(HH?p#%kwGHyV@~DX4RO&tj3S| aKe?A9v`I?lQ6!C9q_Rqk49k=?ft6o4%CMdQ literal 0 HcmV?d00001 diff --git a/src/main/java/DeleteCommand.java b/src/main/java/DeleteCommand.java new file mode 100644 index 0000000000..fb49ed7036 --- /dev/null +++ b/src/main/java/DeleteCommand.java @@ -0,0 +1,15 @@ +public class DeleteCommand extends Command { + private int taskNumber; + + public DeleteCommand(int taskNumber) { + this.taskNumber = taskNumber; + } + + @Override + public void execute(TaskList tasks, Ui ui, Storage storage) { + Task taskRemoved = tasks.getList().remove(taskNumber); + System.out.println("Noted. I've removed this task:"); + ui.printTask(tasks.getList().size(), taskRemoved); + storage.writeFile(tasks.getList()); + } +} diff --git a/src/main/java/DoneCommand.class b/src/main/java/DoneCommand.class new file mode 100644 index 0000000000000000000000000000000000000000..4fd366020117fb99d67c1562e874bc4c7be7effe GIT binary patch literal 1515 zcmaJ>TXWk)7(HvtQLHFV+t4&gNpT>hzO*s7a*0c6>Jn;j(t=Yu15X=!Cs8d+Mp_5* zPk7`7c*zS4n3+B>ed2-N#4wzdm5Bo#Mx));?w<3V@9ekw^Y5p>19%6I9TadS4;L>v zC}P#Y%Xr1cnu8p!=J6`7UEsc|gX_5AU>!9Fui^pvL=l<(|(OTYaNCL(S20skKX%mKW=K>ycM)wRITD zeN{L3*?pzW>Pd`jscfRCuZGf(1um9aPvoJj`7+qAJ=lAqI=Wu|g0Qxho!+(_q|uyq zIE*@K%QKX2*bk_~s#d+LxF^6+D-gfECyEfi)v4J`hFwtGy!c80RySR-H zNN_g{b*v*f*jD-=?8b9bxHFAS7kAOHanHqv*s}4Fi~DHW_}IlKXbH?r#C35Ai*zBC zA;83#?(~ThTw>TSkG z3o|)&uYDA2)h9X}8uU1#7uFs|UZC4LQnFunu#Fvo(vH_rtHtKELsc|vs$0|tUR>0) zswm@Pm)sjpu_&m$FMISl=t%w8(+3>IS_Ya&mmYh4QY6E8!9HCdCw4YEEg2Xse(@ak^Ww!#X~)@rd=>3d7!TAmBEGKt&0WBLBCO<(qPhOX@yr(^v7@7+9aE z@-*9tnKQuMqk($P_Ae*)pWKs)sg$B2eZNiHm?X`-`k(xsr%m9>|L?;pe-{P*Ndz+H zj&Wphd>$9r&hx9n`3!rf@*70u@~_DJlnWyz5%M?8mJys&;)Mj7ryPfrGyL_r6f#R{Ud%MW3VXo- zIYWNTfq>CuRDeK%B`mWwIrOQ;C|$2sen8GTuKs}nW6o6geve%CxcUt4w&A%x!t8gj ztsh}!4QD3dTqY|hB**M*N?4$XMY6BpG9OS_&Mt_*FmJ=X!%K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O7Q*Hb zR%FZhC|0U$uZkE9Re?&T88*|&wB#(E%))R%xNr!oN3e!*C>R`jk%6JEwbILVgNL7$ zVOUQc_pwqd`RRBzibO@AEKtsm(SWRHQGxSW)rI`v4Y7u&U>ZNIPeTbRP)d%I$TNdn zVJyLPtiZ{rXJcH*+PMg)qMgmtP3j&N#D2`iWhledn1gFD7k8r^4`3eKpaO?5ACL2E z`e|nJMM`~%X?vAl({JHSk%wwA8H+?1i^b_UOUywHZCWDMBO)46D|X;q5yLXEm(MG( zQe21C;wG#SH)E~19qYusST9CUCmzH3;wfApUO>Hg85_haXb`WVQ5?a>fPqbcX=nB%#l?Y5*dEx7O9Gc-N8oa_2Cl-+z_qXgH=r$WBiaK4 z{6e^dk-8nFV+=^Hh8-GOHE0_6Y1ay&p(uZh0m(n^B(>!6RNx3I1ZO+nKt*8j;|{4Kgk;RSkpf1wik=AhZVn{N!w81CI_)+Gw~G$2I2C=>?G@8P-{Ixc0#lWP2c8b6}O+tql78Xr*O Iuo@5j2lr9!SpWb4 diff --git a/src/main/java/Duke.java b/src/main/java/Duke.java index b68998c42a..a4e3d6cb53 100644 --- a/src/main/java/Duke.java +++ b/src/main/java/Duke.java @@ -1,131 +1,33 @@ -import java.util.Scanner; -import java.util.ArrayList; -import java.io.File; import java.io.FileNotFoundException; -import java.io.FileWriter; import java.io.IOException; import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; public class Duke { - public static void main(String[] args) throws ParseException, IOException { - String logo = " ____ _ \n" - + "| _ \\ _ _| | _____ \n" - + "| | | | | | | |/ / _ \\\n" - + "| |_| | |_| | < __/\n" - + "|____/ \\__,_|_|\\_\\___|\n"; - System.out.println("Hello from\n" + logo); - System.out.println("Hello! I'm Duke \nWhat can I do for you?"); - Scanner sc = new Scanner(System.in); - ArrayList list = new ArrayList<>(); - String filePath = "Duke_List.txt"; - try { - loadFileContents(filePath, list); - } catch (FileNotFoundException e) { - System.out.println("File not found"); - } - String[] arr = sc.nextLine().split(" "); - String next = arr[0]; - int count = list.size(); - File f = new File(filePath); - while (!next.equals("bye")) { - boolean changed = true; - if (next.equals("list")) { - changed = false; - System.out.println("Here are the tasks in your list:"); - int listCount = 1; - for (Task task : list) { - System.out.println(listCount + "." + task); - listCount++; - } - } else if (next.equals("done")) { - int number = Integer.parseInt(arr[1]) - 1; - Task taskDone = list.get(number); - taskDone.markAsDone(); - System.out.println("Nice! I've marked this task as done:\n " + taskDone); - } else if(next.equals("delete")) { - int number = Integer.parseInt(arr[1]) - 1; - Task taskRemoved = list.remove(number); - System.out.println("Noted. I've removed this task:"); - printTask(--count, taskRemoved); - } else { - String description = ""; - Task t; - try { - if (next.equals("todo") || next.equals("deadline") || next.equals("event")) { - if (arr.length == 1) { - throw new EmptyDescriptionException("☹ OOPS!!! The description of a " + next + " cannot be empty."); - } else { - for (int i = 1; i < arr.length; i++) { - description += " " + arr[i]; - } - } - } else { - throw new UnknownTaskException("☹ OOPS!!! I'm sorry, but I don't know what that means :-("); - } - System.out.println("Got it. I've added this task:"); - count++; - if (next.equals("todo")) { - t = new Todos(description.trim()); - } else if (next.equals("deadline")) { - int index = description.indexOf("/"); - String byWhen = description.substring(index + 4); - String desc = description.substring(1, index - 1); - t = new Deadline(desc, byWhen); - } else { - int index = description.indexOf("/"); - String at = description.substring(index + 4); - String desc = description.substring(1, index - 1); - t = new Event(desc, at); - } - list.add(t); - printTask(count, t); - } catch (DukeException e) { - System.out.println(e.getMessage()); - } - } - arr = sc.nextLine().split(" "); - next = arr[0]; - FileWriter fw = new FileWriter(filePath); - String textToAdd = ""; - for (Task task : list) { - textToAdd += task.print() + "\n"; - } - fw.write(textToAdd); - fw.close(); - } - System.out.println("Bye. Hope to see you again soon!"); + private Storage storage; + private TaskList list; + private Ui ui; + + public Duke(String file) { + ui = new Ui(); + storage = new Storage(file); + list = new TaskList(storage.load()); } - private static void printTask(int count, Task t) { - if (count == 1) { - System.out.println(" " + t + "\nNow you have " + count + " task in the list."); - } else { - System.out.println(" " + t + "\nNow you have " + count + " tasks in the list."); + public void run() { + ui.showWelcome(); + boolean isExit = false; + while (!isExit) { + String fullCommand = ui.readCommand(); + Command c = Parser.parse(fullCommand); + c.execute(list, ui, storage); + isExit = c instanceof ExitCommand; } } - private static void loadFileContents(String filePath, ArrayList list) throws FileNotFoundException, ParseException { - File f = new File(filePath); // create a File for the given file path - Scanner sc = new Scanner(f); // create a Scanner using the File as the source - Task t; - while (sc.hasNext()) { - String next = sc.nextLine(); - String[] arr = next.split("@"); - boolean isDone = arr[1].equals("1"); - String description = arr[2]; - if (arr[0].contains("T")) { - t = new Todos(description.trim(), isDone); - } else if (arr[0].contains("D")) { - t = new Deadline(description.trim(), isDone, arr[3].trim()); - } else { - t = new Event(description.trim(), isDone, arr[3].trim()); - } - list.add(t); - } + public static void main(String[] args) { + Duke duke = new Duke("Duke_List.txt"); + duke.run(); } - } \ No newline at end of file diff --git a/src/main/java/Duke_List.txt b/src/main/java/Duke_List.txt index 845504f0cb..fe1182573e 100644 --- a/src/main/java/Duke_List.txt +++ b/src/main/java/Duke_List.txt @@ -1,2 +1,4 @@ -T @ 0 @ sleep -T @ 0 @ borrow book +T @ 1 @ jump +T @ 0 @ go lecture +E @ 0 @ project @ 2/4/2019 1800 +T @ 0 @ play basketball diff --git a/src/main/java/ExitCommand.class b/src/main/java/ExitCommand.class new file mode 100644 index 0000000000000000000000000000000000000000..697ef584ef7a9466575ce20cfc7be190e3a2a57f GIT binary patch literal 446 zcmZutO;5r=5Pi#6OR0h&exM}fV1gdt=%L1gMB||`CPnWHY{)9zCGFP0&(eb?9{d6R zDB~1N^xz(5X5YN`W@kUY-ai1GqV1rBY8f?b*{C~cVB12|!VW{}Oe$&48S>rZdxpY5 zPXt3XkV@R7(MZHYKAI6?iG>)ahN@OK81m#XkcshwJLw0Z(J`M2Khry*PUEq-l9{G< zxsYa{qll|X?}0yY7Zz*_yDs*y&){7wMbEp|bKx27B|>;hoqBxArScN3RmVch#Q_c( zDu1l#F+Zj>BD3w!xSICEWnx4`i|EuaG=o(~>i%skl?hEOc;quQ{(;GGo{?sXbltUZ zZD|Oe(qibKNMD$p9Ec8^VwrAj%8YXHD3@Q5tLI-) S_@z740yS-#!mvSg4x8Uob6!XQ literal 0 HcmV?d00001 diff --git a/src/main/java/ExitCommand.java b/src/main/java/ExitCommand.java new file mode 100644 index 0000000000..1237f98bf8 --- /dev/null +++ b/src/main/java/ExitCommand.java @@ -0,0 +1,6 @@ +public class ExitCommand extends Command { + @Override + public void execute(TaskList tasks, Ui ui, Storage storage) { + System.out.println("Bye. Hope to see you again soon!"); + } +} diff --git a/src/main/java/ListCommand.class b/src/main/java/ListCommand.class new file mode 100644 index 0000000000000000000000000000000000000000..d182ed875c1a5dc7b790da142f297213b1427edd GIT binary patch literal 1224 zcmaJ=+fEZv6kUg2PH6|xQow>>(V_*EdPV7=T&hTuf+j^x^yyGe+M&~#X6BU8SK~+M z7x=6X7^P$39UPT89%hIbN5Y4WQ4bp;Ca(&2 zL+(*_`tq;HG|S&44)MOQr&~L+tn?@ru|z;N%ScRJ)MVba%0j&~RFzh)5|(lqMl%Kf zYUmxc-Mw)vd%izrNdL3auy*a5%#vx;emmu=D3jqWjwf_Ci?&^BHW;*mWl1M*3fGlX z=UumVogD2?yhhi`ly16B)K6O66*)%SY&GO5@Yh}Vju+j%byDPoX_m-xonwt*@8XK3uF-5AY`=Fs$Ku#dE$+eu^C4|+%E5U0_DzCi$-=A}>Q zi3j!(49*2-_7U1gI2THWzJN2lN7`FO7`~x57bfIjFd05T6d=OeAp7v=hgYS?uQKlE z3n4=FVzi#7)jWE!K=?(93=mR7&o3kxN8%@)2QcWfhwzBzC@EXPD)LAoP5TJ#C+WTN E7v3;64FCWD literal 0 HcmV?d00001 diff --git a/src/main/java/ListCommand.java b/src/main/java/ListCommand.java new file mode 100644 index 0000000000..f5149ddc45 --- /dev/null +++ b/src/main/java/ListCommand.java @@ -0,0 +1,12 @@ +public class ListCommand extends Command { + + @Override + public void execute(TaskList tasks, Ui ui, Storage storage) { + System.out.println("Here are the tasks in your list:"); + int listCount = 1; + for (Task task : tasks.getList()) { + System.out.println(listCount + "." + task); + listCount++; + } + } +} diff --git a/src/main/java/Parser.class b/src/main/java/Parser.class new file mode 100644 index 0000000000000000000000000000000000000000..34c79f05818b548f203015644a30ed4bf34f30d2 GIT binary patch literal 1071 zcmZuwO-~b16g{t<=?v3>mLe!B1x2ABK(T013JCI%U<#UGNQ$c|GnQg$u`Nb7E=>Fp zCdQQsi7rGJ)Y!y@i5vGOZjF0?f_Pp*Aj%~7oqO)PUvuxw*WVvM0T{-Nfi`sOxL_cN zi}L8v(JL{eBdjB$BdVd#fProe{RT{l0|sIkG|+@g8sY|;B@P*A!DS6sG$aH(qq#z^ zGA`f_g_i`BsiN%&_)@uov#`0IaY}crOr92X!zz`D9ih~k_0WpttwJ`oSSjTS*Tw!|HC)wjO~6~Fdrf8c6N+V(z?9@DI_*PDR<@I`NB)|?eKam2Lu?gA}${~w5ec2GbqZ{%|f?LBUA z$HwZbR(W-A4_wL|J8~XuTKTd->(Ly0Jtf1-0?mh=&J`+7)+q_-^@WlC6ZUs!%&Uav zy(Oqd)`B;4F2z3L6UTz|Tm) zwF7r5>WrisW77dY!kalKaUU>fGZ=sIBU2=15cIS3@j(vT=ku9C!w3X+p+h;i O)zHNt!BxrP=l=jCJ=y~R literal 0 HcmV?d00001 diff --git a/src/main/java/Parser.java b/src/main/java/Parser.java new file mode 100644 index 0000000000..1445f32268 --- /dev/null +++ b/src/main/java/Parser.java @@ -0,0 +1,26 @@ +public class Parser { + + public static Command parse(String str) { + String[] arr = str.split(" "); + String next = arr[0]; + Command c; + switch (next) { + case "bye": + c = new ExitCommand(); + break; + case "list": + c = new ListCommand(); + break; + case "done": + c = new DoneCommand(Integer.parseInt(arr[1]) - 1); + break; + case "delete": + c = new DeleteCommand(Integer.parseInt(arr[1]) - 1); + break; + default: + c = new AddCommand(arr); + break; + } + return c; + } +} diff --git a/src/main/java/Storage.class b/src/main/java/Storage.class new file mode 100644 index 0000000000000000000000000000000000000000..1a4252fe9862e01c3931593951e883f84014d772 GIT binary patch literal 2680 zcmaJ@Yf}?f7=BJ}XS1#%QIM!$R8SxSN?R|%dJCXfK-y3#*xQmUuo8CT?gpgydu#9a zO0Rxn#<4TnsYxp{osQG#hkoc!=nv@!>3cRogUNIl&N+MD=e<4edrr<@cW(U#-~g`3 zXh%GVHgt3J$nYZ0(JRA`lN_gHaP*1cv=|3<7qs@@vH=uV_ZfACnY2WDzyejaas%-$ApYs zm<&;z(*lzg!wiQZ!Q{wrTww4`=xL21)PG)`RXftEG1-xDEZvywVh9}84c$4yP}5v4 zZaGWJaWh5ARsFi54Q6M?HEUQM7v_9vQ%x~!YHlegW*t4Z z)QqdZVR6_T4nr`ZPa3L|waCi0%Ib&vhgEyJ>j;?%&RM#n^|~q46@$FbSIb$BEJLKC z^sXt9jhryERoi6}*C18T`X$%Cr@{hUbOa>m=%Ckh(QB zl_t8y-W!DKnbizO!J9(2zBGtI)9E#{MylsxQp-5HX>h!y;BCCauucRSF-#{iArKsw z6uc`Uu5%4I+C`^hNVRP3t}esIZq?Bux)GVPOkU%?0X zkXk_$OTkAX-SsC-)3F^(%?xPHl$o-t0{B?MCkj5rX9_+?r-CmqyFxP2*>|QShN{(Z zw=?i!mB_Rkh}*ws#?Na>imha;(9&f0TzMm}cyo1!rz~@>(8Gn)+(P$JS}OGegST09 zN_DZBiuLXidwfc@2Z=csGe(s%=tCR~;%=pnS069Gok{D2-(Bf+RSYzsUC63w`@REN z$hWISI8B;{qv{4hwv<|pPpMXdlrNjk~(Uh<9oVj`%QB?o1tr@Ph1o6v})TL1$DVJ zsG^O+$vLGOskCM{78JY6!z$TXr8qpF(JH`8+ij(v%1y-8bUHzG>Eif-p{XptO0h9C z{67xc>9@0;exn#X;) z3=d&Hp-GSZjR0hl{<#G2Xdb@)CHO~Me}*TIz`zpt=$<^J!L}TN3%Ep+9P@|$p*1-u zu|PQB>kO^UVcmWn4){A`QaIr43{~Z@egU;hs2&YVIfQC>9vfo5MI3X*8(nez5^7e& z;Xt61aCy`U)aE5@DwEX3e9^Ekhw#Ya@@(|_z)#o`+L}XsakhK$M5cZ8-KX72ZEz9)Y4c@=ndFNfA#d;NUw@k)Dcf%93hL{*n%N! zMUtc@S-wOsg)7*JMM7RB4rrU)c968W|SQAXZI`;Jae}wy-~k-M1(M3@$GJvxiFGvL}bu zMJO)&w64EFUVu1y5hYK8#dfTraWD1SK2%X}Mv1!vB#BYS9i^U&;}D?_;G}rh(XL=- z2Yh!>!x3>4Jo+yhm&wXXc0@>2DrR+z@;FW!9-P28G|S|F0pH load() { + ArrayList list = new ArrayList<>(); + try { + File f = new File(file); // create a File for the given file path + Scanner sc = new Scanner(f); // create a Scanner using the File as the source + Task t; + while (sc.hasNext()) { + String next = sc.nextLine(); + String[] arr = next.split("@"); + boolean isDone = arr[1].equals("1"); + String description = arr[2]; + if (arr[0].contains("T")) { + t = new Todos(description.trim(), isDone); + } else if (arr[0].contains("D")) { + t = new Deadline(description.trim(), isDone, arr[3].trim()); + } else { + t = new Event(description.trim(), isDone, arr[3].trim()); + } + + list.add(t); + } + } catch (FileNotFoundException e) { + System.out.println("File not found"); + } catch (ParseException e) { + System.out.println("Date in wrong format"); + } finally { + return list; + } + } + + public void writeFile(ArrayList list) { + try { + FileWriter fw = new FileWriter(file); + String textToAdd = ""; + for (Task task : list) { + textToAdd += task.print() + "\n"; + } + fw.write(textToAdd); + fw.close(); + } catch (IOException e) { + System.out.println("File not found."); + } + } +} diff --git a/src/main/java/TaskList.class b/src/main/java/TaskList.class new file mode 100644 index 0000000000000000000000000000000000000000..53120153b3f2c2e49d6c7a92045af6666b79002a GIT binary patch literal 499 zcmZvY%}T>S6ot>EY172?$Di76in>c9n5B!9f(WjHE?T;u)=;L#6w*ZStrQf&g%99E ziDz2vDvO!Ry>q{F@0{+?_mpZyDvfW8$61_B zH<^&^b7ad#w132BYJDK=|kHFkUy5 r%ezSpkTuELB)19;@=dh<_&zhiuB!hA<7J2Hf#85G(q^{L+`z#vP|9jR literal 0 HcmV?d00001 diff --git a/src/main/java/TaskList.java b/src/main/java/TaskList.java new file mode 100644 index 0000000000..461a7c4df9 --- /dev/null +++ b/src/main/java/TaskList.java @@ -0,0 +1,13 @@ +import java.util.ArrayList; + +public class TaskList { + private ArrayList taskList; + + public TaskList(ArrayList list) { + this.taskList = list; + } + + public ArrayList getList() { + return this.taskList; + } +} diff --git a/src/main/java/Ui.class b/src/main/java/Ui.class new file mode 100644 index 0000000000000000000000000000000000000000..2ae0debd1f2da9e3658d4901889724201d447670 GIT binary patch literal 1514 zcmaJ>ZEq7t5PsH9a?WuyiGxcZg>E1r4oNv^>8n%PVw%R4p{*Q<5RpzBd%=hAZmqj@ zXe9rTe(bk?ZTSFFD)k5SM^((;xrwb9&hqT+ygV~IGrRx(ck~Z{&+(&;_pn&N2h+HO z%SDo1v2hj41*}-OW`wIYER+pdD}rIYh#b}}d}QGU!_=l9`T7n+zP$E`VWO&9l3}Lq zNAf{0+?Vl=*bhi@CTXh|yE161(ClIB5E<5E3eg`iv!^XB6{XFbnHjZDh$(I zV)TwkIt+HXRySP51UcK#qS?7Gx&v&xp?YysZuusV_0Ydzz#PnAmLcIDeSGj8Gj^YI zkMGf+);{m2Rvstu$j{}jF*D-SDx;ill9%V&eS_`tJuR;^@a3Lh8niG$nt)WT;DHQ)<|)omFBYKhlYLw>K%wIc&wjCQ1c-ZNTpoK-Rg3KIL#y+Mo8H%cdR? zH4YOkLu#Muk)o9K!B_6jruNhdDZ+}4Z}A<2lV-`E#wxTK!}(BjWK~5?p?7`VCN9w; z(h0-0^67St?eKh>+GsTDVA}T}qIAXq(E#Lpqdd;F7Il07=gP1!a3a`Yg&CYeB!AUr zG#QpTXZ8d2!qkEf8{M8$q0&tyQU>u6!fGO zesrKZaxm;!6}LoFtN75uHeIW_Qk`Cxie58Kt_C7WB$f8J;ff3}veDY6s}#s&IdiO> z?!b^_#Bt}aE612W8M4pjrZQZE0Yp^nkHP~OoFqj8xDi!95&L5j@(j%24-9j-}e~JA15kcVJqNWnLl0$G8Qp=0@ bo>rRzRq+Gvk@Q2_pCdgd*-}ccr*z{Dron7p literal 0 HcmV?d00001 diff --git a/src/main/java/Ui.java b/src/main/java/Ui.java new file mode 100644 index 0000000000..39d1bc328e --- /dev/null +++ b/src/main/java/Ui.java @@ -0,0 +1,28 @@ +import java.util.Scanner; + +public class Ui { + + public void showWelcome() { + String logo = " ____ _ \n" + + "| _ \\ _ _| | _____ \n" + + "| | | | | | | |/ / _ \\\n" + + "| |_| | |_| | < __/\n" + + "|____/ \\__,_|_|\\_\\___|\n"; + System.out.println("Hello from\n" + logo); + System.out.println("Hello! I'm Duke \nWhat can I do for you?"); + } + + public String readCommand() { + Scanner sc = new Scanner(System.in); + return sc.nextLine(); + } + + public void printTask(int count, Task t) { + if (count == 1) { + System.out.println(" " + t + "\nNow you have " + count + " task in the list."); + } else { + System.out.println(" " + t + "\nNow you have " + count + " tasks in the list."); + } + } + +} From 1c677e69f983885e31b93666e8361f1dbaaf5388 Mon Sep 17 00:00:00 2001 From: fadisng Date: Wed, 28 Aug 2019 14:14:34 +0800 Subject: [PATCH 13/37] A-JUnit --- src/main/java/DoneCommand.java | 34 +++++++++++++++++----------------- src/test/java/ParserTest.java | 10 ++++++++++ src/test/java/TodosTest.java | 19 +++++++++++++++++++ 3 files changed, 46 insertions(+), 17 deletions(-) create mode 100644 src/test/java/ParserTest.java create mode 100644 src/test/java/TodosTest.java diff --git a/src/main/java/DoneCommand.java b/src/main/java/DoneCommand.java index 4134b4a9da..0fd311a8bf 100644 --- a/src/main/java/DoneCommand.java +++ b/src/main/java/DoneCommand.java @@ -12,20 +12,20 @@ public void execute(TaskList tasks, Ui ui, Storage storage) { storage.writeFile(tasks.getList()); } - public int getTaskNumber() { - return taskNumber; - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } else if (obj == null || obj.getClass() != this.getClass()) { - return false; - } else { - DoneCommand command = (DoneCommand) obj; - return taskNumber == command.getTaskNumber(); - } - - } -} +/// public int getTaskNumber() { +// return taskNumber; +// } +// +// @Override +// public boolean equals(Object obj) { +// if (obj == this) { +// return true; +// } else if (obj == null || obj.getClass() != this.getClass()) { +// return false; +// } else { +// DoneCommand command = (DoneCommand) obj; +// return taskNumber == command.getTaskNumber(); +// } +// +// } +//} diff --git a/src/test/java/ParserTest.java b/src/test/java/ParserTest.java new file mode 100644 index 0000000000..03739de3c3 --- /dev/null +++ b/src/test/java/ParserTest.java @@ -0,0 +1,10 @@ +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class ParserTest { + @Test + public void parseTest() { + assertEquals(new DoneCommand(2), Parser.parse("done 3")); + } + +} diff --git a/src/test/java/TodosTest.java b/src/test/java/TodosTest.java new file mode 100644 index 0000000000..e2ff774e34 --- /dev/null +++ b/src/test/java/TodosTest.java @@ -0,0 +1,19 @@ +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class TodosTest { + @Test + public void dummyTest() { + assertEquals(2, 2); + } + + @Test + public void testPrint() { + assertEquals("T @ 1 @ borrow book", new Todos("borrow book", true).print()); + } + + @Test + public void testToString() { + assertEquals("[T][\u2713] play basketball", new Todos("play basketball", true).toString()); + } +} \ No newline at end of file From 31cc0a37e4868b861de16eba369a8810ffe10958 Mon Sep 17 00:00:00 2001 From: fadisng Date: Wed, 28 Aug 2019 14:21:58 +0800 Subject: [PATCH 14/37] A-JUnit --- src/main/java/DoneCommand.java | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main/java/DoneCommand.java b/src/main/java/DoneCommand.java index 0fd311a8bf..5efb847bce 100644 --- a/src/main/java/DoneCommand.java +++ b/src/main/java/DoneCommand.java @@ -12,20 +12,20 @@ public void execute(TaskList tasks, Ui ui, Storage storage) { storage.writeFile(tasks.getList()); } -/// public int getTaskNumber() { -// return taskNumber; -// } -// -// @Override -// public boolean equals(Object obj) { -// if (obj == this) { -// return true; -// } else if (obj == null || obj.getClass() != this.getClass()) { -// return false; -// } else { -// DoneCommand command = (DoneCommand) obj; -// return taskNumber == command.getTaskNumber(); -// } -// -// } -//} +/ public int getTaskNumber() { + return taskNumber; + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } else if (obj == null || obj.getClass() != this.getClass()) { + return false; + } else { + DoneCommand command = (DoneCommand) obj; + return taskNumber == command.getTaskNumber(); + } + + } +} From 4ea22d185563d4fb15be1f9285d57e5945b0fab4 Mon Sep 17 00:00:00 2001 From: fadisng Date: Wed, 28 Aug 2019 14:25:24 +0800 Subject: [PATCH 15/37] A-JUnit --- src/main/java/DoneCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/DoneCommand.java b/src/main/java/DoneCommand.java index 5efb847bce..5dec78b412 100644 --- a/src/main/java/DoneCommand.java +++ b/src/main/java/DoneCommand.java @@ -12,7 +12,7 @@ public void execute(TaskList tasks, Ui ui, Storage storage) { storage.writeFile(tasks.getList()); } -/ public int getTaskNumber() { + public int getTaskNumber() { return taskNumber; } From 4065b7f23ed96ab9651abad47a235cfd7a3ac06a Mon Sep 17 00:00:00 2001 From: fadisng Date: Wed, 28 Aug 2019 14:45:11 +0800 Subject: [PATCH 16/37] A-Jar --- src/main/java/META-INF/MANIFEST.MF | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 src/main/java/META-INF/MANIFEST.MF diff --git a/src/main/java/META-INF/MANIFEST.MF b/src/main/java/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..9f37e4e0aa --- /dev/null +++ b/src/main/java/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: Duke + From 743b7850146a0fb7c726501de58bb79d48a781c3 Mon Sep 17 00:00:00 2001 From: fadisng Date: Wed, 28 Aug 2019 19:52:29 +0800 Subject: [PATCH 17/37] A-JavaDoc --- src/main/java/AddCommand.java | 4 ++++ src/main/java/Command.java | 10 ++++++++++ src/main/java/Deadline.java | 4 ++++ src/main/java/DeleteCommand.java | 4 ++++ src/main/java/DoneCommand.java | 4 ++++ src/main/java/Duke.java | 4 ++++ src/main/java/DukeException.java | 4 ++++ src/main/java/EmptyDescriptionException.java | 4 ++++ src/main/java/Event.java | 4 ++++ src/main/java/ExitCommand.java | 4 ++++ src/main/java/ListCommand.java | 4 ++++ src/main/java/Parser.java | 8 ++++++++ src/main/java/Storage.java | 17 +++++++++++++++-- src/main/java/Task.java | 9 +++++++++ src/main/java/TaskList.java | 4 ++++ src/main/java/Todos.java | 6 +++++- src/main/java/Ui.java | 8 ++++++++ src/main/java/UnknownTaskException.java | 4 ++++ src/test/java/ParserTest.java | 4 ++++ src/test/java/TodosTest.java | 4 ++++ 20 files changed, 111 insertions(+), 3 deletions(-) diff --git a/src/main/java/AddCommand.java b/src/main/java/AddCommand.java index deb886cc64..c1705801b3 100644 --- a/src/main/java/AddCommand.java +++ b/src/main/java/AddCommand.java @@ -1,3 +1,7 @@ +/** + * Represents the command to add a task into the arraylist. + */ + import java.text.ParseException; public class AddCommand extends Command { diff --git a/src/main/java/Command.java b/src/main/java/Command.java index 9b6adaf5ed..9f74c1f5e6 100644 --- a/src/main/java/Command.java +++ b/src/main/java/Command.java @@ -1,5 +1,15 @@ +/** + * Abstract class to represent the possible commands given to Duke. + */ + public abstract class Command { + /** + * Executes the different commands respectively. + * @param tasks Arraylist of tasks. + * @param ui User interaction that comes with the command. + * @param storage To deal with saving tasks into the file after executing the command. + */ public abstract void execute(TaskList tasks, Ui ui, Storage storage); } diff --git a/src/main/java/Deadline.java b/src/main/java/Deadline.java index 620e979136..419531b013 100644 --- a/src/main/java/Deadline.java +++ b/src/main/java/Deadline.java @@ -1,3 +1,7 @@ +/** + * Deadline class to represent a task with a date to be done by. + */ + import java.text.ParseException; import java.util.Date; import java.text.SimpleDateFormat; diff --git a/src/main/java/DeleteCommand.java b/src/main/java/DeleteCommand.java index fb49ed7036..64c96aa250 100644 --- a/src/main/java/DeleteCommand.java +++ b/src/main/java/DeleteCommand.java @@ -1,3 +1,7 @@ +/** + * Represents a command to remove a task from the arraylist. + */ + public class DeleteCommand extends Command { private int taskNumber; diff --git a/src/main/java/DoneCommand.java b/src/main/java/DoneCommand.java index 5dec78b412..f68e47ffb3 100644 --- a/src/main/java/DoneCommand.java +++ b/src/main/java/DoneCommand.java @@ -1,3 +1,7 @@ +/** + * Represents a command that ticks off a task. + */ + public class DoneCommand extends Command { private int taskNumber; diff --git a/src/main/java/Duke.java b/src/main/java/Duke.java index a4e3d6cb53..b3aab3089c 100644 --- a/src/main/java/Duke.java +++ b/src/main/java/Duke.java @@ -1,3 +1,7 @@ +/** + * Main driving class for Duke. + */ + import java.io.FileNotFoundException; import java.io.IOException; import java.text.ParseException; diff --git a/src/main/java/DukeException.java b/src/main/java/DukeException.java index fe8837e3a3..a42af95744 100644 --- a/src/main/java/DukeException.java +++ b/src/main/java/DukeException.java @@ -1,3 +1,7 @@ +/** + * Represents exceptions specific to Duke. + */ + public class DukeException extends Exception { public DukeException(String message) { super(message); diff --git a/src/main/java/EmptyDescriptionException.java b/src/main/java/EmptyDescriptionException.java index da2269e927..af03e38ce8 100644 --- a/src/main/java/EmptyDescriptionException.java +++ b/src/main/java/EmptyDescriptionException.java @@ -1,3 +1,7 @@ +/** + * An exception that occurs when a task has no description. + */ + public class EmptyDescriptionException extends DukeException { public EmptyDescriptionException(String message) { super(message); diff --git a/src/main/java/Event.java b/src/main/java/Event.java index 595be93971..8b94badab3 100644 --- a/src/main/java/Event.java +++ b/src/main/java/Event.java @@ -1,3 +1,7 @@ +/** + * Event class to represent a task that occurs on a certain date. + */ + import java.text.ParseException; import java.util.Date; import java.text.SimpleDateFormat; diff --git a/src/main/java/ExitCommand.java b/src/main/java/ExitCommand.java index 1237f98bf8..4483767291 100644 --- a/src/main/java/ExitCommand.java +++ b/src/main/java/ExitCommand.java @@ -1,3 +1,7 @@ +/** + * Represents the command for Duke to terminate. + */ + public class ExitCommand extends Command { @Override public void execute(TaskList tasks, Ui ui, Storage storage) { diff --git a/src/main/java/ListCommand.java b/src/main/java/ListCommand.java index f5149ddc45..5426ef8365 100644 --- a/src/main/java/ListCommand.java +++ b/src/main/java/ListCommand.java @@ -1,3 +1,7 @@ +/** + * Represents a command to print out the tasks in the arraylist. + */ + public class ListCommand extends Command { @Override diff --git a/src/main/java/Parser.java b/src/main/java/Parser.java index 1445f32268..8d0e035655 100644 --- a/src/main/java/Parser.java +++ b/src/main/java/Parser.java @@ -1,5 +1,13 @@ +/** + * Parser class to handle user input. + */ public class Parser { + /** + * Parses the input string and determines the type of command given. + * @param str The input string supplied to Duke. + * @return Returns the corresponding command depending on the first word of the input string. + */ public static Command parse(String str) { String[] arr = str.split(" "); String next = arr[0]; diff --git a/src/main/java/Storage.java b/src/main/java/Storage.java index 055a36daeb..e95000ba56 100644 --- a/src/main/java/Storage.java +++ b/src/main/java/Storage.java @@ -1,3 +1,7 @@ +/** + * Deals with loading tasks from the file and saving tasks in the file. + */ + import java.io.File; import java.io.FileNotFoundException; import java.io.FileWriter; @@ -13,11 +17,16 @@ public Storage(String file) { this.file = file; } + /** + * Method that reads the designated file and stores the content into an arraylist. + * Is called upon when Duke initialises. + * @return Returns an arraylist of tasks written in the file given the file path. + */ public ArrayList load() { ArrayList list = new ArrayList<>(); try { - File f = new File(file); // create a File for the given file path - Scanner sc = new Scanner(f); // create a Scanner using the File as the source + File f = new File(file); + Scanner sc = new Scanner(f); Task t; while (sc.hasNext()) { String next = sc.nextLine(); @@ -43,6 +52,10 @@ public ArrayList load() { } } + /** + * Rewrites the file with the new arraylist of tasks. + * @param list arraylist of tasks that are updated after every command given to Duke. + */ public void writeFile(ArrayList list) { try { FileWriter fw = new FileWriter(file); diff --git a/src/main/java/Task.java b/src/main/java/Task.java index 51a1050b69..71c49fad63 100644 --- a/src/main/java/Task.java +++ b/src/main/java/Task.java @@ -1,3 +1,7 @@ +/** + * Represents a task which could be something to do, an event or a deadline. + */ + public class Task { protected String description; protected boolean isDone; @@ -29,6 +33,11 @@ public String toString() { return "[" + this.getStatusIcon() + "] " + this.description; } + /** + * A method to write a task into a file according to the format that it can read. + * @return Returns the string format of a task to write into the designated file. + */ + public String print() { return ""; }; diff --git a/src/main/java/TaskList.java b/src/main/java/TaskList.java index 461a7c4df9..14023b6997 100644 --- a/src/main/java/TaskList.java +++ b/src/main/java/TaskList.java @@ -1,3 +1,7 @@ +/** + * Class to represent the arraylist containing the tasks. + */ + import java.util.ArrayList; public class TaskList { diff --git a/src/main/java/Todos.java b/src/main/java/Todos.java index b797663e3a..e87b433354 100644 --- a/src/main/java/Todos.java +++ b/src/main/java/Todos.java @@ -1,4 +1,8 @@ -public class Todos extends Task { +/** + * Todos class to represent a task to do in the list. + */ + +1public class Todos extends Task { public Todos(String description) { super(description); diff --git a/src/main/java/Ui.java b/src/main/java/Ui.java index 39d1bc328e..6d7991a636 100644 --- a/src/main/java/Ui.java +++ b/src/main/java/Ui.java @@ -1,7 +1,15 @@ +/** + * A class to handle User Interactions. + */ + import java.util.Scanner; public class Ui { + /** + * A method that prints out the introduction when Duke first initialises. + */ + public void showWelcome() { String logo = " ____ _ \n" + "| _ \\ _ _| | _____ \n" diff --git a/src/main/java/UnknownTaskException.java b/src/main/java/UnknownTaskException.java index f80c096496..c28ce64575 100644 --- a/src/main/java/UnknownTaskException.java +++ b/src/main/java/UnknownTaskException.java @@ -1,3 +1,7 @@ +/** + * An exception that occurs when Duke is unable to decipher which command is given. + */ + public class UnknownTaskException extends DukeException { public UnknownTaskException(String message) { super(message); diff --git a/src/test/java/ParserTest.java b/src/test/java/ParserTest.java index 03739de3c3..4efffe4d6e 100644 --- a/src/test/java/ParserTest.java +++ b/src/test/java/ParserTest.java @@ -1,3 +1,7 @@ +/** + * Test class to test parse() method in Parser. + */ + import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/TodosTest.java b/src/test/java/TodosTest.java index e2ff774e34..e123a548ad 100644 --- a/src/test/java/TodosTest.java +++ b/src/test/java/TodosTest.java @@ -1,3 +1,7 @@ +/** + * Test class to test the print() and toString() method in Todos class. + */ + import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; From 8c1dace083d3287443add3a5538d87d4aa4a0916 Mon Sep 17 00:00:00 2001 From: fadisng Date: Wed, 28 Aug 2019 20:05:29 +0800 Subject: [PATCH 18/37] A-CodingStandard --- src/main/java/Parser.java | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main/java/Parser.java b/src/main/java/Parser.java index 1445f32268..882798026d 100644 --- a/src/main/java/Parser.java +++ b/src/main/java/Parser.java @@ -5,22 +5,22 @@ public static Command parse(String str) { String next = arr[0]; Command c; switch (next) { - case "bye": - c = new ExitCommand(); - break; - case "list": - c = new ListCommand(); - break; - case "done": - c = new DoneCommand(Integer.parseInt(arr[1]) - 1); - break; - case "delete": - c = new DeleteCommand(Integer.parseInt(arr[1]) - 1); - break; - default: - c = new AddCommand(arr); - break; - } - return c; + case "bye": + c = new ExitCommand(); + break; + case "list": + c = new ListCommand(); + break; + case "done": + c = new DoneCommand(Integer.parseInt(arr[1]) - 1); + break; + case "delete": + c = new DeleteCommand(Integer.parseInt(arr[1]) - 1); + break; + default: + c = new AddCommand(arr); + break; + } + return c; } } From 126535c9e1662dbd1eaa3d5363d0edc5a75989ce Mon Sep 17 00:00:00 2001 From: fadisng Date: Wed, 28 Aug 2019 20:17:04 +0800 Subject: [PATCH 19/37] branch-Level-9 --- src/main/java/Duke_List.txt | 5 +---- src/main/java/FindCommand.class | Bin 0 -> 1564 bytes src/main/java/FindCommand.java | 24 ++++++++++++++++++++++++ src/main/java/Parser.class | Bin 1071 -> 1184 bytes src/main/java/Parser.java | 3 +++ 5 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 src/main/java/FindCommand.class create mode 100644 src/main/java/FindCommand.java diff --git a/src/main/java/Duke_List.txt b/src/main/java/Duke_List.txt index fe1182573e..7c23a923c8 100644 --- a/src/main/java/Duke_List.txt +++ b/src/main/java/Duke_List.txt @@ -1,4 +1 @@ -T @ 1 @ jump -T @ 0 @ go lecture -E @ 0 @ project @ 2/4/2019 1800 -T @ 0 @ play basketball +D @ 0 @ art project @ 04/04/2009 1600 diff --git a/src/main/java/FindCommand.class b/src/main/java/FindCommand.class new file mode 100644 index 0000000000000000000000000000000000000000..8cf5b4f59e79c07915b18c0eeb39fac08d53371a GIT binary patch literal 1564 zcmaJ>Tayz-6#hDw>Fi|o!on_wYtTiLEN&DOG(nIJuDh6B&@8NgFTInl&1@z!ai&9& zDy#ItA0fYhXDtmSR#`s#>WlCE3(5jdPqHv^DIcci^yzc?zH?6ZpU)ou4&Va5GBJyj z6F7kU1Ww`g4BjxYfYTgrnlNzE#9Jt6shGtvl=QO5amIv&w@oaetk2$=rC9HAyw7o- zA={Lp9XMU(_#VS-eOKHQWmkAR<%S9zZ>P#&Ty#7~U1FFk>_0BvVo25erev6|JD%L= zb+%=&DYjkGaCu+aJw?)yLVZ(&?Ya}HYW=2Dtv8e(h#gtg{*w(Q?Do3oMs6Gz7|e#> z3v9XK=rA)Yj@PXDosRIDOB$esIecK@AP#YSXrTf^SzMKY%nSNdOXfR5*)4*fSClo( zJ6^s|0rM{9uW($n@Db)24n}Ny%5lqAf z6o=u)3qavA&I>^EV@7*G$%eN?xFPRT9Kw8u%Hu_wLwoko3|-&em9`@5Dav{^K5652 zFJ>*yJeofOWBZ;Gju$cDCIx(wEu=gFYviZGOv=Z83vQHXJU zH40G^uG^rdS2^x7oZiRpRoEC#{J$N&PzUI}0vHndu9B1>c@Fcm9;RK1_6ho%rAJ_; z#b1#4F|vM*)+r=uHIM?w1Ty52!;z8S6FSS#>32UNIhz_F{TqzikH9Ob)cN${0GRw=u6@7%x11c*ui literal 0 HcmV?d00001 diff --git a/src/main/java/FindCommand.java b/src/main/java/FindCommand.java new file mode 100644 index 0000000000..2dd6a733a4 --- /dev/null +++ b/src/main/java/FindCommand.java @@ -0,0 +1,24 @@ +import java.util.ArrayList; + +public class FindCommand extends Command { + private String description; + + public FindCommand(String description) { + this.description = description; + } + @Override + public void execute(TaskList tasks, Ui ui, Storage storage) { + System.out.println("Here are the matching tasks in your list:"); + ArrayList matchingTasks = new ArrayList<>(); + int count = 1; + for (Task task : tasks.getList()) { + if (task.getDescription().contains(description)) { + matchingTasks.add(task); + } + } + for (Task task : matchingTasks) { + System.out.println(count + "." + task); + count++; + } + } +} diff --git a/src/main/java/Parser.class b/src/main/java/Parser.class index 34c79f05818b548f203015644a30ed4bf34f30d2..5155f1daf9d23a354433d3aff9e9965562dcc8e3 100644 GIT binary patch delta 725 zcmYk4O;1xn6o#L<+}pX_-dZTM@*$RjAfFbi6a_&9K|~}*6JuRjQXmMF1c`|oNlg3! zq#NBBcO<&7F0^P9Hzp>yFmY+(PcXW2E1v1XILSHhdER@@Br|tjxzDRtKmU3E0T^P= zqmfRR;~ojROzL*&G1}|W=hE+T!X>F0@Cb5Jlky1BsX65lHhS7)khDiFLz*)l^+wNn z#2D6$XwL22S z$O{E>i))KpQUs@^adKmQJ!|@#m@YJ`zThRF87>>1EnHLaswS=!Hr1P0v}^8e_I@_G zmd!6GZ)|O@BGe+PM4g@z>a`R~EC^IgMKwo>OD(PH z3AXsCP+{L{-rhDt#ihqDMK@6oe~M0!Y=0!WK=SuH(G;oTGtujfcEov0;3?BpX=j&l zVO`<0ZFoS~t#GGfxK+5i!m)ti8ey-(0iAZD&I{OPRW>%umPkk>C59!YByN=nW_s;Z z34eZgt?Ah#V&_WKi4`wX|DP2V%P$kl^p-e0-(QrCt;+3; z5jMxS(Kzx#G<$MUAMyBv&lhbtuo>C1K(pGR| zK=2QcEJP4-Ary4cAee{&7lIo%t^~K@-ao;5rwei5+%xCgxtEzcuR@#d&98qxegbB= zph%K)IiN^$P=_&>Lz>534!h)C3JyhuBIhun@H9^4Aj+?_0}zaVY%rWgs;?FtA1sW0ai+M%JUsNsm*^8U&Ue`W|zf zHn5t@t7}4ymHSc|Z1_!o&F{<^#qhkx8P4kZbDeb~6By-u=b7=o(=e~c6Y?UxObp#$ zVyg4aOtyE47Zimc#BTQJjEDx7`0y(qGkXLs6#}Kp#j0gi?3C5RdMhdJ2(0eyCtBRV zc=TI1&s6TQ@I^}9m%`PQ6|;K;pHm4`>%hP!PfZG9jrI<&2W!HS)* z-$;|1K(BycuV7qI7Ay=VMwBdgH2fC3mM95`DQuKrsUoc;WJUb5aYZ2><<$BlyT}?l?iV# lPtYOlkdY|$X_;&!67kYX#bR5ySpTvPS){YUKB+a?{})U3Vfg?6 diff --git a/src/main/java/Parser.java b/src/main/java/Parser.java index 1445f32268..d18ad5c49f 100644 --- a/src/main/java/Parser.java +++ b/src/main/java/Parser.java @@ -5,6 +5,9 @@ public static Command parse(String str) { String next = arr[0]; Command c; switch (next) { + case "find": + c = new FindCommand(arr[1]); + break; case "bye": c = new ExitCommand(); break; From 625f50e2f6ef53c1dc2d7d00f1d859f2d5240687 Mon Sep 17 00:00:00 2001 From: fadisng Date: Thu, 29 Aug 2019 16:33:24 +0800 Subject: [PATCH 20/37] A-Gradle --- build.gradle | 8 +++++++- gradle/wrapper/gradle-wrapper.properties | 5 +++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index e5b8ce7e49..70db0bcc6d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,7 @@ plugins { id 'java' id 'application' + id 'org.openjfx.javafxplugin' version '0.0.7' } group 'seedu.duke' @@ -10,7 +11,12 @@ repositories { mavenCentral() } +javafx { + version = "11.0.2" + modules = [ 'javafx.controls', 'javafx.fxml' ] +} + application { // Change this to your main class. - mainClassName = "seedu.duke.Duke" + mainClassName = "Duke" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4b7e1f3d38..bff0b6fb42 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Thu Aug 29 15:31:54 SGT 2019 +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 9e36be2e17f38908618a57b19bc00333f52ee72b Mon Sep 17 00:00:00 2001 From: fadisng Date: Thu, 29 Aug 2019 16:33:37 +0800 Subject: [PATCH 21/37] Level-10 --- src/main/java/DialogBox.class | Bin 0 -> 1537 bytes src/main/java/DialogBox.java | 45 +++++++++++ src/main/java/Duke.class | Bin 996 -> 6256 bytes src/main/java/Duke.java | 136 +++++++++++++++++++++++++++++++++- src/main/java/Launcher.class | Bin 0 -> 378 bytes src/main/java/Launcher.java | 10 +++ 6 files changed, 187 insertions(+), 4 deletions(-) create mode 100644 src/main/java/DialogBox.class create mode 100644 src/main/java/DialogBox.java create mode 100644 src/main/java/Launcher.class create mode 100644 src/main/java/Launcher.java diff --git a/src/main/java/DialogBox.class b/src/main/java/DialogBox.class new file mode 100644 index 0000000000000000000000000000000000000000..e6923ed0d698e0de4ea186e4bcd96cadea9b98c5 GIT binary patch literal 1537 zcmbtUdsACQ96cKXw+Y)oc}ZIYih_AyZ|kdS+FBkBpy6RjLGTafl5E4)%e~Ca4Z;`j z^QdFfhoc|B59Rdi4TRo~%s68*^V`kt+4DQ+x4-P)|GfGOz#VL*F^uUH1~6m72We!H z>v^!lO@7kIqhP{p3LoNTnh4v3TNZBj;v;-)mOn}3Q+#H^9kceig)a=|OB0F~?g}JB zbsP$em7h9C&XZ%iQB|I@tG*WozH67AJ>?b!GBw>ebe)q8T@9Oo5*Ux;^?_4Y_KJyH zTK&WmJ$JRI!}|jFvTT<<7yKF%_La4#)|v-=K<}fd@fO!jx5)V<5Si-Wz3ceP&5-a{14O{p|qKs9EHIyu@OKjj< ziAUI!sNk_cs*~9yy)H4134zfV5iiVdhW0Xz2waP8#cn~Mx1qxAz&Wf$&5+FQnwpNq zPP}zD?K34EZtGgO&)di@nlq9_TwGSVzR$KAJf)~B|3HPoiM`=BsJ*hj@x!B)rR9pi z@L31E31Qg{(VVO6-huK+G}^h(7|x{Zg0M#+G1{3;F57tepsTB$$ud%eYbF~ zfz|LkD&~T~IWbZMifwClGt{nqjxYW6rf=UeFQ{u6R10&ng_*v*%?oWS<4WE6OpaRw>I472ue*3a1h^$cPXLwx#1 zaGTmz`Cm(z{y){U6sZO#m??9b=>;EqGo}bD@`?=^L&!9k# J_lQs6{nt&scA)?O literal 0 HcmV?d00001 diff --git a/src/main/java/DialogBox.java b/src/main/java/DialogBox.java new file mode 100644 index 0000000000..0081b8da4f --- /dev/null +++ b/src/main/java/DialogBox.java @@ -0,0 +1,45 @@ +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; +import javafx.geometry.Pos; +import javafx.scene.Node; +import javafx.scene.control.Label; +import javafx.scene.image.ImageView; +import javafx.scene.layout.HBox; + +public class DialogBox extends HBox { + + private Label text; + private ImageView displayPicture; + + public DialogBox(Label l, ImageView iv) { + text = l; + displayPicture = iv; + + text.setWrapText(true); + displayPicture.setFitWidth(100.0); + displayPicture.setFitHeight(100.0); + + this.setAlignment(Pos.TOP_RIGHT); + this.getChildren().addAll(text, displayPicture); + } + + /** + * Flips the dialog box such that the ImageView is on the left and text on the right. + */ + private void flip() { + this.setAlignment(Pos.TOP_LEFT); + ObservableList tmp = FXCollections.observableArrayList(this.getChildren()); + FXCollections.reverse(tmp); + this.getChildren().setAll(tmp); + } + + public static DialogBox getUserDialog(Label l, ImageView iv) { + return new DialogBox(l, iv); + } + + public static DialogBox getDukeDialog(Label l, ImageView iv) { + var db = new DialogBox(l, iv); + db.flip(); + return db; + } +} \ No newline at end of file diff --git a/src/main/java/Duke.class b/src/main/java/Duke.class index 722796ea4ea8d315f4587e4d2aefc78935e2c029..5a3fe1d4157eaa5cf5515486c6e57e6ef9fb9116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a$1O>QYl^Abu^g_p|tob~VKuVSTa={-wskVBGXW%vp47a@Y5lJ;l#IermB azrwG5=y&)%ei!2YT>SbM{939ZQuA*Zsg`;G delta 602 zcmYL_O-~b16o#KWGjKc8OQFTq5B#bhP^Yv-P(iJt0)-fKgCFU#(TS;uO`s5V{Sn={ zbLHB^wnh>Yw{G0K_6PU_jC$@!;$qI6bI*Iu`@ZMr%nu!X{r%}PFwa^*mMKjkz+uWK z%_U73FhtQ7)0&bk$^i)~_GQKbFWWF1FvpdEt6bB}YZek*4+K%P;fCgB*EkE^`|e&R z*l6u;KZ|P3SCPVB-rbDKFB^Le!%6ZA=W)|;f(eD*Xt%Z-FCyDGWyo<#Ik0^P-9h*T-k57ms(p}jn~f=UNi)4=78UIB|+)-8piqld(!4m|O!vQKhz^M;#dw7x#)r$j$duYiM z_3#6_k3S&jk$f)`iZc>(azYrDEn^ZpX`#qaVqDsy>yTt$+MdAXWQo_uxYda_6#f+> z52inodRUSwXDEBm6hvSSD`qnh^MEsV(Og0 vG|n%4RS@KPE*#3J#8(lu2c+wn%z*LrVxJ@b&7=f?%m*@*ipMU-^pk%9t*}wg diff --git a/src/main/java/Duke.java b/src/main/java/Duke.java index b3aab3089c..0eaa41def7 100644 --- a/src/main/java/Duke.java +++ b/src/main/java/Duke.java @@ -2,15 +2,32 @@ * Main driving class for Duke. */ -import java.io.FileNotFoundException; -import java.io.IOException; -import java.text.ParseException; +import javafx.application.Application; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.ScrollPane; +import javafx.scene.control.TextField; +import javafx.scene.layout.AnchorPane; +import javafx.scene.layout.Region; +import javafx.scene.layout.VBox; +import javafx.stage.Stage; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; -public class Duke { + +public class Duke extends Application { private Storage storage; private TaskList list; private Ui ui; + private ScrollPane scrollPane; + private VBox dialogContainer; + private TextField userInput; + private Button sendButton; + private Scene scene; + private Image user = new Image(this.getClass().getResourceAsStream("/images/DaUser.png")); + private Image duke = new Image(this.getClass().getResourceAsStream("/images/DaDuke.png")); public Duke(String file) { ui = new Ui(); @@ -34,4 +51,115 @@ public static void main(String[] args) { Duke duke = new Duke("Duke_List.txt"); duke.run(); } + + @Override + public void start(Stage stage) { + + //Step 1. Setting up required components + + //The container for the content of the chat to scroll. + scrollPane = new ScrollPane(); + dialogContainer = new VBox(); + scrollPane.setContent(dialogContainer); + + userInput = new TextField(); + sendButton = new Button("Send"); + + AnchorPane mainLayout = new AnchorPane(); + mainLayout.getChildren().addAll(scrollPane, userInput, sendButton); + + scene = new Scene(mainLayout); + + stage.setScene(scene); + stage.show(); + + stage.setTitle("Duke"); + stage.setResizable(false); + stage.setMinHeight(600.0); + stage.setMinWidth(400.0); + + mainLayout.setPrefSize(400.0, 600.0); + + scrollPane.setPrefSize(385, 535); + scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); + scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.ALWAYS); + + scrollPane.setVvalue(1.0); + scrollPane.setFitToWidth(true); + + // You will need to import `javafx.scene.layout.Region` for this. + dialogContainer.setPrefHeight(Region.USE_COMPUTED_SIZE); + + userInput.setPrefWidth(325.0); + + sendButton.setPrefWidth(55.0); + + AnchorPane.setTopAnchor(scrollPane, 1.0); + + AnchorPane.setBottomAnchor(sendButton, 1.0); + AnchorPane.setRightAnchor(sendButton, 1.0); + + AnchorPane.setLeftAnchor(userInput , 1.0); + AnchorPane.setBottomAnchor(userInput, 1.0); + + sendButton.setOnMouseClicked((event) -> { + dialogContainer.getChildren().add(getDialogLabel(userInput.getText())); + userInput.clear(); + }); + + userInput.setOnAction((event) -> { + dialogContainer.getChildren().add(getDialogLabel(userInput.getText())); + userInput.clear(); + }); + + //Scroll down to the end every time dialogContainer's height changes. + dialogContainer.heightProperty().addListener((observable) -> scrollPane.setVvalue(1.0)); + + //Part 3. Add functionality to handle user input. + sendButton.setOnMouseClicked((event) -> { + handleUserInput(); + }); + + userInput.setOnAction((event) -> { + handleUserInput(); + }); + + } + + /** + * Iteration 1: + * Creates a label with the specified text and adds it to the dialog container. + * @param text String containing text to add + * @return a label with the specified text that has word wrap enabled. + */ + private Label getDialogLabel(String text) { + // You will need to import `javafx.scene.control.Label`. + Label textToAdd = new Label(text); + textToAdd.setWrapText(true); + + return textToAdd; + } + + /** + * Iteration 2: + * Creates two dialog boxes, one echoing user input and the other containing Duke's reply and then appends them to + * the dialog container. Clears the user input after processing. + */ + private void handleUserInput() { + Label userText = new Label(userInput.getText()); + Label dukeText = new Label(getResponse(userInput.getText())); + dialogContainer.getChildren().addAll( + DialogBox.getUserDialog(userText, new ImageView(user)), + DialogBox.getDukeDialog(dukeText, new ImageView(duke)) + ); + userInput.clear(); + } + + /** + * You should have your own function to generate a response to user input. + * Replace this stub with your completed method. + */ + private String getResponse(String input) { + return "Duke heard: " + input; + } } \ No newline at end of file diff --git a/src/main/java/Launcher.class b/src/main/java/Launcher.class new file mode 100644 index 0000000000000000000000000000000000000000..2a3d2ad5642ee961abbb881c0a083771bed75dab GIT binary patch literal 378 zcmZvYu};G<5QhIt)3}6`mI7r02{8~lG$TV15-MVfU?^f?a)K!?sZ*s1;LO!}ybp=ASj z5ZvLSdQt-00d~+Qw0;>vch&JanW?lS?Ay}AOC%SIOsBHcxrxqKn)lA?5rm`g&qCu& zE|;T!SHuBa{s4O%upfeBi*I|JiF0%C26|;dSmWr`MUS Date: Tue, 3 Sep 2019 00:10:02 +0800 Subject: [PATCH 22/37] Revert "Level-10" This reverts commit 9e36be2e17f38908618a57b19bc00333f52ee72b. --- src/main/java/DialogBox.class | Bin 1537 -> 0 bytes src/main/java/DialogBox.java | 45 ----------- src/main/java/Duke.class | Bin 6256 -> 996 bytes src/main/java/Duke.java | 136 +--------------------------------- src/main/java/Launcher.class | Bin 378 -> 0 bytes src/main/java/Launcher.java | 10 --- 6 files changed, 4 insertions(+), 187 deletions(-) delete mode 100644 src/main/java/DialogBox.class delete mode 100644 src/main/java/DialogBox.java delete mode 100644 src/main/java/Launcher.class delete mode 100644 src/main/java/Launcher.java diff --git a/src/main/java/DialogBox.class b/src/main/java/DialogBox.class deleted file mode 100644 index e6923ed0d698e0de4ea186e4bcd96cadea9b98c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1537 zcmbtUdsACQ96cKXw+Y)oc}ZIYih_AyZ|kdS+FBkBpy6RjLGTafl5E4)%e~Ca4Z;`j z^QdFfhoc|B59Rdi4TRo~%s68*^V`kt+4DQ+x4-P)|GfGOz#VL*F^uUH1~6m72We!H z>v^!lO@7kIqhP{p3LoNTnh4v3TNZBj;v;-)mOn}3Q+#H^9kceig)a=|OB0F~?g}JB zbsP$em7h9C&XZ%iQB|I@tG*WozH67AJ>?b!GBw>ebe)q8T@9Oo5*Ux;^?_4Y_KJyH zTK&WmJ$JRI!}|jFvTT<<7yKF%_La4#)|v-=K<}fd@fO!jx5)V<5Si-Wz3ceP&5-a{14O{p|qKs9EHIyu@OKjj< ziAUI!sNk_cs*~9yy)H4134zfV5iiVdhW0Xz2waP8#cn~Mx1qxAz&Wf$&5+FQnwpNq zPP}zD?K34EZtGgO&)di@nlq9_TwGSVzR$KAJf)~B|3HPoiM`=BsJ*hj@x!B)rR9pi z@L31E31Qg{(VVO6-huK+G}^h(7|x{Zg0M#+G1{3;F57tepsTB$$ud%eYbF~ zfz|LkD&~T~IWbZMifwClGt{nqjxYW6rf=UeFQ{u6R10&ng_*v*%?oWS<4WE6OpaRw>I472ue*3a1h^$cPXLwx#1 zaGTmz`Cm(z{y){U6sZO#m??9b=>;EqGo}bD@`?=^L&!9k# J_lQs6{nt&scA)?O diff --git a/src/main/java/DialogBox.java b/src/main/java/DialogBox.java deleted file mode 100644 index 0081b8da4f..0000000000 --- a/src/main/java/DialogBox.java +++ /dev/null @@ -1,45 +0,0 @@ -import javafx.collections.FXCollections; -import javafx.collections.ObservableList; -import javafx.geometry.Pos; -import javafx.scene.Node; -import javafx.scene.control.Label; -import javafx.scene.image.ImageView; -import javafx.scene.layout.HBox; - -public class DialogBox extends HBox { - - private Label text; - private ImageView displayPicture; - - public DialogBox(Label l, ImageView iv) { - text = l; - displayPicture = iv; - - text.setWrapText(true); - displayPicture.setFitWidth(100.0); - displayPicture.setFitHeight(100.0); - - this.setAlignment(Pos.TOP_RIGHT); - this.getChildren().addAll(text, displayPicture); - } - - /** - * Flips the dialog box such that the ImageView is on the left and text on the right. - */ - private void flip() { - this.setAlignment(Pos.TOP_LEFT); - ObservableList tmp = FXCollections.observableArrayList(this.getChildren()); - FXCollections.reverse(tmp); - this.getChildren().setAll(tmp); - } - - public static DialogBox getUserDialog(Label l, ImageView iv) { - return new DialogBox(l, iv); - } - - public static DialogBox getDukeDialog(Label l, ImageView iv) { - var db = new DialogBox(l, iv); - db.flip(); - return db; - } -} \ No newline at end of file diff --git a/src/main/java/Duke.class b/src/main/java/Duke.class index 5a3fe1d4157eaa5cf5515486c6e57e6ef9fb9116..722796ea4ea8d315f4587e4d2aefc78935e2c029 100644 GIT binary patch delta 602 zcmYL_O-~b16o#KWGjKc8OQFTq5B#bhP^Yv-P(iJt0)-fKgCFU#(TS;uO`s5V{Sn={ zbLHB^wnh>Yw{G0K_6PU_jC$@!;$qI6bI*Iu`@ZMr%nu!X{r%}PFwa^*mMKjkz+uWK z%_U73FhtQ7)0&bk$^i)~_GQKbFWWF1FvpdEt6bB}YZek*4+K%P;fCgB*EkE^`|e&R z*l6u;KZ|P3SCPVB-rbDKFB^Le!%6ZA=W)|;f(eD*Xt%Z-FCyDGWyo<#Ik0^P-9h*T-k57ms(p}jn~f=UNi)4=78UIB|+)-8piqld(!4m|O!vQKhz^M;#dw7x#)r$j$duYiM z_3#6_k3S&jk$f)`iZc>(azYrDEn^ZpX`#qaVqDsy>yTt$+MdAXWQo_uxYda_6#f+> z52inodRUSwXDEBm6hvSSD`qnh^MEsV(Og0 vG|n%4RS@KPE*#3J#8(lu2c+wn%z*LrVxJ@b&7=f?%m*@*ipMU-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$1O>QYl^Abu^g_p|tob~VKuVSTa={-wskVBGXW%vp47a@Y5lJ;l#IermB azrwG5=y&)%ei!2YT>SbM{939ZQuA*Zsg`;G diff --git a/src/main/java/Duke.java b/src/main/java/Duke.java index 0eaa41def7..b3aab3089c 100644 --- a/src/main/java/Duke.java +++ b/src/main/java/Duke.java @@ -2,32 +2,15 @@ * Main driving class for Duke. */ -import javafx.application.Application; -import javafx.scene.Scene; -import javafx.scene.control.Button; -import javafx.scene.control.Label; -import javafx.scene.control.ScrollPane; -import javafx.scene.control.TextField; -import javafx.scene.layout.AnchorPane; -import javafx.scene.layout.Region; -import javafx.scene.layout.VBox; -import javafx.stage.Stage; -import javafx.scene.image.Image; -import javafx.scene.image.ImageView; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.text.ParseException; - -public class Duke extends Application { +public class Duke { private Storage storage; private TaskList list; private Ui ui; - private ScrollPane scrollPane; - private VBox dialogContainer; - private TextField userInput; - private Button sendButton; - private Scene scene; - private Image user = new Image(this.getClass().getResourceAsStream("/images/DaUser.png")); - private Image duke = new Image(this.getClass().getResourceAsStream("/images/DaDuke.png")); public Duke(String file) { ui = new Ui(); @@ -51,115 +34,4 @@ public static void main(String[] args) { Duke duke = new Duke("Duke_List.txt"); duke.run(); } - - @Override - public void start(Stage stage) { - - //Step 1. Setting up required components - - //The container for the content of the chat to scroll. - scrollPane = new ScrollPane(); - dialogContainer = new VBox(); - scrollPane.setContent(dialogContainer); - - userInput = new TextField(); - sendButton = new Button("Send"); - - AnchorPane mainLayout = new AnchorPane(); - mainLayout.getChildren().addAll(scrollPane, userInput, sendButton); - - scene = new Scene(mainLayout); - - stage.setScene(scene); - stage.show(); - - stage.setTitle("Duke"); - stage.setResizable(false); - stage.setMinHeight(600.0); - stage.setMinWidth(400.0); - - mainLayout.setPrefSize(400.0, 600.0); - - scrollPane.setPrefSize(385, 535); - scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); - scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.ALWAYS); - - scrollPane.setVvalue(1.0); - scrollPane.setFitToWidth(true); - - // You will need to import `javafx.scene.layout.Region` for this. - dialogContainer.setPrefHeight(Region.USE_COMPUTED_SIZE); - - userInput.setPrefWidth(325.0); - - sendButton.setPrefWidth(55.0); - - AnchorPane.setTopAnchor(scrollPane, 1.0); - - AnchorPane.setBottomAnchor(sendButton, 1.0); - AnchorPane.setRightAnchor(sendButton, 1.0); - - AnchorPane.setLeftAnchor(userInput , 1.0); - AnchorPane.setBottomAnchor(userInput, 1.0); - - sendButton.setOnMouseClicked((event) -> { - dialogContainer.getChildren().add(getDialogLabel(userInput.getText())); - userInput.clear(); - }); - - userInput.setOnAction((event) -> { - dialogContainer.getChildren().add(getDialogLabel(userInput.getText())); - userInput.clear(); - }); - - //Scroll down to the end every time dialogContainer's height changes. - dialogContainer.heightProperty().addListener((observable) -> scrollPane.setVvalue(1.0)); - - //Part 3. Add functionality to handle user input. - sendButton.setOnMouseClicked((event) -> { - handleUserInput(); - }); - - userInput.setOnAction((event) -> { - handleUserInput(); - }); - - } - - /** - * Iteration 1: - * Creates a label with the specified text and adds it to the dialog container. - * @param text String containing text to add - * @return a label with the specified text that has word wrap enabled. - */ - private Label getDialogLabel(String text) { - // You will need to import `javafx.scene.control.Label`. - Label textToAdd = new Label(text); - textToAdd.setWrapText(true); - - return textToAdd; - } - - /** - * Iteration 2: - * Creates two dialog boxes, one echoing user input and the other containing Duke's reply and then appends them to - * the dialog container. Clears the user input after processing. - */ - private void handleUserInput() { - Label userText = new Label(userInput.getText()); - Label dukeText = new Label(getResponse(userInput.getText())); - dialogContainer.getChildren().addAll( - DialogBox.getUserDialog(userText, new ImageView(user)), - DialogBox.getDukeDialog(dukeText, new ImageView(duke)) - ); - userInput.clear(); - } - - /** - * You should have your own function to generate a response to user input. - * Replace this stub with your completed method. - */ - private String getResponse(String input) { - return "Duke heard: " + input; - } } \ No newline at end of file diff --git a/src/main/java/Launcher.class b/src/main/java/Launcher.class deleted file mode 100644 index 2a3d2ad5642ee961abbb881c0a083771bed75dab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 378 zcmZvYu};G<5QhIt)3}6`mI7r02{8~lG$TV15-MVfU?^f?a)K!?sZ*s1;LO!}ybp=ASj z5ZvLSdQt-00d~+Qw0;>vch&JanW?lS?Ay}AOC%SIOsBHcxrxqKn)lA?5rm`g&qCu& zE|;T!SHuBa{s4O%upfeBi*I|JiF0%C26|;dSmWr`MUS Date: Tue, 3 Sep 2019 00:53:53 +0800 Subject: [PATCH 23/37] branch-A-Gradle --- Duke_List.txt | 3 +++ build.gradle | 3 +++ src/main/java/Duke_List.txt | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 Duke_List.txt diff --git a/Duke_List.txt b/Duke_List.txt new file mode 100644 index 0000000000..00fe01dad9 --- /dev/null +++ b/Duke_List.txt @@ -0,0 +1,3 @@ +T @ 0 @ borrow book +E @ 1 @ project meeting @ 02/04/1997 1500 +T @ 0 @ sleep diff --git a/build.gradle b/build.gradle index 70db0bcc6d..7c144a35d7 100644 --- a/build.gradle +++ b/build.gradle @@ -20,3 +20,6 @@ application { // Change this to your main class. mainClassName = "Duke" } +run { + standardInput = System.in +} diff --git a/src/main/java/Duke_List.txt b/src/main/java/Duke_List.txt index ff53105e28..2276413ac2 100644 --- a/src/main/java/Duke_List.txt +++ b/src/main/java/Duke_List.txt @@ -1,2 +1,2 @@ D @ 1 @ art project @ 04/04/2009 1600 -T @ 1 @ borrow book +T @ 0 @ borrow book From 474710ef7238e8c2ef064a74cac9b76034d85179 Mon Sep 17 00:00:00 2001 From: fadisng Date: Thu, 5 Sep 2019 01:20:54 +0800 Subject: [PATCH 24/37] Level-10 --- src/main/java/DialogBox.class | Bin 0 -> 948 bytes src/main/java/DialogBox.fxml | 16 +++ src/main/java/DialogBox.java | 59 ++++++++++ src/main/java/Duke.class | Bin 996 -> 6363 bytes src/main/java/Duke.java | 137 +++++++++++++++++++++++- src/main/java/Launcher.class | Bin 0 -> 378 bytes src/main/java/Launcher.java | 10 ++ src/main/java/Main.java | 30 ++++++ src/main/java/MainWindow.fxml | 19 ++++ src/main/java/MainWindow.java | 49 +++++++++ src/main/resources/images/DaDuke.png | Bin 0 -> 32657 bytes src/main/resources/images/DaUser.png | Bin 0 -> 37794 bytes src/main/resources/view/DialogBox.fxml | 16 +++ src/main/resources/view/MainWindow.fxml | 19 ++++ 14 files changed, 351 insertions(+), 4 deletions(-) create mode 100644 src/main/java/DialogBox.class create mode 100644 src/main/java/DialogBox.fxml create mode 100644 src/main/java/DialogBox.java create mode 100644 src/main/java/Launcher.class create mode 100644 src/main/java/Launcher.java create mode 100644 src/main/java/Main.java create mode 100644 src/main/java/MainWindow.fxml create mode 100644 src/main/java/MainWindow.java create mode 100644 src/main/resources/images/DaDuke.png create mode 100644 src/main/resources/images/DaUser.png create mode 100644 src/main/resources/view/DialogBox.fxml create mode 100644 src/main/resources/view/MainWindow.fxml diff --git a/src/main/java/DialogBox.class b/src/main/java/DialogBox.class new file mode 100644 index 0000000000000000000000000000000000000000..4023cc58a99173503abdb26b4a0bc47025a91d6c GIT binary patch literal 948 zcmZ`%?M@Rx6g|@q*0uwPKt)8PD!5&c6~9mc140mz3Pc*3;t#WJ$L)~qF4>)8c>&)? zBQ=`n1NczJyDJcv#GT~K%+9&zp1F5^{r>(Fz&w_+=*MUVeYhUNSQa-h-m_e#L;A9~ ziHQ&j8Qj9{EHUncFsWfGhr7@<6g3zODJ43JVXSmu9a--?W>6QdFzcSHe9tjUR!uky z41En596HwVj;yP;FBrz-eA%*WVQz-FC&dSf=vkDmR4*8o^f)yx9Y4D$Q`{qit6qZ= z_Lrn9w%VOa}P)#a|z81!C5~80QLfTDg;^3)- zExeXc{;|2^1?0QDz4PwP=Bte|!|++X|D{m3LZKB$+HOm@Bs6l~vluT-nX`pjZAz!% z3zuP1FPgKI&w2YyacZO0TQt3)c^nh literal 0 HcmV?d00001 diff --git a/src/main/java/DialogBox.fxml b/src/main/java/DialogBox.fxml new file mode 100644 index 0000000000..e433809947 --- /dev/null +++ b/src/main/java/DialogBox.fxml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/DialogBox.java b/src/main/java/DialogBox.java new file mode 100644 index 0000000000..60636ac988 --- /dev/null +++ b/src/main/java/DialogBox.java @@ -0,0 +1,59 @@ +import java.io.IOException; +import java.util.Collections; + +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; +import javafx.fxml.FXML; +import javafx.fxml.FXMLLoader; +import javafx.geometry.Pos; +import javafx.scene.Node; +import javafx.scene.control.Label; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; +import javafx.scene.layout.HBox; + +/** + * An example of a custom control using FXML. + * This control represents a dialog box consisting of an ImageView to represent the speaker's face and a label + * containing text from the speaker. + */ +public class DialogBox extends HBox { + @FXML + private Label dialog; + @FXML + private ImageView displayPicture; + + private DialogBox(String text, Image img) { + try { + FXMLLoader fxmlLoader = new FXMLLoader(MainWindow.class.getResource("/view/DialogBox.fxml")); + fxmlLoader.setController(this); + fxmlLoader.setRoot(this); + fxmlLoader.load(); + } catch (IOException e) { + e.printStackTrace(); + } + + dialog.setText(text); + displayPicture.setImage(img); + } + + /** + * Flips the dialog box such that the ImageView is on the left and text on the right. + */ + private void flip() { + ObservableList tmp = FXCollections.observableArrayList(this.getChildren()); + Collections.reverse(tmp); + getChildren().setAll(tmp); + setAlignment(Pos.TOP_LEFT); + } + + public static DialogBox getUserDialog(String text, Image img) { + return new DialogBox(text, img); + } + + public static DialogBox getDukeDialog(String text, Image img) { + var db = new DialogBox(text, img); + db.flip(); + return db; + } +} \ No newline at end of file diff --git a/src/main/java/Duke.class b/src/main/java/Duke.class index 722796ea4ea8d315f4587e4d2aefc78935e2c029..eff2b646a449d18aec4208c55223dada7e553fb6 100644 GIT binary patch literal 6363 zcmcIo33yyrb^ec*dD7_FQWV*7oOq3F%aZJo7vf-Nku2G<@yJp>i znR#;L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C z*lxpi{_Y}`fvR7ko^OzP{4wqhrHJuck}AIOEG`{wUb%qF;vIQhUOL875&&1y0(N03 zuHv#+;htb|RfHPitel|ASMerR&tnb2wFKAAV?Cu_!~gm`t{}FR*bVd8NO03=bK3$o z&x3FW(VhLBd2ES1hOML3x+pPP!){|@w3c0a;!(t^Fhbg{(ar^Io5%JJ;15|4u2r5bxUK~~dGzYw{pibMUjXgT<9dat-~-yz z<_@x7--1JV^b^|Hg2QchYi!>(GF1EJqJ*x|jFghi79yN7o~T zgP6e~KCR!Yun@edPqBK?b3z`$4U$(!9RkE%7Qkj;lWSDfmMf`3=@NLq52j9higwXf!eINP} UevBW5xStefe~Rx*6-26k1GE0FQUCw| delta 631 zcmYL_OK(z96otQYFYV!8ZYfZ~M}6U=rBJ|9wbkOY4?AdeP_1Ez^`@Z@NGO=jm>Xxz z`~!|n1dL5goH}!=Q-6k0_qjH4aQ4~z?6uEYYyX(}sr|3NKYa$~SanGs(PFyt+1ZeJkBt#&>O8rv%2k@#yO7^ zCl%qR)q~x&+Cj^s%pKFY>v4+H9`{Il+~yQ@tNm-699)(mg%TNTj2n#yOXhLybs!c+I zfI@bF${t}=2G~79k`7gJ1BQEO$-|ZG2Xr52fZHSTUM3V5B&KA)Fe<;qBzEFLks!~Q zv_R#Zgf_Juiu=O9Inazi?DWke9h~ETb4~MbsV`~@?OS}gzo diff --git a/src/main/java/Duke.java b/src/main/java/Duke.java index b3aab3089c..7dd40fa474 100644 --- a/src/main/java/Duke.java +++ b/src/main/java/Duke.java @@ -1,16 +1,34 @@ +import javafx.application.Application; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.ScrollPane; +import javafx.scene.control.TextField; +import javafx.scene.layout.AnchorPane; +import javafx.scene.layout.Region; +import javafx.scene.layout.VBox; +import javafx.stage.Stage; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; + /** * Main driving class for Duke. */ -import java.io.FileNotFoundException; -import java.io.IOException; -import java.text.ParseException; -public class Duke { +public class Duke extends Application { private Storage storage; private TaskList list; private Ui ui; + private ScrollPane scrollPane; + private VBox dialogContainer; + private TextField userInput; + private Button sendButton; + private Scene scene; + private Image user = new Image(this.getClass().getResourceAsStream("/images/DaUser.png")); + private Image duke = new Image(this.getClass().getResourceAsStream("/images/DaDuke.png")); + public Duke(String file) { ui = new Ui(); @@ -18,6 +36,8 @@ public Duke(String file) { list = new TaskList(storage.load()); } + public Duke(){} + public void run() { ui.showWelcome(); boolean isExit = false; @@ -34,4 +54,113 @@ public static void main(String[] args) { Duke duke = new Duke("Duke_List.txt"); duke.run(); } + + @Override + public void start(Stage stage) { + //Step 1. Setting up required components + + //The container for the content of the chat to scroll. + scrollPane = new ScrollPane(); + dialogContainer = new VBox(); + scrollPane.setContent(dialogContainer); + + userInput = new TextField(); + sendButton = new Button("Send"); + + AnchorPane mainLayout = new AnchorPane(); + mainLayout.getChildren().addAll(scrollPane, userInput, sendButton); + + scene = new Scene(mainLayout); + + stage.setScene(scene); + stage.show(); + + stage.setTitle("Duke"); + stage.setResizable(false); + stage.setMinHeight(600.0); + stage.setMinWidth(400.0); + + mainLayout.setPrefSize(400.0, 600.0); + + scrollPane.setPrefSize(385, 535); + scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); + scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.ALWAYS); + + scrollPane.setVvalue(1.0); + scrollPane.setFitToWidth(true); + + // You will need to import `javafx.scene.layout.Region` for this. + dialogContainer.setPrefHeight(Region.USE_COMPUTED_SIZE); + + userInput.setPrefWidth(325.0); + + sendButton.setPrefWidth(55.0); + + AnchorPane.setTopAnchor(scrollPane, 1.0); + + AnchorPane.setBottomAnchor(sendButton, 1.0); + AnchorPane.setRightAnchor(sendButton, 1.0); + + AnchorPane.setLeftAnchor(userInput , 1.0); + AnchorPane.setBottomAnchor(userInput, 1.0); + + // more code to be added here later + sendButton.setOnMouseClicked((event) -> { + dialogContainer.getChildren().add(getDialogLabel(userInput.getText())); + userInput.clear(); + }); + + userInput.setOnAction((event) -> { + dialogContainer.getChildren().add(getDialogLabel(userInput.getText())); + userInput.clear(); + }); + + dialogContainer.heightProperty().addListener((observable) -> scrollPane.setVvalue(1.0)); + + //Part 3. Add functionality to handle user input. + sendButton.setOnMouseClicked((event) -> { + handleUserInput(); + }); + + userInput.setOnAction((event) -> { + handleUserInput(); + }); + } + + /** + * Iteration 1: + * Creates a label with the specified text and adds it to the dialog container. + * @param text String containing text to add + * @return a label with the specified text that has word wrap enabled. + */ + private Label getDialogLabel(String text) { + // You will need to import `javafx.scene.control.Label`. + Label textToAdd = new Label(text); + textToAdd.setWrapText(true); + + return textToAdd; + } + + /** + * Iteration 2: + * Creates two dialog boxes, one echoing user input and the other containing Duke's reply and then appends them to + * the dialog container. Clears the user input after processing. + */ + private void handleUserInput() { + String input = userInput.getText(); + String response = getResponse(input); + dialogContainer.getChildren().addAll( + DialogBox.getUserDialog(input, user), + DialogBox.getDukeDialog(response, duke) + ); + userInput.clear(); + } + + /** + * You should have your own function to generate a response to user input. + * Replace this stub with your completed method. + */ + String getResponse(String input) { + return "Duke heard: " + input; + } } \ No newline at end of file diff --git a/src/main/java/Launcher.class b/src/main/java/Launcher.class new file mode 100644 index 0000000000000000000000000000000000000000..2a3d2ad5642ee961abbb881c0a083771bed75dab GIT binary patch literal 378 zcmZvYu};G<5QhIt)3}6`mI7r02{8~lG$TV15-MVfU?^f?a)K!?sZ*s1;LO!}ybp=ASj z5ZvLSdQt-00d~+Qw0;>vch&JanW?lS?Ay}AOC%SIOsBHcxrxqKn)lA?5rm`g&qCu& zE|;T!SHuBa{s4O%upfeBi*I|JiF0%C26|;dSmWr`MUSgetController().setDuke(duke); + stage.show(); + } catch (IOException e) { + e.printStackTrace(); + } + } +} \ No newline at end of file diff --git a/src/main/java/MainWindow.fxml b/src/main/java/MainWindow.fxml new file mode 100644 index 0000000000..435f3ce0d8 --- /dev/null +++ b/src/main/java/MainWindow.fxml @@ -0,0 +1,19 @@ + + + + + + + + + + + +