org.eclipse.bpmn2.di.impl.BPMNEdgeImpl 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.bpmn2.di.impl;
import com.google.gwt.user.client.rpc.GwtTransient;
import org.eclipse.bpmn2.BaseElement;
import org.eclipse.bpmn2.di.BPMNEdge;
import org.eclipse.bpmn2.di.BPMNLabel;
import org.eclipse.bpmn2.di.BpmnDiPackage;
import org.eclipse.bpmn2.di.MessageVisibleKind;
import org.eclipse.dd.di.DiagramElement;
import org.eclipse.dd.di.impl.LabeledEdgeImpl;
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;
/**
*
* An implementation of the model object 'BPMN Edge'.
*
*
* The following features are implemented:
*
*
* - {@link org.eclipse.bpmn2.di.impl.BPMNEdgeImpl#getLabel Label}
* - {@link org.eclipse.bpmn2.di.impl.BPMNEdgeImpl#getBpmnElement Bpmn Element}
* - {@link org.eclipse.bpmn2.di.impl.BPMNEdgeImpl#getMessageVisibleKind Message Visible Kind}
* - {@link org.eclipse.bpmn2.di.impl.BPMNEdgeImpl#getSourceElement Source Element}
* - {@link org.eclipse.bpmn2.di.impl.BPMNEdgeImpl#getTargetElement Target Element}
*
*
* @generated
*/
public class BPMNEdgeImpl extends LabeledEdgeImpl implements BPMNEdge {
/**
* The cached value of the '{@link #getLabel() Label}' containment reference.
*
*
* @see #getLabel()
* @generated
* @ordered
*/
@GwtTransient
protected BPMNLabel label;
/**
* The cached value of the '{@link #getBpmnElement() Bpmn Element}' reference.
*
*
* @see #getBpmnElement()
* @generated
* @ordered
*/
@GwtTransient
protected BaseElement bpmnElement;
/**
* The default value of the '{@link #getMessageVisibleKind() Message Visible Kind}' attribute.
*
*
* @see #getMessageVisibleKind()
* @generated
* @ordered
*/
protected static final MessageVisibleKind MESSAGE_VISIBLE_KIND_EDEFAULT = MessageVisibleKind.INITIATING;
/**
* The cached value of the '{@link #getMessageVisibleKind() Message Visible Kind}' attribute.
*
*
* @see #getMessageVisibleKind()
* @generated
* @ordered
*/
@GwtTransient
protected MessageVisibleKind messageVisibleKind = MESSAGE_VISIBLE_KIND_EDEFAULT;
/**
* The cached value of the '{@link #getSourceElement() Source Element}' reference.
*
*
* @see #getSourceElement()
* @generated
* @ordered
*/
@GwtTransient
protected DiagramElement sourceElement;
/**
* The cached value of the '{@link #getTargetElement() Target Element}' reference.
*
*
* @see #getTargetElement()
* @generated
* @ordered
*/
@GwtTransient
protected DiagramElement targetElement;
/**
*
*
* @generated
*/
protected BPMNEdgeImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return BpmnDiPackage.Literals.BPMN_EDGE;
}
/**
*
*
* @generated
*/
@Override
public BPMNLabel getLabel() {
return label;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetLabel(BPMNLabel newLabel, NotificationChain msgs) {
BPMNLabel oldLabel = label;
label = newLabel;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
BpmnDiPackage.BPMN_EDGE__LABEL, oldLabel, newLabel);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setLabel(BPMNLabel newLabel) {
if (newLabel != label) {
NotificationChain msgs = null;
if (label != null)
msgs = ((InternalEObject) label).eInverseRemove(this,
EOPPOSITE_FEATURE_BASE - BpmnDiPackage.BPMN_EDGE__LABEL, null, msgs);
if (newLabel != null)
msgs = ((InternalEObject) newLabel).eInverseAdd(this,
EOPPOSITE_FEATURE_BASE - BpmnDiPackage.BPMN_EDGE__LABEL, null, msgs);
msgs = basicSetLabel(newLabel, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BpmnDiPackage.BPMN_EDGE__LABEL, newLabel, newLabel));
}
/**
*
*
* @generated
*/
@Override
public BaseElement getBpmnElement() {
if (bpmnElement != null && bpmnElement.eIsProxy()) {
InternalEObject oldBpmnElement = (InternalEObject) bpmnElement;
bpmnElement = (BaseElement) eResolveProxy(oldBpmnElement);
if (bpmnElement != oldBpmnElement) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, BpmnDiPackage.BPMN_EDGE__BPMN_ELEMENT,
oldBpmnElement, bpmnElement));
}
}
return bpmnElement;
}
/**
*
*
* @generated
*/
public BaseElement basicGetBpmnElement() {
return bpmnElement;
}
/**
*
*
* @generated
*/
@Override
public void setBpmnElement(BaseElement newBpmnElement) {
BaseElement oldBpmnElement = bpmnElement;
bpmnElement = newBpmnElement;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BpmnDiPackage.BPMN_EDGE__BPMN_ELEMENT, oldBpmnElement,
bpmnElement));
}
/**
*
*
* @generated
*/
@Override
public MessageVisibleKind getMessageVisibleKind() {
return messageVisibleKind;
}
/**
*
*
* @generated
*/
@Override
public void setMessageVisibleKind(MessageVisibleKind newMessageVisibleKind) {
MessageVisibleKind oldMessageVisibleKind = messageVisibleKind;
messageVisibleKind = newMessageVisibleKind == null ? MESSAGE_VISIBLE_KIND_EDEFAULT : newMessageVisibleKind;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BpmnDiPackage.BPMN_EDGE__MESSAGE_VISIBLE_KIND,
oldMessageVisibleKind, messageVisibleKind));
}
/**
*
*
* @generated
*/
@Override
public DiagramElement getSourceElement() {
if (sourceElement != null && sourceElement.eIsProxy()) {
InternalEObject oldSourceElement = (InternalEObject) sourceElement;
sourceElement = (DiagramElement) eResolveProxy(oldSourceElement);
if (sourceElement != oldSourceElement) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, BpmnDiPackage.BPMN_EDGE__SOURCE_ELEMENT,
oldSourceElement, sourceElement));
}
}
return sourceElement;
}
/**
*
*
* @generated
*/
public DiagramElement basicGetSourceElement() {
return sourceElement;
}
/**
*
*
* @generated
*/
@Override
public void setSourceElement(DiagramElement newSourceElement) {
DiagramElement oldSourceElement = sourceElement;
sourceElement = newSourceElement;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BpmnDiPackage.BPMN_EDGE__SOURCE_ELEMENT,
oldSourceElement, sourceElement));
}
/**
*
*
* @generated
*/
@Override
public DiagramElement getTargetElement() {
if (targetElement != null && targetElement.eIsProxy()) {
InternalEObject oldTargetElement = (InternalEObject) targetElement;
targetElement = (DiagramElement) eResolveProxy(oldTargetElement);
if (targetElement != oldTargetElement) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, BpmnDiPackage.BPMN_EDGE__TARGET_ELEMENT,
oldTargetElement, targetElement));
}
}
return targetElement;
}
/**
*
*
* @generated
*/
public DiagramElement basicGetTargetElement() {
return targetElement;
}
/**
*
*
* @generated
*/
@Override
public void setTargetElement(DiagramElement newTargetElement) {
DiagramElement oldTargetElement = targetElement;
targetElement = newTargetElement;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BpmnDiPackage.BPMN_EDGE__TARGET_ELEMENT,
oldTargetElement, targetElement));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case BpmnDiPackage.BPMN_EDGE__LABEL:
return basicSetLabel(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case BpmnDiPackage.BPMN_EDGE__LABEL:
return getLabel();
case BpmnDiPackage.BPMN_EDGE__BPMN_ELEMENT:
if (resolve)
return getBpmnElement();
return basicGetBpmnElement();
case BpmnDiPackage.BPMN_EDGE__MESSAGE_VISIBLE_KIND:
return getMessageVisibleKind();
case BpmnDiPackage.BPMN_EDGE__SOURCE_ELEMENT:
if (resolve)
return getSourceElement();
return basicGetSourceElement();
case BpmnDiPackage.BPMN_EDGE__TARGET_ELEMENT:
if (resolve)
return getTargetElement();
return basicGetTargetElement();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case BpmnDiPackage.BPMN_EDGE__LABEL:
setLabel((BPMNLabel) newValue);
return;
case BpmnDiPackage.BPMN_EDGE__BPMN_ELEMENT:
setBpmnElement((BaseElement) newValue);
return;
case BpmnDiPackage.BPMN_EDGE__MESSAGE_VISIBLE_KIND:
setMessageVisibleKind((MessageVisibleKind) newValue);
return;
case BpmnDiPackage.BPMN_EDGE__SOURCE_ELEMENT:
setSourceElement((DiagramElement) newValue);
return;
case BpmnDiPackage.BPMN_EDGE__TARGET_ELEMENT:
setTargetElement((DiagramElement) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BpmnDiPackage.BPMN_EDGE__LABEL:
setLabel((BPMNLabel) null);
return;
case BpmnDiPackage.BPMN_EDGE__BPMN_ELEMENT:
setBpmnElement((BaseElement) null);
return;
case BpmnDiPackage.BPMN_EDGE__MESSAGE_VISIBLE_KIND:
setMessageVisibleKind(MESSAGE_VISIBLE_KIND_EDEFAULT);
return;
case BpmnDiPackage.BPMN_EDGE__SOURCE_ELEMENT:
setSourceElement((DiagramElement) null);
return;
case BpmnDiPackage.BPMN_EDGE__TARGET_ELEMENT:
setTargetElement((DiagramElement) null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BpmnDiPackage.BPMN_EDGE__LABEL:
return label != null;
case BpmnDiPackage.BPMN_EDGE__BPMN_ELEMENT:
return bpmnElement != null;
case BpmnDiPackage.BPMN_EDGE__MESSAGE_VISIBLE_KIND:
return messageVisibleKind != MESSAGE_VISIBLE_KIND_EDEFAULT;
case BpmnDiPackage.BPMN_EDGE__SOURCE_ELEMENT:
return sourceElement != null;
case BpmnDiPackage.BPMN_EDGE__TARGET_ELEMENT:
return targetElement != null;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy())
return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (messageVisibleKind: ");
result.append(messageVisibleKind);
result.append(')');
return result.toString();
}
} //BPMNEdgeImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy