| /** |
| * Copyright (c) 2016 CEA LIST. |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0 |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * CEA LIST - Initial API and implementation |
| */ |
| package org.eclipse.papyrus.moka.datavisualization.profile.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| 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.papyrus.moka.datavisualization.profile.DataSource; |
| import org.eclipse.papyrus.moka.datavisualization.profile.ValueSeries; |
| import org.eclipse.papyrus.moka.datavisualization.profile.VisualizationPackage; |
| |
| import org.eclipse.uml2.uml.DataType; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Data Source</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.moka.datavisualization.profile.impl.DataSourceImpl#getBase_DataType <em>Base Data Type</em>}</li> |
| * <li>{@link org.eclipse.papyrus.moka.datavisualization.profile.impl.DataSourceImpl#getSeries <em>Series</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DataSourceImpl extends MinimalEObjectImpl.Container implements DataSource { |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static final String copyright = "Copyright (c) 2016 CEA LIST.\r\n\r\n All rights reserved. This program and the accompanying materials\r\n are made available under the terms of the Eclipse Public License 2.0\r\n which accompanies this distribution, and is available at\r\n https://www.eclipse.org/legal/epl-2.0 \r\n\r\nSPDX-License-Identifier: EPL-2.0\r\n\r\n Contributors:\r\n CEA LIST - Initial API and implementation"; |
| |
| /** |
| * The cached value of the '{@link #getBase_DataType() <em>Base Data Type</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getBase_DataType() |
| * @generated |
| * @ordered |
| */ |
| protected DataType base_DataType; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DataSourceImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return VisualizationPackage.Literals.DATA_SOURCE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DataType getBase_DataType() { |
| if (base_DataType != null && base_DataType.eIsProxy()) { |
| InternalEObject oldBase_DataType = (InternalEObject)base_DataType; |
| base_DataType = (DataType)eResolveProxy(oldBase_DataType); |
| if (base_DataType != oldBase_DataType) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, VisualizationPackage.DATA_SOURCE__BASE_DATA_TYPE, oldBase_DataType, base_DataType)); |
| } |
| } |
| return base_DataType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DataType basicGetBase_DataType() { |
| return base_DataType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setBase_DataType(DataType newBase_DataType) { |
| DataType oldBase_DataType = base_DataType; |
| base_DataType = newBase_DataType; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, VisualizationPackage.DATA_SOURCE__BASE_DATA_TYPE, oldBase_DataType, base_DataType)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<ValueSeries> getSeries() { |
| // TODO: implement this method to return the 'Series' reference list |
| // Ensure that you remove @generated or mark it @generated NOT |
| throw new UnsupportedOperationException(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case VisualizationPackage.DATA_SOURCE__BASE_DATA_TYPE: |
| if (resolve) return getBase_DataType(); |
| return basicGetBase_DataType(); |
| case VisualizationPackage.DATA_SOURCE__SERIES: |
| return getSeries(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case VisualizationPackage.DATA_SOURCE__BASE_DATA_TYPE: |
| setBase_DataType((DataType)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case VisualizationPackage.DATA_SOURCE__BASE_DATA_TYPE: |
| setBase_DataType((DataType)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case VisualizationPackage.DATA_SOURCE__BASE_DATA_TYPE: |
| return base_DataType != null; |
| case VisualizationPackage.DATA_SOURCE__SERIES: |
| return !getSeries().isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //DataSourceImpl |