From ee6726fd754c8b5da2c84f716c0dba3e904d0018 Mon Sep 17 00:00:00 2001 From: Erwan Bousse Date: Wed, 20 May 2020 10:12:32 +0200 Subject: [PATCH 01/29] Add Footprint EClass to trace mse metamodel rebase wrt master (jd) Signed-off-by: Erwan Bousse +<<<<<<< HEAD +======= + + +>>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) GenericTrace.ecore platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore http://www.eclipse.org/emf/2002/Ecore @@ -10,7 +15,11 @@ +<<<<<<< HEAD +======= + +>>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) @@ -19,7 +28,11 @@ +<<<<<<< HEAD +======= + +>>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) @@ -77,6 +90,20 @@ + + + + + + + + + + + + + + @@ -92,7 +119,7 @@ - + @@ -109,7 +136,7 @@ - + @@ -130,7 +157,7 @@ - + @@ -139,7 +166,7 @@ - + @@ -160,7 +187,7 @@ - + @@ -180,7 +207,7 @@ - + @@ -211,7 +238,7 @@ - + @@ -223,7 +250,7 @@ - + @@ -231,7 +258,7 @@ - + @@ -262,7 +289,7 @@ - + @@ -293,7 +320,7 @@ - + @@ -351,7 +378,7 @@ - + @@ -363,7 +390,7 @@ - + @@ -436,143 +463,267 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - + - + - + - + +<<<<<<< HEAD @@ -585,21 +736,35 @@ +======= + + + + + + + + + + + + +>>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) - + - + - + - + @@ -621,33 +786,33 @@ - + - + - + - + - + - + - + - + @@ -685,19 +850,19 @@ - + - + - + - + @@ -707,45 +872,45 @@ - + - + - + - + - + - + - + - + - + - - - + + + @@ -768,62 +933,46 @@ - + - + - + - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + @@ -843,21 +992,164 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -964,7 +1256,11 @@ +<<<<<<< HEAD +======= + +>>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) KEEP_LOCATION @@ -1062,7 +1358,11 @@ +<<<<<<< HEAD +======= + +>>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) @@ -1476,6 +1776,7 @@ +<<<<<<< HEAD @@ -1634,6 +1935,8 @@ +======= +>>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) @@ -1684,6 +1987,7 @@ +<<<<<<< HEAD @@ -1801,11 +2105,594 @@ labelSize +======= + + + + + + + labelSize + + + labelSize + + + + + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + + + + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + + + + + + + + + + + + + + + + + + + + + + + + + + + + italic + + + + + + + + + + italic + + + + + + + + + + italic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + italic + + + + + + + + + + italic + + + + + + + + + + italic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + labelSize + + + labelSize + + + + + + + + + + + labelSize + + labelSize + + + + + + + labelSize + + + labelSize + + + + + + + + + + + + + + + + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + + + + + + + + + + labelSize + + +>>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) + labelSize + + + + +<<<<<<< HEAD @@ -1814,6 +2701,45 @@ labelSize +======= + + + + + + + labelSize + + + labelSize + + + + + + + + + + + labelSize + + + labelSize + + + + + + + + + + + labelSize + + +>>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) labelSize diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore index d3f7f973c..0c3aa4ddf 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore @@ -78,6 +78,8 @@ + @@ -215,4 +217,12 @@ + + + + + diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.genmodel b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.genmodel index 3b234e93c..2e4f6f649 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.genmodel +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.genmodel @@ -20,7 +20,10 @@ +<<<<<<< HEAD +======= +>>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) @@ -41,6 +44,10 @@ +<<<<<<< HEAD +======= + +>>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) @@ -80,6 +87,14 @@ +<<<<<<< HEAD +======= + + + + + +>>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/generictrace/GenerictracePackage.java b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/generictrace/GenerictracePackage.java index d2730dfb4..47000fd9e 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/generictrace/GenerictracePackage.java +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/generictrace/GenerictracePackage.java @@ -290,6 +290,15 @@ public interface GenerictracePackage extends EPackage { */ int GENERIC_SMALL_STEP__ENDING_STATE = GENERIC_STEP__ENDING_STATE; + /** + * The feature id for the 'Footprint' containment reference. + * + * + * @generated + * @ordered + */ + int GENERIC_SMALL_STEP__FOOTPRINT = GENERIC_STEP_FEATURE_COUNT + 0; + /** * The number of structural features of the 'Generic Small Step' class. * @@ -297,7 +306,7 @@ public interface GenerictracePackage extends EPackage { * @generated * @ordered */ - int GENERIC_SMALL_STEP_FEATURE_COUNT = GENERIC_STEP_FEATURE_COUNT + 0; + int GENERIC_SMALL_STEP_FEATURE_COUNT = GENERIC_STEP_FEATURE_COUNT + 1; /** * The number of operations of the 'Generic Small Step' class. diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/generictrace/impl/GenericSmallStepImpl.java b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/generictrace/impl/GenericSmallStepImpl.java index 17d24c067..0975f1aad 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/generictrace/impl/GenericSmallStepImpl.java +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/generictrace/impl/GenericSmallStepImpl.java @@ -12,19 +12,42 @@ */ package org.eclipse.gemoc.trace.commons.model.generictrace.impl; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.gemoc.trace.commons.model.generictrace.GenericSmallStep; import org.eclipse.gemoc.trace.commons.model.generictrace.GenerictracePackage; +import org.eclipse.gemoc.trace.commons.model.trace.Footprint; +import org.eclipse.gemoc.trace.commons.model.trace.SmallStep; +import org.eclipse.gemoc.trace.commons.model.trace.TracePackage; import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; /** * * An implementation of the model object 'Generic Small Step'. * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.gemoc.trace.commons.model.generictrace.impl.GenericSmallStepImpl#getFootprint Footprint}
  • + *
* * @generated */ public class GenericSmallStepImpl extends GenericStepImpl implements GenericSmallStep { + /** + * The cached value of the '{@link #getFootprint() Footprint}' containment reference. + * + * + * @see #getFootprint() + * @generated + * @ordered + */ + protected Footprint footprint; + /** * * @@ -44,4 +67,151 @@ protected EClass eStaticClass() { return GenerictracePackage.Literals.GENERIC_SMALL_STEP; } + /** + * + * + * @generated + */ + public Footprint getFootprint() { + return footprint; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetFootprint(Footprint newFootprint, NotificationChain msgs) { + Footprint oldFootprint = footprint; + footprint = newFootprint; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GenerictracePackage.GENERIC_SMALL_STEP__FOOTPRINT, oldFootprint, newFootprint); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setFootprint(Footprint newFootprint) { + if (newFootprint != footprint) { + NotificationChain msgs = null; + if (footprint != null) + msgs = ((InternalEObject)footprint).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GenerictracePackage.GENERIC_SMALL_STEP__FOOTPRINT, null, msgs); + if (newFootprint != null) + msgs = ((InternalEObject)newFootprint).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GenerictracePackage.GENERIC_SMALL_STEP__FOOTPRINT, null, msgs); + msgs = basicSetFootprint(newFootprint, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GenerictracePackage.GENERIC_SMALL_STEP__FOOTPRINT, newFootprint, newFootprint)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case GenerictracePackage.GENERIC_SMALL_STEP__FOOTPRINT: + return basicSetFootprint(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GenerictracePackage.GENERIC_SMALL_STEP__FOOTPRINT: + return getFootprint(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GenerictracePackage.GENERIC_SMALL_STEP__FOOTPRINT: + setFootprint((Footprint)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case GenerictracePackage.GENERIC_SMALL_STEP__FOOTPRINT: + setFootprint((Footprint)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case GenerictracePackage.GENERIC_SMALL_STEP__FOOTPRINT: + return footprint != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == SmallStep.class) { + switch (derivedFeatureID) { + case GenerictracePackage.GENERIC_SMALL_STEP__FOOTPRINT: return TracePackage.SMALL_STEP__FOOTPRINT; + default: return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == SmallStep.class) { + switch (baseFeatureID) { + case TracePackage.SMALL_STEP__FOOTPRINT: return GenerictracePackage.GENERIC_SMALL_STEP__FOOTPRINT; + default: return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + } //GenericSmallStepImpl diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/Footprint.java b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/Footprint.java new file mode 100644 index 000000000..ea810838f --- /dev/null +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/Footprint.java @@ -0,0 +1,77 @@ +/** + */ +package org.eclipse.gemoc.trace.commons.model.trace; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Footprint'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.gemoc.trace.commons.model.trace.Footprint#getAccesses Accesses}
  • + *
  • {@link org.eclipse.gemoc.trace.commons.model.trace.Footprint#getChanges Changes}
  • + *
  • {@link org.eclipse.gemoc.trace.commons.model.trace.Footprint#getInstantiations Instantiations}
  • + *
+ * + * @see org.eclipse.gemoc.trace.commons.model.trace.TracePackage#getFootprint() + * @model + * @generated + */ +public interface Footprint extends EObject { + /** + * Returns the value of the 'Accesses' reference list. + * The list contents are of type {@link org.eclipse.emf.ecore.EObject}. + * + *

+ * If the meaning of the 'Accesses' reference list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Accesses' reference list. + * @see org.eclipse.gemoc.trace.commons.model.trace.TracePackage#getFootprint_Accesses() + * @model + * @generated + */ + EList getAccesses(); + + /** + * Returns the value of the 'Changes' reference list. + * The list contents are of type {@link org.eclipse.emf.ecore.EObject}. + * + *

+ * If the meaning of the 'Changes' reference list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Changes' reference list. + * @see org.eclipse.gemoc.trace.commons.model.trace.TracePackage#getFootprint_Changes() + * @model + * @generated + */ + EList getChanges(); + + /** + * Returns the value of the 'Instantiations' reference list. + * The list contents are of type {@link org.eclipse.emf.ecore.EClass}. + * + *

+ * If the meaning of the 'Instantiations' reference list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Instantiations' reference list. + * @see org.eclipse.gemoc.trace.commons.model.trace.TracePackage#getFootprint_Instantiations() + * @model + * @generated + */ + EList getInstantiations(); + +} // Footprint diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/SmallStep.java b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/SmallStep.java index 292e477e5..8ad8728b3 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/SmallStep.java +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/SmallStep.java @@ -18,10 +18,42 @@ * A representation of the model object 'Small Step'. * * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.gemoc.trace.commons.model.trace.SmallStep#getFootprint Footprint}
  • + *
* * @see org.eclipse.gemoc.trace.commons.model.trace.TracePackage#getSmallStep() * @model abstract="true" * @generated */ public interface SmallStep> extends Step { + + /** + * Returns the value of the 'Footprint' containment reference. + * + *

+ * If the meaning of the 'Footprint' containment reference isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Footprint' containment reference. + * @see #setFootprint(Footprint) + * @see org.eclipse.gemoc.trace.commons.model.trace.TracePackage#getSmallStep_Footprint() + * @model containment="true" + * @generated + */ + Footprint getFootprint(); + + /** + * Sets the value of the '{@link org.eclipse.gemoc.trace.commons.model.trace.SmallStep#getFootprint Footprint}' containment reference. + * + * + * @param value the new value of the 'Footprint' containment reference. + * @see #getFootprint() + * @generated + */ + void setFootprint(Footprint value); } // SmallStep diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/TraceFactory.java b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/TraceFactory.java index ec82b81ab..6f7421171 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/TraceFactory.java +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/TraceFactory.java @@ -58,6 +58,15 @@ public interface TraceFactory extends EFactory { */ GenericMSE createGenericMSE(); + /** + * Returns a new object of class 'Footprint'. + * + * + * @return a new object of class 'Footprint'. + * @generated + */ + Footprint createFootprint(); + /** * Returns the package supported by this factory. * diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/TracePackage.java b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/TracePackage.java index b1942071c..02bc500ea 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/TracePackage.java +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/TracePackage.java @@ -490,6 +490,15 @@ public interface TracePackage extends EPackage { */ int SMALL_STEP__ENDING_STATE = STEP__ENDING_STATE; + /** + * The feature id for the 'Footprint' containment reference. + * + * + * @generated + * @ordered + */ + int SMALL_STEP__FOOTPRINT = STEP_FEATURE_COUNT + 0; + /** * The number of structural features of the 'Small Step' class. * @@ -497,7 +506,7 @@ public interface TracePackage extends EPackage { * @generated * @ordered */ - int SMALL_STEP_FEATURE_COUNT = STEP_FEATURE_COUNT + 0; + int SMALL_STEP_FEATURE_COUNT = STEP_FEATURE_COUNT + 1; /** * The number of operations of the 'Small Step' class. @@ -875,6 +884,61 @@ public interface TracePackage extends EPackage { */ int STATE_OPERATION_COUNT = 0; + /** + * The meta object id for the '{@link org.eclipse.gemoc.trace.commons.model.trace.impl.FootprintImpl Footprint}' class. + * + * + * @see org.eclipse.gemoc.trace.commons.model.trace.impl.FootprintImpl + * @see org.eclipse.gemoc.trace.commons.model.trace.impl.TracePackageImpl#getFootprint() + * @generated + */ + int FOOTPRINT = 14; + + /** + * The feature id for the 'Accesses' reference list. + * + * + * @generated + * @ordered + */ + int FOOTPRINT__ACCESSES = 0; + + /** + * The feature id for the 'Changes' reference list. + * + * + * @generated + * @ordered + */ + int FOOTPRINT__CHANGES = 1; + + /** + * The feature id for the 'Instantiations' reference list. + * + * + * @generated + * @ordered + */ + int FOOTPRINT__INSTANTIATIONS = 2; + + /** + * The number of structural features of the 'Footprint' class. + * + * + * @generated + * @ordered + */ + int FOOTPRINT_FEATURE_COUNT = 3; + + /** + * The number of operations of the 'Footprint' class. + * + * + * @generated + * @ordered + */ + int FOOTPRINT_OPERATION_COUNT = 0; + /** * The meta object id for the 'ISerializable' data type. * @@ -882,7 +946,7 @@ public interface TracePackage extends EPackage { * @see org.eclipse.gemoc.trace.commons.model.trace.impl.TracePackageImpl#getISerializable() * @generated */ - int ISERIALIZABLE = 14; + int ISERIALIZABLE = 15; /** @@ -1116,6 +1180,17 @@ public interface TracePackage extends EPackage { */ EClass getSmallStep(); + /** + * Returns the meta object for the containment reference '{@link org.eclipse.gemoc.trace.commons.model.trace.SmallStep#getFootprint Footprint}'. + * + * + * @return the meta object for the containment reference 'Footprint'. + * @see org.eclipse.gemoc.trace.commons.model.trace.SmallStep#getFootprint() + * @see #getSmallStep() + * @generated + */ + EReference getSmallStep_Footprint(); + /** * Returns the meta object for class '{@link org.eclipse.gemoc.trace.commons.model.trace.SequentialStep Sequential Step}'. * @@ -1306,6 +1381,49 @@ public interface TracePackage extends EPackage { */ EReference getState_Values(); + /** + * Returns the meta object for class '{@link org.eclipse.gemoc.trace.commons.model.trace.Footprint Footprint}'. + * + * + * @return the meta object for class 'Footprint'. + * @see org.eclipse.gemoc.trace.commons.model.trace.Footprint + * @generated + */ + EClass getFootprint(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.gemoc.trace.commons.model.trace.Footprint#getAccesses Accesses}'. + * + * + * @return the meta object for the reference list 'Accesses'. + * @see org.eclipse.gemoc.trace.commons.model.trace.Footprint#getAccesses() + * @see #getFootprint() + * @generated + */ + EReference getFootprint_Accesses(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.gemoc.trace.commons.model.trace.Footprint#getChanges Changes}'. + * + * + * @return the meta object for the reference list 'Changes'. + * @see org.eclipse.gemoc.trace.commons.model.trace.Footprint#getChanges() + * @see #getFootprint() + * @generated + */ + EReference getFootprint_Changes(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.gemoc.trace.commons.model.trace.Footprint#getInstantiations Instantiations}'. + * + * + * @return the meta object for the reference list 'Instantiations'. + * @see org.eclipse.gemoc.trace.commons.model.trace.Footprint#getInstantiations() + * @see #getFootprint() + * @generated + */ + EReference getFootprint_Instantiations(); + /** * Returns the meta object for data type 'ISerializable'. * @@ -1529,6 +1647,14 @@ interface Literals { */ EClass SMALL_STEP = eINSTANCE.getSmallStep(); + /** + * The meta object literal for the 'Footprint' containment reference feature. + * + * + * @generated + */ + EReference SMALL_STEP__FOOTPRINT = eINSTANCE.getSmallStep_Footprint(); + /** * The meta object literal for the '{@link org.eclipse.gemoc.trace.commons.model.trace.impl.SequentialStepImpl Sequential Step}' class. * @@ -1687,6 +1813,40 @@ interface Literals { */ EReference STATE__VALUES = eINSTANCE.getState_Values(); + /** + * The meta object literal for the '{@link org.eclipse.gemoc.trace.commons.model.trace.impl.FootprintImpl Footprint}' class. + * + * + * @see org.eclipse.gemoc.trace.commons.model.trace.impl.FootprintImpl + * @see org.eclipse.gemoc.trace.commons.model.trace.impl.TracePackageImpl#getFootprint() + * @generated + */ + EClass FOOTPRINT = eINSTANCE.getFootprint(); + + /** + * The meta object literal for the 'Accesses' reference list feature. + * + * + * @generated + */ + EReference FOOTPRINT__ACCESSES = eINSTANCE.getFootprint_Accesses(); + + /** + * The meta object literal for the 'Changes' reference list feature. + * + * + * @generated + */ + EReference FOOTPRINT__CHANGES = eINSTANCE.getFootprint_Changes(); + + /** + * The meta object literal for the 'Instantiations' reference list feature. + * + * + * @generated + */ + EReference FOOTPRINT__INSTANTIATIONS = eINSTANCE.getFootprint_Instantiations(); + /** * The meta object literal for the 'ISerializable' data type. * diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/TracedObject.java b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/TracedObject.java index 8b90f663a..01f7d441f 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/TracedObject.java +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/TracedObject.java @@ -52,6 +52,10 @@ public interface TracedObject> extends EOb * * * @model kind="operation" +<<<<<<< HEAD +======= + * annotation="http://www.eclipse.org/emf/2002/GenModel body='// Default implementation, returning empty list.\nfinal EList<DimensionSubType> result = new org.eclipse.emf.ecore.util.BasicInternalEList<DimensionSubType>(Object.class);\nreturn result;'" +>>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) * @generated */ EList getDimensionsInternal(); diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/impl/FootprintImpl.java b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/impl/FootprintImpl.java new file mode 100644 index 000000000..5f24434d9 --- /dev/null +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/impl/FootprintImpl.java @@ -0,0 +1,202 @@ +/** + */ +package org.eclipse.gemoc.trace.commons.model.trace.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectResolvingEList; + +import org.eclipse.gemoc.trace.commons.model.trace.Footprint; +import org.eclipse.gemoc.trace.commons.model.trace.TracePackage; + +/** + * + * An implementation of the model object 'Footprint'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.gemoc.trace.commons.model.trace.impl.FootprintImpl#getAccesses Accesses}
  • + *
  • {@link org.eclipse.gemoc.trace.commons.model.trace.impl.FootprintImpl#getChanges Changes}
  • + *
  • {@link org.eclipse.gemoc.trace.commons.model.trace.impl.FootprintImpl#getInstantiations Instantiations}
  • + *
+ * + * @generated + */ +public class FootprintImpl extends MinimalEObjectImpl.Container implements Footprint { + /** + * The cached value of the '{@link #getAccesses() Accesses}' reference list. + * + * + * @see #getAccesses() + * @generated + * @ordered + */ + protected EList accesses; + + /** + * The cached value of the '{@link #getChanges() Changes}' reference list. + * + * + * @see #getChanges() + * @generated + * @ordered + */ + protected EList changes; + + /** + * The cached value of the '{@link #getInstantiations() Instantiations}' reference list. + * + * + * @see #getInstantiations() + * @generated + * @ordered + */ + protected EList instantiations; + + /** + * + * + * @generated + */ + protected FootprintImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return TracePackage.Literals.FOOTPRINT; + } + + /** + * + * + * @generated + */ + public EList getAccesses() { + if (accesses == null) { + accesses = new EObjectResolvingEList(EObject.class, this, TracePackage.FOOTPRINT__ACCESSES); + } + return accesses; + } + + /** + * + * + * @generated + */ + public EList getChanges() { + if (changes == null) { + changes = new EObjectResolvingEList(EObject.class, this, TracePackage.FOOTPRINT__CHANGES); + } + return changes; + } + + /** + * + * + * @generated + */ + public EList getInstantiations() { + if (instantiations == null) { + instantiations = new EObjectResolvingEList(EClass.class, this, TracePackage.FOOTPRINT__INSTANTIATIONS); + } + return instantiations; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case TracePackage.FOOTPRINT__ACCESSES: + return getAccesses(); + case TracePackage.FOOTPRINT__CHANGES: + return getChanges(); + case TracePackage.FOOTPRINT__INSTANTIATIONS: + return getInstantiations(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case TracePackage.FOOTPRINT__ACCESSES: + getAccesses().clear(); + getAccesses().addAll((Collection)newValue); + return; + case TracePackage.FOOTPRINT__CHANGES: + getChanges().clear(); + getChanges().addAll((Collection)newValue); + return; + case TracePackage.FOOTPRINT__INSTANTIATIONS: + getInstantiations().clear(); + getInstantiations().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case TracePackage.FOOTPRINT__ACCESSES: + getAccesses().clear(); + return; + case TracePackage.FOOTPRINT__CHANGES: + getChanges().clear(); + return; + case TracePackage.FOOTPRINT__INSTANTIATIONS: + getInstantiations().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case TracePackage.FOOTPRINT__ACCESSES: + return accesses != null && !accesses.isEmpty(); + case TracePackage.FOOTPRINT__CHANGES: + return changes != null && !changes.isEmpty(); + case TracePackage.FOOTPRINT__INSTANTIATIONS: + return instantiations != null && !instantiations.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //FootprintImpl diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/impl/SmallStepImpl.java b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/impl/SmallStepImpl.java index 8343d3d88..4a972502d 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/impl/SmallStepImpl.java +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/impl/SmallStepImpl.java @@ -12,20 +12,41 @@ */ package org.eclipse.gemoc.trace.commons.model.trace.impl; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.gemoc.trace.commons.model.trace.SmallStep; import org.eclipse.gemoc.trace.commons.model.trace.State; import org.eclipse.gemoc.trace.commons.model.trace.TracePackage; import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.gemoc.trace.commons.model.trace.Footprint; /** * * An implementation of the model object 'Small Step'. * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.gemoc.trace.commons.model.trace.impl.SmallStepImpl#getFootprint Footprint}
  • + *
* * @generated */ public abstract class SmallStepImpl> extends StepImpl implements SmallStep { + /** + * The cached value of the '{@link #getFootprint() Footprint}' containment reference. + * + * + * @see #getFootprint() + * @generated + * @ordered + */ + protected Footprint footprint; + /** * * @@ -45,4 +66,119 @@ protected EClass eStaticClass() { return TracePackage.Literals.SMALL_STEP; } + /** + * + * + * @generated + */ + public Footprint getFootprint() { + return footprint; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetFootprint(Footprint newFootprint, NotificationChain msgs) { + Footprint oldFootprint = footprint; + footprint = newFootprint; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TracePackage.SMALL_STEP__FOOTPRINT, oldFootprint, newFootprint); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setFootprint(Footprint newFootprint) { + if (newFootprint != footprint) { + NotificationChain msgs = null; + if (footprint != null) + msgs = ((InternalEObject)footprint).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TracePackage.SMALL_STEP__FOOTPRINT, null, msgs); + if (newFootprint != null) + msgs = ((InternalEObject)newFootprint).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - TracePackage.SMALL_STEP__FOOTPRINT, null, msgs); + msgs = basicSetFootprint(newFootprint, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, TracePackage.SMALL_STEP__FOOTPRINT, newFootprint, newFootprint)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case TracePackage.SMALL_STEP__FOOTPRINT: + return basicSetFootprint(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case TracePackage.SMALL_STEP__FOOTPRINT: + return getFootprint(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case TracePackage.SMALL_STEP__FOOTPRINT: + setFootprint((Footprint)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case TracePackage.SMALL_STEP__FOOTPRINT: + setFootprint((Footprint)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case TracePackage.SMALL_STEP__FOOTPRINT: + return footprint != null; + } + return super.eIsSet(featureID); + } + } //SmallStepImpl diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/impl/TraceFactoryImpl.java b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/impl/TraceFactoryImpl.java index bb85f25b4..f98b9e110 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/impl/TraceFactoryImpl.java +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/impl/TraceFactoryImpl.java @@ -70,6 +70,7 @@ public EObject create(EClass eClass) { case TracePackage.MSE_OCCURRENCE: return createMSEOccurrence(); case TracePackage.MSE_MODEL: return createMSEModel(); case TracePackage.GENERIC_MSE: return createGenericMSE(); + case TracePackage.FOOTPRINT: return createFootprint(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } @@ -138,6 +139,16 @@ public GenericMSE createGenericMSE() { return genericMSE; } + /** + * + * + * @generated + */ + public Footprint createFootprint() { + FootprintImpl footprint = new FootprintImpl(); + return footprint; + } + /** * * diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/impl/TracePackageImpl.java b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/impl/TracePackageImpl.java index fec0d99dc..7e843219b 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/impl/TracePackageImpl.java +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/impl/TracePackageImpl.java @@ -18,6 +18,7 @@ import org.eclipse.gemoc.trace.commons.model.trace.BigStep; import org.eclipse.gemoc.trace.commons.model.trace.Dimension; +import org.eclipse.gemoc.trace.commons.model.trace.Footprint; import org.eclipse.gemoc.trace.commons.model.trace.GenericMSE; import org.eclipse.gemoc.trace.commons.model.trace.MSEModel; import org.eclipse.gemoc.trace.commons.model.trace.MSEOccurrence; @@ -137,6 +138,13 @@ public class TracePackageImpl extends EPackageImpl implements TracePackage { */ private EClass stateEClass = null; + /** + * + * + * @generated + */ + private EClass footprintEClass = null; + /** * * @@ -434,7 +442,19 @@ public EClass getSmallStep() { * * @generated */ +<<<<<<< HEAD @Override +======= + public EReference getSmallStep_Footprint() { + return (EReference)smallStepEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ +>>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) public EClass getSequentialStep() { return sequentialStepEClass; } @@ -614,7 +634,46 @@ public EReference getState_Values() { * * @generated */ +<<<<<<< HEAD @Override +======= + public EClass getFootprint() { + return footprintEClass; + } + + /** + * + * + * @generated + */ + public EReference getFootprint_Accesses() { + return (EReference)footprintEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getFootprint_Changes() { + return (EReference)footprintEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EReference getFootprint_Instantiations() { + return (EReference)footprintEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ +>>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) public EDataType getISerializable() { return iSerializableEDataType; } @@ -676,6 +735,7 @@ public void createPackageContents() { createEReference(bigStepEClass, BIG_STEP__SUB_STEPS); smallStepEClass = createEClass(SMALL_STEP); + createEReference(smallStepEClass, SMALL_STEP__FOOTPRINT); sequentialStepEClass = createEClass(SEQUENTIAL_STEP); @@ -702,6 +762,11 @@ public void createPackageContents() { createEReference(stateEClass, STATE__ENDED_STEPS); createEReference(stateEClass, STATE__VALUES); + footprintEClass = createEClass(FOOTPRINT); + createEReference(footprintEClass, FOOTPRINT__ACCESSES); + createEReference(footprintEClass, FOOTPRINT__CHANGES); + createEReference(footprintEClass, FOOTPRINT__INSTANTIATIONS); + // Create data types iSerializableEDataType = createEDataType(ISERIALIZABLE); } @@ -891,6 +956,7 @@ public void initializePackageContents() { initEReference(getBigStep_SubSteps(), g1, null, "subSteps", null, 0, -1, BigStep.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(smallStepEClass, SmallStep.class, "SmallStep", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getSmallStep_Footprint(), this.getFootprint(), null, "footprint", null, 0, 1, SmallStep.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(sequentialStepEClass, SequentialStep.class, "SequentialStep", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -929,6 +995,11 @@ public void initializePackageContents() { g1 = createEGenericType(stateEClass_ValueSubType); initEReference(getState_Values(), g1, this.getValue_States(), "values", null, 0, -1, State.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEClass(footprintEClass, Footprint.class, "Footprint", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getFootprint_Accesses(), theEcorePackage.getEObject(), null, "accesses", null, 0, -1, Footprint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getFootprint_Changes(), theEcorePackage.getEObject(), null, "changes", null, 0, -1, Footprint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getFootprint_Instantiations(), theEcorePackage.getEClass(), null, "instantiations", null, 0, -1, Footprint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + // Initialize data types initEDataType(iSerializableEDataType, byte[].class, "ISerializable", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/util/TraceAdapterFactory.java b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/util/TraceAdapterFactory.java index 799065126..98a1f571f 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/util/TraceAdapterFactory.java +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/util/TraceAdapterFactory.java @@ -136,6 +136,10 @@ public , ValueSubType extends Value> Adapter case return createStateAdapter(); } @Override + public Adapter caseFootprint(Footprint object) { + return createFootprintAdapter(); + } + @Override public Adapter caseEModelElement(EModelElement object) { return createEModelElementAdapter(); } @@ -359,6 +363,20 @@ public Adapter createStateAdapter() { return null; } + /** + * Creates a new adapter for an object of class '{@link org.eclipse.gemoc.trace.commons.model.trace.Footprint Footprint}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.gemoc.trace.commons.model.trace.Footprint + * @generated + */ + public Adapter createFootprintAdapter() { + return null; + } + /** * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecore.EModelElement EModel Element}'. * diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/util/TraceSwitch.java b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/util/TraceSwitch.java index b4ab90544..ec9ee9ad7 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/util/TraceSwitch.java +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/util/TraceSwitch.java @@ -173,6 +173,12 @@ protected T doSwitch(int classifierID, EObject theEObject) { if (result == null) result = defaultCase(theEObject); return result; } + case TracePackage.FOOTPRINT: { + Footprint footprint = (Footprint)theEObject; + T result = caseFootprint(footprint); + if (result == null) result = defaultCase(theEObject); + return result; + } default: return defaultCase(theEObject); } } @@ -387,6 +393,21 @@ public , ValueSubType extends Value> T caseState( return null; } + /** + * Returns the result of interpreting the object as an instance of 'Footprint'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Footprint'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseFootprint(Footprint object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'EModel Element'. * From fc11637681d5f10ac36a07456fdbd7605679ee6c Mon Sep 17 00:00:00 2001 From: Steffen Zschaler Date: Fri, 22 May 2020 14:50:04 +0100 Subject: [PATCH 02/29] Ensure UTF-8 encoding --- .../.settings/org.eclipse.core.resources.prefs | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/.settings/org.eclipse.core.resources.prefs diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/.settings/org.eclipse.core.resources.prefs b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..4824b8026 --- /dev/null +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 From 88b826e9c1919a1669142a718859f88f08c3584e Mon Sep 17 00:00:00 2001 From: Erwan Bousse Date: Mon, 18 Jan 2021 15:16:52 +0100 Subject: [PATCH 03/29] Bump xtend compiler to 2.22.0 rebase wrt master (jd) --- pom.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pom.xml b/pom.xml index 7b3f53fd5..b4465f4ec 100644 --- a/pom.xml +++ b/pom.xml @@ -39,6 +39,9 @@ + 1.7.0 + 2.22.0 + UTF-8 scm:git:https://github.com/eclipse/gemoc-studio-modeldebugging.git From fe2e32764a7a997bc477bbbaa6aa9a717ccdba46 Mon Sep 17 00:00:00 2001 From: Erwan Bousse Date: Tue, 19 Jan 2021 10:15:25 +0100 Subject: [PATCH 04/29] Undo xtend bump --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b4465f4ec..564a5e6d3 100644 --- a/pom.xml +++ b/pom.xml @@ -40,7 +40,7 @@ 1.7.0 - 2.22.0 + 2.21.0 UTF-8 scm:git:https://github.com/eclipse/gemoc-studio-modeldebugging.git From b029514e18d916a5aa9039ff09e1f0d1d0a4afee Mon Sep 17 00:00:00 2001 From: Erwan Bousse Date: Mon, 15 Feb 2021 13:08:30 +0100 Subject: [PATCH 05/29] Format + fix null pointers in setTimelineProvider rebase wrt master (jd) --- .../timeline/view/AbstractTimelineView.java | 843 ++++++++++++++++++ 1 file changed, 843 insertions(+) create mode 100644 commons/plugins/org.eclipse.gemoc.timeline/src/org/eclipse/gemoc/timeline/view/AbstractTimelineView.java diff --git a/commons/plugins/org.eclipse.gemoc.timeline/src/org/eclipse/gemoc/timeline/view/AbstractTimelineView.java b/commons/plugins/org.eclipse.gemoc.timeline/src/org/eclipse/gemoc/timeline/view/AbstractTimelineView.java new file mode 100644 index 000000000..202b3416b --- /dev/null +++ b/commons/plugins/org.eclipse.gemoc.timeline/src/org/eclipse/gemoc/timeline/view/AbstractTimelineView.java @@ -0,0 +1,843 @@ +/******************************************************************************* + * Copyright (c) 2017 Inria and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Inria - initial API and implementation + *******************************************************************************/ +package org.eclipse.gemoc.timeline.view; + +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.commands.Command; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.NotEnabledException; +import org.eclipse.core.commands.NotHandledException; +import org.eclipse.core.commands.State; +import org.eclipse.core.commands.common.NotDefinedException; +import org.eclipse.core.runtime.Status; +import org.eclipse.draw2d.ColorConstants; +import org.eclipse.draw2d.FigureCanvas; +import org.eclipse.draw2d.geometry.Point; +import org.eclipse.gef.editparts.ScalableFreeformRootEditPart; +import org.eclipse.gef.editparts.ZoomListener; +import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer; +import org.eclipse.gemoc.timeline.Activator; +import org.eclipse.gemoc.timeline.editpart.BranchEditPart; +import org.eclipse.gemoc.timeline.editpart.ChoiceEditPart; +import org.eclipse.gemoc.timeline.editpart.PossibleStepEditPart; +import org.eclipse.gemoc.timeline.editpart.TimelineEditPartFactory; +import org.eclipse.gemoc.timeline.model.ITimelineWindowListener; +import org.eclipse.gemoc.timeline.model.TimelineWindow; +import org.eclipse.jface.action.GroupMarker; +import org.eclipse.jface.action.IMenuListener; +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.viewers.IContentProvider; +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.SashForm; +import org.eclipse.swt.events.ControlEvent; +import org.eclipse.swt.events.ControlListener; +import org.eclipse.swt.events.KeyEvent; +import org.eclipse.swt.events.KeyListener; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.MouseListener; +import org.eclipse.swt.events.MouseMoveListener; +import org.eclipse.swt.events.MouseWheelListener; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Canvas; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.Slider; +import org.eclipse.ui.IWorkbenchActionConstants; +import org.eclipse.ui.commands.ICommandService; +import org.eclipse.ui.dialogs.FilteredTree; +import org.eclipse.ui.dialogs.PatternFilter; +import org.eclipse.ui.handlers.IHandlerService; +import org.eclipse.ui.handlers.RegistryToggleState; +import org.eclipse.ui.part.ViewPart; + +/** + * A graphical timeline view with an overview and a detail viewer. + * + * @author Yvan Lussaud + */ +public abstract class AbstractTimelineView extends ViewPart { + + /** + * The timeline {@link MouseWheelListener}. + * + * @author Yvan Lussaud + */ + private final class TimelineMouseWheelListener implements MouseWheelListener { + @Override + public void mouseScrolled(MouseEvent e) { + if ((e.stateMask & SWT.MOD1) != 0) { + zoom(e); + } else { + scroll(e); + } + } + + /** + * Scrolls according to the given {@link MouseEvent}. + * + * @param e + * the {@link MouseEvent} + */ + private void scroll(MouseEvent e) { + final FigureCanvas canvas = (FigureCanvas)timelineViewer.getControl(); + if (canvas.getVerticalBar() != null) { + int offsetY = canvas.getVerticalBar().getSelection(); + if (e.count > 0) { + int destinationY = offsetY + 10; + if (destinationY <= canvas.getVerticalBar().getMinimum()) { + canvas.scrollTo(0, destinationY); + } + } else { + int destinationY = offsetY - 10; + if (destinationY >= canvas.getVerticalBar().getMaximum()) { + canvas.scrollTo(0, destinationY); + } + } + } + } + + /** + * Zooms according to the given {@link MouseEvent}. + * + * @param e + * the {@link MouseEvent} + */ + private void zoom(MouseEvent e) { + if (e.count > 0) { + rootEditPart.getZoomManager().zoomIn(); + } else { + rootEditPart.getZoomManager().zoomOut(); + final int length = getWindowLength(); + if (provider != null && timelineWindow.getStart() + length > timelineWindow + .getMaxTimelineIndex() + nbVirtualChoices && timelineWindow.getMaxTimelineIndex() + + nbVirtualChoices - length >= 0) { + timelineWindow.setStart(timelineWindow.getMaxTimelineIndex() + nbVirtualChoices - length); + } + } + } + } + + /** + * {@link KeyListener} for the timeline viewer. + * + * @author Yvan Lussaud + */ + private final class TimelineKeyListener implements KeyListener { + + @Override + public void keyReleased(KeyEvent e) { + // nothing to do here + } + + @Override + public void keyPressed(KeyEvent e) { + final PossibleStepEditPart toSelect; + final List selected = timelineViewer.getSelectedEditParts(); + if (selected.size() == 1 && selected.get(0) instanceof PossibleStepEditPart) { + final PossibleStepEditPart part = (PossibleStepEditPart)selected.get(0); + switch (e.keyCode) { + case SWT.ARROW_LEFT: + // shift the TimelineWindow if needed + if (timelineWindow.getStart() > part.getModel().getChoice().getIndex() - 1 && part + .getModel().getChoice().getIndex() - 1 >= 0) { + if (follow) { + toggleFollow(); + } + timelineWindow.setStart(timelineWindow.getStart() - 1); + } + toSelect = part.getLeftPossibleStepEditPart(); + break; + + case SWT.ARROW_RIGHT: + // shift the TimelineWindow if needed + if (timelineWindow.getEnd() <= part.getModel().getChoice().getIndex() + 1 && part + .getModel().getChoice().getIndex() + 1 <= timelineWindow.getMaxTimelineIndex() + + nbVirtualChoices) { + timelineWindow.setStart(timelineWindow.getStart() + 1); + } + toSelect = part.getRightPossibleStepEditPart(); + break; + + case SWT.ARROW_UP: + toSelect = part.getAbovePossibleStepEditPart(); + break; + + case SWT.ARROW_DOWN: + toSelect = part.getBeneathPossibleStepEditPart(); + break; + + default: + toSelect = null; + break; + } + + if (toSelect != null) { + timelineViewer.getSelectionManager().deselectAll(); + timelineViewer.getSelectionManager().appendSelection(toSelect); + part.getViewer().reveal(toSelect); + } + } + } + } + + /** + * Mouse listener handling the scroll. + * + * @author Yvan Lussaud + */ + private final class TimelineMouseListener implements MouseListener, MouseMoveListener { + + /** + * The position on the mouse down event. + */ + private Point originMousePosition; + + /** + * The offset of the scroll bars on the mouse down event. + */ + private Point offset = new Point(); + + /** + * The shift applied to the timeline window so far. + */ + private int doneShift; + + @Override + public void mouseDoubleClick(MouseEvent e) { + // nothing to do here + } + + @Override + public void mouseDown(MouseEvent e) { + if (e.button == 1) { + originMousePosition = new Point(e.x, e.y); + final Canvas canevas = (Canvas)timelineViewer.getControl(); + doneShift = 0; + if (canevas.getVerticalBar() != null) { + offset.y = canevas.getVerticalBar().getSelection(); + } else { + offset.y = 0; + } + } + } + + @Override + public void mouseUp(MouseEvent e) { + if (e.button == 1) { + originMousePosition = null; + } + } + + @Override + public void mouseMove(MouseEvent e) { + if (originMousePosition != null) { + final FigureCanvas canvas = (FigureCanvas)timelineViewer.getControl(); + canvas.scrollTo(offset.x, offset.y - e.y + originMousePosition.y); + final int shift = (int)((-e.x + originMousePosition.x) / (PossibleStepEditPart.SIZE + + BranchEditPart.SPACING) / rootEditPart.getZoomManager().getZoom()) - doneShift; + final int multiplier; + if ((e.stateMask & SWT.MOD1) != 0) { + multiplier = timelineWindow.getLength(); + } else { + multiplier = 1; + } + if (follow && shift < 0) { + toggleFollow(); + } + if (timelineWindow.getStart() + shift * multiplier < 0) { + timelineWindow.setStart(0); + } else if (provider != null && timelineWindow.getStart() + timelineWindow.getLength() + shift + * multiplier > timelineWindow.getMaxTimelineIndex() + nbVirtualChoices) { + timelineWindow.setStart(Math.max(timelineWindow.getMaxTimelineIndex() + nbVirtualChoices + - timelineWindow.getLength(), 0)); + } else if (shift != 0) { + doneShift += shift; + timelineWindow.setStart(timelineWindow.getStart() + shift * multiplier); + } + } + } + } + + /** + * Lister to the {@link TimelineWindow} and update the slide bar. + * + * @author Yvan Lussaud + */ + private class TimelineWindowListener extends ITimelineWindowListener.Stub { + + @Override + public void endChanged(int branch, int end) { + Display.getDefault().syncExec(new Runnable() { + + @Override + public void run() { + if (!timelineSlider.isDisposed()) { + timelineSlider.setMaximum(timelineWindow.getMaxTimelineIndex() + nbVirtualChoices); + timelineSlider.setVisible(timelineWindow.getLength() < timelineWindow + .getMaxTimelineIndex() + nbVirtualChoices); + } + if (follow && provider != null) { + int start = timelineWindow.getMaxTimelineIndex() + nbVirtualChoices - timelineWindow + .getLength(); + if (start < 0) { + start = 0; + } + timelineWindow.setStart(start); + } + } + }); + } + + @Override + public void startChanged(final int start) { + Display.getDefault().syncExec(new Runnable() { + + @Override + public void run() { + if (!timelineSlider.isDisposed()) { + timelineSlider.setSelection(start); + } + timelineWindow.setLength(getWindowLength()); + } + }); + } + + @Override + public void lengthChanged(final int length) { + Display.getDefault().syncExec(new Runnable() { + + @Override + public void run() { + if (!timelineSlider.isDisposed()) { + timelineSlider.setPageIncrement(length); + timelineSlider.setThumb(length); + if (provider != null) { + timelineSlider.setMaximum(timelineWindow.getMaxTimelineIndex() + + nbVirtualChoices); + timelineSlider.setVisible(timelineWindow.getLength() < timelineWindow + .getMaxTimelineIndex() + nbVirtualChoices); + } else { + timelineSlider.setVisible(false); + } + } + if (follow && provider != null) { + int start = timelineWindow.getMaxTimelineIndex() + nbVirtualChoices - length; + if (start >= 0) { + timelineWindow.setStart(start); + } + } + } + }); + } + } + + /** + * The ID of this {@link ViewPart}. + */ + public static final String ID = "org.eclipse.gemoc.timeline.view"; + + /** + * The detail view ratio. + */ + private static final int DETAIL_RATIO = 10; + + /** + * The timeline view ratio. + */ + private static final int TIMELINE_RATIO = 90; + + /** + * The detail {@link TreeViewer}. + */ + private TreeViewer detailViewer; + + /** + * The timeline {@link ScrollingGraphicalViewer}. + */ + private ScrollingGraphicalViewer timelineViewer; + + /** + * The {@link ScalableFreeformRootEditPart}. + */ + private ScalableFreeformRootEditPart rootEditPart; + + /** + * Timeline {@link Slider}. + */ + private Slider timelineSlider; + + /** + * The {@link TimelineWindow}. + */ + private TimelineWindow timelineWindow; + + /** + * The {@link ITimelineProvider}. + */ + private ITimelineProvider provider; + + /** + * The timeline window listener. + */ + private ITimelineWindowListener timelineWindowListener; + + /** + * Tells if we should follow the last position or not. + */ + private boolean follow; + + /** + * The number of virtual choices. virtually mapped in the last choice pixel space. + */ + private int nbVirtualChoices; + + /** + * The {@link MenuManager}. + */ + private MenuManager menuManager; + + @Override + public void createPartControl(Composite parent) { + final Composite container; + if (hasDetailViewer()) { + final SashForm mainSashForm = new SashForm(parent, SWT.HORIZONTAL); + container = mainSashForm; + detailViewer = createDetailViewer(container); + } else { + container = parent; + } + timelineViewer = new ScrollingGraphicalViewer(); + Composite timelineComposite = new Composite(container, SWT.NONE); + timelineComposite.setLayout(new FillLayout(SWT.HORIZONTAL | SWT.VERTICAL)); + if (hasDetailViewer()) { + ((SashForm)container).setWeights(new int[] {DETAIL_RATIO, TIMELINE_RATIO, }); + } + GridLayout layout = new GridLayout(1, false); + timelineComposite.setLayout(layout); + timelineViewer.createControl(timelineComposite); + + timelineSlider = new Slider(timelineComposite, SWT.HORIZONTAL); + GridData gridData = new GridData(); + gridData.horizontalAlignment = SWT.FILL; + timelineSlider.setLayoutData(gridData); + gridData.grabExcessHorizontalSpace = true; + + rootEditPart = new ScalableFreeformRootEditPart(); + rootEditPart.setViewer(timelineViewer); + timelineViewer.setRootEditPart(rootEditPart); + gridData = new GridData(); + gridData.horizontalAlignment = SWT.FILL; + gridData.grabExcessHorizontalSpace = true; + gridData.verticalAlignment = SWT.FILL; + gridData.grabExcessVerticalSpace = true; + timelineViewer.getControl().setLayoutData(gridData); + timelineViewer.setEditPartFactory(getTimelineEditPartFactory()); + if (timelineWindow == null) { + timelineWindow = new TimelineWindow(provider); + } + timelineViewer.setContents(timelineWindow); + timelineSlider.setPageIncrement(timelineWindow.getLength()); + timelineSlider.setThumb(timelineWindow.getLength()); + timelineSlider.setSelection(timelineWindow.getStart()); + if (provider != null) { + timelineSlider.setMaximum(timelineWindow.getMaxTimelineIndex() + nbVirtualChoices); + timelineSlider.setVisible(timelineWindow.getLength() < timelineWindow.getMaxTimelineIndex() + + nbVirtualChoices); + } else { + timelineSlider.setVisible(false); + } + timelineSlider.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + if (follow) { + toggleFollow(); + } + timelineWindow.setStart(timelineSlider.getSelection()); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + if (follow) { + toggleFollow(); + } + timelineWindow.setStart(timelineSlider.getSelection()); + } + + }); + if (timelineWindowListener == null) { + timelineWindowListener = new TimelineWindowListener(); + } + timelineWindow.addTimelineWindowListener(timelineWindowListener); + if (provider != null) { + provider.addTimelineListener(timelineWindowListener); + } + timelineViewer.getControl().setBackground(ColorConstants.listBackground); + if (hasDetailViewer()) { + timelineViewer.addSelectionChangedListener(new ISelectionChangedListener() { + + @Override + public void selectionChanged(SelectionChangedEvent event) { + final ISelection selection = event.getSelection(); + if (selection instanceof IStructuredSelection) { + final Object firstElement = ((IStructuredSelection)selection).getFirstElement(); + if (firstElement instanceof PossibleStepEditPart) { + final PossibleStepEditPart possibleStepEditPart = (PossibleStepEditPart)firstElement; + detailViewer.setInput(possibleStepEditPart.getModel().getPossibleStep()); + } + } + } + }); + } + timelineViewer.getControl().addKeyListener(new TimelineKeyListener()); + final TimelineMouseListener listener = new TimelineMouseListener(); + timelineViewer.getControl().addMouseListener(listener); + timelineViewer.getControl().addMouseMoveListener(listener); + timelineViewer.getControl().addMouseWheelListener(new TimelineMouseWheelListener()); + rootEditPart.getZoomManager().addZoomListener(new ZoomListener() { + + @Override + public void zoomChanged(double zoom) { + timelineWindow.setLength(getWindowLength()); + } + + }); + timelineViewer.getControl().addControlListener(new ControlListener() { + + @Override + public void controlResized(ControlEvent e) { + timelineWindow.setLength(getWindowLength()); + final Canvas canevas = (Canvas)timelineViewer.getControl(); + canevas.getHorizontalBar().setVisible(false); + } + + @Override + public void controlMoved(ControlEvent e) { + // nothing to do here + } + }); + + final ICommandService cmdService = (ICommandService)getSite().getService(ICommandService.class); + String commandID = getFollowCommandID(); + if (commandID != null) { + final Command followCommand = cmdService.getCommand(commandID); + if (followCommand != null) { + final State state = followCommand.getState(RegistryToggleState.STATE_ID); + follow = state != null && ((Boolean)state.getValue()).booleanValue(); + } + } + createMenuManager(); + } + + /** + * Creates the {@link MenuManager}. + */ + private void createMenuManager() { + menuManager = new MenuManager(); + menuManager.setRemoveAllWhenShown(true); + menuManager.addMenuListener(new IMenuListener() { + public void menuAboutToShow(IMenuManager mgr) { + fillContextMenu(mgr); + } + }); + Menu menu = menuManager.createContextMenu(timelineViewer.getControl()); + timelineViewer.getControl().setMenu(menu); + getSite().registerContextMenu(menuManager, timelineViewer); + // make the selection available + getSite().setSelectionProvider(timelineViewer); + } + + /** + * Fills the context menu. + * + * @param mgr + * the {@link IMenuManager} + */ + private void fillContextMenu(IMenuManager mgr) { + mgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); + } + + /** + * Gets the {@link TimelineEditPartFactory}. + * + * @return the {@link TimelineEditPartFactory} + */ + protected abstract TimelineEditPartFactory getTimelineEditPartFactory(); + + /** + * Toggle the follow value via the command. + */ + private void toggleFollow() { + final IHandlerService handlerService = (IHandlerService)getSite().getService(IHandlerService.class); + try { + final String commandId = getFollowCommandID(); + if (commandId != null) { + handlerService.executeCommand(commandId, null); + } + } catch (ExecutionException e1) { + Activator.getDefault().getLog().log(new Status(Status.ERROR, Activator.PLUGIN_ID, e1 + .getMessage())); + } catch (NotDefinedException e1) { + Activator.getDefault().getLog().log(new Status(Status.ERROR, Activator.PLUGIN_ID, e1 + .getMessage())); + } catch (NotEnabledException e1) { + Activator.getDefault().getLog().log(new Status(Status.ERROR, Activator.PLUGIN_ID, e1 + .getMessage())); + } catch (NotHandledException e1) { + Activator.getDefault().getLog().log(new Status(Status.ERROR, Activator.PLUGIN_ID, e1 + .getMessage())); + } + } + + /** + * Gets the timeline viewer. + * + * @return the timeline viewer + */ + public ScrollingGraphicalViewer getTimelineViewer() { + return timelineViewer; + } + + /** + * Sets the {@link ITimelineProvider}. + * + * @param timelineProvider + * the {@link ITimelineProvider} + * @param start + * the new start + */ + public void setTimelineProvider(ITimelineProvider timelineProvider, int start) { + + if (timelineWindow == null) { + timelineWindow = new TimelineWindow(timelineProvider); + } + if (timelineWindowListener == null) { + timelineWindowListener = new TimelineWindowListener(); + } + + timelineWindow.setProvider(timelineProvider, start); + if (this.provider != null) { + this.provider.removeTimelineListener(timelineWindowListener); + } + this.provider = timelineProvider; + if (timelineProvider != null) { + this.provider.addTimelineListener(timelineWindowListener); + } + timelineWindow.setLength(getWindowLength()); + + } + + /** + * Gets the start point of the displayed timeline. + * + * @return the start point of the displayed timeline + */ + public int getStart() { + final int res; + + if (timelineWindow != null) { + res = timelineWindow.getStart(); + } else { + res = 0; + } + + return res; + } + + /** + * Gets the length of the {@link TimelineWindow}. + * + * @return the length of the {@link TimelineWindow} + */ + @SuppressWarnings("unchecked") + private int getWindowLength() { + int length = 0; + + double averageWidth = PossibleStepEditPart.SIZE; + int lastChoiceWidth = PossibleStepEditPart.SIZE; + if (provider != null && timelineViewer != null) { + for (BranchEditPart branchEditPart : (List)timelineViewer.getContents() + .getChildren()) { + double[] widthes = computeWidthesForBranch(branchEditPart); + averageWidth = Math.max(averageWidth, widthes[0]); + lastChoiceWidth = Math.max(lastChoiceWidth, (int)widthes[1]); + } + final double baseWidth = (averageWidth + BranchEditPart.SPACING) * rootEditPart.getZoomManager() + .getZoom(); + if (timelineViewer.getControl().getBounds().width > 2 * BranchEditPart.MARGIN) { + length = (int)Math.floor((timelineViewer.getControl().getBounds().width - 2 + * BranchEditPart.MARGIN) / baseWidth); + } else { + length = 0; + } + if (lastChoiceWidth > PossibleStepEditPart.SIZE) { + nbVirtualChoices = (int)(Math.floor(lastChoiceWidth * rootEditPart.getZoomManager().getZoom() + / baseWidth)); + if (provider != null) { + timelineSlider.setMaximum(timelineWindow.getMaxTimelineIndex() + nbVirtualChoices); + } + } + } + + return length; + } + + /** + * Computes the average width and the last choice width for the given {@link BranchEditPart}. + * + * @param branchEditPart + * the {@link BranchEditPart} + * @return the computed average width and last choice width + */ + private double[] computeWidthesForBranch(BranchEditPart branchEditPart) { + double averageWidth = 0; + int lastChoiceWidth = 0; + + if (branchEditPart.getChildren().size() != 0) { + Iterator it = (Iterator)branchEditPart.getChildren().iterator(); + while (it.hasNext()) { + ChoiceEditPart editPart = it.next(); + if (timelineWindow.getEnd() >= timelineWindow.getMaxTimelineIndex()) { + if (it.hasNext()) { + averageWidth += editPart.getFigure().getPreferredSize().width; + } else { + lastChoiceWidth = editPart.getFigure().getPreferredSize(Integer.MAX_VALUE, + Integer.MAX_VALUE).width; + } + } else { + averageWidth += editPart.getFigure().getPreferredSize().width; + } + } + averageWidth /= branchEditPart.getChildren().size(); + } else { + averageWidth = PossibleStepEditPart.SIZE; + lastChoiceWidth = PossibleStepEditPart.SIZE; + } + + return new double[] {averageWidth, lastChoiceWidth }; + } + + /** + * Creates the detail {@link TreeViewer}. + * + * @param parent + * the parent {@link Composite} + * @return the created detail {@link TreeViewer} + */ + protected TreeViewer createDetailViewer(Composite parent) { + final FilteredTree treeViewer = new FilteredTree(parent, SWT.None, createDetailPatternFilter(), + false); + return treeViewer.getViewer(); + } + + /** + * Sets the detail view content provider. + * + * @param detailContentProvider + * the {@link IContentProvider} + */ + public void setDetailViewerContentProvider(IContentProvider detailContentProvider) { + if (detailViewer != null) { + detailViewer.setContentProvider(detailContentProvider); + } + } + + /** + * Sets the detail view label provider. + * + * @param detailLabelProvider + * the {@link ILabelProvider} + */ + public void setDetailViewerLabelProvider(ILabelProvider detailLabelProvider) { + if (detailViewer != null) { + detailViewer.setLabelProvider(detailLabelProvider); + } + } + + /** + * Creates a {@link PatternFilter} for the detail view. + * + * @return the created {@link PatternFilter} for the detail view + */ + protected PatternFilter createDetailPatternFilter() { + PatternFilter res = new PatternFilter(); + return res; + } + + /** + * Gets the detail {@link Viewer}. + * + * @return the detail {@link Viewer} if any, null otherwise + */ + public Viewer getDetailViewer() { + return detailViewer; + } + + @Override + public void setFocus() { + if (timelineViewer != null) { + timelineViewer.getControl().setFocus(); + } + } + + @Override + public void dispose() { + timelineWindow.removeTimelineWindowListener(timelineWindowListener); + super.dispose(); + } + + /** + * Sets the follow last choice value. + * + * @param newFollow + * the new follow value + */ + public void setFollow(boolean newFollow) { + this.follow = newFollow; + if (follow && provider != null && timelineWindow != null) { + int start = timelineWindow.getMaxTimelineIndex() + nbVirtualChoices - timelineWindow.getLength(); + if (start >= 0) { + timelineWindow.setStart(start); + } + } + } + + /** + * Tells if the {@link AbstractTimelineView#getDetailViewer() detail viewer} exists for this view. + * + * @return true if the {@link AbstractTimelineView#getDetailViewer() detail viewer} exists + * for this view, false otherwise + */ + public abstract boolean hasDetailViewer(); + + /** + * Gets the ID of the follow toggle command if any, null otherwise. + * + * @return the ID of the follow toggle command if any, null otherwise + */ + public abstract String getFollowCommandID(); + +} From c19c71a658133de83356d775ef33451ef196fd89 Mon Sep 17 00:00:00 2001 From: Erwan Bousse Date: Wed, 20 May 2020 10:12:32 +0200 Subject: [PATCH 06/29] Add Footprint EClass to trace metamodel rebase wrt master (jd) Signed-off-by: Erwan Bousse -<<<<<<< HEAD - - -======= ->>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) GenericTrace.ecore platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore http://www.eclipse.org/emf/2002/Ecore @@ -15,11 +10,7 @@ -<<<<<<< HEAD - -======= ->>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) @@ -28,11 +19,7 @@ -<<<<<<< HEAD - -======= ->>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) @@ -723,20 +710,6 @@
-<<<<<<< HEAD - - - - - - - - - - - - -=======
@@ -749,7 +722,6 @@ ->>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel)
@@ -1151,22 +1123,6 @@ - - - - - - - - - - - - - - - -
@@ -1256,11 +1212,7 @@ -<<<<<<< HEAD - -======= ->>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) KEEP_LOCATION @@ -1358,11 +1310,7 @@ -<<<<<<< HEAD - -======= ->>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) @@ -1776,167 +1724,6 @@ -<<<<<<< HEAD - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -======= ->>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) @@ -1987,125 +1774,6 @@ -<<<<<<< HEAD - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - - - - - - - - - - - - - - - - - - - - - italic - - - - - - - - - - italic - - - - - - - - - - italic - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - labelSize - - -======= @@ -2686,22 +2354,11 @@ labelSize ->>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) labelSize -<<<<<<< HEAD - - - - - - labelSize - - -======= @@ -2739,7 +2396,6 @@ labelSize ->>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) labelSize diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/TracedObject.java b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/TracedObject.java index 01f7d441f..40c481945 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/TracedObject.java +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/TracedObject.java @@ -52,10 +52,7 @@ public interface TracedObject> extends EOb * * * @model kind="operation" -<<<<<<< HEAD -======= * annotation="http://www.eclipse.org/emf/2002/GenModel body='// Default implementation, returning empty list.\nfinal EList<DimensionSubType> result = new org.eclipse.emf.ecore.util.BasicInternalEList<DimensionSubType>(Object.class);\nreturn result;'" ->>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) * @generated */ EList getDimensionsInternal(); diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/impl/TracePackageImpl.java b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/impl/TracePackageImpl.java index 7e843219b..650294648 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/impl/TracePackageImpl.java +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/impl/TracePackageImpl.java @@ -442,9 +442,7 @@ public EClass getSmallStep() { * * @generated */ -<<<<<<< HEAD @Override -======= public EReference getSmallStep_Footprint() { return (EReference)smallStepEClass.getEStructuralFeatures().get(0); } @@ -454,7 +452,7 @@ public EReference getSmallStep_Footprint() { * * @generated */ ->>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) + public EClass getSequentialStep() { return sequentialStepEClass; } @@ -634,9 +632,7 @@ public EReference getState_Values() { * * @generated */ -<<<<<<< HEAD @Override -======= public EClass getFootprint() { return footprintEClass; } @@ -673,7 +669,7 @@ public EReference getFootprint_Instantiations() { * * @generated */ ->>>>>>> 6a6b587 (Add Footprint EClass to trace metamodel) + public EDataType getISerializable() { return iSerializableEDataType; } From bbf36f8217323a1f0fd2949e5eb9be9ed879222b Mon Sep 17 00:00:00 2001 From: Didier Vojtisek Date: Wed, 24 Aug 2022 10:46:46 +0200 Subject: [PATCH 07/29] Move commons from modeldebugging repository to dedicated repository (#223) rebase wrt master (jd) * use commons from new gemoc-studio-commons repository --- .../eclipse/gemoc/executionframework/debugger/Activator.java | 2 +- .../eclipse/gemoc/executionframework/engine/Activator.java | 2 +- .../META-INF/MANIFEST.MF | 3 ++- .../plugin.xml | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.debugger/src/org/eclipse/gemoc/executionframework/debugger/Activator.java b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.debugger/src/org/eclipse/gemoc/executionframework/debugger/Activator.java index 63afb8b83..9bb5906a4 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.debugger/src/org/eclipse/gemoc/executionframework/debugger/Activator.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.debugger/src/org/eclipse/gemoc/executionframework/debugger/Activator.java @@ -12,8 +12,8 @@ import java.util.function.Supplier; -import org.eclipse.gemoc.commons.eclipse.logging.backends.DefaultLoggingBackend; import org.eclipse.gemoc.commons.eclipse.GemocPlugin; +import org.eclipse.gemoc.commons.eclipse.logging.backends.DefaultLoggingBackend; import org.eclipse.gemoc.xdsmlframework.api.core.IExecutionEngine; import org.osgi.framework.BundleContext; diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine/src/org/eclipse/gemoc/executionframework/engine/Activator.java b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine/src/org/eclipse/gemoc/executionframework/engine/Activator.java index 68367df8d..03122b5f1 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine/src/org/eclipse/gemoc/executionframework/engine/Activator.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine/src/org/eclipse/gemoc/executionframework/engine/Activator.java @@ -10,8 +10,8 @@ *******************************************************************************/ package org.eclipse.gemoc.executionframework.engine; -import org.eclipse.gemoc.commons.eclipse.logging.backends.DefaultLoggingBackend; import org.eclipse.gemoc.commons.eclipse.GemocPlugin; +import org.eclipse.gemoc.commons.eclipse.logging.backends.DefaultLoggingBackend; import org.eclipse.gemoc.executionframework.engine.core.GemocRunningEnginesRegistry; import org.osgi.framework.BundleContext; diff --git a/framework/xdsml_framework/plugins/org.eclipse.gemoc.xdsmlframework.extensions.sirius/META-INF/MANIFEST.MF b/framework/xdsml_framework/plugins/org.eclipse.gemoc.xdsmlframework.extensions.sirius/META-INF/MANIFEST.MF index dacb029f1..47925b9c5 100644 --- a/framework/xdsml_framework/plugins/org.eclipse.gemoc.xdsmlframework.extensions.sirius/META-INF/MANIFEST.MF +++ b/framework/xdsml_framework/plugins/org.eclipse.gemoc.xdsmlframework.extensions.sirius/META-INF/MANIFEST.MF @@ -33,7 +33,8 @@ Require-Bundle: org.eclipse.gemoc.xdsmlframework.api, org.eclipse.gemoc.dsl.model, org.eclipse.gemoc.executionframework.engine;bundle-version="4.0.0", org.eclipse.sirius.diagram, - org.eclipse.sirius + org.eclipse.sirius, + org.eclipse.gemoc.commons.eclipse.pde.ui Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: org.eclipse.gemoc.xdsmlframework.extensions.sirius, diff --git a/framework/xdsml_framework/plugins/org.eclipse.gemoc.xdsmlframework.extensions.sirius/plugin.xml b/framework/xdsml_framework/plugins/org.eclipse.gemoc.xdsmlframework.extensions.sirius/plugin.xml index 7ffe6b3ae..f2955af32 100644 --- a/framework/xdsml_framework/plugins/org.eclipse.gemoc.xdsmlframework.extensions.sirius/plugin.xml +++ b/framework/xdsml_framework/plugins/org.eclipse.gemoc.xdsmlframework.extensions.sirius/plugin.xml @@ -80,7 +80,7 @@ + point="org.eclipse.gemoc.commons.eclipse.pde.ui.templates">