diff options
Diffstat (limited to 'extraplugins/diagram-definition/org.eclipse.papyrus.umldi/src-gen/org/eclipse/papyrus/umldi/impl/StereotypeCompartmentImpl.java')
-rw-r--r-- | extraplugins/diagram-definition/org.eclipse.papyrus.umldi/src-gen/org/eclipse/papyrus/umldi/impl/StereotypeCompartmentImpl.java | 255 |
1 files changed, 255 insertions, 0 deletions
diff --git a/extraplugins/diagram-definition/org.eclipse.papyrus.umldi/src-gen/org/eclipse/papyrus/umldi/impl/StereotypeCompartmentImpl.java b/extraplugins/diagram-definition/org.eclipse.papyrus.umldi/src-gen/org/eclipse/papyrus/umldi/impl/StereotypeCompartmentImpl.java new file mode 100644 index 00000000000..c17513af658 --- /dev/null +++ b/extraplugins/diagram-definition/org.eclipse.papyrus.umldi/src-gen/org/eclipse/papyrus/umldi/impl/StereotypeCompartmentImpl.java @@ -0,0 +1,255 @@ +/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.umldi.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.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.papyrus.umldi.StereotypeCompartment; +import org.eclipse.papyrus.umldi.UMLDIPackage; +import org.eclipse.papyrus.umldi.UmlDiagramElement; +import org.eclipse.papyrus.umldi.UmlShape; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Stereotype Compartment</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.papyrus.umldi.impl.StereotypeCompartmentImpl#getOwningUmlDiagramElement <em>Owning Uml Diagram Element</em>}</li> + * <li>{@link org.eclipse.papyrus.umldi.impl.StereotypeCompartmentImpl#getUmlShape <em>Uml Shape</em>}</li> + * </ul> + * + * @generated + */ +public class StereotypeCompartmentImpl extends ListCompartmentImpl implements StereotypeCompartment { + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + protected StereotypeCompartmentImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return UMLDIPackage.Literals.STEREOTYPE_COMPARTMENT; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public UmlDiagramElement getOwningUmlDiagramElement() { + UmlDiagramElement owningUmlDiagramElement = basicGetOwningUmlDiagramElement(); + return owningUmlDiagramElement != null && owningUmlDiagramElement.eIsProxy() ? (UmlDiagramElement)eResolveProxy((InternalEObject)owningUmlDiagramElement) : owningUmlDiagramElement; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public UmlDiagramElement basicGetOwningUmlDiagramElement() { + UmlShape umlShape = getUmlShape(); + if(umlShape != null) { + return umlShape; + } + return super.basicGetOwningUmlDiagramElement(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public UmlShape getUmlShape() { + if(eContainerFeatureID() != UMLDIPackage.STEREOTYPE_COMPARTMENT__UML_SHAPE) + return null; + return (UmlShape)eInternalContainer(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public NotificationChain basicSetUmlShape(UmlShape newUmlShape, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject)newUmlShape, UMLDIPackage.STEREOTYPE_COMPARTMENT__UML_SHAPE, msgs); + return msgs; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public void setUmlShape(UmlShape newUmlShape) { + if(newUmlShape != eInternalContainer() || (eContainerFeatureID() != UMLDIPackage.STEREOTYPE_COMPARTMENT__UML_SHAPE && newUmlShape != null)) { + if(EcoreUtil.isAncestor(this, newUmlShape)) + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + NotificationChain msgs = null; + if(eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + if(newUmlShape != null) + msgs = ((InternalEObject)newUmlShape).eInverseAdd(this, UMLDIPackage.UML_SHAPE__STEREOTYPE_COMPARTMENT, UmlShape.class, msgs); + msgs = basicSetUmlShape(newUmlShape, msgs); + if(msgs != null) + msgs.dispatch(); + } else if(eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, UMLDIPackage.STEREOTYPE_COMPARTMENT__UML_SHAPE, newUmlShape, newUmlShape)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch(featureID) { + case UMLDIPackage.STEREOTYPE_COMPARTMENT__UML_SHAPE: + if(eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + return basicSetUmlShape((UmlShape)otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch(featureID) { + case UMLDIPackage.STEREOTYPE_COMPARTMENT__UML_SHAPE: + return basicSetUmlShape(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch(eContainerFeatureID()) { + case UMLDIPackage.STEREOTYPE_COMPARTMENT__UML_SHAPE: + return eInternalContainer().eInverseRemove(this, UMLDIPackage.UML_SHAPE__STEREOTYPE_COMPARTMENT, UmlShape.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch(featureID) { + case UMLDIPackage.STEREOTYPE_COMPARTMENT__UML_SHAPE: + return getUmlShape(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch(featureID) { + case UMLDIPackage.STEREOTYPE_COMPARTMENT__UML_SHAPE: + setUmlShape((UmlShape)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch(featureID) { + case UMLDIPackage.STEREOTYPE_COMPARTMENT__UML_SHAPE: + setUmlShape((UmlShape)null); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch(featureID) { + case UMLDIPackage.STEREOTYPE_COMPARTMENT__OWNING_UML_DIAGRAM_ELEMENT: + return isSetOwningUmlDiagramElement(); + case UMLDIPackage.STEREOTYPE_COMPARTMENT__UML_SHAPE: + return getUmlShape() != null; + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public boolean isSetOwningUmlDiagramElement() { + return super.isSetOwningUmlDiagramElement() || eIsSet(UMLDIPackage.STEREOTYPE_COMPARTMENT__UML_SHAPE); + } +} //StereotypeCompartmentImpl |