Android Open Source - Tree-Task Task






From Project

Back to project page Tree-Task.

License

The source code is released under:

Apache License

If you think the Android project Tree-Task listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.ghsoft.treetask;
/* w  w  w  . j a v  a2  s.c o  m*/
import java.io.Serializable;
import java.util.Date;

public abstract class Task implements Serializable {

  private static final long serialVersionUID = 1L;
  public static final int maxNameLen = 3000;
  public static final int maxDescriptionLen = 50000;
  private String name, description;
  private Date timeStamp;
  private Task parent;
  private TaskHead head;
  private int color;
  private boolean useColor;
  private int weight;
  private Date deadline;

  public Task(Task parent) {
    this.parent = parent;
    this.head = parent.getHead();
  }

  public Task(TaskHead head) {
    this.parent = null;
    this.head = head;
    this.weight = 1;
  }

  public abstract int completion();

  public boolean hasChildren() {
    return subTaskCount() != 0;
  }

  public abstract int subTaskCount();

  public boolean setName(String name) {
    if (name.length() <= maxNameLen) {
      this.name = name;
      return true;
    }
    return false;
  }

  public boolean setDescription(String description) {
    if (description.length() <= maxDescriptionLen) {
      this.description = description;
      return true;
    }
    return false;
  }
  
  public void setColor(int color) {
    this.color = color;
    this.useColor = true;
  }
  
  public int getColor() {
    return this.color;
  }
  
  public void setUseColor(boolean useColor) {
    this.useColor = useColor;
  }
  
  public boolean getUseColor() {
    return useColor;
  }
  
  public Date getDeadline() {
    return deadline;
  }
  
  public void setDeadline(Date deadline) {
    this.deadline = deadline;
  }
  
  public int getWeight() {
    if (this.weight < 1) {
      this.weight = 1;
    }
    return this.weight;
  }
  
  public void setWeight(int weight) {
    this.weight = weight;
  }

  public String getName() {
    if (name == null)
      return "";
    else
      return name;
  }

  public String getDescription() {
    if (description == null)
      return "";
    else
      return description;
  }
  
  public Date getTimeStamp() {
    return timeStamp;
  }
  
  public void setTimeStamp(Date timeStamp) {
    this.timeStamp = timeStamp;
  }

  public Task getParent() {
    return parent;
  }

  public void setParent(Task p) {
    this.parent = p;
  }

  public boolean isHead() {
    return parent == null;
  }

  public String getPath() {
    if (!isHead()) {
      return parent.getPath() + " > " + this.name;
    }
    return this.name;
  }

  public TaskHead getHead() {
    return head;
  }

}




Java Source Code List

com.ghsoft.treetask.MetaData.java
com.ghsoft.treetask.TaskDummy.java
com.ghsoft.treetask.TaskHead.java
com.ghsoft.treetask.TaskLeaf.java
com.ghsoft.treetask.TaskManager.java
com.ghsoft.treetask.TaskNode.java
com.ghsoft.treetask.Task.java
com.ghsoft.treetask.TextTreeBuilder.java
com.ghsoft.treetaskapp.About.java
com.ghsoft.treetaskapp.EditTask.java
com.ghsoft.treetaskapp.ExportView.java
com.ghsoft.treetaskapp.HtmlTreeBuilder.java
com.ghsoft.treetaskapp.MainListItem.java
com.ghsoft.treetaskapp.MainViewFragment.java
com.ghsoft.treetaskapp.Main.java
com.ghsoft.treetaskapp.ModifyTaskActivity.java
com.ghsoft.treetaskapp.NewTask.java
com.ghsoft.treetaskapp.NewTreeTask.java
com.ghsoft.treetaskapp.NewTreeView.java
com.ghsoft.treetaskapp.Settings.java
com.ghsoft.treetaskapp.TaskViewListItem.java
com.ghsoft.treetaskapp.TaskView.java
com.ghsoft.treetaskapp.TreeTaskProgressBar.java
com.ghsoft.treetaskapp.TreeView.java