Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoracuccuru2013-05-02 06:28:01 -0400
committeracuccuru2013-05-02 06:28:01 -0400
commit0b1d3114b0a21b442e110e91883af58b3e6b3811 (patch)
tree381efa65660210624cecf3385fc9e6d27d108e67 /sandbox
parentc0fa29f34e34ea7072d112c40e76ba9aa04713d3 (diff)
downloadorg.eclipse.papyrus-0b1d3114b0a21b442e110e91883af58b3e6b3811.tar.gz
org.eclipse.papyrus-0b1d3114b0a21b442e110e91883af58b3e6b3811.tar.xz
org.eclipse.papyrus-0b1d3114b0a21b442e110e91883af58b3e6b3811.zip
Minor optimization for animation. Only tries to retrieve graphical representation for an activity node or edge if the context activity has a representation.
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/debug/ControlDelegate.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/debug/ControlDelegate.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/debug/ControlDelegate.java
index f1c9c577b26..1d66db89271 100644
--- a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/debug/ControlDelegate.java
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/debug/ControlDelegate.java
@@ -24,7 +24,9 @@ import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities
import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.ActivityNodeActivation;
import org.eclipse.papyrus.moka.fuml.presentation.FUMLPresentationUtils;
import org.eclipse.papyrus.moka.ui.presentation.AnimationUtils;
+import org.eclipse.uml2.uml.Activity;
import org.eclipse.uml2.uml.ActivityEdge;
+import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Pin;
public class ControlDelegate {
@@ -250,7 +252,7 @@ public class ControlDelegate {
if (element instanceof ActivityEdge) {
ActivityEdge edge = (ActivityEdge)element ;
if (edge.getSource() instanceof Pin) {
- if (AnimationUtils.getInstance().diagramsExistFor(edge.getSource())) {
+ if (this.diagramsExistFor(edge.getSource())) {
AnimationUtils.getInstance().addAnimationMarker(edge.getSource()) ;
Thread.sleep(MokaConstants.MOKA_ANIMATION_DELAY) ;
AnimationUtils.getInstance().removeAnimationMarker(edge.getSource()) ;
@@ -258,7 +260,7 @@ public class ControlDelegate {
}
}
// Animates the element
- if (AnimationUtils.getInstance().diagramsExistFor(element)) {
+ if (this.diagramsExistFor((Element)element)) {
AnimationUtils.getInstance().addAnimationMarker(element) ;
Thread.sleep(MokaConstants.MOKA_ANIMATION_DELAY) ;
AnimationUtils.getInstance().removeAnimationMarker(element) ;
@@ -272,4 +274,17 @@ public class ControlDelegate {
// Nothing to do
}
+ protected boolean diagramsExistFor(Element element) {
+ Activity activity = null ;
+ Element tmp = element ;
+ while (activity == null) {
+ tmp = tmp.getOwner() ;
+ if (tmp instanceof Activity) {
+ activity = (Activity)tmp ;
+ }
+ }
+ if (activity != null && !AnimationUtils.getInstance().diagramsExistFor(activity))
+ return false ;
+ return AnimationUtils.getInstance().diagramsExistFor(element) ;
+ }
}

Back to the top