Skip to content

Commit

Permalink
Collated code.
Browse files Browse the repository at this point in the history
  • Loading branch information
dfz2019 committed Oct 27, 2016
1 parent 26a1444 commit 4579f6b
Show file tree
Hide file tree
Showing 4 changed files with 1,576 additions and 44 deletions.
297 changes: 297 additions & 0 deletions collated/docs/A0147924X.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,297 @@
# A0147924X
###### /DeveloperGuide.md
``` md
## Introduction

Task Ninja is a task manager with a command line interface. It is aimed at users who prefer to only use the keyboard and prefer to be able to add tasks with one line of information.<br>

This guide describes how Task Ninja has been designed and implemented. It is directed at developers new to this application aiming to understand the architecture of the application and at more experienced developers aiming to refresh their knowledge of the application. It also provides a description of how you can set up the development environment. Finally, it includes User Stories, Use Cases, Non Functional Requirements and a Product Survey in the Appendix to give you a better idea of the pain points that this application is trying to solve.


```
###### /DeveloperGuide.md
``` md
## Appendix A : User Stories

Likeliness: Likely - `L`, Unlikely - `U`

Likeliness | As (a)... | I want to... | So that I can...
-------- | :-------- | :--------- | :-----------
`L` | All Users | Interact with the manager using a CLI and keys | Get rid of the need for a mouse
`L` | All Users | Use a keyboard shortcut to activate the manager | Speed up my workflow
`L` | New User | View info about a command | Learn how to use these commands
`L` | User | Add tasks with a description and a specific deadline | Set deadlines for tasks
`L` | User | Add tasks with description, start time and end time | Create events in the calendar
`L` | User | Add tasks with only a description | Set tasks that need to be completed at some point of time
`L` | User | Add tasks that starts from a certain time | Set tasks that doesn't have an end time
`L` | User | Modify a task | Update deadlines and descriptions
`L` | User | Delete a task | Remove it from the Task Manager's to-do list
`L` | User | Tick off a task | Record that this task is complete by marking it as done
`L` | User | Search for (a) task(s) | Find (a) task(s) and maybe edit it
`L` | User | See upcoming tasks | Decide what to do next
`L` | User | Assign priority to tasks | Gauge which task should be done next
`L` | User | See tasks in a specific period of time | See what has been scheduled for a certain period
`L` | User | See upcoming tasks up until a specified time | See less / more upcoming tasks according to the time frame I want
`L` | User | Undo operation(s) | Remove a mistake
`L` | Advanced User | Edit the storage file | Make changes without having to go through the manager
`L` | Advanced User | Declare my own names for commands | Personalise the experience and make it faster
`U` | New User | View the procedure of creating a task | Learn how to create a task first
`U` | User | Declare tasks that have to be done after a certain time | Record these tasks somewhere and not be bothered by them until a certain time
`U` | User | Redo operation(s) | Redo a change that had been undone
`U` | User | Declare recurring tasks | Remove the need to enter these tasks multiple times
`U` | User | Search for empty slots (within a given time frame) | Decide when to schedule a task
`U` | User | Integrate with third-party applications like GCalendar | Access my tasks on another platform too
`U` | User | List [floating tasks](#floating-task) | See whether I want to complete a floating task next
`U` | User | Sort upcoming tasks by priority | Make the decision of which task to complete next faster
`U` | User | Block multiple slots for a task | Choose later which slot I want to assign this task to and keep the selected slots free for that task
`U` | User | Decide slot for an item blocking multiple slots | Free up the other slots for other tasks
`U` | User | Receive emails/notifications about pressing deadlines | Be reminded to complete these tasks

```
###### /UserGuide.md
``` md
# User Guide

* [Quick Start](#quick-start)
* [Features](#features)
* [Primary Commands](#primary-commands)
* [Extensions](#extensions)
* [Cheat Sheet](#cheat-sheet)
* [Appendix A](#appendix-a)



## Quick Start

0. Ensure you have Java version `1.8.0_60` or later installed in your Computer.<br>
> Having any Java 8 version is not enough. <br>
This app will not work with earlier versions of Java 8.

1. Download the latest `taskninja.jar` from the [releases](../../../releases) tab.
2. Copy the file to the folder you want to use as the home folder for Task Ninja.

3. Double-click the file to start the app. The GUI should appear in a few seconds.

4. To communicate with Task Ninja, type a command in the command box and press <kbd>Enter</kbd>

5. Some commands to get you started:
* `help` : Bring up the help page.
* `add Dinner with Mum` : Add a task `Dinner with Mum` to your list.
* `find Dinner` : Finds all the tasks containing the word `Dinner`.
* `delete 3` : Delete the 3rd task as visible in the current list.



## Features

### Overview
Task Ninja uses some [primary commands](#primary-commands), like `add`, `edit`, `delete` and `find`. These commands can then be made more specific using [extensions](#extensions), such as `at`, `before`, `from-to` and `priority`. <br>

This means that the primary commands are used in conjunction with extensions to give the manager more information about what you want to do. <br>

For example, you could edit the venue of the 1st task displayed by typing `edit 1 at Home`.

> The order of extensions is not fixed.

### Notation used:
`[]`: These square brackets represent optional argument(s)<br>
`<>`: These angular brackets should be replaced with what you wish to enter, eg. an actual time if it says `<time>` <br>

### Primary Commands

<a id="help"></a>
#### Viewing help: `help`
_Overwhelmed by the amazingness of Task Ninja? `help` is here to help you discover more._<br>

Format: `help`

> This shows help for all commands. <br>

Example:
* `help`


<a id="add"></a>
#### Adding a task to the list: `add`
_The most basic command... let's start adding tasks to the manager._<br>
Format: `add <task description> [<extensions>]`

> * Task description outlines the task to be added. <br>
> * Extensions allow specifying more details about the task, such as deadlines and venues. <br>
> * Without any time information, the task will be added as a task without a time (a floating task). <br>

Examples:
* `add Dinner with Arthur`
* `add Dinner with Arthur venue Avalon from 8:30pm to 9:30pm`
* `add Finish 2103T Tutorial before 11:59pm`


<a id="find"></a>
#### Searching for tasks: `find`
_Forgotten when you arranged that date? Use `find`!_<br>
Format: `find <keywords> [<more keywords>]`

> * The search is case sensitive. e.g `dinner` will not match `Dinner`.
> * The order of the keywords does not matter. e.g. `Tutorial CS2103T` will match `CS2103T Tutorial`.
> * Only the description is searched for.
> * Only full words will be matched e.g. `2103T` will not match `CS2103T`.
> * Tasks matching at least one keyword will be returned (i.e. OR search). e.g. `Dinner` will match `Dinner with Mum`.

Examples:
* `find Tutorial`<br>
Shows all tasks containing `Tutorial` in the description
* `find Dinner Tutorial`<br>
Shows all tasks containing `Dinner` or `Tutorial` in their descriptions


<a id="edit"></a>
#### Editing tasks: `edit`
_Decided to postpone your homework? We let you do that too ;)_<br>
Format: `edit <task number> [<new task description>] [<extensions>]`

> * Task number specifies which out of the tasks on the screen you wish to modify. <br>
> * If given, the new task description will replace the old one for this task. <br>
> * Fields for the specified extensions will be changed. <br>

Examples:
* `edit 1 Dinner with Guinevere`
* `edit 2 at 1am 3 Oct`
* `edit 1 Dinner with Guinevere venue Under the stars`


<a id="delete"></a>
#### Deleting tasks: `delete`
_Added a task you don't need? Fear not, for delete is here._<br>
Format: `delete <task number>`

> Task number specifies which out of the tasks on the screen you wish to delete. <br>

Examples:
* `delete 1`
* `delete 3`


<a id="exit"></a>
#### Exiting Task Ninja: `exit`
_This command closes Task Ninja. Hope to see you back soon!_<br>
Format: `exit`

Example:
* `exit`


#### Saving the data
Tasks are saved in the hard disk automatically after any command that changes the data.<br>
There is no need to save manually.


<a id="next"></a>
#### List upcoming tasks: `next`
_Lists all upcoming tasks._<br>
Format: `next [before <time>]`

> * All tasks whose start times are after the current time are listed, by default. <br>
> * Floating tasks are also listed; they are listed at the bottom of the list. <br>
> * Can also be used with `before` to see upcoming tasks until a specified time/date. <br>

Example:
* `next`
* `next before 10pm`


<a id="undo"></a>
#### Undo previous action: `undo`
_Made a mistake? Fret not! Just use this keyword to revert the last action that you did!_<br>
Format: `undo`

> Can be used more than once. <br>

Example:
* `undo`


<a id="storage"></a>
#### Specify a storage folder: `storage`
_Allows you to edit the storage file._<br>
Format: `storage <path/to/file/fileName.xml>`

> The file's name must have a .xml extension. <br>

Example:
* `storage data/TaskNinja.xml`


### Extensions

<a id="venue"></a>
#### At a certain venue: `venue`
_Going to university but somehow ended up wandering at the mall aimlessly? Remember your destination with this extension._<br>
Format: `venue <description of venue>`

Examples:
* `add Lunch with Arthur venue Avalon`
* `edit 1 venue Round Table`


<a id="from-to"></a>
#### Events that last from a certain period of time/date: `from-to`
_Mark tasks/events that will be done in a certain period of time/date._<br>
Format: `from <start time/date> to <end time/date>`

> * Start time/date indicates when the task/event begins, end time/date indicates when the task/event finishes. <br>
> * A list of supported time and date inputs are listed in [Appendix A](#appendix-a). You may also refer to the examples for a brief guide. <br>

Examples:
* `add Meeting with Boss from 11am to 1pm`
* `edit 1 from 10/20/16 to 10/25/16`
* `add Collect computer from store from 2:30pm to 3:00pm`
* `edit 4 from 15 Oct to 17 Oct`


<a id="before"></a>
#### Before a certain time/date: `before`
_Specify a deadline for a task._<br>
Format: `before <time/date>`

> A list of supported time and date inputs are listed in [Appendix A](#appendix-a). You may also refer to the examples for a brief guide too. <br>

Examples:
* `add Finish 2103T Tutorial before 13:00`
* `edit 3 before 6 Feb '17`
* `add Complete assignment before Nov 2 2016 2359`
* `edit 5 before 1st May`


<a id="priority"></a>
#### Priority level for tasks: `priority`
_Assign a priority level to tasks._<br>
Format: `priority <low/med/high>`

> * Helps give levels of importance to tasks. <br>
> * Priority level can be low, medium or high. <br>
> * The default priority level of a task is medium ("med"). <br>

Examples:
* `add Lunch with Arthur priority high`
* `edit 1 priority med`


## Cheat Sheet

Type | Command | Format
:--------: | :--------: | ----- |
Primary | [Help](#help) | `help`
Primary | [Add](#add) | `add <task description> [<extensions>]`
Primary | [Find](#find) | `find <keyword> [<more keywords>]`
Primary | [Edit](#edit) | `edit <task number> [<extensions>]`
Primary | [Delete](#delete) | `delete <task number>`
Primary | [Exit](#exit) | `exit`
Primary | [Next](#next) | `next [before <time>]`
Primary | [Undo](#undo) | `undo`
Primary | [Storage](#storage) | `storage <path/to/file/fileName.xml>`
Extension | [Venue](#venue) | `at <description of venue>`
Extension | [Event](#from-to) | `from <start time> to <end time>`
Extension | [Before](#before) | `before <time>`
Extension | [Priority](#priority) | `priority <low/med/high>`

```
47 changes: 3 additions & 44 deletions collated/main/A0147924X.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,23 +468,9 @@ public class ExtensionParser {
}
/**
* Parses events and puts the times into the properties
* Throw an exception if start time is behind end time
*
* @param properties Properties to put in.
* @param arguments Arguments specifying the time.
* @throws IllegalValueException
*/
private void throwExceptionIfTimeInvalid(String startTime, String endTime) throws IllegalValueException {
StartTime start = new StartTime(startTime);
EndTime end = new EndTime(endTime);
if (start.getTime().after(end.getTime())) {
throw new IllegalValueException(START_AFTER_END);
}
}
/**
```
###### /java/seedu/manager/logic/parser/ExtensionParser.java
``` java
* Adds a property to the properties HashMap
*
* @param properties HashMap to put the new property into.
Expand Down Expand Up @@ -596,33 +582,6 @@ public class ExtensionParser {
return new UnmodifiableObservableList<>(sortedTasks);
}
@Override
public UnmodifiableObservableList<Tag> getSortedFilteredTagList() {
return new UnmodifiableObservableList<>(sortedTags);
}
@Override
public void updateSortedFilteredListToShowAll() {
updateFilteredListToShowAll();
}
@Override
public void sortSortedFilteredTaskListByPriority() {
sortedTasks.setComparator((Task t1, Task t2) -> t1.compareProperty(t2, TaskProperties.PRIORITY));
}
@Override
public void unSortSortedFilteredTaskList() {
sortedTasks.setComparator(null);
}
@Override
public int getIndexOfTask(ReadOnlyTask task) {
return sortedTasks.indexOf(task);
}
//=========== Filtered Task List Accessors ===============================================================
```
###### /java/seedu/manager/model/task/Desc.java
``` java
Expand Down

0 comments on commit 4579f6b

Please sign in to comment.