blob: 4f8b4d0735869d906b512cd0e228bfe2417c1112 [file] [log] [blame]
/*******************************************************************************
* CHESS core plugin
*
* Copyright (C) 2011-2015
* Mälardalen University, Sweden
*
*
* 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-v20.html
*******************************************************************************/
/**
*/
package org.polarsys.chess.fla.flaxml.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.polarsys.chess.fla.flaxml.Components;
import org.polarsys.chess.fla.flaxml.CompositeComponent;
import org.polarsys.chess.fla.flaxml.Connections;
import org.polarsys.chess.fla.flaxml.FlaxmlPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Composite Component</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.polarsys.chess.fla.flaxml.impl.CompositeComponentImpl#getConnections <em>Connections</em>}</li>
* <li>{@link org.polarsys.chess.fla.flaxml.impl.CompositeComponentImpl#getComponents <em>Components</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class CompositeComponentImpl extends ComponentImpl implements CompositeComponent {
/**
* The cached value of the '{@link #getConnections() <em>Connections</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getConnections()
* @generated
* @ordered
*/
protected Connections connections;
/**
* The cached value of the '{@link #getComponents() <em>Components</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getComponents()
* @generated
* @ordered
*/
protected Components components;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected CompositeComponentImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FlaxmlPackage.Literals.COMPOSITE_COMPONENT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Connections getConnections() {
return connections;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetConnections(Connections newConnections, NotificationChain msgs) {
Connections oldConnections = connections;
connections = newConnections;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FlaxmlPackage.COMPOSITE_COMPONENT__CONNECTIONS, oldConnections, newConnections);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setConnections(Connections newConnections) {
if (newConnections != connections) {
NotificationChain msgs = null;
if (connections != null)
msgs = ((InternalEObject)connections).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FlaxmlPackage.COMPOSITE_COMPONENT__CONNECTIONS, null, msgs);
if (newConnections != null)
msgs = ((InternalEObject)newConnections).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FlaxmlPackage.COMPOSITE_COMPONENT__CONNECTIONS, null, msgs);
msgs = basicSetConnections(newConnections, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FlaxmlPackage.COMPOSITE_COMPONENT__CONNECTIONS, newConnections, newConnections));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Components getComponents() {
return components;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetComponents(Components newComponents, NotificationChain msgs) {
Components oldComponents = components;
components = newComponents;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FlaxmlPackage.COMPOSITE_COMPONENT__COMPONENTS, oldComponents, newComponents);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setComponents(Components newComponents) {
if (newComponents != components) {
NotificationChain msgs = null;
if (components != null)
msgs = ((InternalEObject)components).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FlaxmlPackage.COMPOSITE_COMPONENT__COMPONENTS, null, msgs);
if (newComponents != null)
msgs = ((InternalEObject)newComponents).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FlaxmlPackage.COMPOSITE_COMPONENT__COMPONENTS, null, msgs);
msgs = basicSetComponents(newComponents, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FlaxmlPackage.COMPOSITE_COMPONENT__COMPONENTS, newComponents, newComponents));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FlaxmlPackage.COMPOSITE_COMPONENT__CONNECTIONS:
return basicSetConnections(null, msgs);
case FlaxmlPackage.COMPOSITE_COMPONENT__COMPONENTS:
return basicSetComponents(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 FlaxmlPackage.COMPOSITE_COMPONENT__CONNECTIONS:
return getConnections();
case FlaxmlPackage.COMPOSITE_COMPONENT__COMPONENTS:
return getComponents();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FlaxmlPackage.COMPOSITE_COMPONENT__CONNECTIONS:
setConnections((Connections)newValue);
return;
case FlaxmlPackage.COMPOSITE_COMPONENT__COMPONENTS:
setComponents((Components)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FlaxmlPackage.COMPOSITE_COMPONENT__CONNECTIONS:
setConnections((Connections)null);
return;
case FlaxmlPackage.COMPOSITE_COMPONENT__COMPONENTS:
setComponents((Components)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FlaxmlPackage.COMPOSITE_COMPONENT__CONNECTIONS:
return connections != null;
case FlaxmlPackage.COMPOSITE_COMPONENT__COMPONENTS:
return components != null;
}
return super.eIsSet(featureID);
}
} //CompositeComponentImpl