| /** |
| * 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.ActivityEdgeEdge; |
| import org.eclipse.papyrus.umldi.UMLDIPackage; |
| import org.eclipse.papyrus.umldi.UmlDiagramElement; |
| import org.eclipse.papyrus.umldi.WeightLabel; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Weight Label</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.umldi.impl.WeightLabelImpl#getOwningUmlDiagramElement <em>Owning Uml Diagram Element</em>}</li> |
| * <li>{@link org.eclipse.papyrus.umldi.impl.WeightLabelImpl#getActivityEdgeEdge <em>Activity Edge Edge</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class WeightLabelImpl extends UmlLabelImpl implements WeightLabel { |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| protected WeightLabelImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return UMLDIPackage.Literals.WEIGHT_LABEL; |
| } |
| |
| /** |
| * <!-- 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() { |
| ActivityEdgeEdge activityEdgeEdge = getActivityEdgeEdge(); |
| if(activityEdgeEdge != null) { |
| return activityEdgeEdge; |
| } |
| return super.basicGetOwningUmlDiagramElement(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public ActivityEdgeEdge getActivityEdgeEdge() { |
| if(eContainerFeatureID() != UMLDIPackage.WEIGHT_LABEL__ACTIVITY_EDGE_EDGE) |
| return null; |
| return (ActivityEdgeEdge)eInternalContainer(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public NotificationChain basicSetActivityEdgeEdge(ActivityEdgeEdge newActivityEdgeEdge, NotificationChain msgs) { |
| msgs = eBasicSetContainer((InternalEObject)newActivityEdgeEdge, UMLDIPackage.WEIGHT_LABEL__ACTIVITY_EDGE_EDGE, msgs); |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public void setActivityEdgeEdge(ActivityEdgeEdge newActivityEdgeEdge) { |
| if(newActivityEdgeEdge != eInternalContainer() || (eContainerFeatureID() != UMLDIPackage.WEIGHT_LABEL__ACTIVITY_EDGE_EDGE && newActivityEdgeEdge != null)) { |
| if(EcoreUtil.isAncestor(this, newActivityEdgeEdge)) |
| throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); |
| NotificationChain msgs = null; |
| if(eInternalContainer() != null) |
| msgs = eBasicRemoveFromContainer(msgs); |
| if(newActivityEdgeEdge != null) |
| msgs = ((InternalEObject)newActivityEdgeEdge).eInverseAdd(this, UMLDIPackage.ACTIVITY_EDGE_EDGE__WEIGHT_LABEL, ActivityEdgeEdge.class, msgs); |
| msgs = basicSetActivityEdgeEdge(newActivityEdgeEdge, msgs); |
| if(msgs != null) |
| msgs.dispatch(); |
| } else if(eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UMLDIPackage.WEIGHT_LABEL__ACTIVITY_EDGE_EDGE, newActivityEdgeEdge, newActivityEdgeEdge)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch(featureID) { |
| case UMLDIPackage.WEIGHT_LABEL__ACTIVITY_EDGE_EDGE: |
| if(eInternalContainer() != null) |
| msgs = eBasicRemoveFromContainer(msgs); |
| return basicSetActivityEdgeEdge((ActivityEdgeEdge)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.WEIGHT_LABEL__ACTIVITY_EDGE_EDGE: |
| return basicSetActivityEdgeEdge(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.WEIGHT_LABEL__ACTIVITY_EDGE_EDGE: |
| return eInternalContainer().eInverseRemove(this, UMLDIPackage.ACTIVITY_EDGE_EDGE__WEIGHT_LABEL, ActivityEdgeEdge.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.WEIGHT_LABEL__ACTIVITY_EDGE_EDGE: |
| return getActivityEdgeEdge(); |
| } |
| 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.WEIGHT_LABEL__ACTIVITY_EDGE_EDGE: |
| setActivityEdgeEdge((ActivityEdgeEdge)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch(featureID) { |
| case UMLDIPackage.WEIGHT_LABEL__ACTIVITY_EDGE_EDGE: |
| setActivityEdgeEdge((ActivityEdgeEdge)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch(featureID) { |
| case UMLDIPackage.WEIGHT_LABEL__OWNING_UML_DIAGRAM_ELEMENT: |
| return isSetOwningUmlDiagramElement(); |
| case UMLDIPackage.WEIGHT_LABEL__ACTIVITY_EDGE_EDGE: |
| return getActivityEdgeEdge() != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public boolean isSetOwningUmlDiagramElement() { |
| return super.isSetOwningUmlDiagramElement() || eIsSet(UMLDIPackage.WEIGHT_LABEL__ACTIVITY_EDGE_EDGE); |
| } |
| } //WeightLabelImpl |