Integer minOrdinal = new Integer(-2);
for (int i=0; i<visibleTasks.size(); i++) {
Task next = (Task)visibleTasks.get(i);
TaskDependency[] dependencies = next.getDependenciesAsDependant().toArray();
for (int j=0; j<dependencies.length; j++) {
TaskDependency nextDependency = dependencies[j];
TaskActivity dependeeActivity = nextDependency.getActivityBinding().getDependeeActivity();
if (hashedVisible.contains(dependeeActivity)) {
continue;
}
Task dependeeTask = dependeeActivity.getTask();
if (false==getChartModel().getTaskManager().getTaskHierarchy().contains(dependeeTask)) {
continue;
}
if (false==isPathExpanded(dependeeTask)) {
continue;
}
int diff = getChartModel().getTaskManager().getTaskHierarchy().compareDocumentOrder(next, dependeeTask);
assert diff!=0;
Integer dependeePosition = diff<0 ? maxOrdinal : minOrdinal;
myActivity2ordinalNumber.put(dependeeActivity, dependeePosition);
visibleActivities.add(dependeeActivity);
hashedVisible.add(dependeeActivity);
}
dependencies = next.getDependenciesAsDependee().toArray();
for (int j=0; j<dependencies.length; j++) {
TaskDependency nextDependency = dependencies[j];
TaskActivity dependantActivity = nextDependency.getActivityBinding().getDependantActivity();
if (hashedVisible.contains(dependantActivity)) {
continue;
}
Task dependantTask = dependantActivity.getTask();
if (false==getChartModel().getTaskManager().getTaskHierarchy().contains(dependantTask)) {