/** * <copyright> * </copyright> * * $Id$ */ package at.bestsolution.efxclipse.formats.fxg.fxg.impl; import at.bestsolution.efxclipse.formats.fxg.fxg.FxgPackage; import at.bestsolution.efxclipse.formats.fxg.fxg.GradientEntry; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; 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>Gradient Entry</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link at.bestsolution.efxclipse.formats.fxg.fxg.impl.GradientEntryImpl#getColor <em>Color</em>}</li> * <li>{@link at.bestsolution.efxclipse.formats.fxg.fxg.impl.GradientEntryImpl#getAlpha <em>Alpha</em>}</li> * <li>{@link at.bestsolution.efxclipse.formats.fxg.fxg.impl.GradientEntryImpl#getRatio <em>Ratio</em>}</li> * </ul> * </p> * * @generated */ public class GradientEntryImpl extends EObjectImpl implements GradientEntry { /** * The default value of the '{@link #getColor() <em>Color</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getColor() * @generated * @ordered */ protected static final String COLOR_EDEFAULT = null; /** * The cached value of the '{@link #getColor() <em>Color</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getColor() * @generated * @ordered */ protected String color = COLOR_EDEFAULT; /** * The default value of the '{@link #getAlpha() <em>Alpha</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getAlpha() * @generated * @ordered */ protected static final Double ALPHA_EDEFAULT = null; /** * The cached value of the '{@link #getAlpha() <em>Alpha</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getAlpha() * @generated * @ordered */ protected Double alpha = ALPHA_EDEFAULT; /** * The default value of the '{@link #getRatio() <em>Ratio</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getRatio() * @generated * @ordered */ protected static final Double RATIO_EDEFAULT = null; /** * The cached value of the '{@link #getRatio() <em>Ratio</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getRatio() * @generated * @ordered */ protected Double ratio = RATIO_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected GradientEntryImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return FxgPackage.Literals.GRADIENT_ENTRY; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getColor() { return color; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setColor(String newColor) { String oldColor = color; color = newColor; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, FxgPackage.GRADIENT_ENTRY__COLOR, oldColor, color)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Double getAlpha() { return alpha; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setAlpha(Double newAlpha) { Double oldAlpha = alpha; alpha = newAlpha; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, FxgPackage.GRADIENT_ENTRY__ALPHA, oldAlpha, alpha)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Double getRatio() { return ratio; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setRatio(Double newRatio) { Double oldRatio = ratio; ratio = newRatio; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, FxgPackage.GRADIENT_ENTRY__RATIO, oldRatio, ratio)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case FxgPackage.GRADIENT_ENTRY__COLOR: return getColor(); case FxgPackage.GRADIENT_ENTRY__ALPHA: return getAlpha(); case FxgPackage.GRADIENT_ENTRY__RATIO: return getRatio(); } 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.GRADIENT_ENTRY__COLOR: setColor((String)newValue); return; case FxgPackage.GRADIENT_ENTRY__ALPHA: setAlpha((Double)newValue); return; case FxgPackage.GRADIENT_ENTRY__RATIO: setRatio((Double)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case FxgPackage.GRADIENT_ENTRY__COLOR: setColor(COLOR_EDEFAULT); return; case FxgPackage.GRADIENT_ENTRY__ALPHA: setAlpha(ALPHA_EDEFAULT); return; case FxgPackage.GRADIENT_ENTRY__RATIO: setRatio(RATIO_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case FxgPackage.GRADIENT_ENTRY__COLOR: return COLOR_EDEFAULT == null ? color != null : !COLOR_EDEFAULT.equals(color); case FxgPackage.GRADIENT_ENTRY__ALPHA: return ALPHA_EDEFAULT == null ? alpha != null : !ALPHA_EDEFAULT.equals(alpha); case FxgPackage.GRADIENT_ENTRY__RATIO: return RATIO_EDEFAULT == null ? ratio != null : !RATIO_EDEFAULT.equals(ratio); } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (color: "); result.append(color); result.append(", alpha: "); result.append(alpha); result.append(", ratio: "); result.append(ratio); result.append(')'); return result.toString(); } } //GradientEntryImpl