/** * <copyright> * </copyright> * * $Id$ */ package org.openscada.vi.model.VisualInterface.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 org.openscada.vi.model.VisualInterface.FigureContainer; import org.openscada.vi.model.VisualInterface.Primitive; import org.openscada.vi.model.VisualInterface.VisualInterfacePackage; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Figure Container</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.openscada.vi.model.VisualInterface.impl.FigureContainerImpl#getContent <em>Content</em>}</li> * </ul> * </p> * * @generated */ public class FigureContainerImpl extends FigureImpl implements FigureContainer { /** * The cached value of the '{@link #getContent() <em>Content</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getContent() * @generated * @ordered */ protected Primitive content; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected FigureContainerImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return VisualInterfacePackage.Literals.FIGURE_CONTAINER; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Primitive getContent() { return content; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetContent(Primitive newContent, NotificationChain msgs) { Primitive oldContent = content; content = newContent; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, VisualInterfacePackage.FIGURE_CONTAINER__CONTENT, oldContent, newContent); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setContent(Primitive newContent) { if (newContent != content) { NotificationChain msgs = null; if (content != null) msgs = ((InternalEObject)content).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - VisualInterfacePackage.FIGURE_CONTAINER__CONTENT, null, msgs); if (newContent != null) msgs = ((InternalEObject)newContent).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - VisualInterfacePackage.FIGURE_CONTAINER__CONTENT, null, msgs); msgs = basicSetContent(newContent, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, VisualInterfacePackage.FIGURE_CONTAINER__CONTENT, newContent, newContent)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case VisualInterfacePackage.FIGURE_CONTAINER__CONTENT: return basicSetContent(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 VisualInterfacePackage.FIGURE_CONTAINER__CONTENT: return getContent(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case VisualInterfacePackage.FIGURE_CONTAINER__CONTENT: setContent((Primitive)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case VisualInterfacePackage.FIGURE_CONTAINER__CONTENT: setContent((Primitive)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case VisualInterfacePackage.FIGURE_CONTAINER__CONTENT: return content != null; } return super.eIsSet(featureID); } } //FigureContainerImpl