Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
90c8452
Level-0 Increment
DarkDragoon2002 Aug 22, 2024
6027a2d
Level-1
DarkDragoon2002 Aug 28, 2024
0d164dd
Level-2
DarkDragoon2002 Aug 28, 2024
dded6bf
Level-3
DarkDragoon2002 Aug 28, 2024
d0d0bda
A-CodingStandard
DarkDragoon2002 Aug 28, 2024
a43c3b2
Added ToDo, Deadline and Event
DarkDragoon2002 Sep 6, 2024
6a7f020
Added UI Text Testing
DarkDragoon2002 Sep 7, 2024
0d50273
Implemented Deadline and Event Constructor Exceptions
DarkDragoon2002 Sep 10, 2024
cb16bf3
Implemented ToDo Constructor Exceptions and Error Catching for chat c…
DarkDragoon2002 Sep 10, 2024
913e641
Implemented Packages
DarkDragoon2002 Sep 10, 2024
f0c0fab
Added Comments
DarkDragoon2002 Sep 12, 2024
36dbaff
Merge pull request #1 from DarkDragoon2002/branch-A-Packages
DarkDragoon2002 Sep 12, 2024
2d8b65a
Implemented ArrayList
DarkDragoon2002 Sep 19, 2024
5b59c6f
Implemented delete function & cleaned up code
DarkDragoon2002 Sep 19, 2024
c4ca544
Implemented Data Writing System
DarkDragoon2002 Sep 20, 2024
f0b78b9
Merge pull request #2 from DarkDragoon2002/branch-Level-6
DarkDragoon2002 Sep 20, 2024
0941170
Merge branch 'master' into branch-Level-7
DarkDragoon2002 Sep 20, 2024
9672976
Merge pull request #3 from DarkDragoon2002/branch-Level-7
DarkDragoon2002 Sep 20, 2024
2d5e67e
Bugfix and Created JAR file
DarkDragoon2002 Sep 20, 2024
c88fc8c
Migrated UI to separate Class
DarkDragoon2002 Oct 8, 2024
e2f954e
Migrate TaskList Functions from Task
DarkDragoon2002 Oct 9, 2024
1e844eb
Migrated Parser functions from Juan
DarkDragoon2002 Oct 9, 2024
44b8d55
Fixed Corrupted Data Handling
DarkDragoon2002 Oct 9, 2024
43e739f
Extracted Command Handling from Parser and Followed Good Coding Princ…
DarkDragoon2002 Oct 9, 2024
075bdcf
Merge pull request #4 from DarkDragoon2002/master
DarkDragoon2002 Oct 9, 2024
8eff0ee
Implemented DateTime feature and Updated Exception Handling
DarkDragoon2002 Oct 9, 2024
01d0c9d
Implement find function
DarkDragoon2002 Oct 9, 2024
cdf58d0
Merge pull request #5 from DarkDragoon2002/branch-Level-8
DarkDragoon2002 Oct 9, 2024
8d0bb25
Merge branch 'master' into branch-Level-9
DarkDragoon2002 Oct 9, 2024
4e5f9fa
Merge pull request #6 from DarkDragoon2002/branch-Level-9
DarkDragoon2002 Oct 9, 2024
2935ec3
Improved Code Quality
DarkDragoon2002 Oct 9, 2024
e439f74
Merge branch 'master' of https://github.com/DarkDragoon2002/ip
DarkDragoon2002 Oct 9, 2024
936c109
Updated UI-Text-Testing Files
DarkDragoon2002 Oct 9, 2024
42cbb2c
Updated JavaDoc Comments
DarkDragoon2002 Oct 9, 2024
364eab3
Merge pull request #7 from DarkDragoon2002/branch-A-JavaDoc
DarkDragoon2002 Oct 9, 2024
e64f9dc
Resolved Merge Conflicts
DarkDragoon2002 Oct 9, 2024
16bf1b5
Merge branch 'master' of https://github.com/DarkDragoon2002/ip
DarkDragoon2002 Oct 9, 2024
97be193
Updated README.md
DarkDragoon2002 Oct 10, 2024
45abc71
Update README.md
DarkDragoon2002 Oct 10, 2024
4175b23
Update README.md
DarkDragoon2002 Oct 10, 2024
98d3df5
Update README.md
DarkDragoon2002 Oct 10, 2024
246fbcb
Storage Bug Fix
DarkDragoon2002 Oct 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions data.text
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
todo go to class /isdone true
todo say hi /isdone false
deadline go for meeting /by 01-01-2000 00:00 /isdone true
event Senior Seminar RC4 /from 10-10-2024 14:00 /to 10-10-2024 17:00 /isdone true
195 changes: 181 additions & 14 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,197 @@
# Duke User Guide
# Juan User Guide

// Update the title above to match the actual product name
._-'-_ .
. ' /_-_-_\ ` .
.' |-_-_-_-| `.
( `.-_-_-.' )
!`. .'!
! ` . . ' !
! ! ! ! ! ! ! ! !
/ / \ \
_-| \___ ___/ /-_
(_ )__\_)\(_/__( _)
))))\X\ ((((
\/ \/

// Product screenshot goes here
Juan is a simple command-line task manager that helps users keep track of tasks such as to-dos, deadlines, and events. It allows users to manage their tasks, mark them as complete, and store them for future use. Juan is written in Java and supports basic task operations with a fun user interface.

// Product intro goes here
## Run

## Adding deadlines
To Run Juan, open Command Prompt and navigate to the directory `ip.jar` is located in and run the following command:
```
java -jar ip.jar
```

## Command Overview

| Command | Description | Format | Example |
|---------------|--------------------------------------------|----------------------------------------------------|---------------------------------------------------------------------|
| Add ToDo | Adds a to-do task | `todo <task_description>` | `todo Buy groceries` |
| Add Deadline | Adds a deadline task | `deadline <task_description> /by <date>` | `deadline Submit assignment /by 15-10-2024 23:59` |
| Add Event | Adds an event with start and end | `event <task_description> /from <date> /to <date>` | `event Project meeting /from 15-10-2024 10:00 /to 15-10-2024 12:00` |
| Mark Task | Marks a task as done | `mark <task_number>` | `mark 2` |
| Unmark Task | Unmarks a task | `unmark <task_number>` | `unmark 2` |
| Delete Task | Deletes a task | `delete <task_number>` | `delete 3` |
| List Tasks | Lists all tasks | `list` | `list` |
| Find Task | Finds tasks matching a keyword | `find <keyword>` | `find groceries` |
| Exit | Saves the tasks into a text file and exits | `bye` | `bye` |


## Commands

### 1. Add ToDo Task

**Format**:
```
todo <task_description>
```

Adds a new to-do task to the task list.

Example:
```
todo Buy groceries

Muy Bien, work hard compadre!
I've Added the Task:
[T][ ] Buy groceries
```

### 2. Add Deadline Task

**Format**:
```
deadline <task_description> /by <dd-MM-yyyy HH:mm>
```

Adds a task with a specific deadline.

Example:
```
deadline Submit assignment /by 15-10-2024 23:59

Muy Bien, work hard compadre!
I've Added the Task:
[D][ ] Submit assignment (by: 15-10-2024 23:59)
```

### 3. Add Event Task

**Format**:
```
event <task_description> /from <dd-MM-yyyy HH:mm> /to <dd-MM-yyyy HH:mm>
```

Adds a task with a specific start and end time.

Example:
```
event Project meeting /from 15-10-2024 10:00 /to 15-10-2024 12:00

Muy Bien, work hard compadre!
I've Added the Task:
[E][ ] Project meeting (from: 15-10-2024 10:00 to: 15-10-2024 12:00)
```

### 4. Mark Task as Done

**Format**:
```
mark <task_number>
```

// Describe the action and its outcome.
Marks the specified task as completed.

// Give examples of usage
Example:
```
mark 1

Fantastica!!!! I marked it:
[T][X] Buy groceries
```

Example: `keyword (optional arguments)`
### 5. Unmark Task

**Format**:
```
unmark <task_number>
```

// A description of the expected outcome goes here
Unmarks the specified task, indicating it is not completed.

Example:
```
expected output
unmark 1

Ay Caramba, I unmarked it:
[T][ ] Buy groceries
```

## Feature ABC
### 6. Delete Task

// Feature details
**Format**:
```
delete <task_number>
```

Deletes the specified task from the task list.

## Feature XYZ
Example:
```
delete 1

Ay Caramba, Task deleted: [T][ ] Buy groceries
```

### 7. List All Tasks

**Format**:
```
list
```

Lists all current tasks in the task list, including their status (marked as done or not done) and task numbers.

Example:
```
list

Si compinche, your 2 tasks:
1.[D][X] Submit assignment (by: 15-10-2024 23:59)
2.[E][ ] Project meeting (from: 15-10-2024 10:00 to: 15-10-2024 12:00)
```

### 8. Find Task

**Format**:
```
find <keyword>
```

Finds all tasks that contain the specified keyword in their description.

Example:
```
find meeting

Si compinche, your tasks with the phrase <meeting>:
2.[E][ ] Project meeting (from: 15-10-2024 10:00 to: 15-10-2024 12:00)
5.[T][X] Do Tutorial
```

### 9. Exit

**Format**:
```
bye
```
Saves changes done to .txt file and exits program.

Example:

```
bye

// Feature details
Data File Written
Adios amigo, la familia will miss you
```
140 changes: 140 additions & 0 deletions src/main/java/CommandHandling.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
import customexceptions.DeadlineConstructorException;
import customexceptions.EventConstructorException;
import customexceptions.ToDoConstructorException;
import taskpackage.Deadline;
import taskpackage.Event;
import taskpackage.TaskList;
import taskpackage.ToDo;

/**
* Handles various user commands related to tasks such as adding, deleting, finding, and marking tasks.
*/
public class CommandHandling {
public static final String BYE_COMMAND = "bye";
public static final String LIST_COMMAND = "list";
public static final String DELETE_COMMAND = "delete ";
public static final String FIND_COMMAND = "find ";
public static final String MARK_COMMAND = "mark ";
public static final String UNMARK_COMMAND = "unmark ";
public static final String TODO_COMMAND = "todo ";
public static final String DEADLINE_COMMAND = "deadline ";
public static final String EVENT_COMMAND = "event ";

/**
* Deletes a task from the task list based on the user input.
*
* @param tasks The task list from which to delete the task.
* @param line The user input line.
* @param ui The user interface to display messages.
*/
public static void deleteCommand(TaskList tasks, String line, UI ui) {
try {
int taskIndex = Integer.parseInt(line.replace(DELETE_COMMAND, "")) - 1; // Parse the task index
tasks.deleteTask(taskIndex); // Delete the task
} catch (NumberFormatException | IndexOutOfBoundsException e) {
ui.porFavorMessage("DELETE EXCEPTION: INVALID TASK INDEX");
} catch (NullPointerException e) {
ui.porFavorMessage("DELETE EXCEPTION: NULL TASK INDEX");
}
}

/**
* Finds tasks in the task list that match the search string.
*
* @param tasks The task list to search in.
* @param line The user input line containing the search string.
* @param ui The user interface to display messages.
*/
public static void findCommand(TaskList tasks, String line, UI ui) {
String findString = line.replace(FIND_COMMAND, "");
if (findString.isEmpty()) {
ui.porFavorMessage("FIND EXCEPTION: INVALID TASK INDEX");
return;
}
tasks.findTasksList(findString);
}

/**
* Marks a task as done in the task list based on user input.
*
* @param tasks The task list containing the task to be marked.
* @param line The user input line specifying the task index.
* @param ui The user interface to display messages.
*/
public static void markCommand(TaskList tasks, String line, UI ui) {
try {
int taskIndex = Integer.parseInt(line.replace(MARK_COMMAND, "")) - 1; // Parse the task index
tasks.mark(taskIndex); // Mark the task as done
} catch (NumberFormatException | IndexOutOfBoundsException e) {
ui.porFavorMessage("MARK EXCEPTION: INVALID TASK INDEX");
} catch (NullPointerException e) {
ui.porFavorMessage("MARK EXCEPTION: NULL TASK INDEX");
}
}

/**
* Unmarks a task as not done in the task list based on user input.
*
* @param tasks The task list containing the task to be unmarked.
* @param line The user input line specifying the task index.
* @param ui The user interface to display messages.
*/
public static void unmarkCommand(TaskList tasks, String line, UI ui) {
try {
int taskIndex = Integer.parseInt(line.replace(UNMARK_COMMAND, "")) - 1; // Parse the task index
tasks.unmark(taskIndex); // Unmark the task
} catch (NumberFormatException | IndexOutOfBoundsException e) {
ui.porFavorMessage("UNMARK EXCEPTION: INVALID TASK INDEX");
} catch (NullPointerException e) {
ui.porFavorMessage("UNMARK EXCEPTION: NULL TASK INDEX");
}
}

/**
* Adds a new to-do task to the task list based on user input.
*
* @param tasks The task list to add the to-do task to.
* @param line The user input line containing the to-do details.
* @param ui The user interface to display messages.
*/
public static void addTodoCommand(TaskList tasks, String line, UI ui) {
try {
new ToDo(line.replace(TODO_COMMAND, ""), tasks, true); // Create a new ToDo object
} catch (ToDoConstructorException e) {
ui.porFavorMessage(e.getMessage());
tasks.deleteLatestTask();
}
}

/**
* Adds a new deadline task to the task list based on user input.
*
* @param tasks The task list to add the deadline task to.
* @param line The user input line containing the deadline details.
* @param ui The user interface to display messages.
*/
public static void addDeadlineCommand(TaskList tasks, String line, UI ui) {
try {
new Deadline(line.replace(DEADLINE_COMMAND, ""), tasks, true); // Create a new Deadline object
} catch (DeadlineConstructorException e) {
ui.porFavorMessage(e.getMessage());
tasks.deleteLatestTask();
}
}

/**
* Adds a new event task to the task list based on user input.
*
* @param tasks The task list to add the event task to.
* @param line The user input line containing the event details.
* @param ui The user interface to display messages.
*/
public static void addEventCommand(TaskList tasks, String line, UI ui) {
try {
new Event(line.replace(EVENT_COMMAND, ""), tasks, true); // Create a new Event object
} catch (EventConstructorException e) {
ui.porFavorMessage(e.getMessage());
tasks.deleteLatestTask();
}
}
}
10 changes: 0 additions & 10 deletions src/main/java/Duke.java

This file was deleted.

Loading