Skip to content

Commit

Permalink
Generate overdue, floating, daily and upcoming list in model manager …
Browse files Browse the repository at this point in the history
…and load them in mainWindow
  • Loading branch information
ruiwen905 committed Nov 2, 2016
1 parent 28ed6d8 commit 5624ef3
Show file tree
Hide file tree
Showing 6 changed files with 711 additions and 151 deletions.
19 changes: 17 additions & 2 deletions src/main/java/seedu/savvytasker/logic/Logic.java
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package seedu.savvytasker.logic;

import java.util.Date;

import javafx.collections.ObservableList;
import seedu.savvytasker.logic.commands.CommandResult;
import seedu.savvytasker.model.alias.AliasSymbol;
import seedu.savvytasker.logic.commands.CommandResult;
import seedu.savvytasker.model.task.ReadOnlyTask;

/**
Expand All @@ -18,10 +20,23 @@ public interface Logic {

/** Returns the filtered list of tasks */
ObservableList<ReadOnlyTask> getFilteredTaskList();

/** Returns the filtered list of alias symbol */
ObservableList<AliasSymbol> getAliasSymbolList();

/** */
boolean canParseHeader(String keyword);

/** Returns the list of tasks that are overdue */
ObservableList<ReadOnlyTask> getFilteredOverdueTasks();

/** Returns the list of floating tasks */
ObservableList<ReadOnlyTask> getFilteredFloatingTasks();

/** Returns the list of tasks on a specific day */
ObservableList<ReadOnlyTask> getFilteredDailyTasks(Date date);

/** Returns the list of tasks that occur after the selected week */
ObservableList<ReadOnlyTask> getFilteredUpcomingTasks(Date date);

}
27 changes: 24 additions & 3 deletions src/main/java/seedu/savvytasker/logic/LogicManager.java
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package seedu.savvytasker.logic;

import java.util.Date;
import java.util.List;
import java.util.Stack;
import java.util.logging.Logger;
Expand Down Expand Up @@ -92,18 +93,38 @@ else if (command.canUndo()){

return result;
}

//@@author A0139915W
@Override
public ObservableList<ReadOnlyTask> getFilteredTaskList() {
return model.getFilteredTaskList();
}

@Override
public ObservableList<AliasSymbol> getAliasSymbolList() {
return parser.getAliasSymbolList();
}
}
//@@author

//@@author A0138431L
@Override
public ObservableList<ReadOnlyTask> getFilteredOverdueTasks() {
return model.getFilteredOverdueTasks();
}

@Override
public ObservableList<ReadOnlyTask> getFilteredFloatingTasks() {
return model.getFilteredFloatingTasks();
}

@Override
public ObservableList<ReadOnlyTask> getFilteredDailyTasks(Date date) {
return model.getFilteredDailyTasks(date);
}

@Override
public ObservableList<ReadOnlyTask> getFilteredUpcomingTasks(Date date) {
return model.getFilteredUpcomingTasks(date);
}

//@@author A0139916U
private void registerAllDefaultCommandParsers() {
Expand Down
30 changes: 30 additions & 0 deletions src/main/java/seedu/savvytasker/model/Model.java
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package seedu.savvytasker.model;

import java.util.LinkedList;
import java.util.Date;

import seedu.savvytasker.commons.core.UnmodifiableObservableList;
import seedu.savvytasker.model.alias.AliasSymbol;
Expand Down Expand Up @@ -77,4 +78,33 @@ public interface Model {

/** Removes an the given AliasSymbol. */
void removeAliasSymbol(AliasSymbol symbol) throws SymbolKeywordNotFoundException;

//@@author A0138431L
/** Returns the filtered task list of overdue task as an {@code UnmodifiableObservableList<ReadOnlyTask>}
* as of current date */
UnmodifiableObservableList<ReadOnlyTask> getFilteredOverdueTasks();

/** Returns the filtered task list of floating task as an {@code UnmodifiableObservableList<ReadOnlyTask>} */
UnmodifiableObservableList<ReadOnlyTask> getFilteredFloatingTasks();

/** Returns the filtered task list of daily task as an {@code UnmodifiableObservableList<ReadOnlyTask>}
* as of expected date */
UnmodifiableObservableList<ReadOnlyTask> getFilteredDailyTasks(Date date);

/** Returns the filtered task list of upcoming task as an {@code UnmodifiableObservableList<ReadOnlyTask>}
* as of expected date */
UnmodifiableObservableList<ReadOnlyTask> getFilteredUpcomingTasks(Date date);

/** Updates the filter of the filtered task list to show all overdue tasks */
void updateFilteredListToShowOverdue();

/** Updates the filter of the filtered task list to show all floating tasks */
void updateFilteredListToShowFloating();

/** Updates the filter of the filtered task list to show all tasks of the selected week*/
void updateFilteredListToShowDaily();

/** Updates the filter of the filtered task list to show all upcoming tasks after the selected week*/
void updateFilteredListToShowUpcoming();
//@@author
}
Loading

0 comments on commit 5624ef3

Please sign in to comment.