Class GanttTask
java.lang.Object
com.codename1.scheduling.GanttTask
A task in a project: a piece of work, a milestone, or a summary of the tasks under it.
A task with children is a summary, and its dates are the span of its
children. A task with no children and no duration is a milestone. For any
other, duration is working time in the project's WorkCalendar, and
ProjectScheduler works out start and end from the dependencies, the
constraint and the leveling delay. A task that is scheduled manually keeps
the dates it was given.
Add a task to a ProjectModel before using it; the model owns the tree.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumA limit on when a task may be scheduled, on top of its dependencies. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAssigns a resource full time.Assignsunitsof a resource:0.5fis half of somebody's time.longlongintgetColor()An RGB colour for the bar, or -1 for the theme's.longlongWorking time the task takes, in milliseconds.longlongThe earliest the task can start, from the last scheduling pass.longgetEnd()longWorking time the task can slip by without delaying any successor.getId()longlongThe latest the task can start without delaying the project.intgetLevel()How deep the task is in the tree; a top level task is at 0.longWorking time the task is held back by after its dependencies would let it start.getName()int0 to 100.int0 to 1000; when two tasks want the same resource the higher keeps its dates.longgetStart()longWorking time the task can slip by without delaying the project.getUIID()The UIID the bar is drawn with in place ofGanttBar, or null.floatThe units of a resource the task uses, 0 when it is not assigned.booleanbooleanWhether the dependencies pushed the task past a "no later than" constraint, or a "must" constraint pulled it ahead of a predecessor.booleanWhether the task is on the critical path: any slip delays the project.booleanisDescendantOf(GanttTask other) Whetherotheris this task's parent, or its parent's, and so on.booleanWhether the task keeps the dates it was given instead of being moved by its dependencies.booleanbooleansetBaseline(long start, long end) Records the dates the task was planned at, to compare with later.setColor(int v) setConstraint(GanttTask.Constraint type, long date) setDates(long start, long end) Sets the dates directly.setDuration(long millis) setLevelingDelay(long millis) setManuallyScheduled(boolean v) setPercentComplete(int v) setPriority(int v) toString()Returns a string representation of the object.
-
Constructor Details
-
GanttTask
-
GanttTask
-
-
Method Details
-
getId
-
getName
-
setName
-
getParent
-
getChildren
-
isSummary
public boolean isSummary() -
isMilestone
public boolean isMilestone() -
getLevel
public int getLevel()How deep the task is in the tree; a top level task is at 0. -
isDescendantOf
Whetherotheris this task's parent, or its parent's, and so on. -
getDuration
public long getDuration()Working time the task takes, in milliseconds. Ignored for a summary. -
setDuration
-
getStart
public long getStart() -
getEnd
public long getEnd() -
setDates
Sets the dates directly. The scheduler overwrites them unless the task is scheduled manually. -
getPercentComplete
public int getPercentComplete()0 to 100. -
setPercentComplete
-
getConstraint
-
getConstraintDate
public long getConstraintDate() -
setConstraint
-
isManuallyScheduled
public boolean isManuallyScheduled()Whether the task keeps the dates it was given instead of being moved by its dependencies. Its successors still follow it. -
setManuallyScheduled
-
getLevelingDelay
public long getLevelingDelay()Working time the task is held back by after its dependencies would let it start.ResourceLevelersets it; zero undoes leveling. -
setLevelingDelay
-
getPriority
public int getPriority()0 to 1000; when two tasks want the same resource the higher keeps its dates. 1000 is never delayed by leveling. -
setPriority
-
hasBaseline
public boolean hasBaseline() -
getBaselineStart
public long getBaselineStart() -
getBaselineEnd
public long getBaselineEnd() -
setBaseline
Records the dates the task was planned at, to compare with later. -
clearBaseline
-
getAssignments
-
assign
-
assign
-
unassign
-
getUnits
The units of a resource the task uses, 0 when it is not assigned. -
getColor
public int getColor()An RGB colour for the bar, or -1 for the theme's. -
setColor
-
getUIID
The UIID the bar is drawn with in place ofGanttBar, or null. -
setUIID
-
getUserObject
-
setUserObject
-
getEarlyStart
public long getEarlyStart()The earliest the task can start, from the last scheduling pass. -
getEarlyFinish
public long getEarlyFinish() -
getLateStart
public long getLateStart()The latest the task can start without delaying the project. -
getLateFinish
public long getLateFinish() -
getTotalSlack
public long getTotalSlack()Working time the task can slip by without delaying the project. Negative when a constraint or a deadline cannot be met. -
getFreeSlack
public long getFreeSlack()Working time the task can slip by without delaying any successor. -
isCritical
public boolean isCritical()Whether the task is on the critical path: any slip delays the project. -
isConstraintViolated
public boolean isConstraintViolated()Whether the dependencies pushed the task past a "no later than" constraint, or a "must" constraint pulled it ahead of a predecessor. -
toString
Description copied from class:ObjectReturns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
-