blob: 788462918d49168cde8c81483f45afdcfc858327 [file] [log] [blame]
/**
* Copyright (c) 2016 CEA LIST 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:
* CEA LIST - Initial API and implementation
*
*/
package org.eclipse.papyrus.interoperability.rpy.rpymetamodel.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.util.EDataTypeEList;
import org.eclipse.papyrus.interoperability.rpy.rpymetamodel.CGIStateChart;
import org.eclipse.papyrus.interoperability.rpy.rpymetamodel.IActivityDiagram;
import org.eclipse.papyrus.interoperability.rpy.rpymetamodel.UMLRpyPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>IActivity Diagram</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.interoperability.rpy.rpymetamodel.impl.IActivityDiagramImpl#getGraphicChart <em>Graphic Chart</em>}</li>
* <li>{@link org.eclipse.papyrus.interoperability.rpy.rpymetamodel.impl.IActivityDiagramImpl#getCodeUpdateCGTime <em>Code Update CG Time</em>}</li>
* </ul>
*
* @generated
*/
public class IActivityDiagramImpl extends DependsOnTypeImpl implements IActivityDiagram {
/**
* The cached value of the '{@link #getGraphicChart() <em>Graphic Chart</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getGraphicChart()
* @generated
* @ordered
*/
protected CGIStateChart graphicChart;
/**
* The cached value of the '{@link #getCodeUpdateCGTime() <em>Code Update CG Time</em>}' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCodeUpdateCGTime()
* @generated
* @ordered
*/
protected EList<String> codeUpdateCGTime;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IActivityDiagramImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return UMLRpyPackage.eINSTANCE.getIActivityDiagram();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CGIStateChart getGraphicChart() {
if (graphicChart != null && graphicChart.eIsProxy()) {
InternalEObject oldGraphicChart = (InternalEObject)graphicChart;
graphicChart = (CGIStateChart)eResolveProxy(oldGraphicChart);
if (graphicChart != oldGraphicChart) {
InternalEObject newGraphicChart = (InternalEObject)graphicChart;
NotificationChain msgs = oldGraphicChart.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - UMLRpyPackage.IACTIVITY_DIAGRAM__GRAPHIC_CHART, null, null);
if (newGraphicChart.eInternalContainer() == null) {
msgs = newGraphicChart.eInverseAdd(this, EOPPOSITE_FEATURE_BASE - UMLRpyPackage.IACTIVITY_DIAGRAM__GRAPHIC_CHART, null, msgs);
}
if (msgs != null) msgs.dispatch();
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, UMLRpyPackage.IACTIVITY_DIAGRAM__GRAPHIC_CHART, oldGraphicChart, graphicChart));
}
}
return graphicChart;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CGIStateChart basicGetGraphicChart() {
return graphicChart;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetGraphicChart(CGIStateChart newGraphicChart, NotificationChain msgs) {
CGIStateChart oldGraphicChart = graphicChart;
graphicChart = newGraphicChart;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, UMLRpyPackage.IACTIVITY_DIAGRAM__GRAPHIC_CHART, oldGraphicChart, newGraphicChart);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setGraphicChart(CGIStateChart newGraphicChart) {
if (newGraphicChart != graphicChart) {
NotificationChain msgs = null;
if (graphicChart != null)
msgs = ((InternalEObject)graphicChart).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - UMLRpyPackage.IACTIVITY_DIAGRAM__GRAPHIC_CHART, null, msgs);
if (newGraphicChart != null)
msgs = ((InternalEObject)newGraphicChart).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - UMLRpyPackage.IACTIVITY_DIAGRAM__GRAPHIC_CHART, null, msgs);
msgs = basicSetGraphicChart(newGraphicChart, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, UMLRpyPackage.IACTIVITY_DIAGRAM__GRAPHIC_CHART, newGraphicChart, newGraphicChart));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<String> getCodeUpdateCGTime() {
if (codeUpdateCGTime == null) {
codeUpdateCGTime = new EDataTypeEList<String>(String.class, this, UMLRpyPackage.IACTIVITY_DIAGRAM__CODE_UPDATE_CG_TIME);
}
return codeUpdateCGTime;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case UMLRpyPackage.IACTIVITY_DIAGRAM__GRAPHIC_CHART:
return basicSetGraphicChart(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case UMLRpyPackage.IACTIVITY_DIAGRAM__GRAPHIC_CHART:
if (resolve) return getGraphicChart();
return basicGetGraphicChart();
case UMLRpyPackage.IACTIVITY_DIAGRAM__CODE_UPDATE_CG_TIME:
return getCodeUpdateCGTime();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case UMLRpyPackage.IACTIVITY_DIAGRAM__GRAPHIC_CHART:
setGraphicChart((CGIStateChart)newValue);
return;
case UMLRpyPackage.IACTIVITY_DIAGRAM__CODE_UPDATE_CG_TIME:
getCodeUpdateCGTime().clear();
getCodeUpdateCGTime().addAll((Collection<? extends String>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case UMLRpyPackage.IACTIVITY_DIAGRAM__GRAPHIC_CHART:
setGraphicChart((CGIStateChart)null);
return;
case UMLRpyPackage.IACTIVITY_DIAGRAM__CODE_UPDATE_CG_TIME:
getCodeUpdateCGTime().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case UMLRpyPackage.IACTIVITY_DIAGRAM__GRAPHIC_CHART:
return graphicChart != null;
case UMLRpyPackage.IACTIVITY_DIAGRAM__CODE_UPDATE_CG_TIME:
return codeUpdateCGTime != null && !codeUpdateCGTime.isEmpty();
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (codeUpdateCGTime: "); //$NON-NLS-1$
result.append(codeUpdateCGTime);
result.append(')');
return result.toString();
}
} //IActivityDiagramImpl