/**
* <copyright>
* </copyright>
*
* $Id$
*/
package at.bestsolution.efxclipse.formats.fxg.fxg.impl;
import at.bestsolution.efxclipse.formats.fxg.fxg.ColorTransform;
import at.bestsolution.efxclipse.formats.fxg.fxg.FxgPackage;
import at.bestsolution.efxclipse.formats.fxg.fxg.Matrix;
import at.bestsolution.efxclipse.formats.fxg.fxg.Transform;
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.EObjectImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Transform</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link at.bestsolution.efxclipse.formats.fxg.fxg.impl.TransformImpl#getMatrix <em>Matrix</em>}</li>
* <li>{@link at.bestsolution.efxclipse.formats.fxg.fxg.impl.TransformImpl#getColorTransform <em>Color Transform</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class TransformImpl extends EObjectImpl implements Transform {
/**
* The cached value of the '{@link #getMatrix() <em>Matrix</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMatrix()
* @generated
* @ordered
*/
protected Matrix matrix;
/**
* The cached value of the '{@link #getColorTransform() <em>Color Transform</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getColorTransform()
* @generated
* @ordered
*/
protected ColorTransform colorTransform;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TransformImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FxgPackage.Literals.TRANSFORM;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Matrix getMatrix() {
return matrix;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetMatrix(Matrix newMatrix, NotificationChain msgs) {
Matrix oldMatrix = matrix;
matrix = newMatrix;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FxgPackage.TRANSFORM__MATRIX, oldMatrix, newMatrix);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMatrix(Matrix newMatrix) {
if (newMatrix != matrix) {
NotificationChain msgs = null;
if (matrix != null)
msgs = ((InternalEObject)matrix).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FxgPackage.TRANSFORM__MATRIX, null, msgs);
if (newMatrix != null)
msgs = ((InternalEObject)newMatrix).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FxgPackage.TRANSFORM__MATRIX, null, msgs);
msgs = basicSetMatrix(newMatrix, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FxgPackage.TRANSFORM__MATRIX, newMatrix, newMatrix));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ColorTransform getColorTransform() {
if (colorTransform != null && colorTransform.eIsProxy()) {
InternalEObject oldColorTransform = (InternalEObject)colorTransform;
colorTransform = (ColorTransform)eResolveProxy(oldColorTransform);
if (colorTransform != oldColorTransform) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FxgPackage.TRANSFORM__COLOR_TRANSFORM, oldColorTransform, colorTransform));
}
}
return colorTransform;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ColorTransform basicGetColorTransform() {
return colorTransform;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setColorTransform(ColorTransform newColorTransform) {
ColorTransform oldColorTransform = colorTransform;
colorTransform = newColorTransform;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FxgPackage.TRANSFORM__COLOR_TRANSFORM, oldColorTransform, colorTransform));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FxgPackage.TRANSFORM__MATRIX:
return basicSetMatrix(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 FxgPackage.TRANSFORM__MATRIX:
return getMatrix();
case FxgPackage.TRANSFORM__COLOR_TRANSFORM:
if (resolve) return getColorTransform();
return basicGetColorTransform();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FxgPackage.TRANSFORM__MATRIX:
setMatrix((Matrix)newValue);
return;
case FxgPackage.TRANSFORM__COLOR_TRANSFORM:
setColorTransform((ColorTransform)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FxgPackage.TRANSFORM__MATRIX:
setMatrix((Matrix)null);
return;
case FxgPackage.TRANSFORM__COLOR_TRANSFORM:
setColorTransform((ColorTransform)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FxgPackage.TRANSFORM__MATRIX:
return matrix != null;
case FxgPackage.TRANSFORM__COLOR_TRANSFORM:
return colorTransform != null;
}
return super.eIsSet(featureID);
}
} //TransformImpl