ItEr57S15RecalculosConexionEscenarios: Introduce adapter so GanntDiagramGraph could be applied on another types
This commit is contained in:
parent
b9eaa0d4f6
commit
eeefaf5362
4 changed files with 396 additions and 239 deletions
|
|
@ -45,6 +45,7 @@ import org.zkoss.ganttz.data.Position;
|
|||
import org.zkoss.ganttz.data.Task;
|
||||
import org.zkoss.ganttz.data.TaskContainer;
|
||||
import org.zkoss.ganttz.data.TaskLeaf;
|
||||
import org.zkoss.ganttz.data.GanttDiagramGraph.GanttZKDiagramGraph;
|
||||
import org.zkoss.ganttz.data.criticalpath.CriticalPathCalculator;
|
||||
import org.zkoss.ganttz.extensions.IContext;
|
||||
import org.zkoss.ganttz.timetracker.TimeTracker;
|
||||
|
|
@ -166,13 +167,13 @@ public class FunctionalityExposedForExtensions<T> implements IContext<T> {
|
|||
private final IAdapterToTaskFundamentalProperties<T> adapter;
|
||||
private final IStructureNavigator<T> navigator;
|
||||
private final OneToOneMapper<T> mapper = new OneToOneMapper<T>();
|
||||
private final GanttDiagramGraph diagramGraph;
|
||||
private final GanttZKDiagramGraph diagramGraph;
|
||||
private TimeTracker timeTracker;
|
||||
private final PlannerConfiguration<T> configuration;
|
||||
|
||||
public FunctionalityExposedForExtensions(Planner planner,
|
||||
PlannerConfiguration<T> configuration,
|
||||
GanttDiagramGraph diagramGraph) {
|
||||
GanttZKDiagramGraph diagramGraph) {
|
||||
this.planner = planner;
|
||||
this.configuration = configuration;
|
||||
this.adapter = configuration.getAdapter();
|
||||
|
|
@ -313,7 +314,7 @@ public class FunctionalityExposedForExtensions<T> implements IContext<T> {
|
|||
add(position, newDomainObject);
|
||||
}
|
||||
|
||||
public GanttDiagramGraph getDiagramGraph() {
|
||||
public GanttZKDiagramGraph getDiagramGraph() {
|
||||
return diagramGraph;
|
||||
}
|
||||
|
||||
|
|
@ -351,7 +352,7 @@ public class FunctionalityExposedForExtensions<T> implements IContext<T> {
|
|||
|
||||
public void removeDependency(Dependency dependency) {
|
||||
adapter.removeDependency(toDomainDependency(dependency));
|
||||
diagramGraph.remove(dependency);
|
||||
diagramGraph.removeDependency(dependency);
|
||||
getDependencyList().remove(dependency);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import org.zkoss.ganttz.data.Dependency;
|
|||
import org.zkoss.ganttz.data.GanttDiagramGraph;
|
||||
import org.zkoss.ganttz.data.Position;
|
||||
import org.zkoss.ganttz.data.Task;
|
||||
import org.zkoss.ganttz.data.GanttDiagramGraph.GanttZKDiagramGraph;
|
||||
import org.zkoss.ganttz.data.GanttDiagramGraph.IGraphChangeListener;
|
||||
import org.zkoss.ganttz.extensions.ICommand;
|
||||
import org.zkoss.ganttz.extensions.ICommandOnTask;
|
||||
|
|
@ -111,7 +112,7 @@ public class Planner extends HtmlMacroComponent {
|
|||
return result;
|
||||
}
|
||||
|
||||
private GanttDiagramGraph diagramGraph;
|
||||
private GanttZKDiagramGraph diagramGraph;
|
||||
|
||||
private LeftPane leftPane;
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import java.util.List;
|
|||
|
||||
import org.apache.commons.lang.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
import org.zkoss.ganttz.data.GanttDiagramGraph.GanttZKAdapter;
|
||||
import org.zkoss.ganttz.data.GanttDiagramGraph.TaskPoint;
|
||||
import org.zkoss.ganttz.data.constraint.Constraint;
|
||||
import org.zkoss.ganttz.data.constraint.Constraint.IConstraintViolationListener;
|
||||
|
|
@ -167,8 +168,9 @@ public class Dependency implements IDependency<Task> {
|
|||
return new Dependency(source, destination, type, visible);
|
||||
}
|
||||
|
||||
public TaskPoint getDestinationPoint() {
|
||||
return new TaskPoint(destination, type.getPointModified());
|
||||
public TaskPoint<Task, Dependency> getDestinationPoint() {
|
||||
return new TaskPoint<Task, Dependency>(new GanttZKAdapter(),
|
||||
destination, type.getPointModified());
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue