org.omg.dd.di.impl.EdgeImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.omg.bpmn.model Show documentation
Show all versions of org.omg.bpmn.model Show documentation
Ecore and generated code for org.omg.bpmn2
The newest version!
/*
* Copyright (c) 2012 - 2024 Data In Motion and others.
* All rights reserved.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Mark Hoffmann - initial API and implementation
*/
package org.omg.dd.di.impl;
import java.util.Collection;
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.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.omg.dd.dc.Point;
import org.omg.dd.di.DiPackage;
import org.omg.dd.di.DiagramElement;
import org.omg.dd.di.Edge;
/**
*
* An implementation of the model object 'Edge'.
*
*
* The following features are implemented:
*
*
* - {@link org.omg.dd.di.impl.EdgeImpl#getSource Source}
* - {@link org.omg.dd.di.impl.EdgeImpl#getTarget Target}
* - {@link org.omg.dd.di.impl.EdgeImpl#getWaypoint Waypoint}
*
*
* @generated
*/
public abstract class EdgeImpl extends DiagramElementImpl implements Edge {
/**
* The cached value of the '{@link #getSource() Source}' reference.
*
*
* @see #getSource()
* @generated
* @ordered
*/
protected DiagramElement source;
/**
* The cached value of the '{@link #getTarget() Target}' reference.
*
*
* @see #getTarget()
* @generated
* @ordered
*/
protected DiagramElement target;
/**
* The cached value of the '{@link #getWaypoint() Waypoint}' containment reference list.
*
*
* @see #getWaypoint()
* @generated
* @ordered
*/
protected EList waypoint;
/**
*
*
* @generated
*/
protected EdgeImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return DiPackage.Literals.EDGE;
}
/**
*
*
* @generated
*/
@Override
public DiagramElement getSource() {
if (source != null && source.eIsProxy()) {
InternalEObject oldSource = (InternalEObject)source;
source = (DiagramElement)eResolveProxy(oldSource);
if (source != oldSource) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, DiPackage.EDGE__SOURCE, oldSource, source));
}
}
return source;
}
/**
*
*
* @generated
*/
public DiagramElement basicGetSource() {
return source;
}
/**
*
*
* @generated
*/
@Override
public DiagramElement getTarget() {
if (target != null && target.eIsProxy()) {
InternalEObject oldTarget = (InternalEObject)target;
target = (DiagramElement)eResolveProxy(oldTarget);
if (target != oldTarget) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, DiPackage.EDGE__TARGET, oldTarget, target));
}
}
return target;
}
/**
*
*
* @generated
*/
public DiagramElement basicGetTarget() {
return target;
}
/**
*
*
* @generated
*/
@Override
public EList getWaypoint() {
if (waypoint == null) {
waypoint = new EObjectContainmentEList(Point.class, this, DiPackage.EDGE__WAYPOINT);
}
return waypoint;
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case DiPackage.EDGE__WAYPOINT:
return ((InternalEList>)getWaypoint()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case DiPackage.EDGE__SOURCE:
if (resolve) return getSource();
return basicGetSource();
case DiPackage.EDGE__TARGET:
if (resolve) return getTarget();
return basicGetTarget();
case DiPackage.EDGE__WAYPOINT:
return getWaypoint();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case DiPackage.EDGE__WAYPOINT:
getWaypoint().clear();
getWaypoint().addAll((Collection extends Point>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case DiPackage.EDGE__WAYPOINT:
getWaypoint().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DiPackage.EDGE__SOURCE:
return source != null;
case DiPackage.EDGE__TARGET:
return target != null;
case DiPackage.EDGE__WAYPOINT:
return waypoint != null && !waypoint.isEmpty();
}
return super.eIsSet(featureID);
}
} //EdgeImpl