Commit f9dc36de authored by Faezeh KHORRAM's avatar Faezeh KHORRAM 💬
Browse files

define animator for messages

parent 678f7f51
......@@ -33,8 +33,10 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.sirius.properties.ext.widgets.reference,
org.eclipse.sirius.properties.ext.widgets.reference.edit,
org.eclipse.sirius.ui.properties.ext.widgets.reference,
org.eclipse.gemoc.executionframework.extensions.sirius;bundle-version="0.0.0";visibility:="reexport",
org.eclipse.gemoc.execution.sequential.javaengine.ui;bundle-version=0.0.0;visibility:=reexport
org.eclipse.gemoc.executionframework.extensions.sirius;bundle-version="0.0.0";visibility:=reexport,
org.eclipse.gemoc.execution.sequential.javaengine.ui;bundle-version="0.0.0";visibility:=reexport,
org.imt.k3tdl.tdlInterpreter,
org.imt.tdl.testResult
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: org.etsi.mts.tdl
......@@ -842,7 +842,7 @@
</ownedTools>
</toolSections>
</defaultLayer>
<additionalLayers name="Debug">
<additionalLayers name="Debug" activeByDefault="true">
<toolSections name="Debug">
<ownedTools xsi:type="tool_1:PopupMenu" name="Gemoc">
<menuItemDescription xsi:type="tool_1:OperationAction" name="Debug" icon="/org.eclipse.gemoc.executionframework.extensions.sirius/icons/debug_exc.gif">
......@@ -870,20 +870,25 @@
<decorationDescriptions xsi:type="description_2:MappingBasedDecoration" name="Disabled breakpoint" position="WEST" preconditionExpression="service:self.hasDisabledBreakpoint" imageExpression="/org.eclipse.gemoc.executionframework.extensions.sirius/icons/breakpoint_disabled.gif" mappings="//@ownedViewpoints[name='org.etsi.mts.tdl']/@ownedRepresentations[name='TestDescriptionDiagram']/@defaultLayer/@containerMappings[name='combinedBehaviour']/@subContainerMappings[name='boundedLoopBehaviour']/@subNodeMappings[name='boundedLoop.iteration'] //@ownedViewpoints[name='org.etsi.mts.tdl']/@ownedRepresentations[name='TestDescriptionDiagram']/@defaultLayer/@containerMappings[name='combinedBehaviour']/@subContainerMappings[name='periodicBehaviour']/@subNodeMappings[name='periodicBehaviour.iteration'] //@ownedViewpoints[name='org.etsi.mts.tdl']/@ownedRepresentations[name='TestDescriptionDiagram']/@defaultLayer/@edgeMappings[name='interaction'] //@ownedViewpoints[name='org.etsi.mts.tdl']/@ownedRepresentations[name='GenericDiagram']/@defaultLayer/@containerMappings[name='testDescription']"/>
</decorationDescriptionsSet>
<customization>
<vsmElementCustomizations xsi:type="description:VSMElementCustomization" predicateExpression="service:self.isCurrentInstruction">
<vsmElementCustomizations xsi:type="description:VSMElementCustomization" predicateExpression="service:self.isCurrentInstruction()">
<featureCustomizations xsi:type="description:EReferenceCustomization" appliedOn="//@ownedViewpoints[name='org.etsi.mts.tdl']/@ownedRepresentations[name='TestDescriptionDiagram']/@defaultLayer/@edgeMappings[name='interaction']/@style //@ownedViewpoints[name='org.etsi.mts.tdl']/@ownedRepresentations[name='TestDescriptionDiagram']/@defaultLayer/@edgeMappings[name='interaction']/@conditionnalStyles.0/@style //@ownedViewpoints[name='org.etsi.mts.tdl']/@ownedRepresentations[name='TestDescriptionDiagram']/@defaultLayer/@edgeMappings[name='interaction']/@conditionnalStyles.2/@style //@ownedViewpoints[name='org.etsi.mts.tdl']/@ownedRepresentations[name='TestDescriptionDiagram']/@defaultLayer/@edgeMappings[name='interaction']/@conditionnalStyles.1/@style" referenceName="strokeColor">
<value href="environment:/viewpoint#//@systemColors/@entries[name='purple']"/>
</featureCustomizations>
</vsmElementCustomizations>
</customization>
</additionalLayers>
<additionalLayers name="Animation" activeByDefault="true">
<additionalLayers name="Animation">
<customization>
<vsmElementCustomizations xsi:type="description:VSMElementCustomization" predicateExpression="service:self.hasBeenActivated">
<vsmElementCustomizations xsi:type="description:VSMElementCustomization" predicateExpression="service:self.isPassedMessage()">
<featureCustomizations xsi:type="description:EReferenceCustomization" appliedOn="//@ownedViewpoints[name='org.etsi.mts.tdl']/@ownedRepresentations[name='TestDescriptionDiagram']/@defaultLayer/@edgeMappings[name='interaction']/@style //@ownedViewpoints[name='org.etsi.mts.tdl']/@ownedRepresentations[name='TestDescriptionDiagram']/@defaultLayer/@edgeMappings[name='interaction']/@conditionnalStyles.0/@style //@ownedViewpoints[name='org.etsi.mts.tdl']/@ownedRepresentations[name='TestDescriptionDiagram']/@defaultLayer/@edgeMappings[name='interaction']/@conditionnalStyles.2/@style //@ownedViewpoints[name='org.etsi.mts.tdl']/@ownedRepresentations[name='TestDescriptionDiagram']/@defaultLayer/@edgeMappings[name='interaction']/@conditionnalStyles.1/@style" referenceName="strokeColor">
<value href="environment:/viewpoint#//@systemColors/@entries[name='green']"/>
</featureCustomizations>
</vsmElementCustomizations>
<vsmElementCustomizations xsi:type="description:VSMElementCustomization" predicateExpression="service:self.isFailedMessage()">
<featureCustomizations xsi:type="description:EReferenceCustomization" appliedOn="//@ownedViewpoints[name='org.etsi.mts.tdl']/@ownedRepresentations[name='TestDescriptionDiagram']/@defaultLayer/@edgeMappings[name='interaction']/@style //@ownedViewpoints[name='org.etsi.mts.tdl']/@ownedRepresentations[name='TestDescriptionDiagram']/@defaultLayer/@edgeMappings[name='interaction']/@conditionnalStyles.0/@style //@ownedViewpoints[name='org.etsi.mts.tdl']/@ownedRepresentations[name='TestDescriptionDiagram']/@defaultLayer/@edgeMappings[name='interaction']/@conditionnalStyles.2/@style //@ownedViewpoints[name='org.etsi.mts.tdl']/@ownedRepresentations[name='TestDescriptionDiagram']/@defaultLayer/@edgeMappings[name='interaction']/@conditionnalStyles.1/@style" referenceName="strokeColor">
<value href="environment:/viewpoint#//@systemColors/@entries[name='red']"/>
</featureCustomizations>
</vsmElementCustomizations>
</customization>
</additionalLayers>
</ownedRepresentations>
......
......@@ -11,13 +11,17 @@
package org.etsi.mts.tdl.graphical.services;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.gemoc.executionframework.extensions.sirius.services.AbstractGemocAnimatorServices;
import org.etsi.mts.tdl.Message;
import org.imt.k3tdl.k3dsa.MessageAspectMessageAspectContext;
import org.imt.tdl.testResult.TDLMessageResult;
// tag::FsmAnimatorServicesClass[]
public class TdlAnimatorServices extends AbstractGemocAnimatorServices {
@Override
protected List<StringCouple> getRepresentationRefreshList() { // <1>
......@@ -25,5 +29,20 @@ public class TdlAnimatorServices extends AbstractGemocAnimatorServices {
res.add(new StringCouple("TestDescriptionDiagram", "Animation"));
return res;
}
public boolean isPassedMessage(EObject o){
if(o.eContainer() instanceof Message){
Message message = (Message) o.eContainer();
return MessageAspectMessageAspectContext.INSTANCE.getSelf(message).messageVerdict.getValue();
} else {
return false;
}
}
public boolean isFailedMessage(EObject o){
if(o.eContainer() instanceof Message){
Message message = (Message) o.eContainer();
return !MessageAspectMessageAspectContext.INSTANCE.getSelf(message).messageVerdict.getValue();
} else {
return false;
}
}
}
// end::FsmAnimatorServicesClass[]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment