Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.yuxingwang.gantt.model
Class Task

    java.lang.Object
      javax.swing.tree.DefaultMutableTreeNode
          com.yuxingwang.gantt.model.BaseTask<Task>
              com.yuxingwang.gantt.model.Task

All Implemented Interfaces:
  com.yuxingwang.gantt.event.PredecessorChangeListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

    public final class Task

extends BaseTask<Task>
implements com.yuxingwang.gantt.event.PredecessorChangeListener

A `Task` is an object that represent a task in project, it is task node in the tasks tree.

Version:
  1.0
Author:
  Yuxing Wang
See Also:
  Serialized Form

Field Summary

Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
`EMPTY_ENUMERATION`

Constructor Summary
`Task()`
`Task(java.lang.String name, java.util.Calendar startTime, java.util.Calendar endTime)`
`Task(java.lang.String name, java.util.Calendar startTime, java.util.Calendar endTime, int progress)`
`Task(java.lang.String name, java.util.Calendar startTime, java.util.Calendar endTime, java.util.List<Task> predecessors)`
`Task(java.lang.String name, java.lang.String description, java.util.Calendar startTime, java.util.Calendar endTime, int progress, java.util.List<Task> predecessors)`

Method Summary
`void` | `adjustActualTimesByPredecessor()` Adjust actual start and end time by it's latest predecessor.
`int` | `calcProgressSteps()` Calculate displaying progress steps by task progress.
`int` | `calcTaskSteps()` Calculate how many steps for this task in Gantt chart.
`void` | `copy(Task sourceTask)` Copy content from given source task
`java.util.Calendar` | `getActualEnd()` Get actual end time of this task.
`java.util.Calendar` | `getActualStart()` Get actual start time of this task.
`int` | `getDuration()` Get duration of this `Task`, exclude the rest-out time.
`Task` | `getEarliestSubTask()` Get the sub-task, who has the earliest end time, in the sub-task tree.
`Task` | `getEarliestTask()` Get the sub-task, who has the earliest end time, in the sub-task tree include myself.
`java.util.Calendar` | `getEnd()` Get end time of this `Task`.
`Task` | `getLatestSubTask()` Get the last task, who has the latest end time, in the sub task tree.
`Task` | `getLatestTask()` Get the last task, who has the latest end time, in the sub task tree include myself.
`int` | `getProgress()` Get progress of this `Task`.
`java.util.Calendar` | `getStart()` Get start time of this `Task`.
`void` | `predecessorChanged(com.yuxingwang.gantt.event.PredecessorChangeEvent e)` Handler the predecessor changes event.
`void` | `setEnd(java.util.Calendar end)` Set end time of this `Task`.
`void` | `setProgress(int progress)` Set progress of this `Task`.
`void` | `setStart(java.util.Calendar start)` Set start time of this `Task`.
`java.lang.String` | `toSimpleString()` Task Name + Actual start and end time.
`java.lang.String` | `toString()` The information about this Task.

Methods inherited from class com.yuxingwang.gantt.model.BaseTask
`add, add, addPredecessor, addPredecessorChangeListener, addPropertyChangeListener, getBackcolor, getChildren, getDescription, getId, getLevel, getName, getPredecessors, getTasksCount, removePredecessorChangeListener, removePropertyChangeListener, setBackcolor, setDescription, setId, setName`

Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
`add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Task

    public Task()

### Task

    public Task(java.lang.String name,
                java.util.Calendar startTime,
                java.util.Calendar endTime)

### Task

    public Task(java.lang.String name,
                java.util.Calendar startTime,
                java.util.Calendar endTime,
                int progress)

### Task

    public Task(java.lang.String name,
                java.util.Calendar startTime,
                java.util.Calendar endTime,
                java.util.List<Task> predecessors)

### Task

    public Task(java.lang.String name,
                java.lang.String description,
                java.util.Calendar startTime,
                java.util.Calendar endTime,
                int progress,
                java.util.List<Task> predecessors)

Method Detail

### copy

    public void copy(Task sourceTask)

  Copy content from given source task

### getEarliestSubTask

    public Task getEarliestSubTask()

  Get the sub-task, who has the earliest end time, in the sub-task tree.

  Returns:

### getEarliestTask

    public Task getEarliestTask()

  Get the sub-task, who has the earliest end time, in the sub-task tree include myself.

  Returns:

### getLatestSubTask

    public Task getLatestSubTask()

  Get the last task, who has the latest end time, in the sub task tree.

  Returns:

### getLatestTask

    public Task getLatestTask()

  Get the last task, who has the latest end time, in the sub task tree include myself.

  Returns:

### calcTaskSteps

    public int calcTaskSteps()

  Calculate how many steps for this task in Gantt chart.

  Parameters:
    `task` -
  Returns:

### calcProgressSteps

    public int calcProgressSteps()

  Calculate displaying progress steps by task progress.

  Parameters:
    `start` -
    `progress` -
  Returns:

### getDuration

    public int getDuration()

  Get duration of this `Task`, exclude the rest-out time.

  Returns:
    the duration

### getProgress

    public int getProgress()

  Get progress of this `Task`. If progress exceeds the task duration, it will be limited within the duration.

  Returns:
    the progress

### setProgress

    public void setProgress(int progress)

  Set progress of this `Task`.

  Parameters:
    `progress` - the progress to set

### getStart

    public java.util.Calendar getStart()

  Get start time of this `Task`.

  Returns:
    the start

### setStart

    public void setStart(java.util.Calendar start)

  Set start time of this `Task`.

  Parameters:
    `start` - the start to set

### predecessorChanged

    public void predecessorChanged(com.yuxingwang.gantt.event.PredecessorChangeEvent e)

  Handler the predecessor changes event.

  Specified by:
    `predecessorChanged` in interface `com.yuxingwang.gantt.event.PredecessorChangeListener`

### adjustActualTimesByPredecessor

    public void adjustActualTimesByPredecessor()

  Adjust actual start and end time by it's latest predecessor.

### getActualStart

    public java.util.Calendar getActualStart()

  Get actual start time of this task.

  Returns:

### getEnd

    public java.util.Calendar getEnd()

  Get end time of this `Task`.

  Returns:
    the end

### setEnd

    public void setEnd(java.util.Calendar end)

  Set end time of this `Task`.

  Parameters:
    `end` - the end to set

### getActualEnd

    public java.util.Calendar getActualEnd()

  Get actual end time of this task.

  Returns:

### toString

    public java.lang.String toString()

  The information about this Task.

  Overrides:
    `toString` in class `javax.swing.tree.DefaultMutableTreeNode`

### toSimpleString

    public java.lang.String toSimpleString()

  Task Name + Actual start and end time.

  Returns:

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD