TaskDependency relationship;
com.tapsterrock.mpx.Task mpxSuccessorTask;
com.tapsterrock.mpx.Task mpxPredecessorTask;
Integer mpxSuccessorTaskID;
Integer mpxPredecessorTaskID;
Relation mpxRelation;
for (int loop = 0; loop < dependencies.length; loop++) {
relationship = dependencies[loop];
mpxSuccessorTaskID = (Integer) m_ganttMpxTaskMap.get(new Integer(
relationship.getDependant().getTaskID()));
mpxPredecessorTaskID = (Integer) m_ganttMpxTaskMap.get(new Integer(
relationship.getDependee().getTaskID()));
if (mpxSuccessorTaskID != null && mpxPredecessorTaskID != null) {
mpxSuccessorTask = m_mpx.getTaskByUniqueID(mpxSuccessorTaskID
.intValue());
mpxPredecessorTask = m_mpx
.getTaskByUniqueID(mpxPredecessorTaskID.intValue());
mpxRelation = mpxSuccessorTask
.addPredecessor(mpxPredecessorTask);
TaskDependencyConstraint constraint = relationship
.getConstraint();
switch (constraint.getID()) {
case GanttTaskRelationship.SS: {
mpxRelation.setType(RelationType.START_START);
break;
}
case GanttTaskRelationship.SF: {
mpxRelation.setType(RelationType.START_FINISH);
break;
}
case GanttTaskRelationship.FS: {
mpxRelation.setType(RelationType.FINISH_START);
break;
}
case GanttTaskRelationship.FF: {
mpxRelation.setType(RelationType.FINISH_FINISH);
break;
}
}
}
}