[Bug #1073] Add dependencies with its parent when a milestone is added.
A new operation in the Adapter was implemented. Also the Milestone class was modified to store a reference to its parent. FEA: ItEr75S04BugFixing
This commit is contained in:
parent
f5fa10ff81
commit
3260623d7e
4 changed files with 37 additions and 0 deletions
|
|
@ -221,6 +221,9 @@ public class FunctionalityExposedForExtensions<T> implements IContext<T> {
|
|||
accumulatedDependencies, child));
|
||||
i++;
|
||||
}
|
||||
} else if (navigator.isMilestone(data)) {
|
||||
Milestone milestone = (Milestone) data;
|
||||
milestone.setOwner(position.getParent());
|
||||
}
|
||||
|
||||
result.setShowingReportedHours(planner.showReportedHoursRightNow());
|
||||
|
|
|
|||
|
|
@ -91,6 +91,8 @@ public class GanttDiagramGraph<V, D extends IDependency<V>> implements
|
|||
public interface IAdapter<V, D extends IDependency<V>> {
|
||||
List<V> getChildren(V task);
|
||||
|
||||
V getOwner(V task);
|
||||
|
||||
boolean isContainer(V task);
|
||||
|
||||
void registerDependenciesEnforcerHookOn(V task,
|
||||
|
|
@ -135,6 +137,15 @@ public class GanttDiagramGraph<V, D extends IDependency<V>> implements
|
|||
return task.getTasks();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Task getOwner(Task task) {
|
||||
if (task instanceof Milestone) {
|
||||
Milestone milestone = (Milestone) task;
|
||||
return milestone.getOwner();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Task getDestination(Dependency dependency) {
|
||||
return dependency.getDestination();
|
||||
|
|
@ -529,6 +540,14 @@ public class GanttDiagramGraph<V, D extends IDependency<V>> implements
|
|||
dependenciesToAdd.add(adapter.createInvisibleDependency(
|
||||
task, child, DependencyType.START_START));
|
||||
}
|
||||
} else {
|
||||
V owner = adapter.getOwner(task);
|
||||
if(owner != null) {
|
||||
dependenciesToAdd.add(adapter.createInvisibleDependency(
|
||||
task, owner, DependencyType.END_END));
|
||||
dependenciesToAdd.add(adapter.createInvisibleDependency(
|
||||
owner, task, DependencyType.START_START));
|
||||
}
|
||||
}
|
||||
}
|
||||
for (D each : dependenciesToAdd) {
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ public class Milestone extends Task {
|
|||
|
||||
private List<Task> tasks = new ArrayList<Task>();
|
||||
|
||||
private TaskContainer owner;
|
||||
|
||||
private boolean expanded = false;
|
||||
|
||||
@Override
|
||||
|
|
@ -73,4 +75,12 @@ public class Milestone extends Task {
|
|||
return true;
|
||||
}
|
||||
|
||||
public void setOwner(TaskContainer owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public TaskContainer getOwner() {
|
||||
return this.owner;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,6 +93,11 @@ public class TemplateModelAdapter implements
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TaskElement getOwner(TaskElement task) {
|
||||
return task.getParent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<DependencyWithVisibility> getDependencyType() {
|
||||
return DependencyWithVisibility.class;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue