/**
* <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.FontStyle;
import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage;
import org.eclipse.gmf.codegen.gmfgen.GenCustomFont;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Gen Custom Font</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.GenCustomFontImpl#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.GenCustomFontImpl#getHeight <em>Height</em>}</li>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.GenCustomFontImpl#getStyle <em>Style</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class GenCustomFontImpl extends EObjectImpl implements GenCustomFont {
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* The default value of the '{@link #getHeight() <em>Height</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getHeight()
* @generated
* @ordered
*/
protected static final int HEIGHT_EDEFAULT = 0;
/**
* The cached value of the '{@link #getHeight() <em>Height</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getHeight()
* @generated
* @ordered
*/
protected int height = HEIGHT_EDEFAULT;
/**
* The default value of the '{@link #getStyle() <em>Style</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getStyle()
* @generated
* @ordered
*/
protected static final FontStyle STYLE_EDEFAULT = FontStyle.NORMAL_LITERAL;
/**
* The cached value of the '{@link #getStyle() <em>Style</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getStyle()
* @generated
* @ordered
*/
protected FontStyle style = STYLE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected GenCustomFontImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return GMFGenPackage.eINSTANCE.getGenCustomFont();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getName() {
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(String newName) {
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GMFGenPackage.GEN_CUSTOM_FONT__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getHeight() {
return height;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setHeight(int newHeight) {
int oldHeight = height;
height = newHeight;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GMFGenPackage.GEN_CUSTOM_FONT__HEIGHT, oldHeight, height));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FontStyle getStyle() {
return style;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setStyle(FontStyle newStyle) {
FontStyle oldStyle = style;
style = newStyle == null ? STYLE_EDEFAULT : newStyle;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GMFGenPackage.GEN_CUSTOM_FONT__STYLE, oldStyle, style));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case GMFGenPackage.GEN_CUSTOM_FONT__NAME:
return getName();
case GMFGenPackage.GEN_CUSTOM_FONT__HEIGHT:
return getHeight();
case GMFGenPackage.GEN_CUSTOM_FONT__STYLE:
return getStyle();
}
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.GEN_CUSTOM_FONT__NAME:
setName((String)newValue);
return;
case GMFGenPackage.GEN_CUSTOM_FONT__HEIGHT:
setHeight((Integer)newValue);
return;
case GMFGenPackage.GEN_CUSTOM_FONT__STYLE:
setStyle((FontStyle)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case GMFGenPackage.GEN_CUSTOM_FONT__NAME:
setName(NAME_EDEFAULT);
return;
case GMFGenPackage.GEN_CUSTOM_FONT__HEIGHT:
setHeight(HEIGHT_EDEFAULT);
return;
case GMFGenPackage.GEN_CUSTOM_FONT__STYLE:
setStyle(STYLE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case GMFGenPackage.GEN_CUSTOM_FONT__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case GMFGenPackage.GEN_CUSTOM_FONT__HEIGHT:
return height != HEIGHT_EDEFAULT;
case GMFGenPackage.GEN_CUSTOM_FONT__STYLE:
return style != STYLE_EDEFAULT;
}
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(" (name: ");
result.append(name);
result.append(", height: ");
result.append(height);
result.append(", style: ");
result.append(style);
result.append(')');
return result.toString();
}
} //GenCustomFontImpl