net.sourceforge.ganttproject
Class GanttTask

java.lang.Object
  |
  +--net.sourceforge.ganttproject.GanttTask
All Implemented Interfaces:
java.io.Serializable

public class GanttTask
extends java.lang.Object
implements java.io.Serializable

Class that generate a task

See Also:
Serialized Form

Field Summary
static int HIGHT
           
static int LOW
           
static int NORMAL
           
 
Constructor Summary
GanttTask(java.lang.String name, GanttCalendar start, int length)
          Constructor
 
Method Summary
 void addNotes(java.lang.String note)
          Add notes
 void addPredecessor(GanttTaskRelationship predecessor)
          add one predecessor
 void addSuccessor(GanttTaskRelationship successor)
          add one successor
 void cleanUsers()
           
 GanttTask Clone()
          clone the GanttTask
 boolean colorDefined()
          Allows to determine, if a special color is defined for this task.
 java.util.Hashtable findUser(HumanResource user)
          Looks for a given user object in this task.
 boolean getBilan()
          Is it a meeting point??
 java.awt.Color getColor()
           
 GanttCalendar getEnd()
          Return the end date
 java.lang.String getID()
          return the identity of the task
 int getLength()
          Return the duration
 java.lang.String getName()
           
 java.lang.String getNotes()
          Return the notes
 int getPercent()
          Return the state
 java.util.Vector getPredecessors()
           
 int getPriority()
          Return the priority of the task
 ShapePaint getShape()
          Return the shape of the task
 GanttCalendar getStart()
          Return the begining
 java.util.Vector getSuccessors()
          get all the successors
static GanttTask getTaskByTaskID(int taskID)
          max ID in the allTasksMap
 int getTaskID()
           
 java.util.ArrayList getUserNames()
           
 java.util.ArrayList getUsersList()
          Return the list of the user assigned to
 void indentID(java.lang.String parent)
          Indent the id of the task
 boolean isChecked()
          return true if the realtionship between this task and others has been checked
 boolean isIn(HumanResource user)
           
 java.lang.String nextID()
          Return the next id of the task
 java.lang.String prevID()
          Return the previous id of the task
 void refreshDateAndAdvancement(GanttTree tree)
          This function calculate the begin of a task in function of the sub taks.
 void removePredecessor(GanttTaskRelationship r)
           
 void removeSuccessor(GanttTaskRelationship r)
           
 void removeUser(HumanResource user)
          Remove the user u_name from the task's user list
 void replaceOldSuccessor(GanttTaskRelationship oldRel, GanttTaskRelationship newRel)
          supposed method that replaces checkDepend(String t, String n) replace the old successor (oldRel) with new one (newRel)
 void setBilan(boolean b)
          Change meeting point
 void setChecked(boolean checked)
          set the checked state of task: true if the relationship has been check. or else, false
 void setColor(java.awt.Color color)
           
 void setEnd(GanttCalendar e)
          Change the end of the date and the length indead
 void setID(java.lang.String newID)
          Change the identity of the task
 void setLength(int l)
          Change the duration
 void setName(java.lang.String name)
          Change the name
 void setNotes(java.lang.String note)
          Change notes
 void setPercent(int percent)
          Change state
 void setPredecessors(java.util.Vector predecessors)
          set all the predecessors
 void setPriority(int p)
          Set the priority for the task
 void setResources(java.util.ArrayList resources)
           
 void setShape(ShapePaint newShape)
          Set a new shape for the task
 void setStart(GanttCalendar s)
          Change the begining
 void setSuccessors(java.util.Vector successors)
          set all the successors
 void setTaskID(int taskID)
          set the task ID. the uniquness of ID should be check before using this method
 boolean shapeDefined()
          Allows to determine, if a special shape is defined for this task.
 void taskUser(HumanResource user, int load)
          This adds a user to a task.
 java.lang.String toString()
          Return the name.
 void unlink()
          Unlink the task from all relashionship
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOW

public static int LOW

NORMAL

public static int NORMAL

HIGHT

public static int HIGHT
Constructor Detail

GanttTask

public GanttTask(java.lang.String name,
                 GanttCalendar start,
                 int length)
Constructor

Method Detail

Clone

public GanttTask Clone()
clone the GanttTask

Returns:

toString

public java.lang.String toString()
Return the name.

Overrides:
toString in class java.lang.Object

getName

public java.lang.String getName()

getID

public java.lang.String getID()
return the identity of the task


setID

public void setID(java.lang.String newID)
Change the identity of the task


indentID

public void indentID(java.lang.String parent)
Indent the id of the task


nextID

public java.lang.String nextID()
Return the next id of the task


prevID

public java.lang.String prevID()
Return the previous id of the task


getShape

public ShapePaint getShape()
Return the shape of the task


setShape

public void setShape(ShapePaint newShape)
Set a new shape for the task


getLength

public int getLength()
Return the duration


shapeDefined

public boolean shapeDefined()
Allows to determine, if a special shape is defined for this task.

Returns:
true, if this task has its own shape defined.

getStart

public GanttCalendar getStart()
Return the begining


getEnd

public GanttCalendar getEnd()
Return the end date


getNotes

public java.lang.String getNotes()
Return the notes


getPercent

public int getPercent()
Return the state


getBilan

public boolean getBilan()
Is it a meeting point??


getPriority

public int getPriority()
Return the priority of the task


setName

public void setName(java.lang.String name)
Change the name


setLength

public void setLength(int l)
Change the duration


setStart

public void setStart(GanttCalendar s)
Change the begining


setEnd

public void setEnd(GanttCalendar e)
Change the end of the date and the length indead


setNotes

public void setNotes(java.lang.String note)
Change notes


addNotes

public void addNotes(java.lang.String note)
Add notes


setPercent

public void setPercent(int percent)
Change state


setBilan

public void setBilan(boolean b)
Change meeting point


setPriority

public void setPriority(int p)
Set the priority for the task


replaceOldSuccessor

public void replaceOldSuccessor(GanttTaskRelationship oldRel,
                                GanttTaskRelationship newRel)
supposed method that replaces checkDepend(String t, String n) replace the old successor (oldRel) with new one (newRel)

Parameters:
oldRel - old successor
newRel - new relationship

refreshDateAndAdvancement

public void refreshDateAndAdvancement(GanttTree tree)
This function calculate the begin of a task in function of the sub taks.


getUsersList

public java.util.ArrayList getUsersList()
Return the list of the user assigned to


taskUser

public void taskUser(HumanResource user,
                     int load)
This adds a user to a task. The method creates a Hashtable and places this into an ArrayList. This is for now and will be changed to be more convenient in the future for other developers. barmeier

Parameters:
user - is the HumanResource object that represents a user.
load - is the load this task produes on the resource represented through the user object.

removeUser

public void removeUser(HumanResource user)
Remove the user u_name from the task's user list


findUser

public java.util.Hashtable findUser(HumanResource user)
Looks for a given user object in this task. If the user is assigned to this task the method returns the Hashtable where the additional informations like load,... are stored.

Parameters:
user - the user the method should search for
Returns:
the hashtable where the users additional informations concerning this task are stored. The method returns null if the user could not be found. Be aware of Nullpointer Exceptions ;)

cleanUsers

public void cleanUsers()

getUserNames

public java.util.ArrayList getUserNames()

isIn

public boolean isIn(HumanResource user)

getColor

public java.awt.Color getColor()
Returns:
Color of this task

setColor

public void setColor(java.awt.Color color)
Parameters:
color - New color for this task or null for default color

colorDefined

public boolean colorDefined()
Allows to determine, if a special color is defined for this task.

Returns:
true, if this task has its own color defined.

getSuccessors

public java.util.Vector getSuccessors()
get all the successors


setSuccessors

public void setSuccessors(java.util.Vector successors)
set all the successors


addSuccessor

public void addSuccessor(GanttTaskRelationship successor)
add one successor


setPredecessors

public void setPredecessors(java.util.Vector predecessors)
set all the predecessors


setResources

public void setResources(java.util.ArrayList resources)

addPredecessor

public void addPredecessor(GanttTaskRelationship predecessor)
add one predecessor


getPredecessors

public java.util.Vector getPredecessors()

unlink

public void unlink()
Unlink the task from all relashionship


removeSuccessor

public void removeSuccessor(GanttTaskRelationship r)

removePredecessor

public void removePredecessor(GanttTaskRelationship r)

isChecked

public boolean isChecked()
return true if the realtionship between this task and others has been checked


setChecked

public void setChecked(boolean checked)
set the checked state of task: true if the relationship has been check. or else, false


getTaskByTaskID

public static GanttTask getTaskByTaskID(int taskID)
max ID in the allTasksMap


getTaskID

public int getTaskID()
Returns:
task ID. -1 if the task has not been registered

setTaskID

public void setTaskID(int taskID)
set the task ID. the uniquness of ID should be check before using this method

Parameters:
taskID -


${copyright}