diff options
author | jeremie.tatibouet | 2015-11-24 10:19:55 +0000 |
---|---|---|
committer | jeremie.tatibouet | 2015-11-24 15:20:43 +0000 |
commit | 1d752f530a53189f262a1d645acc28242a5c3e05 (patch) | |
tree | 576350d917f7aa8efcd86a7bd5d49b1219f82f8b | |
parent | 6a4227a38298aacf1b906205450988fee60a7455 (diff) | |
download | org.eclipse.papyrus-moka-1d752f530a53189f262a1d645acc28242a5c3e05.tar.gz org.eclipse.papyrus-moka-1d752f530a53189f262a1d645acc28242a5c3e05.tar.xz org.eclipse.papyrus-moka-1d752f530a53189f262a1d645acc28242a5c3e05.zip |
1 - Ensure compatibility of the animation manager with asynchronous
executions
2 - Refactor asynchronous control delegate to call the new animation
manager
Change-Id: Iab56f6ba5360d62298bd1aeb98a3a753765176ca
Signed-off-by: jeremie.tatibouet <jeremie.tatibouet@cea.fr>
2 files changed, 8 insertions, 14 deletions
diff --git a/org.eclipse.papyrus.moka.animation/src/org/eclipse/papyrus/moka/animation/engine/AnimationManager.java b/org.eclipse.papyrus.moka.animation/src/org/eclipse/papyrus/moka/animation/engine/AnimationManager.java index 616cdcae..c9610981 100644 --- a/org.eclipse.papyrus.moka.animation/src/org/eclipse/papyrus/moka/animation/engine/AnimationManager.java +++ b/org.eclipse.papyrus.moka.animation/src/org/eclipse/papyrus/moka/animation/engine/AnimationManager.java @@ -183,7 +183,7 @@ public class AnimationManager implements IAnimationManager{ } @Override - public void startRendering(EObject modelElement, AnimationKind animationKind) { + public synchronized void startRendering(EObject modelElement, AnimationKind animationKind) { // A marker is only registered on a model element if // this latter has not already a marker applied on it // and if so this marker is not of the kind of the requested @@ -224,7 +224,7 @@ public class AnimationManager implements IAnimationManager{ } @Override - public void render(EObject modelElement, AnimationKind animationKind, int renderingDuration) { + public synchronized void render(EObject modelElement, AnimationKind animationKind, int renderingDuration) { // Place the marker to trigger the user view to change this.startRendering(modelElement, animationKind); // The duration for which the marker is in place @@ -238,7 +238,7 @@ public class AnimationManager implements IAnimationManager{ } @Override - public void stopRendering(EObject modelElement, AnimationKind kind) { + public synchronized void stopRendering(EObject modelElement, AnimationKind kind) { // A marker can only be removed from a model element if it is applied on it. // As a model element can have multiple markers applied, only the one corresponding // to the specific animation kind is removed diff --git a/org.eclipse.papyrus.moka.async.fuml/src/org/eclipse/papyrus/moka/async/fuml/debug/AsyncControlDelegate.java b/org.eclipse.papyrus.moka.async.fuml/src/org/eclipse/papyrus/moka/async/fuml/debug/AsyncControlDelegate.java index 1306d4a6..3499cf52 100644 --- a/org.eclipse.papyrus.moka.async.fuml/src/org/eclipse/papyrus/moka/async/fuml/debug/AsyncControlDelegate.java +++ b/org.eclipse.papyrus.moka.async.fuml/src/org/eclipse/papyrus/moka/async/fuml/debug/AsyncControlDelegate.java @@ -24,7 +24,6 @@ import org.eclipse.debug.core.model.IStackFrame; import org.eclipse.emf.ecore.EObject; import org.eclipse.papyrus.infra.core.Activator; import org.eclipse.papyrus.moka.MokaConstants; -import org.eclipse.papyrus.moka.animation.engine.AnimationKind; import org.eclipse.papyrus.moka.animation.engine.AnimationManager; import org.eclipse.papyrus.moka.async.fuml.Semantics.CommonBehaviors.Communications.AsyncObjectActivation; import org.eclipse.papyrus.moka.communication.event.Start_Event; @@ -207,11 +206,6 @@ public class AsyncControlDelegate extends ControlDelegate { public void terminate(Terminate_Request request) { engine.setIsTerminated(true); this.terminateRequestByClient = true; - for (List<AcceptEventAction> waitingOn : this.objectActivationToWaitingAcceptEventActions.values()) { - for (EObject o : waitingOn) { - //AnimationManager.getInstance().removeAnimationMarker(o); - } - } /**********/ // 439639: [Moka] oepm.async.fuml.debug.AsyncControlDelegate.terminate shall send a TerminateSignalInstance to all objects in the execution locus // https://bugs.eclipse.org/bugs/show_bug.cgi?id=439639 @@ -235,7 +229,7 @@ public class AsyncControlDelegate extends ControlDelegate { synchronized (this) { notifyAll(); } - //AnimationManager.getInstance().removeAllAnimationMarker(); + AnimationManager.getInstance().deleteAllMarkers(); } /** @@ -362,8 +356,8 @@ public class AsyncControlDelegate extends ControlDelegate { thread = this.mainThread; } } - if (semanticElement != null && MokaConstants.MOKA_AUTOMATIC_ANIMATION && this.mode.equals(ILaunchManager.DEBUG_MODE) && !thread.isStepping()) { - this.animate(semanticElement); + if (object != null && MokaConstants.MOKA_AUTOMATIC_ANIMATION && this.mode.equals(ILaunchManager.DEBUG_MODE) && !thread.isStepping()) { + this.animate(object); } int reasonForSuspending = -1; if (thread.getReasonForSuspending() != -1) { @@ -418,7 +412,7 @@ public class AsyncControlDelegate extends ControlDelegate { if (eventAccepter instanceof AcceptEventActionEventAccepter) { AcceptEventAction action = (AcceptEventAction) ((AcceptEventActionEventAccepter) eventAccepter).actionActivation.node; waitingAcceptEventActions.add(action); - AnimationManager.getInstance().startRendering(action, AnimationKind.ANIMATED); + ((AcceptEventActionEventAccepter) eventAccepter).actionActivation.animate(AnimationManager.getInstance()); } } objectActivationToWaitingAcceptEventActions.put(asyncObjectActivation, waitingAcceptEventActions); @@ -452,7 +446,7 @@ public class AsyncControlDelegate extends ControlDelegate { } objectActivationToWaitingAcceptEventActions.put(asyncObjectActivation, waitingAcceptEventActions); if (action != null) { - AnimationManager.getInstance().stopRendering(action); + accepter.actionActivation.animate(AnimationManager.getInstance()); } } } |