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 GanttModel

    java.lang.Object
      com.yuxingwang.gantt.model.GanttModel

    public class GanttModel

extends java.lang.Object

Represent the model of the `GanttChart`, consist of KickOffTime, Deadline and a `TaskTreeModel`.

Version:
  1.0
Author:
  Yuxing Wang

Constructor Summary
`GanttModel()`

Method Summary
`void` | `addGanttModelListener(GanttModelListener l)` Add listener for Gantt chart model changes.
`void` | `addTask(Task task)` Add Task to the root node of TaskTreeModel inside the GanttModel.
`void` | `addTask(Task[] tasks)` Add Tasks to the root node of TaskTreeModel inside the GanttModel.
`java.util.Calendar` | `getDeadline()` Get deadline of Gantt chart.
`java.util.Calendar` | `getKickoffTime()` Get kickoff time of Gantt chart.
`int[]` | `getSelectedIds()` Get IDs of selected tasks.
`Task` | `getTask(int id)` Get task by task ID.
`java.util.List<Task>` | `getTasksByBFS()` Get all tasks by Breadth-First-Search principle.
`java.util.List<Task>` | `getTasksByDFS()` Get all tasks by Depth-First-Search principle.
`TaskTreeModel` | `getTaskTreeModel()` Get `TaskTreeModel`.
`void` | `recalculate()` Recaculate something that needs for displaying.
`void` | `removeAll()` Remove all tasks from Gantt chart.
`void` | `removeTask(Task task)` Remove task from the Gantt chart model.
`void` | `setDeadline(java.util.Calendar deadline)` Set deadline of Gantt chart.
`void` | `setKickoffTime(java.util.Calendar kickoffTime)` Set kickoff time of Gantt chart.
`void` | `setSelectedIds(int[] selectedIds)` Set IDs of selected tasks.

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

Constructor Detail

### GanttModel

    public GanttModel()

Method Detail

### addTask

    public void addTask(Task[] tasks)

  Add Tasks to the root node of TaskTreeModel inside the GanttModel.

  Parameters:
    `tasks` -

### addTask

    public void addTask(Task task)

  Add Task to the root node of TaskTreeModel inside the GanttModel.

  Parameters:
    `task` -

### getTask

    public Task getTask(int id)

  Get task by task ID.

  Parameters:
    `id` -
  Returns:

### getTasksByDFS

    public java.util.List<Task> getTasksByDFS()

  Get all tasks by Depth-First-Search principle.

  Returns:

### getTasksByBFS

    public java.util.List<Task> getTasksByBFS()

  Get all tasks by Breadth-First-Search principle.

  Returns:

### removeTask

    public void removeTask(Task task)

  Remove task from the Gantt chart model.

  Parameters:
    `task` -

### removeAll

    public void removeAll()

  Remove all tasks from Gantt chart.

### recalculate

    public void recalculate()

  Recaculate something that needs for displaying.

### addGanttModelListener

    public void addGanttModelListener(GanttModelListener l)

  Add listener for Gantt chart model changes.

  Parameters:
    `l` -

### getDeadline

    public java.util.Calendar getDeadline()

  Get deadline of Gantt chart.

  Returns:
    the deadline

### setDeadline

    public void setDeadline(java.util.Calendar deadline)

  Set deadline of Gantt chart.

  Parameters:
    `deadline` - the deadline to set

### getKickoffTime

    public java.util.Calendar getKickoffTime()

  Get kickoff time of Gantt chart.

  Returns:
    the kickoffTime

### setKickoffTime

    public void setKickoffTime(java.util.Calendar kickoffTime)

  Set kickoff time of Gantt chart.

  Parameters:
    `kickoffTime` - the kickoffTime to set

### getTaskTreeModel

    public TaskTreeModel getTaskTreeModel()

  Get `TaskTreeModel`.

  Returns:
    the taskList

### getSelectedIds

    public int[] getSelectedIds()

  Get IDs of selected tasks.

  Returns:

### setSelectedIds

    public void setSelectedIds(int[] selectedIds)

  Set IDs of selected tasks.

  Parameters:
    `selectedIds` -

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