/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.eclipse.gmf.codegen.gmfgen.impl;
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;
import org.eclipse.gmf.codegen.gmfgen.ColorAttributes;
import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Color Attributes</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.ColorAttributesImpl#getForegroundColor <em>Foreground Color</em>}</li>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.ColorAttributesImpl#getBackgroundColor <em>Background Color</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ColorAttributesImpl extends EObjectImpl implements ColorAttributes {
/**
* The default value of the '{@link #getForegroundColor() <em>Foreground Color</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getForegroundColor()
* @generated
* @ordered
*/
protected static final String FOREGROUND_COLOR_EDEFAULT = null;
/**
* The cached value of the '{@link #getForegroundColor() <em>Foreground Color</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getForegroundColor()
* @generated
* @ordered
*/
protected String foregroundColor = FOREGROUND_COLOR_EDEFAULT;
/**
* The default value of the '{@link #getBackgroundColor() <em>Background Color</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBackgroundColor()
* @generated
* @ordered
*/
protected static final String BACKGROUND_COLOR_EDEFAULT = null;
/**
* The cached value of the '{@link #getBackgroundColor() <em>Background Color</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBackgroundColor()
* @generated
* @ordered
*/
protected String backgroundColor = BACKGROUND_COLOR_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ColorAttributesImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return GMFGenPackage.eINSTANCE.getColorAttributes();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getForegroundColor() {
return foregroundColor;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setForegroundColor(String newForegroundColor) {
String oldForegroundColor = foregroundColor;
foregroundColor = newForegroundColor;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GMFGenPackage.COLOR_ATTRIBUTES__FOREGROUND_COLOR, oldForegroundColor, foregroundColor));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getBackgroundColor() {
return backgroundColor;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBackgroundColor(String newBackgroundColor) {
String oldBackgroundColor = backgroundColor;
backgroundColor = newBackgroundColor;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GMFGenPackage.COLOR_ATTRIBUTES__BACKGROUND_COLOR, oldBackgroundColor, backgroundColor));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case GMFGenPackage.COLOR_ATTRIBUTES__FOREGROUND_COLOR:
return getForegroundColor();
case GMFGenPackage.COLOR_ATTRIBUTES__BACKGROUND_COLOR:
return getBackgroundColor();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case GMFGenPackage.COLOR_ATTRIBUTES__FOREGROUND_COLOR:
setForegroundColor((String)newValue);
return;
case GMFGenPackage.COLOR_ATTRIBUTES__BACKGROUND_COLOR:
setBackgroundColor((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case GMFGenPackage.COLOR_ATTRIBUTES__FOREGROUND_COLOR:
setForegroundColor(FOREGROUND_COLOR_EDEFAULT);
return;
case GMFGenPackage.COLOR_ATTRIBUTES__BACKGROUND_COLOR:
setBackgroundColor(BACKGROUND_COLOR_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case GMFGenPackage.COLOR_ATTRIBUTES__FOREGROUND_COLOR:
return FOREGROUND_COLOR_EDEFAULT == null ? foregroundColor != null : !FOREGROUND_COLOR_EDEFAULT.equals(foregroundColor);
case GMFGenPackage.COLOR_ATTRIBUTES__BACKGROUND_COLOR:
return BACKGROUND_COLOR_EDEFAULT == null ? backgroundColor != null : !BACKGROUND_COLOR_EDEFAULT.equals(backgroundColor);
}
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(" (foregroundColor: ");
result.append(foregroundColor);
result.append(", backgroundColor: ");
result.append(backgroundColor);
result.append(')');
return result.toString();
}
} //ColorAttributesImpl