Skip to content
Snippets Groups Projects
Commit 883d2673 authored by Simon Barner's avatar Simon Barner
Browse files

Use AnnotationViewPart.setUpdateEnabled() consistently with rest of code base

parent 29c37343
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ import static org.fortiss.af3.exploration.alg.util.ExplorationAlgUtils.getDeploy ...@@ -27,6 +27,7 @@ import static org.fortiss.af3.exploration.alg.util.ExplorationAlgUtils.getDeploy
import static org.fortiss.af3.platform.utils.PlatformArchitectureUtils.getPhysicalPlatformArchitecture; import static org.fortiss.af3.platform.utils.PlatformArchitectureUtils.getPhysicalPlatformArchitecture;
import static org.fortiss.af3.platform.utils.PlatformArchitectureUtils.getReferencedElementsWithType; import static org.fortiss.af3.platform.utils.PlatformArchitectureUtils.getReferencedElementsWithType;
import static org.fortiss.af3.schedule.utils.MathUtils.gcdDoubleCollection; import static org.fortiss.af3.schedule.utils.MathUtils.gcdDoubleCollection;
import static org.fortiss.tooling.base.ui.annotation.view.AnnotationViewPartBase.isUpdateEnabled;
import static org.fortiss.tooling.base.ui.annotation.view.AnnotationViewPartBase.setUpdateEnabled; import static org.fortiss.tooling.base.ui.annotation.view.AnnotationViewPartBase.setUpdateEnabled;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getChildrenWithType; import static org.fortiss.tooling.kernel.utils.EcoreUtils.getChildrenWithType;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickFirstInstanceOf; import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickFirstInstanceOf;
...@@ -111,12 +112,16 @@ public class AF3SystemModelAdapter ...@@ -111,12 +112,16 @@ public class AF3SystemModelAdapter
*/ */
private Collection<IDeployableComponentAdapter<Component>> componentReplacementAdapters; private Collection<IDeployableComponentAdapter<Component>> componentReplacementAdapters;
// TODO (2x): package access rights are ok? If so, please add /* package */
/** Contains informations whether the given AF3 model supports multicast channels. */ /** Contains informations whether the given AF3 model supports multicast channels. */
boolean multicastSupport = false; boolean multicastSupport = false;
/** References the method which returns the multicast targets (if available). */ /** References the method which returns the multicast targets (if available). */
Method multicastGetTargets; Method multicastGetTargets;
/** Cache the Annotation View's update status. */
private boolean annotationUpdateEnabled;
/** /**
* Constructor. * Constructor.
* *
...@@ -147,6 +152,7 @@ public class AF3SystemModelAdapter ...@@ -147,6 +152,7 @@ public class AF3SystemModelAdapter
putInputModel(PlatformArchitecture.class, platformArchitecture); putInputModel(PlatformArchitecture.class, platformArchitecture);
// Disable any annotation view update. // Disable any annotation view update.
annotationUpdateEnabled = isUpdateEnabled();
setUpdateEnabled(false); setUpdateEnabled(false);
// Determine the associated hardware platform given the platform architecture is a a model // Determine the associated hardware platform given the platform architecture is a a model
...@@ -210,7 +216,7 @@ public class AF3SystemModelAdapter ...@@ -210,7 +216,7 @@ public class AF3SystemModelAdapter
createAbstractTaskGraphEncoding(); createAbstractTaskGraphEncoding();
// Re-enable annotation view updates. // Re-enable annotation view updates.
setUpdateEnabled(true); setUpdateEnabled(annotationUpdateEnabled);
} }
/** Determines whether the current AF3 version supports multicast channels. */ /** Determines whether the current AF3 version supports multicast channels. */
......
...@@ -270,11 +270,8 @@ public class ExplorationTransformationService<T extends ITransformationModule<?> ...@@ -270,11 +270,8 @@ public class ExplorationTransformationService<T extends ITransformationModule<?>
((ITransformationStrategy<?>)moduleInstance).setModelName(transformedModelName); ((ITransformationStrategy<?>)moduleInstance).setModelName(transformedModelName);
} }
// Disable any Annotation view update annotationUpdateEnabled = isUpdateEnabled();
if(isUpdateEnabled()) { setUpdateEnabled(false);
annotationUpdateEnabled = true;
setUpdateEnabled(false);
}
SubClassToInstanceMap<U> transformedModels = MutableSubClassToInstanceMap.create(); SubClassToInstanceMap<U> transformedModels = MutableSubClassToInstanceMap.create();
moduleInstance.transform(TransformationState.INITIALIZING, context, baseModels, moduleInstance.transform(TransformationState.INITIALIZING, context, baseModels,
...@@ -296,10 +293,8 @@ public class ExplorationTransformationService<T extends ITransformationModule<?> ...@@ -296,10 +293,8 @@ public class ExplorationTransformationService<T extends ITransformationModule<?>
((ITransformationStrategy<?>)moduleInstance).addModelToProject(fp, modelContext); ((ITransformationStrategy<?>)moduleInstance).addModelToProject(fp, modelContext);
} }
// Disable any Annotation view update // Re-enable Annotation view updates if needed
if(annotationUpdateEnabled) { setUpdateEnabled(annotationUpdateEnabled);
setUpdateEnabled(true);
}
ClassToInstanceMap<U> retModels = MutableClassToInstanceMap.create(); ClassToInstanceMap<U> retModels = MutableClassToInstanceMap.create();
for(Class<? extends EObject> retType : transformedModelTypes) { for(Class<? extends EObject> retType : transformedModelTypes) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment