org.eclipse.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 kie-wb-common-stunner-bpmn-emf Show documentation
Show all versions of kie-wb-common-stunner-bpmn-emf Show documentation
Kie Workbench - Common - Stunner - BPMN Definition Set - GWT Support for Eclipse EMF/XMI
/**
*
*
* 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.dd.di.impl;
import com.google.gwt.user.client.rpc.GwtTransient;
import java.util.Collection;
import org.eclipse.dd.dc.Point;
import org.eclipse.dd.di.DiPackage;
import org.eclipse.dd.di.DiagramElement;
import org.eclipse.dd.di.Edge;
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;
/**
*
* An implementation of the model object 'Edge'.
*
*
* The following features are implemented:
*
*
* - {@link org.eclipse.dd.di.impl.EdgeImpl#getSource Source}
* - {@link org.eclipse.dd.di.impl.EdgeImpl#getTarget Target}
* - {@link org.eclipse.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
*/
@GwtTransient
protected DiagramElement source;
/**
* The cached value of the '{@link #getTarget() Target}' reference.
*
*
* @see #getTarget()
* @generated
* @ordered
*/
@GwtTransient
protected DiagramElement target;
/**
* The cached value of the '{@link #getWaypoint() Waypoint}' containment reference list.
*
*
* @see #getWaypoint()
* @generated
* @ordered
*/
@GwtTransient
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
© 2015 - 2025 Weber Informatics LLC | Privacy Policy