Added TaskPresenter, render it. Added Date setters/getters.

Change-Id: Ic97f1b08a82dc66faebf0578cffd5ff4f5971632
diff --git a/TaskManager/src/funcTest/java/edu/wpi/cs/wpisuitetng/modules/taskmanager/models/TaskTest.java b/TaskManager/src/funcTest/java/edu/wpi/cs/wpisuitetng/modules/taskmanager/models/TaskTest.java
index 37fe637..cb3e107 100644
--- a/TaskManager/src/funcTest/java/edu/wpi/cs/wpisuitetng/modules/taskmanager/models/TaskTest.java
+++ b/TaskManager/src/funcTest/java/edu/wpi/cs/wpisuitetng/modules/taskmanager/models/TaskTest.java
@@ -19,6 +19,7 @@
 	User Keenan;
 	User Yihao;
 	List<User> testList;
+	Date testDate;
 	TaskModel t1;
 	TaskModel t2;
 	TaskModel t3;
@@ -30,8 +31,9 @@
 		testList = new ArrayList();
 		testList.add(Keenan);
 		testList.add(Yihao);
+		testDate = new Date(114, 11, 18);
 		t1 = new TaskModel();
-		t2 = new TaskModel(1928, "TaskTwo","This is task two", 400);
+		t2 = new TaskModel(1928, "TaskTwo","This is task two", 400, testDate);
 		t3 = new TaskModel();
 		t3.setId(2000);
 		t3.setTitle("TaskThree");
diff --git a/TaskManager/src/main/java/edu/wpi/cs/wpisuitetng/modules/taskmanager/TaskManager.java b/TaskManager/src/main/java/edu/wpi/cs/wpisuitetng/modules/taskmanager/TaskManager.java
index 0a61b72..b8ebae1 100644
--- a/TaskManager/src/main/java/edu/wpi/cs/wpisuitetng/modules/taskmanager/TaskManager.java
+++ b/TaskManager/src/main/java/edu/wpi/cs/wpisuitetng/modules/taskmanager/TaskManager.java
@@ -10,22 +10,19 @@
 
 package edu.wpi.cs.wpisuitetng.modules.taskmanager;
 
-import java.awt.event.ActionEvent;
-import java.text.DateFormat;
-import java.text.ParseException;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.List;
+import java.util.Date;
 
 import javax.swing.ImageIcon;
 import javax.swing.JPanel;
 
 import edu.wpi.cs.wpisuitetng.janeway.modules.IJanewayModule;
 import edu.wpi.cs.wpisuitetng.janeway.modules.JanewayTabModel;
+import edu.wpi.cs.wpisuitetng.modules.taskmanager.presenter.TaskPresenter;
+import edu.wpi.cs.wpisuitetng.modules.taskmanager.model.TaskModel;
 import edu.wpi.cs.wpisuitetng.modules.taskmanager.view.TaskView;
 
-// Remove this comment Blah
-
 /**
  * This is the main class for the WPI Suite TM module for Janeway.
  *
@@ -36,7 +33,7 @@
 {
   /** A list containing the one tab */
   private List<JanewayTabModel> tabs;
-  
+
   public TaskManager() {
     JPanel toolbarPanel = new JPanel();
     JPanel mainPanel = new JPanel();
@@ -45,35 +42,23 @@
     this.tabs = new ArrayList<JanewayTabModel>();
     this.tabs.add(new JanewayTabModel("Task Manager", new ImageIcon(),
         toolbarPanel, mainPanel));
-    
+
     String title = "Duck";
     int effort = 100;
     String description = "Add a duck";
     Date dueDate = new Date(114, 11, 18);
-    
-    final TaskView taskView = new TaskView(title, effort, description, dueDate);
+
+    final TaskModel taskModel = new TaskModel(1, title, description, effort, dueDate);
+
+    final TaskPresenter taskPresenter = new TaskPresenter(taskModel);
+
+    final TaskView taskView = taskPresenter.getView();
     mainPanel.add(taskView);
-    
-    taskView.addOnSaveListener((ActionEvent action) -> {
-        System.out.println("Save");
-        System.out.println(taskView.getTitleText());
-        System.out.println(taskView.getEstimatedEffort());
-        System.out.println(taskView.getDescriptionText());
-    });
-    
-    taskView.addOnReloadListener((ActionEvent action) -> {
-        System.out.println("Reload");
-        taskView.setTitleText(title);
-        taskView.setEstimatedEffort(effort);
-        taskView.setDescriptionText(description);
-        taskView.setDueDate(dueDate);
-    });
   }
 
   /**
    * @return The name of the module ("Task Manager")
    */
-  @Override
   public String getName()
   {
     return "Task Manager";
@@ -82,10 +67,8 @@
   /**
    * {@inheritDoc}
    */
-  @Override
   public List<JanewayTabModel> getTabs()
   {
     return this.tabs;
   }
-
 }
diff --git a/TaskManager/src/main/java/edu/wpi/cs/wpisuitetng/modules/taskmanager/model/TaskModel.java b/TaskManager/src/main/java/edu/wpi/cs/wpisuitetng/modules/taskmanager/model/TaskModel.java
index 43e4749..c2a1a0b 100644
--- a/TaskManager/src/main/java/edu/wpi/cs/wpisuitetng/modules/taskmanager/model/TaskModel.java
+++ b/TaskManager/src/main/java/edu/wpi/cs/wpisuitetng/modules/taskmanager/model/TaskModel.java
@@ -32,7 +32,7 @@
 	private Date dueDate;
 	//private List<events> Activities; 
 	//private List<Task> dependencies;
-	
+
 	/**
 	 * Constructor for a default Task object
 	 * 
@@ -52,14 +52,14 @@
 	 * @param ID the unique id of the Task
 	 * @param title the title of the Task
 	 * @param description the description of the Task
-	
 	 */
-	public TaskModel(int id, String title, String description, int estimatedEffort) {
+	public TaskModel(int id, String title, String description, int estimatedEffort, Date dueDate) {
 		this();
 		this.ID = id;
 		this.title = title;
 		this.description = description;
 		this.estimatedEffort = estimatedEffort;
+		this.dueDate = dueDate;
 	}
 
 	/**
@@ -89,7 +89,7 @@
 	public void setTitle(String title) {
 		this.title = title;
 	}
-	
+
 	/**
 	 * @return the description of this Task
 	 */
@@ -103,22 +103,35 @@
 	public void setDescription(String description) {
 		this.description = description;
 	}
-		
+	
 	/**
 	 * @return the list of users assigned to this Task
 	 */
 	public List<User> getAssignedTo() {
 		return assignedTo;
 	}
-	
+
 	/**
 	 * @param user adds a user to the list of assigned users
 	 */
 	public void setAssignedTo(User user){
-		this.assignedTo.add(user);
-		
+		this.assignedTo.add(user);	
 	}
-		
+
+	/**
+	 * @return the due date of this Task
+	 */
+	public Date getDueDate() {
+		return dueDate;
+	}
+
+	/**
+	 * @param Sets the due date to the given date.
+	 */
+	public void setDueDate(Date dueDate){
+		this.dueDate = dueDate;	
+	}
+
 	/**
 	 * Converts this Task to a JSON string
 	 * @return a string in JSON representing this Task
@@ -129,7 +142,7 @@
 		json = gson.toJson(this, TaskModel.class);
 		return json;
 	}
-	
+
 	/**
 	 * Converts the given list of Task to a JSON string
 	 * @param tlist a list of Task
@@ -142,7 +155,6 @@
 		return json;
 	}
 
-	@Override
 	public Boolean identify(Object o) {
 		Boolean returnValue = false;
 		if(o instanceof TaskModel && ID == ((TaskModel) o).getID()){
@@ -154,16 +166,12 @@
 			return returnValue;
 	}
 
-	@Override
 	public void save() {
 		// TODO Auto-generated method stub
-		
 	}
 
-	@Override
 	public void delete() {
 		// TODO Auto-generated method stub
-		
 	}
 
 	/**
@@ -172,7 +180,7 @@
 	public int getEstimatedEffort() {
 		return estimatedEffort;
 	}
-	
+
 	/**
 	 * @param EstimatedEffort of Task
 	 */
diff --git a/TaskManager/src/main/java/edu/wpi/cs/wpisuitetng/modules/taskmanager/presenter/TaskPresenter.java b/TaskManager/src/main/java/edu/wpi/cs/wpisuitetng/modules/taskmanager/presenter/TaskPresenter.java
new file mode 100644
index 0000000..5e2a2de
--- /dev/null
+++ b/TaskManager/src/main/java/edu/wpi/cs/wpisuitetng/modules/taskmanager/presenter/TaskPresenter.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2014 -- WPI Suite
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ ******************************************************************************/
+
+package edu.wpi.cs.wpisuitetng.modules.taskmanager.presenter;
+
+import edu.wpi.cs.wpisuitetng.modules.taskmanager.model.TaskModel;
+import edu.wpi.cs.wpisuitetng.modules.taskmanager.view.TaskView;
+
+import java.util.Date;
+
+/**
+ * This class creates a TaskView and updates the task with
+ * new information from the database. This lets you modify the task,
+ * and will let the user modify it as well.
+ */
+public class TaskPresenter {
+
+    	/** View for the task. */
+	private final TaskView view;
+	/** Model for the task. */
+	private final TaskModel model;
+
+	/**
+	 * Constructs a TaskPresenter for the given model. Constructs the
+	 * view offscreen, available if you call getView().
+	 * @param model model to copy
+	 */
+	public TaskPresenter(TaskModel model) {
+		this.model = model;
+		view = new TaskView(model.getTitle(), model.getEstimatedEffort(),
+		                    model.getDescription(), new Date(114, 11, 18));
+	}
+
+	/**
+	 * Get the view for this Task.
+	 * @return This provider's view.
+	 */
+	public TaskView getView() {
+		return view;
+	}
+
+	/**
+	 * Get the model for this class.
+	 * @return This provider's model.
+	 */
+	public TaskModel getModel() {
+	    return model;
+	}
+}