/******************************************************************************* | |
* 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.FlaxmlPackage; | |
import org.polarsys.chess.fla.flaxml.FptcRules; | |
import org.polarsys.chess.fla.flaxml.SimpleComponent; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Simple Component</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* <ul> | |
* <li>{@link org.polarsys.chess.fla.flaxml.impl.SimpleComponentImpl#getRules <em>Rules</em>}</li> | |
* </ul> | |
* </p> | |
* | |
* @generated | |
*/ | |
public class SimpleComponentImpl extends ComponentImpl implements SimpleComponent { | |
/** | |
* The cached value of the '{@link #getRules() <em>Rules</em>}' containment reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getRules() | |
* @generated | |
* @ordered | |
*/ | |
protected FptcRules rules; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected SimpleComponentImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return FlaxmlPackage.Literals.SIMPLE_COMPONENT; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public FptcRules getRules() { | |
return rules; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public NotificationChain basicSetRules(FptcRules newRules, NotificationChain msgs) { | |
FptcRules oldRules = rules; | |
rules = newRules; | |
if (eNotificationRequired()) { | |
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FlaxmlPackage.SIMPLE_COMPONENT__RULES, oldRules, newRules); | |
if (msgs == null) msgs = notification; else msgs.add(notification); | |
} | |
return msgs; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setRules(FptcRules newRules) { | |
if (newRules != rules) { | |
NotificationChain msgs = null; | |
if (rules != null) | |
msgs = ((InternalEObject)rules).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FlaxmlPackage.SIMPLE_COMPONENT__RULES, null, msgs); | |
if (newRules != null) | |
msgs = ((InternalEObject)newRules).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FlaxmlPackage.SIMPLE_COMPONENT__RULES, null, msgs); | |
msgs = basicSetRules(newRules, msgs); | |
if (msgs != null) msgs.dispatch(); | |
} | |
else if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, FlaxmlPackage.SIMPLE_COMPONENT__RULES, newRules, newRules)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | |
switch (featureID) { | |
case FlaxmlPackage.SIMPLE_COMPONENT__RULES: | |
return basicSetRules(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.SIMPLE_COMPONENT__RULES: | |
return getRules(); | |
} | |
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.SIMPLE_COMPONENT__RULES: | |
setRules((FptcRules)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case FlaxmlPackage.SIMPLE_COMPONENT__RULES: | |
setRules((FptcRules)null); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case FlaxmlPackage.SIMPLE_COMPONENT__RULES: | |
return rules != null; | |
} | |
return super.eIsSet(featureID); | |
} | |
} //SimpleComponentImpl |