org.swiftgantt.model
Class GanttModel

java.lang.Object
  extended by org.swiftgantt.model.GanttModel

public class GanttModel
extends java.lang.Object

Represent the data 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.
 org.swiftgantt.common.Time getDeadline()
          Get deadline of Gantt chart.
 org.swiftgantt.common.Time 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(org.swiftgantt.common.Time deadline)
          Set deadline of Gantt chart.
 void setKickoffTime(org.swiftgantt.common.Time 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 org.swiftgantt.common.Time getDeadline()
Get deadline of Gantt chart.

Returns:
the deadline

setDeadline

public void setDeadline(org.swiftgantt.common.Time deadline)
Set deadline of Gantt chart.

Parameters:
deadline - the deadline to set

getKickoffTime

public org.swiftgantt.common.Time getKickoffTime()
Get kickoff time of Gantt chart.

Returns:
the kickoffTime

setKickoffTime

public void setKickoffTime(org.swiftgantt.common.Time 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 -