/**
*/
package rba.view.impl;
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 rba.core.impl.PackagableElementImpl;
import rba.view.CompositeArea;
import rba.view.Display;
import rba.view.RBAViewPackage;
import rba.view.SizeIdentifier;
/**
* An implementation of the model object 'Display'.
*
* The following features are implemented:
*
*
* - {@link rba.view.impl.DisplayImpl#getRoot Root}
* - {@link rba.view.impl.DisplayImpl#getSize Size}
*
*
* @generated
*/
public class DisplayImpl extends PackagableElementImpl implements Display {
/**
* The cached value of the '{@link #getRoot() Root}' containment reference.
*
* @see #getRoot()
* @generated
* @ordered
*/
protected CompositeArea root;
/**
* The cached value of the '{@link #getSize() Size}' containment reference.
*
* @see #getSize()
* @generated
* @ordered
*/
protected SizeIdentifier size;
/**
*
* @generated
*/
protected DisplayImpl() {
super();
}
/**
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return RBAViewPackage.Literals.DISPLAY;
}
/**
*
* @generated
*/
public CompositeArea getRoot() {
return root;
}
/**
*
* @generated
*/
public NotificationChain basicSetRoot(CompositeArea newRoot, NotificationChain msgs) {
CompositeArea oldRoot = root;
root = newRoot;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RBAViewPackage.DISPLAY__ROOT,
oldRoot, newRoot);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
*
* @generated
*/
public void setRoot(CompositeArea newRoot) {
if (newRoot != root) {
NotificationChain msgs = null;
if (root != null)
msgs = ((InternalEObject) root).eInverseRemove(this,
EOPPOSITE_FEATURE_BASE - RBAViewPackage.DISPLAY__ROOT, null, msgs);
if (newRoot != null)
msgs = ((InternalEObject) newRoot).eInverseAdd(this,
EOPPOSITE_FEATURE_BASE - RBAViewPackage.DISPLAY__ROOT, null, msgs);
msgs = basicSetRoot(newRoot, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RBAViewPackage.DISPLAY__ROOT, newRoot, newRoot));
}
/**
*
* @generated
*/
public SizeIdentifier getSize() {
return size;
}
/**
*
* @generated
*/
public NotificationChain basicSetSize(SizeIdentifier newSize, NotificationChain msgs) {
SizeIdentifier oldSize = size;
size = newSize;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RBAViewPackage.DISPLAY__SIZE,
oldSize, newSize);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
*
* @generated
*/
public void setSize(SizeIdentifier newSize) {
if (newSize != size) {
NotificationChain msgs = null;
if (size != null)
msgs = ((InternalEObject) size).eInverseRemove(this,
EOPPOSITE_FEATURE_BASE - RBAViewPackage.DISPLAY__SIZE, null, msgs);
if (newSize != null)
msgs = ((InternalEObject) newSize).eInverseAdd(this,
EOPPOSITE_FEATURE_BASE - RBAViewPackage.DISPLAY__SIZE, null, msgs);
msgs = basicSetSize(newSize, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RBAViewPackage.DISPLAY__SIZE, newSize, newSize));
}
/**
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case RBAViewPackage.DISPLAY__ROOT:
return basicSetRoot(null, msgs);
case RBAViewPackage.DISPLAY__SIZE:
return basicSetSize(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case RBAViewPackage.DISPLAY__ROOT:
return getRoot();
case RBAViewPackage.DISPLAY__SIZE:
return getSize();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case RBAViewPackage.DISPLAY__ROOT:
setRoot((CompositeArea) newValue);
return;
case RBAViewPackage.DISPLAY__SIZE:
setSize((SizeIdentifier) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case RBAViewPackage.DISPLAY__ROOT:
setRoot((CompositeArea) null);
return;
case RBAViewPackage.DISPLAY__SIZE:
setSize((SizeIdentifier) null);
return;
}
super.eUnset(featureID);
}
/**
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case RBAViewPackage.DISPLAY__ROOT:
return root != null;
case RBAViewPackage.DISPLAY__SIZE:
return size != null;
}
return super.eIsSet(featureID);
}
} // DisplayImpl