/**
*/
package de.unidue.ecg.dialogScript.dialogScript.impl;
import de.unidue.ecg.dialogScript.dialogScript.Dialog;
import de.unidue.ecg.dialogScript.dialogScript.DialogScriptPackage;
import de.unidue.ecg.dialogScript.dialogScript.Scene;
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>Scene</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link de.unidue.ecg.dialogScript.dialogScript.impl.SceneImpl#getName <em>Name</em>}</li>
* <li>{@link de.unidue.ecg.dialogScript.dialogScript.impl.SceneImpl#getDialog <em>Dialog</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class SceneImpl extends MinimalEObjectImpl.Container implements Scene
{
/**
* 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 cached value of the '{@link #getDialog() <em>Dialog</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDialog()
* @generated
* @ordered
*/
protected Dialog dialog;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected SceneImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return DialogScriptPackage.Literals.SCENE;
}
/**
* <!-- 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, DialogScriptPackage.SCENE__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Dialog getDialog()
{
return dialog;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetDialog(Dialog newDialog, NotificationChain msgs)
{
Dialog oldDialog = dialog;
dialog = newDialog;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DialogScriptPackage.SCENE__DIALOG, oldDialog, newDialog);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDialog(Dialog newDialog)
{
if (newDialog != dialog)
{
NotificationChain msgs = null;
if (dialog != null)
msgs = ((InternalEObject)dialog).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DialogScriptPackage.SCENE__DIALOG, null, msgs);
if (newDialog != null)
msgs = ((InternalEObject)newDialog).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DialogScriptPackage.SCENE__DIALOG, null, msgs);
msgs = basicSetDialog(newDialog, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DialogScriptPackage.SCENE__DIALOG, newDialog, newDialog));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case DialogScriptPackage.SCENE__DIALOG:
return basicSetDialog(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 DialogScriptPackage.SCENE__NAME:
return getName();
case DialogScriptPackage.SCENE__DIALOG:
return getDialog();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case DialogScriptPackage.SCENE__NAME:
setName((String)newValue);
return;
case DialogScriptPackage.SCENE__DIALOG:
setDialog((Dialog)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case DialogScriptPackage.SCENE__NAME:
setName(NAME_EDEFAULT);
return;
case DialogScriptPackage.SCENE__DIALOG:
setDialog((Dialog)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case DialogScriptPackage.SCENE__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case DialogScriptPackage.SCENE__DIALOG:
return dialog != null;
}
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(')');
return result.toString();
}
} //SceneImpl