Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge V0.5rc ruiwen #125

Merged
merged 11 commits into from
Nov 5, 2016
9 changes: 5 additions & 4 deletions src/main/java/seedu/savvytasker/MainApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ public class MainApp extends Application {
protected Config config;
protected UserPrefs userPrefs;
protected static MainApp instance;

public MainApp() {}

@Override
public void init() throws Exception {
logger.info("=============================[ Initializing Savvy Tasker ]===========================");
super.init();
instance = this;

config = initConfig(getApplicationParameter("config"));
storage = new StorageManager(config.getSavvyTaskerFilePath(), config.getUserPrefsFilePath());

Expand All @@ -69,8 +69,9 @@ public void init() throws Exception {
ui = new UiManager(logic, config, userPrefs);

initEventsCenter();

}

private String getApplicationParameter(String parameterName){
Map<String, String> applicationParameters = getParameters().getNamed();
return applicationParameters.get(parameterName);
Expand Down Expand Up @@ -183,7 +184,7 @@ public void stop() {
System.exit(0);
}

//@@author A0139915W
//@@author A0138431L
@Subscribe
public void handleSavvyTaskerSaveLocationChangedEvent(DataSavingLocationChangedEvent dslce) {
try {
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/seedu/savvytasker/commons/core/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public class Config {
private String savvyTaskerFilePath = "data/savvytasker.xml";
private String savvyTaskerListName = "MyTaskList";


public Config() {
}

Expand Down Expand Up @@ -61,7 +60,6 @@ public void setSavvyTaskerName(String savvyTaskerName) {
this.savvyTaskerListName = savvyTaskerName;
}


@Override
public boolean equals(Object other) {
if (other == this){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import seedu.savvytasker.commons.events.BaseEvent;
import seedu.savvytasker.model.ReadOnlySavvyTasker;

//@@author A0139915W
//@@author A0138431L
/**
* Indicates a change in location of the storage
*/
Expand Down
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(int i, Date date);

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

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

import java.util.Date;
import java.util.List;
import java.util.Stack;
import java.util.logging.Logger;

import com.google.common.eventbus.Subscribe;

import javafx.collections.ObservableList;
import seedu.savvytasker.MainApp;
import seedu.savvytasker.commons.core.ComponentManager;
import seedu.savvytasker.commons.core.EventsCenter;
import seedu.savvytasker.commons.core.LogsCenter;
Expand Down Expand Up @@ -37,7 +37,6 @@
import seedu.savvytasker.model.alias.AliasSymbol;
import seedu.savvytasker.model.task.ReadOnlyTask;
import seedu.savvytasker.storage.Storage;
import seedu.savvytasker.ui.Ui;

/**
* The main LogicManager of the app.
Expand Down Expand Up @@ -96,16 +95,37 @@ 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(int i, Date date) {
return model.getFilteredDailyTasks(i, date);
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import seedu.savvytasker.commons.events.storage.DataSavingLocationChangedEvent;
import seedu.savvytasker.model.ReadOnlySavvyTasker;


//@@author A0138431L
/**
* Changes the storage location of Savvy Tasker
*/
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/seedu/savvytasker/logic/parser/TaskFieldParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,19 @@ protected String parseDescription(String descriptionText) throws ParseException
return null;
return descriptionText.trim();
}
//@@author

//@@author A0138431L
public String parsefilePath(String filePathText) throws ParseException {
if (filePathText == null)
return null;
return filePathText.trim();
}

public String parsefileName(String fileNameText) throws ParseException {
if (fileNameText == null)
return null;
return fileNameText.trim();
}
//@@author
}
30 changes: 30 additions & 0 deletions src/main/java/seedu/savvytasker/model/Model.java
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 @@ -80,4 +81,33 @@ public interface Model {

/** Gets the number of aliases */
int getAliasSymbolCount();

//@@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(int dayOfWeek, 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(int i);

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