/**
*/
package rba.view.impl;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import rba.core.ExpressionType;
import rba.core.impl.PackagableElementImpl;
import rba.view.Area;
import rba.view.CompositeArea;
import rba.view.LayoutManager;
import rba.view.RBAViewPackage;
/**
* An implementation of the model object 'Composite Area'.
*
* The following features are implemented:
*
*
* - {@link rba.view.impl.CompositeAreaImpl#getLayout Layout}
*
*
* @generated
*/
public class CompositeAreaImpl extends PackagableElementImpl implements CompositeArea {
/**
* The cached value of the '{@link #getLayout() Layout}' containment reference.
*
* @see #getLayout()
* @generated
* @ordered
*/
protected LayoutManager layout;
/**
*
* @generated
*/
protected CompositeAreaImpl() {
super();
}
/**
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return RBAViewPackage.Literals.COMPOSITE_AREA;
}
/**
*
* @generated
*/
public LayoutManager getLayout() {
return layout;
}
/**
*
* @generated
*/
public NotificationChain basicSetLayout(LayoutManager newLayout, NotificationChain msgs) {
LayoutManager oldLayout = layout;
layout = newLayout;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
RBAViewPackage.COMPOSITE_AREA__LAYOUT, oldLayout, newLayout);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
*
* @generated
*/
public void setLayout(LayoutManager newLayout) {
if (newLayout != layout) {
NotificationChain msgs = null;
if (layout != null)
msgs = ((InternalEObject) layout).eInverseRemove(this,
EOPPOSITE_FEATURE_BASE - RBAViewPackage.COMPOSITE_AREA__LAYOUT, null, msgs);
if (newLayout != null)
msgs = ((InternalEObject) newLayout).eInverseAdd(this,
EOPPOSITE_FEATURE_BASE - RBAViewPackage.COMPOSITE_AREA__LAYOUT, null, msgs);
msgs = basicSetLayout(newLayout, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RBAViewPackage.COMPOSITE_AREA__LAYOUT, newLayout,
newLayout));
}
/**
*
* @generated
*/
public EList collectLeafArea() {
java.util.Set areas = new java.util.HashSet();
if (layout != null) {
areas.addAll(layout.collectLeafArea());
}
return new org.eclipse.emf.common.util.BasicEList(areas);
}
/**
*
* @generated
*/
public ExpressionType getExpressionType() {
return ExpressionType.AREA;
}
/**
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case RBAViewPackage.COMPOSITE_AREA__LAYOUT:
return basicSetLayout(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case RBAViewPackage.COMPOSITE_AREA__LAYOUT:
return getLayout();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case RBAViewPackage.COMPOSITE_AREA__LAYOUT:
setLayout((LayoutManager) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case RBAViewPackage.COMPOSITE_AREA__LAYOUT:
setLayout((LayoutManager) null);
return;
}
super.eUnset(featureID);
}
/**
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case RBAViewPackage.COMPOSITE_AREA__LAYOUT:
return layout != null;
}
return super.eIsSet(featureID);
}
/**
*
* @generated
*/
@Override
public Object eInvoke(int operationID, EList> arguments) throws InvocationTargetException {
switch (operationID) {
case RBAViewPackage.COMPOSITE_AREA___COLLECT_LEAF_AREA:
return collectLeafArea();
case RBAViewPackage.COMPOSITE_AREA___GET_EXPRESSION_TYPE:
return getExpressionType();
}
return super.eInvoke(operationID, arguments);
}
} // CompositeAreaImpl