[Natalie Tan] Duke Increments#344
[Natalie Tan] Duke Increments#344nattanyz wants to merge 96 commits intonus-cs2103-AY1920S1:masterfrom
Conversation
Add toolVersion block in to Gradle code sample to prevent errors.
Change file mode on `gradle` to be executable (#9)
Gradle defaults to an empty stdin which results in runtime exceptions when attempting to read from `System.in`. Let's add some sensible defaults for students who may still need to work with the standard input stream.
Add configuration for console applications
| @@ -1,10 +1,10 @@ | |||
| import java.util.Scanner; | |||
| public class DukeBot { | ||
| private Scanner in; | ||
| private TaskList taskList = new TaskList(); | ||
| private static final String welcomeMessage = "What can I do for you?"; |
There was a problem hiding this comment.
From the coding standard:
Constant names must be all uppercase using underscore to separate words.
| * Starts DukeBot and prints welcome message. | ||
| */ | ||
|
|
||
| public void initialise() { |
There was a problem hiding this comment.
These code should be in the constructor and run can be a public method that can be called separately IMO.
| */ | ||
|
|
||
| public void initialise() { | ||
| String logo = " ____ _ \n" |
| input = in.nextLine(); | ||
| if (input.equals("bye")) { | ||
| // if "bye", terminate | ||
| // todo: is there a way to combine this into processInput()? |
There was a problem hiding this comment.
Maybe you can make processInput return a boolean to indicate whether the command is "bye"
| * | ||
| * @param input input string given by user. | ||
| */ | ||
| public void processInput(String input) throws InputMismatchException { |
There was a problem hiding this comment.
Instead of having almost all the app logic here, maybe it would help to define a Command class and a few subclasses like AddCommand, DoneCommand, etc. It would make the code more maintainable.
|
|
||
| public void printList() { | ||
| int i = 1; | ||
| for (Iterator<Task> iterator = this.tasks.iterator(); iterator.hasNext(); i++) { |
There was a problem hiding this comment.
I don't think the iterator here is necessary :)
| tasks.add(newTask); | ||
| System.out.println("Okay! I've added: " + description | ||
| + ". Use list to see all your tasks!"); | ||
| // todo: description has trailing space due to using /at or /by as delimiter. how? |
There was a problem hiding this comment.
Use strip(), stripLeading(), stripTrailing(), whichever that suits your need :)
| TODO | ||
| } | ||
|
|
||
| public void addToList(TaskType taskType, String description, String deadline) |
There was a problem hiding this comment.
Maybe make this method take in a Task and construct the Task at the call site. This reduces duplicate code.
| } | ||
| break; | ||
| case "event": | ||
| inputReader.useDelimiter("/at"); |
| @@ -1,10 +1,10 @@ | |||
| import java.util.Scanner; | |||
…to implement A-MoreOOP
…mentation(s) of execute() from previous version. currently unable to run: encountered "could not find or load main class Duke" error :(
…t Level-9 (find), fix String comparison bug
…his.tasks" with "tasks" in TaskList.java
…ddToList method and replace with calls to newTask() and add()
…geBox to represent different types of message boxes. change Gui class to use these subclasses.
Branch-Level-10
…GuiDuke, build Jar file
Branch level 10
* 'master' of https://github.com/nattanyz/duke: (22 commits) remove redundant print statements in Task class, change filePath for GuiDuke, build Jar file remove System.out.println statements. add SaveCommand add showUserInput() method to Gui class add DukeMessageBox, ExceptionMessageBox, TaskMessageBox and UserMessageBox to represent different types of message boxes. change Gui class to use these subclasses. add Storage param back to execute() method in all Commands, add storage.save() when ExitCommand() is issued use ui.showMessage() in Storage class, add try/catch blocks to debug, manage to get partially working GUI (yay!) partially implement GUI using messageBoxQueue. changed font family and size. add DropShadow to MessageBox. complete refactoring from previous commit, add GREY colour scheme fix VBox width issue, complete refactoring of dialogBox to messageBox refactor: rename DialogBox to MessageBox.add ColourScheme enum to take care of customisable colour schemes. configure getUserDialog and getDukeDialog to use background and text colour create CliDuke and GuiDuke classes to implement Duke interface, set default invocation of Duke from CLI to use CliDuke and GUI to use GuiDuke continue refactoring in earlier commit replace Ui class with Ui interface and Cli and Gui implementations, attempt to do the same for Duke refactor: organise methods in Duke class fix scrolling and resizing behaviour of MainWindow, add some JavaDoc refactor: move GUI-related classes to duke.gui, add title and application icon rectify MainWindow fit wrap TextField and Button in HBox change images to png (but still cannot get them to appear) manage to compile and run, opens GUI window ...
Branch tests and assertions
…-Tests-and-Assertions * 'master' of https://github.com/nattanyz/duke: Set theme jekyll-theme-cayman
No description provided.