From d76c1c496b0774e28b699dd5ff4f446d580fd986 Mon Sep 17 00:00:00 2001 From: ArenBabikian Date: Mon, 20 May 2019 18:47:20 -0400 Subject: REALMET: implement incoming edges in visualisation. multips need fix --- .../src/simpleStatechart/impl/StatechartImpl.java | 221 +++++++++++++++++++++ 1 file changed, 221 insertions(+) create mode 100644 Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/impl/StatechartImpl.java (limited to 'Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/impl/StatechartImpl.java') diff --git a/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/impl/StatechartImpl.java b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/impl/StatechartImpl.java new file mode 100644 index 00000000..cef2ee61 --- /dev/null +++ b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/simpleStatechart/impl/StatechartImpl.java @@ -0,0 +1,221 @@ +/** + */ +package simpleStatechart.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import simpleStatechart.Entry; +import simpleStatechart.SimpleStatechartPackage; +import simpleStatechart.State; +import simpleStatechart.Statechart; + +/** + * + * An implementation of the model object 'Statechart'. + * + *

+ * The following features are implemented: + *

+ * + * + * @generated + */ +public class StatechartImpl extends MinimalEObjectImpl.Container implements Statechart { + /** + * The cached value of the '{@link #getState() State}' containment reference list. + * + * + * @see #getState() + * @generated + * @ordered + */ + protected EList state; + + /** + * The cached value of the '{@link #getEntry() Entry}' containment reference. + * + * + * @see #getEntry() + * @generated + * @ordered + */ + protected Entry entry; + + /** + * + * + * @generated + */ + protected StatechartImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return SimpleStatechartPackage.Literals.STATECHART; + } + + /** + * + * + * @generated + */ + public EList getState() { + if (state == null) { + state = new EObjectContainmentEList(State.class, this, SimpleStatechartPackage.STATECHART__STATE); + } + return state; + } + + /** + * + * + * @generated + */ + public Entry getEntry() { + return entry; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetEntry(Entry newEntry, NotificationChain msgs) { + Entry oldEntry = entry; + entry = newEntry; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SimpleStatechartPackage.STATECHART__ENTRY, oldEntry, newEntry); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setEntry(Entry newEntry) { + if (newEntry != entry) { + NotificationChain msgs = null; + if (entry != null) + msgs = ((InternalEObject)entry).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SimpleStatechartPackage.STATECHART__ENTRY, null, msgs); + if (newEntry != null) + msgs = ((InternalEObject)newEntry).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SimpleStatechartPackage.STATECHART__ENTRY, null, msgs); + msgs = basicSetEntry(newEntry, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SimpleStatechartPackage.STATECHART__ENTRY, newEntry, newEntry)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case SimpleStatechartPackage.STATECHART__STATE: + return ((InternalEList)getState()).basicRemove(otherEnd, msgs); + case SimpleStatechartPackage.STATECHART__ENTRY: + return basicSetEntry(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case SimpleStatechartPackage.STATECHART__STATE: + return getState(); + case SimpleStatechartPackage.STATECHART__ENTRY: + return getEntry(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case SimpleStatechartPackage.STATECHART__STATE: + getState().clear(); + getState().addAll((Collection)newValue); + return; + case SimpleStatechartPackage.STATECHART__ENTRY: + setEntry((Entry)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case SimpleStatechartPackage.STATECHART__STATE: + getState().clear(); + return; + case SimpleStatechartPackage.STATECHART__ENTRY: + setEntry((Entry)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case SimpleStatechartPackage.STATECHART__STATE: + return state != null && !state.isEmpty(); + case SimpleStatechartPackage.STATECHART__ENTRY: + return entry != null; + } + return super.eIsSet(featureID); + } + +} //StatechartImpl -- cgit v1.2.3-54-g00ecf