Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoracuccuru2013-06-15 05:58:42 -0400
committeracuccuru2013-06-15 05:58:42 -0400
commit9362d5b963c2fe9d33a4596b0e074414ca0a236d (patch)
tree101b5201c634ab0631bfa93a3c876526e9067385 /sandbox
parentaf89ea3f50b0b94008dbb156b8ff55fb4f01a071 (diff)
downloadorg.eclipse.papyrus-9362d5b963c2fe9d33a4596b0e074414ca0a236d.tar.gz
org.eclipse.papyrus-9362d5b963c2fe9d33a4596b0e074414ca0a236d.tar.xz
org.eclipse.papyrus-9362d5b963c2fe9d33a4596b0e074414ca0a236d.zip
Bug 405389 - [Moka] Papyrus shall provide a generic and extendible framework for execution and debugging of models
Optimization in AnimationUtils.getDiagrams(semanticElement) When a mapping is established between a semantic element and a diagram, a mapping is now established as well between other semantic element (displayed in the diagram) and the diagram
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.ui/src/org/eclipse/papyrus/moka/ui/presentation/AnimationUtils.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.ui/src/org/eclipse/papyrus/moka/ui/presentation/AnimationUtils.java b/sandbox/Moka/org.eclipse.papyrus.moka.ui/src/org/eclipse/papyrus/moka/ui/presentation/AnimationUtils.java
index ba4b6ed3ae6..827babb71f3 100644
--- a/sandbox/Moka/org.eclipse.papyrus.moka.ui/src/org/eclipse/papyrus/moka/ui/presentation/AnimationUtils.java
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.ui/src/org/eclipse/papyrus/moka/ui/presentation/AnimationUtils.java
@@ -16,6 +16,7 @@ package org.eclipse.papyrus.moka.ui.presentation;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -136,6 +137,25 @@ public class AnimationUtils {
if(! matchingDiagrams.contains(diagram)) {
matchingDiagrams.add(diagram) ;
}
+ // For optimization purposes,
+ // Add mapping entries for other semantic elements
+ // having a representation in this diagram
+ for (Iterator<EObject> i = diagram.eAllContents() ; i.hasNext() ; ) {
+ EObject cddView = i.next() ;
+ if (cddView instanceof View) {
+ EObject element = ((View) cddView).getElement() ;
+ if (element != modelElement) {
+ List<Diagram> diags = eObjectToDiagrams.get(element) ;
+ if (diags == null) {
+ diags = new ArrayList<Diagram>() ;
+ }
+ else if (! diags.contains(diagram)) {
+ diags.add(diagram) ;
+ }
+ eObjectToDiagrams.put(element, diags) ;
+ }
+ }
+ }
}
}
}

Back to the top