/**
* <copyright>
* </copyright>
*
*/
package at.bestsolution.e4.jfx.xtext.jFXCss.impl;
import at.bestsolution.e4.jfx.xtext.jFXCss.ColorValue;
import at.bestsolution.e4.jfx.xtext.jFXCss.JFXCssPackage;
import at.bestsolution.e4.jfx.xtext.jFXCss.SizeValue;
import at.bestsolution.e4.jfx.xtext.jFXCss.StopValue;
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;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Stop Value</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link at.bestsolution.e4.jfx.xtext.jFXCss.impl.StopValueImpl#getPos <em>Pos</em>}</li>
* <li>{@link at.bestsolution.e4.jfx.xtext.jFXCss.impl.StopValueImpl#getColor <em>Color</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class StopValueImpl extends MinimalEObjectImpl.Container implements StopValue
{
/**
* The cached value of the '{@link #getPos() <em>Pos</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPos()
* @generated
* @ordered
*/
protected SizeValue pos;
/**
* The cached value of the '{@link #getColor() <em>Color</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getColor()
* @generated
* @ordered
*/
protected ColorValue color;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected StopValueImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return JFXCssPackage.Literals.STOP_VALUE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SizeValue getPos()
{
return pos;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetPos(SizeValue newPos, NotificationChain msgs)
{
SizeValue oldPos = pos;
pos = newPos;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JFXCssPackage.STOP_VALUE__POS, oldPos, newPos);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPos(SizeValue newPos)
{
if (newPos != pos)
{
NotificationChain msgs = null;
if (pos != null)
msgs = ((InternalEObject)pos).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - JFXCssPackage.STOP_VALUE__POS, null, msgs);
if (newPos != null)
msgs = ((InternalEObject)newPos).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JFXCssPackage.STOP_VALUE__POS, null, msgs);
msgs = basicSetPos(newPos, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, JFXCssPackage.STOP_VALUE__POS, newPos, newPos));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ColorValue getColor()
{
return color;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetColor(ColorValue newColor, NotificationChain msgs)
{
ColorValue oldColor = color;
color = newColor;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JFXCssPackage.STOP_VALUE__COLOR, oldColor, newColor);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setColor(ColorValue newColor)
{
if (newColor != color)
{
NotificationChain msgs = null;
if (color != null)
msgs = ((InternalEObject)color).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - JFXCssPackage.STOP_VALUE__COLOR, null, msgs);
if (newColor != null)
msgs = ((InternalEObject)newColor).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JFXCssPackage.STOP_VALUE__COLOR, null, msgs);
msgs = basicSetColor(newColor, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, JFXCssPackage.STOP_VALUE__COLOR, newColor, newColor));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case JFXCssPackage.STOP_VALUE__POS:
return basicSetPos(null, msgs);
case JFXCssPackage.STOP_VALUE__COLOR:
return basicSetColor(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 JFXCssPackage.STOP_VALUE__POS:
return getPos();
case JFXCssPackage.STOP_VALUE__COLOR:
return getColor();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case JFXCssPackage.STOP_VALUE__POS:
setPos((SizeValue)newValue);
return;
case JFXCssPackage.STOP_VALUE__COLOR:
setColor((ColorValue)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case JFXCssPackage.STOP_VALUE__POS:
setPos((SizeValue)null);
return;
case JFXCssPackage.STOP_VALUE__COLOR:
setColor((ColorValue)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case JFXCssPackage.STOP_VALUE__POS:
return pos != null;
case JFXCssPackage.STOP_VALUE__COLOR:
return color != null;
}
return super.eIsSet(featureID);
}
} //StopValueImpl