ItEr58S14RecalculosConexionEscenariosItEr57S15: Let create a IDependenciesEnforcerHook without specifying a notificator.

A default one is specified. It does nothing.
This commit is contained in:
Óscar González Fernández 2010-05-18 19:45:59 +02:00
parent 6cb780d95c
commit 123103ed2e

View file

@ -392,6 +392,8 @@ public class GanttDiagramGraph<V, D> {
public interface IDependenciesEnforcerHookFactory<T> {
public IDependenciesEnforcerHook create(T task,
INotificationAfterDependenciesEnforcement notification);
public IDependenciesEnforcerHook create(T task);
}
public interface INotificationAfterDependenciesEnforcement {
@ -401,6 +403,18 @@ public class GanttDiagramGraph<V, D> {
public void onLengthChange(long previousLength, long newLength);
}
private static final INotificationAfterDependenciesEnforcement EMPTY_NOTIFICATOR = new INotificationAfterDependenciesEnforcement() {
@Override
public void onStartDateChange(Date previousStart, long previousLength,
Date newStart) {
}
@Override
public void onLengthChange(long previousLength, long newLength) {
}
};
public class DeferedNotifier {
private Map<V, NotificationPendingForTask> notificationsPending = new LinkedHashMap<V, NotificationPendingForTask>();
@ -526,6 +540,11 @@ public class GanttDiagramGraph<V, D> {
onNotification(task, notificator));
}
@Override
public IDependenciesEnforcerHook create(V task) {
return create(task, EMPTY_NOTIFICATOR);
}
private IDependenciesEnforcerHook onEntrance(final V task) {
return new IDependenciesEnforcerHook() {