blob: 2337eed1a87f3340c6bb8aeaa68de4130009792a [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.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.polarsys.chess.fla.flaxml.Component;
import org.polarsys.chess.fla.flaxml.FlaxmlPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>System</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.polarsys.chess.fla.flaxml.impl.SystemImpl#getComponent <em>Component</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class SystemImpl extends MinimalEObjectImpl.Container implements org.polarsys.chess.fla.flaxml.System {
/**
* The cached value of the '{@link #getComponent() <em>Component</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getComponent()
* @generated
* @ordered
*/
protected Component component;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected SystemImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FlaxmlPackage.Literals.SYSTEM;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Component getComponent() {
return component;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetComponent(Component newComponent, NotificationChain msgs) {
Component oldComponent = component;
component = newComponent;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FlaxmlPackage.SYSTEM__COMPONENT, oldComponent, newComponent);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setComponent(Component newComponent) {
if (newComponent != component) {
NotificationChain msgs = null;
if (component != null)
msgs = ((InternalEObject)component).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FlaxmlPackage.SYSTEM__COMPONENT, null, msgs);
if (newComponent != null)
msgs = ((InternalEObject)newComponent).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FlaxmlPackage.SYSTEM__COMPONENT, null, msgs);
msgs = basicSetComponent(newComponent, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FlaxmlPackage.SYSTEM__COMPONENT, newComponent, newComponent));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FlaxmlPackage.SYSTEM__COMPONENT:
return basicSetComponent(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.SYSTEM__COMPONENT:
return getComponent();
}
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.SYSTEM__COMPONENT:
setComponent((Component)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FlaxmlPackage.SYSTEM__COMPONENT:
setComponent((Component)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FlaxmlPackage.SYSTEM__COMPONENT:
return component != null;
}
return super.eIsSet(featureID);
}
} //SystemImpl