All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.bpmn2.impl.LaneImpl Maven / Gradle / Ivy

/**
 * 
 * 
 * Copyright (c) 2010 SAP AG.
 * 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:
 *    Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation
 * 
 * 
 */
package org.eclipse.bpmn2.impl;

import com.google.gwt.user.client.rpc.GwtTransient;

import java.util.Collection;

import org.eclipse.bpmn2.BaseElement;
import org.eclipse.bpmn2.Bpmn2Package;
import org.eclipse.bpmn2.FlowNode;
import org.eclipse.bpmn2.Lane;
import org.eclipse.bpmn2.LaneSet;

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 org.eclipse.emf.ecore.util.EObjectWithInverseEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * 
 * An implementation of the model object 'Lane'.
 * 
 * 

* The following features are implemented: *

*
    *
  • {@link org.eclipse.bpmn2.impl.LaneImpl#getPartitionElement Partition Element}
  • *
  • {@link org.eclipse.bpmn2.impl.LaneImpl#getFlowNodeRefs Flow Node Refs}
  • *
  • {@link org.eclipse.bpmn2.impl.LaneImpl#getChildLaneSet Child Lane Set}
  • *
  • {@link org.eclipse.bpmn2.impl.LaneImpl#getName Name}
  • *
  • {@link org.eclipse.bpmn2.impl.LaneImpl#getPartitionElementRef Partition Element Ref}
  • *
* * @generated */ public class LaneImpl extends BaseElementImpl implements Lane { /** * The cached value of the '{@link #getPartitionElement() Partition Element}' containment reference. * * * @see #getPartitionElement() * @generated * @ordered */ @GwtTransient protected BaseElement partitionElement; /** * The cached value of the '{@link #getFlowNodeRefs() Flow Node Refs}' reference list. * * * @see #getFlowNodeRefs() * @generated * @ordered */ @GwtTransient protected EList flowNodeRefs; /** * The cached value of the '{@link #getChildLaneSet() Child Lane Set}' containment reference. * * * @see #getChildLaneSet() * @generated * @ordered */ @GwtTransient protected LaneSet childLaneSet; /** * The default value of the '{@link #getName() Name}' attribute. * * * @see #getName() * @generated * @ordered */ protected static final String NAME_EDEFAULT = null; /** * The cached value of the '{@link #getName() Name}' attribute. * * * @see #getName() * @generated * @ordered */ @GwtTransient protected String name = NAME_EDEFAULT; /** * The cached value of the '{@link #getPartitionElementRef() Partition Element Ref}' reference. * * * @see #getPartitionElementRef() * @generated * @ordered */ @GwtTransient protected BaseElement partitionElementRef; /** * * * @generated */ protected LaneImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return Bpmn2Package.Literals.LANE; } /** * * * @generated */ @Override public BaseElement getPartitionElement() { return partitionElement; } /** * * * @generated */ public NotificationChain basicSetPartitionElement(BaseElement newPartitionElement, NotificationChain msgs) { BaseElement oldPartitionElement = partitionElement; partitionElement = newPartitionElement; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Bpmn2Package.LANE__PARTITION_ELEMENT, oldPartitionElement, newPartitionElement); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setPartitionElement(BaseElement newPartitionElement) { if (newPartitionElement != partitionElement) { NotificationChain msgs = null; if (partitionElement != null) msgs = ((InternalEObject) partitionElement).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - Bpmn2Package.LANE__PARTITION_ELEMENT, null, msgs); if (newPartitionElement != null) msgs = ((InternalEObject) newPartitionElement).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - Bpmn2Package.LANE__PARTITION_ELEMENT, null, msgs); msgs = basicSetPartitionElement(newPartitionElement, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.LANE__PARTITION_ELEMENT, newPartitionElement, newPartitionElement)); } /** * * * @generated */ @Override public EList getFlowNodeRefs() { if (flowNodeRefs == null) { flowNodeRefs = new EObjectWithInverseEList.ManyInverse(FlowNode.class, this, Bpmn2Package.LANE__FLOW_NODE_REFS, Bpmn2Package.FLOW_NODE__LANES); } return flowNodeRefs; } /** * * * @generated */ @Override public LaneSet getChildLaneSet() { return childLaneSet; } /** * * * @generated */ public NotificationChain basicSetChildLaneSet(LaneSet newChildLaneSet, NotificationChain msgs) { LaneSet oldChildLaneSet = childLaneSet; childLaneSet = newChildLaneSet; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Bpmn2Package.LANE__CHILD_LANE_SET, oldChildLaneSet, newChildLaneSet); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setChildLaneSet(LaneSet newChildLaneSet) { if (newChildLaneSet != childLaneSet) { NotificationChain msgs = null; if (childLaneSet != null) msgs = ((InternalEObject) childLaneSet).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - Bpmn2Package.LANE__CHILD_LANE_SET, null, msgs); if (newChildLaneSet != null) msgs = ((InternalEObject) newChildLaneSet).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - Bpmn2Package.LANE__CHILD_LANE_SET, null, msgs); msgs = basicSetChildLaneSet(newChildLaneSet, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.LANE__CHILD_LANE_SET, newChildLaneSet, newChildLaneSet)); } /** * * * @generated */ @Override public String getName() { return name; } /** * * * @generated */ @Override public void setName(String newName) { String oldName = name; name = newName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.LANE__NAME, oldName, name)); } /** * * * @generated */ @Override public BaseElement getPartitionElementRef() { if (partitionElementRef != null && partitionElementRef.eIsProxy()) { InternalEObject oldPartitionElementRef = (InternalEObject) partitionElementRef; partitionElementRef = (BaseElement) eResolveProxy(oldPartitionElementRef); if (partitionElementRef != oldPartitionElementRef) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.LANE__PARTITION_ELEMENT_REF, oldPartitionElementRef, partitionElementRef)); } } return partitionElementRef; } /** * * * @generated */ public BaseElement basicGetPartitionElementRef() { return partitionElementRef; } /** * * * @generated */ @Override public void setPartitionElementRef(BaseElement newPartitionElementRef) { BaseElement oldPartitionElementRef = partitionElementRef; partitionElementRef = newPartitionElementRef; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.LANE__PARTITION_ELEMENT_REF, oldPartitionElementRef, partitionElementRef)); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case Bpmn2Package.LANE__FLOW_NODE_REFS: return ((InternalEList) (InternalEList) getFlowNodeRefs()).basicAdd(otherEnd, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case Bpmn2Package.LANE__PARTITION_ELEMENT: return basicSetPartitionElement(null, msgs); case Bpmn2Package.LANE__FLOW_NODE_REFS: return ((InternalEList) getFlowNodeRefs()).basicRemove(otherEnd, msgs); case Bpmn2Package.LANE__CHILD_LANE_SET: return basicSetChildLaneSet(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case Bpmn2Package.LANE__PARTITION_ELEMENT: return getPartitionElement(); case Bpmn2Package.LANE__FLOW_NODE_REFS: return getFlowNodeRefs(); case Bpmn2Package.LANE__CHILD_LANE_SET: return getChildLaneSet(); case Bpmn2Package.LANE__NAME: return getName(); case Bpmn2Package.LANE__PARTITION_ELEMENT_REF: if (resolve) return getPartitionElementRef(); return basicGetPartitionElementRef(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case Bpmn2Package.LANE__PARTITION_ELEMENT: setPartitionElement((BaseElement) newValue); return; case Bpmn2Package.LANE__FLOW_NODE_REFS: getFlowNodeRefs().clear(); getFlowNodeRefs().addAll((Collection) newValue); return; case Bpmn2Package.LANE__CHILD_LANE_SET: setChildLaneSet((LaneSet) newValue); return; case Bpmn2Package.LANE__NAME: setName((String) newValue); return; case Bpmn2Package.LANE__PARTITION_ELEMENT_REF: setPartitionElementRef((BaseElement) newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case Bpmn2Package.LANE__PARTITION_ELEMENT: setPartitionElement((BaseElement) null); return; case Bpmn2Package.LANE__FLOW_NODE_REFS: getFlowNodeRefs().clear(); return; case Bpmn2Package.LANE__CHILD_LANE_SET: setChildLaneSet((LaneSet) null); return; case Bpmn2Package.LANE__NAME: setName(NAME_EDEFAULT); return; case Bpmn2Package.LANE__PARTITION_ELEMENT_REF: setPartitionElementRef((BaseElement) null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case Bpmn2Package.LANE__PARTITION_ELEMENT: return partitionElement != null; case Bpmn2Package.LANE__FLOW_NODE_REFS: return flowNodeRefs != null && !flowNodeRefs.isEmpty(); case Bpmn2Package.LANE__CHILD_LANE_SET: return childLaneSet != null; case Bpmn2Package.LANE__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case Bpmn2Package.LANE__PARTITION_ELEMENT_REF: return partitionElementRef != null; } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (name: "); result.append(name); result.append(')'); return result.toString(); } } //LaneImpl




© 2015 - 2025 Weber Informatics LLC | Privacy Policy