Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'deprecated/org.eclipse.papyrus.uml.diagram.sequence_initial-kepler/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseEditPart.java')
-rw-r--r--deprecated/org.eclipse.papyrus.uml.diagram.sequence_initial-kepler/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseEditPart.java1351
1 files changed, 0 insertions, 1351 deletions
diff --git a/deprecated/org.eclipse.papyrus.uml.diagram.sequence_initial-kepler/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseEditPart.java b/deprecated/org.eclipse.papyrus.uml.diagram.sequence_initial-kepler/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseEditPart.java
deleted file mode 100644
index 1112c8af146..00000000000
--- a/deprecated/org.eclipse.papyrus.uml.diagram.sequence_initial-kepler/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseEditPart.java
+++ /dev/null
@@ -1,1351 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009 Atos Origin.
- *
- *
- * 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:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.parts;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.edit.command.AddCommand;
-import org.eclipse.emf.edit.command.RemoveCommand;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.FillStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.gmf.runtime.notation.datatype.GradientData;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.infra.emf.appearance.helper.ShadowFigureHelper;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.uml.diagram.common.providers.UIAdapterImpl;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.InteractionUseItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.OpenDiagramEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.figures.InteractionUseRectangleFigure;
-import org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-import org.eclipse.papyrus.uml.diagram.sequence.util.CommandHelper;
-import org.eclipse.papyrus.uml.diagram.sequence.util.InteractionUseUtil;
-import org.eclipse.papyrus.uml.diagram.sequence.util.NotificationHelper;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.uml2.uml.Gate;
-import org.eclipse.uml2.uml.Interaction;
-import org.eclipse.uml2.uml.InteractionUse;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class InteractionUseEditPart extends InteractionFragmentEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 3002;
-
- /**
- * Title for dialog of no actual gate's manual creation
- */
- private static final String NO_ACTUAL_GATE_MANUAL_CREATION_DLG_TITLE = "No manual creation of actual gate"; //$NON-NLS-1$
-
- /**
- * Message for dialog of no actual gate's manual creation
- */
- private static final String NO_ACTUAL_GATE_MANUAL_CREATION_DLG_MSG = "It's forbidden to create actual gate"; //$NON-NLS-1$
-
- /**
- * Title for dialog of no actual gate's manual deletion
- */
- private static final String NO_ACTUAL_GATE_MANUAL_DELETION_DLG_TITLE = "No manual deletion of actual gate"; //$NON-NLS-1$
-
- /**
- * Message for dialog of no actual gate's manual deletion
- */
- private static final String NO_ACTUAL_GATE_MANUAL_DELETION_DLG_MSG = "It's forbidden to delete actual gate"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * Notfier for listen and unlistend model element.
- */
- private NotificationHelper notifier = new NotificationHelper(new UIAdapterImpl() {
-
- @Override
- protected void safeNotifyChanged(Notification msg) {
- handleNotificationEvent(msg);
- }
- });
-
- /**
- * @generated
- */
- public InteractionUseEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new InteractionUseItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- primaryShape = new InteractionUseRectangleFigure();
- getPrimaryShape().setShadow(false);
- return primaryShape;
- }
-
-
- protected final void refreshShadow() {
- getPrimaryShape().setShadow(ShadowFigureHelper.getShadowFigureValue((View)getModel()));
- }
-
- /**
- * Override to set the transparency to the correct figure
- */
- @Override
- protected void setTransparency(int transp) {
- getPrimaryShape().setTransparency(transp);
- }
-
- /**
- * sets the back ground color of this edit part
- *
- * @param color
- * the new value of the back ground color
- */
- @Override
- protected void setBackgroundColor(Color color) {
- getPrimaryShape().setBackgroundColor(color);
- getPrimaryShape().setIsUsingGradient(false);
- getPrimaryShape().setGradientData(-1, -1, 0);
- }
-
- /**
- * Override to set the gradient data to the correct figure
- */
- @Override
- protected void setGradient(GradientData gradient) {
- IPapyrusNodeFigure fig = getPrimaryShape();
- FillStyle style = (FillStyle)getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
- if(gradient != null) {
- fig.setIsUsingGradient(true);;
- fig.setGradientData(style.getFillColor(), gradient.getGradientColor1(), gradient.getGradientStyle());
- } else {
- fig.setIsUsingGradient(false);
- }
- }
-
- public boolean supportsGradient() {
- return true;
- }
-
- /**
- * @generated
- */
- public InteractionUseRectangleFigure getPrimaryShape() {
- return (InteractionUseRectangleFigure)primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InteractionUseNameEditPart) {
- ((InteractionUseNameEditPart)childEditPart).setLabel(getPrimaryShape().getHeaderLabel());
- return true;
- }
- if(childEditPart instanceof InteractionUseName2EditPart) {
- ((InteractionUseName2EditPart)childEditPart).setLabel(getPrimaryShape().getCenterLabel());
- return true;
- }
-
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InteractionUseNameEditPart) {
- return true;
- }
- if(childEditPart instanceof InteractionUseName2EditPart) {
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- @Override
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- @Override
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- @Override
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- return getContentPane();
- }
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- String prefElementId = "InteractionUse";
- IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model so you may safely remove
- * <i>generated</i> tag and modify it.
- *
- * @generated
- */
- @Override
- protected NodeFigure createNodeFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane. Respects layout one may have set
- * for generated figure.
- *
- * @param nodeShape
- * instance of generated figure class
- * @generated
- */
-
- protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- @Override
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- @Override
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- @Override
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }else if(primaryShape instanceof NodeFigure){
- ((NodeFigure)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- @Override
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- @Override
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(InteractionUseNameEditPart.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
- Object result = null;
-
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("InteractionUse", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("InteractionUse", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("InteractionUse", PreferenceConstantHelper.COLOR_FILL);
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- String prefGradient = PreferenceConstantHelper.getElementConstant("InteractionUse", PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
- result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null) {
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(7);
- types.add(UMLElementTypes.Message_4003);
- types.add(UMLElementTypes.Message_4004);
- types.add(UMLElementTypes.Message_4005);
- types.add(UMLElementTypes.Message_4006);
- types.add(UMLElementTypes.Message_4007);
- types.add(UMLElementTypes.Message_4008);
- types.add(UMLElementTypes.Message_4009);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof InteractionEditPart) {
- types.add(UMLElementTypes.Message_4003);
- }
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
- types.add(UMLElementTypes.Message_4003);
- }
- if(targetEditPart instanceof CombinedFragmentEditPart) {
- types.add(UMLElementTypes.Message_4003);
- }
- if(targetEditPart instanceof InteractionOperandEditPart) {
- types.add(UMLElementTypes.Message_4003);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseEditPart) {
- types.add(UMLElementTypes.Message_4003);
- }
- if(targetEditPart instanceof ContinuationEditPart) {
- types.add(UMLElementTypes.Message_4003);
- }
- if(targetEditPart instanceof LifelineEditPart) {
- types.add(UMLElementTypes.Message_4003);
- }
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
- types.add(UMLElementTypes.Message_4003);
- }
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
- types.add(UMLElementTypes.Message_4003);
- }
- if(targetEditPart instanceof StateInvariantEditPart) {
- types.add(UMLElementTypes.Message_4003);
- }
- if(targetEditPart instanceof CombinedFragment2EditPart) {
- types.add(UMLElementTypes.Message_4003);
- }
- if(targetEditPart instanceof TimeConstraintEditPart) {
- types.add(UMLElementTypes.Message_4003);
- }
- if(targetEditPart instanceof TimeObservationEditPart) {
- types.add(UMLElementTypes.Message_4003);
- }
- if(targetEditPart instanceof DurationConstraintEditPart) {
- types.add(UMLElementTypes.Message_4003);
- }
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
- types.add(UMLElementTypes.Message_4003);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Message_4003);
- }
- if(targetEditPart instanceof CommentEditPart) {
- types.add(UMLElementTypes.Message_4003);
- }
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
- types.add(UMLElementTypes.Message_4003);
- }
- if(targetEditPart instanceof DurationObservationEditPart) {
- types.add(UMLElementTypes.Message_4003);
- }
- if(targetEditPart instanceof InteractionEditPart) {
- types.add(UMLElementTypes.Message_4004);
- }
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
- types.add(UMLElementTypes.Message_4004);
- }
- if(targetEditPart instanceof CombinedFragmentEditPart) {
- types.add(UMLElementTypes.Message_4004);
- }
- if(targetEditPart instanceof InteractionOperandEditPart) {
- types.add(UMLElementTypes.Message_4004);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseEditPart) {
- types.add(UMLElementTypes.Message_4004);
- }
- if(targetEditPart instanceof ContinuationEditPart) {
- types.add(UMLElementTypes.Message_4004);
- }
- if(targetEditPart instanceof LifelineEditPart) {
- types.add(UMLElementTypes.Message_4004);
- }
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
- types.add(UMLElementTypes.Message_4004);
- }
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
- types.add(UMLElementTypes.Message_4004);
- }
- if(targetEditPart instanceof StateInvariantEditPart) {
- types.add(UMLElementTypes.Message_4004);
- }
- if(targetEditPart instanceof CombinedFragment2EditPart) {
- types.add(UMLElementTypes.Message_4004);
- }
- if(targetEditPart instanceof TimeConstraintEditPart) {
- types.add(UMLElementTypes.Message_4004);
- }
- if(targetEditPart instanceof TimeObservationEditPart) {
- types.add(UMLElementTypes.Message_4004);
- }
- if(targetEditPart instanceof DurationConstraintEditPart) {
- types.add(UMLElementTypes.Message_4004);
- }
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
- types.add(UMLElementTypes.Message_4004);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Message_4004);
- }
- if(targetEditPart instanceof CommentEditPart) {
- types.add(UMLElementTypes.Message_4004);
- }
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
- types.add(UMLElementTypes.Message_4004);
- }
- if(targetEditPart instanceof DurationObservationEditPart) {
- types.add(UMLElementTypes.Message_4004);
- }
- if(targetEditPart instanceof InteractionEditPart) {
- types.add(UMLElementTypes.Message_4005);
- }
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
- types.add(UMLElementTypes.Message_4005);
- }
- if(targetEditPart instanceof CombinedFragmentEditPart) {
- types.add(UMLElementTypes.Message_4005);
- }
- if(targetEditPart instanceof InteractionOperandEditPart) {
- types.add(UMLElementTypes.Message_4005);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseEditPart) {
- types.add(UMLElementTypes.Message_4005);
- }
- if(targetEditPart instanceof ContinuationEditPart) {
- types.add(UMLElementTypes.Message_4005);
- }
- if(targetEditPart instanceof LifelineEditPart) {
- types.add(UMLElementTypes.Message_4005);
- }
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
- types.add(UMLElementTypes.Message_4005);
- }
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
- types.add(UMLElementTypes.Message_4005);
- }
- if(targetEditPart instanceof StateInvariantEditPart) {
- types.add(UMLElementTypes.Message_4005);
- }
- if(targetEditPart instanceof CombinedFragment2EditPart) {
- types.add(UMLElementTypes.Message_4005);
- }
- if(targetEditPart instanceof TimeConstraintEditPart) {
- types.add(UMLElementTypes.Message_4005);
- }
- if(targetEditPart instanceof TimeObservationEditPart) {
- types.add(UMLElementTypes.Message_4005);
- }
- if(targetEditPart instanceof DurationConstraintEditPart) {
- types.add(UMLElementTypes.Message_4005);
- }
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
- types.add(UMLElementTypes.Message_4005);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Message_4005);
- }
- if(targetEditPart instanceof CommentEditPart) {
- types.add(UMLElementTypes.Message_4005);
- }
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
- types.add(UMLElementTypes.Message_4005);
- }
- if(targetEditPart instanceof DurationObservationEditPart) {
- types.add(UMLElementTypes.Message_4005);
- }
- if(targetEditPart instanceof InteractionEditPart) {
- types.add(UMLElementTypes.Message_4006);
- }
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
- types.add(UMLElementTypes.Message_4006);
- }
- if(targetEditPart instanceof CombinedFragmentEditPart) {
- types.add(UMLElementTypes.Message_4006);
- }
- if(targetEditPart instanceof InteractionOperandEditPart) {
- types.add(UMLElementTypes.Message_4006);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseEditPart) {
- types.add(UMLElementTypes.Message_4006);
- }
- if(targetEditPart instanceof ContinuationEditPart) {
- types.add(UMLElementTypes.Message_4006);
- }
- if(targetEditPart instanceof LifelineEditPart) {
- types.add(UMLElementTypes.Message_4006);
- }
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
- types.add(UMLElementTypes.Message_4006);
- }
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
- types.add(UMLElementTypes.Message_4006);
- }
- if(targetEditPart instanceof StateInvariantEditPart) {
- types.add(UMLElementTypes.Message_4006);
- }
- if(targetEditPart instanceof CombinedFragment2EditPart) {
- types.add(UMLElementTypes.Message_4006);
- }
- if(targetEditPart instanceof TimeConstraintEditPart) {
- types.add(UMLElementTypes.Message_4006);
- }
- if(targetEditPart instanceof TimeObservationEditPart) {
- types.add(UMLElementTypes.Message_4006);
- }
- if(targetEditPart instanceof DurationConstraintEditPart) {
- types.add(UMLElementTypes.Message_4006);
- }
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
- types.add(UMLElementTypes.Message_4006);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Message_4006);
- }
- if(targetEditPart instanceof CommentEditPart) {
- types.add(UMLElementTypes.Message_4006);
- }
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
- types.add(UMLElementTypes.Message_4006);
- }
- if(targetEditPart instanceof DurationObservationEditPart) {
- types.add(UMLElementTypes.Message_4006);
- }
- if(targetEditPart instanceof InteractionEditPart) {
- types.add(UMLElementTypes.Message_4007);
- }
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
- types.add(UMLElementTypes.Message_4007);
- }
- if(targetEditPart instanceof CombinedFragmentEditPart) {
- types.add(UMLElementTypes.Message_4007);
- }
- if(targetEditPart instanceof InteractionOperandEditPart) {
- types.add(UMLElementTypes.Message_4007);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseEditPart) {
- types.add(UMLElementTypes.Message_4007);
- }
- if(targetEditPart instanceof ContinuationEditPart) {
- types.add(UMLElementTypes.Message_4007);
- }
- if(targetEditPart instanceof LifelineEditPart) {
- types.add(UMLElementTypes.Message_4007);
- }
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
- types.add(UMLElementTypes.Message_4007);
- }
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
- types.add(UMLElementTypes.Message_4007);
- }
- if(targetEditPart instanceof StateInvariantEditPart) {
- types.add(UMLElementTypes.Message_4007);
- }
- if(targetEditPart instanceof CombinedFragment2EditPart) {
- types.add(UMLElementTypes.Message_4007);
- }
- if(targetEditPart instanceof TimeConstraintEditPart) {
- types.add(UMLElementTypes.Message_4007);
- }
- if(targetEditPart instanceof TimeObservationEditPart) {
- types.add(UMLElementTypes.Message_4007);
- }
- if(targetEditPart instanceof DurationConstraintEditPart) {
- types.add(UMLElementTypes.Message_4007);
- }
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
- types.add(UMLElementTypes.Message_4007);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Message_4007);
- }
- if(targetEditPart instanceof CommentEditPart) {
- types.add(UMLElementTypes.Message_4007);
- }
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
- types.add(UMLElementTypes.Message_4007);
- }
- if(targetEditPart instanceof DurationObservationEditPart) {
- types.add(UMLElementTypes.Message_4007);
- }
- if(targetEditPart instanceof InteractionEditPart) {
- types.add(UMLElementTypes.Message_4008);
- }
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
- types.add(UMLElementTypes.Message_4008);
- }
- if(targetEditPart instanceof CombinedFragmentEditPart) {
- types.add(UMLElementTypes.Message_4008);
- }
- if(targetEditPart instanceof InteractionOperandEditPart) {
- types.add(UMLElementTypes.Message_4008);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseEditPart) {
- types.add(UMLElementTypes.Message_4008);
- }
- if(targetEditPart instanceof ContinuationEditPart) {
- types.add(UMLElementTypes.Message_4008);
- }
- if(targetEditPart instanceof LifelineEditPart) {
- types.add(UMLElementTypes.Message_4008);
- }
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
- types.add(UMLElementTypes.Message_4008);
- }
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
- types.add(UMLElementTypes.Message_4008);
- }
- if(targetEditPart instanceof StateInvariantEditPart) {
- types.add(UMLElementTypes.Message_4008);
- }
- if(targetEditPart instanceof CombinedFragment2EditPart) {
- types.add(UMLElementTypes.Message_4008);
- }
- if(targetEditPart instanceof TimeConstraintEditPart) {
- types.add(UMLElementTypes.Message_4008);
- }
- if(targetEditPart instanceof TimeObservationEditPart) {
- types.add(UMLElementTypes.Message_4008);
- }
- if(targetEditPart instanceof DurationConstraintEditPart) {
- types.add(UMLElementTypes.Message_4008);
- }
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
- types.add(UMLElementTypes.Message_4008);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Message_4008);
- }
- if(targetEditPart instanceof CommentEditPart) {
- types.add(UMLElementTypes.Message_4008);
- }
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
- types.add(UMLElementTypes.Message_4008);
- }
- if(targetEditPart instanceof DurationObservationEditPart) {
- types.add(UMLElementTypes.Message_4008);
- }
- if(targetEditPart instanceof InteractionEditPart) {
- types.add(UMLElementTypes.Message_4009);
- }
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
- types.add(UMLElementTypes.Message_4009);
- }
- if(targetEditPart instanceof CombinedFragmentEditPart) {
- types.add(UMLElementTypes.Message_4009);
- }
- if(targetEditPart instanceof InteractionOperandEditPart) {
- types.add(UMLElementTypes.Message_4009);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseEditPart) {
- types.add(UMLElementTypes.Message_4009);
- }
- if(targetEditPart instanceof ContinuationEditPart) {
- types.add(UMLElementTypes.Message_4009);
- }
- if(targetEditPart instanceof LifelineEditPart) {
- types.add(UMLElementTypes.Message_4009);
- }
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
- types.add(UMLElementTypes.Message_4009);
- }
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
- types.add(UMLElementTypes.Message_4009);
- }
- if(targetEditPart instanceof StateInvariantEditPart) {
- types.add(UMLElementTypes.Message_4009);
- }
- if(targetEditPart instanceof CombinedFragment2EditPart) {
- types.add(UMLElementTypes.Message_4009);
- }
- if(targetEditPart instanceof TimeConstraintEditPart) {
- types.add(UMLElementTypes.Message_4009);
- }
- if(targetEditPart instanceof TimeObservationEditPart) {
- types.add(UMLElementTypes.Message_4009);
- }
- if(targetEditPart instanceof DurationConstraintEditPart) {
- types.add(UMLElementTypes.Message_4009);
- }
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
- types.add(UMLElementTypes.Message_4009);
- }
- if(targetEditPart instanceof ConstraintEditPart) {
- types.add(UMLElementTypes.Message_4009);
- }
- if(targetEditPart instanceof CommentEditPart) {
- types.add(UMLElementTypes.Message_4009);
- }
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
- types.add(UMLElementTypes.Message_4009);
- }
- if(targetEditPart instanceof DurationObservationEditPart) {
- types.add(UMLElementTypes.Message_4009);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
- types.add(UMLElementTypes.Interaction_2001);
- types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
- types.add(UMLElementTypes.CombinedFragment_3004);
- types.add(UMLElementTypes.InteractionOperand_3005);
- types.add(UMLElementTypes.InteractionUse_3002);
- types.add(UMLElementTypes.Continuation_3016);
- types.add(UMLElementTypes.Lifeline_3001);
- types.add(UMLElementTypes.ActionExecutionSpecification_3006);
- types.add(UMLElementTypes.BehaviorExecutionSpecification_3003);
- types.add(UMLElementTypes.StateInvariant_3017);
- types.add(UMLElementTypes.CombinedFragment_3018);
- types.add(UMLElementTypes.TimeConstraint_3019);
- types.add(UMLElementTypes.TimeObservation_3020);
- types.add(UMLElementTypes.DurationConstraint_3021);
- types.add(UMLElementTypes.DestructionOccurrenceSpecification_3022);
- types.add(UMLElementTypes.Constraint_3008);
- types.add(UMLElementTypes.Comment_3009);
- types.add(UMLElementTypes.DurationConstraint_3023);
- types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
- types.add(UMLElementTypes.Interaction_2001);
- types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
- types.add(UMLElementTypes.CombinedFragment_3004);
- types.add(UMLElementTypes.InteractionOperand_3005);
- types.add(UMLElementTypes.InteractionUse_3002);
- types.add(UMLElementTypes.Continuation_3016);
- types.add(UMLElementTypes.Lifeline_3001);
- types.add(UMLElementTypes.ActionExecutionSpecification_3006);
- types.add(UMLElementTypes.BehaviorExecutionSpecification_3003);
- types.add(UMLElementTypes.StateInvariant_3017);
- types.add(UMLElementTypes.CombinedFragment_3018);
- types.add(UMLElementTypes.TimeConstraint_3019);
- types.add(UMLElementTypes.TimeObservation_3020);
- types.add(UMLElementTypes.DurationConstraint_3021);
- types.add(UMLElementTypes.DestructionOccurrenceSpecification_3022);
- types.add(UMLElementTypes.Constraint_3008);
- types.add(UMLElementTypes.Comment_3009);
- types.add(UMLElementTypes.DurationConstraint_3023);
- types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
- types.add(UMLElementTypes.Interaction_2001);
- types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
- types.add(UMLElementTypes.CombinedFragment_3004);
- types.add(UMLElementTypes.InteractionOperand_3005);
- types.add(UMLElementTypes.InteractionUse_3002);
- types.add(UMLElementTypes.Continuation_3016);
- types.add(UMLElementTypes.Lifeline_3001);
- types.add(UMLElementTypes.ActionExecutionSpecification_3006);
- types.add(UMLElementTypes.BehaviorExecutionSpecification_3003);
- types.add(UMLElementTypes.StateInvariant_3017);
- types.add(UMLElementTypes.CombinedFragment_3018);
- types.add(UMLElementTypes.TimeConstraint_3019);
- types.add(UMLElementTypes.TimeObservation_3020);
- types.add(UMLElementTypes.DurationConstraint_3021);
- types.add(UMLElementTypes.DestructionOccurrenceSpecification_3022);
- types.add(UMLElementTypes.Constraint_3008);
- types.add(UMLElementTypes.Comment_3009);
- types.add(UMLElementTypes.DurationConstraint_3023);
- types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
- types.add(UMLElementTypes.Interaction_2001);
- types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
- types.add(UMLElementTypes.CombinedFragment_3004);
- types.add(UMLElementTypes.InteractionOperand_3005);
- types.add(UMLElementTypes.InteractionUse_3002);
- types.add(UMLElementTypes.Continuation_3016);
- types.add(UMLElementTypes.Lifeline_3001);
- types.add(UMLElementTypes.ActionExecutionSpecification_3006);
- types.add(UMLElementTypes.BehaviorExecutionSpecification_3003);
- types.add(UMLElementTypes.StateInvariant_3017);
- types.add(UMLElementTypes.CombinedFragment_3018);
- types.add(UMLElementTypes.TimeConstraint_3019);
- types.add(UMLElementTypes.TimeObservation_3020);
- types.add(UMLElementTypes.DurationConstraint_3021);
- types.add(UMLElementTypes.DestructionOccurrenceSpecification_3022);
- types.add(UMLElementTypes.Constraint_3008);
- types.add(UMLElementTypes.Comment_3009);
- types.add(UMLElementTypes.DurationConstraint_3023);
- types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
- types.add(UMLElementTypes.Interaction_2001);
- types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
- types.add(UMLElementTypes.CombinedFragment_3004);
- types.add(UMLElementTypes.InteractionOperand_3005);
- types.add(UMLElementTypes.InteractionUse_3002);
- types.add(UMLElementTypes.Continuation_3016);
- types.add(UMLElementTypes.Lifeline_3001);
- types.add(UMLElementTypes.ActionExecutionSpecification_3006);
- types.add(UMLElementTypes.BehaviorExecutionSpecification_3003);
- types.add(UMLElementTypes.StateInvariant_3017);
- types.add(UMLElementTypes.CombinedFragment_3018);
- types.add(UMLElementTypes.TimeConstraint_3019);
- types.add(UMLElementTypes.TimeObservation_3020);
- types.add(UMLElementTypes.DurationConstraint_3021);
- types.add(UMLElementTypes.DestructionOccurrenceSpecification_3022);
- types.add(UMLElementTypes.Constraint_3008);
- types.add(UMLElementTypes.Comment_3009);
- types.add(UMLElementTypes.DurationConstraint_3023);
- types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
- types.add(UMLElementTypes.Interaction_2001);
- types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
- types.add(UMLElementTypes.CombinedFragment_3004);
- types.add(UMLElementTypes.InteractionOperand_3005);
- types.add(UMLElementTypes.InteractionUse_3002);
- types.add(UMLElementTypes.Continuation_3016);
- types.add(UMLElementTypes.Lifeline_3001);
- types.add(UMLElementTypes.ActionExecutionSpecification_3006);
- types.add(UMLElementTypes.BehaviorExecutionSpecification_3003);
- types.add(UMLElementTypes.StateInvariant_3017);
- types.add(UMLElementTypes.CombinedFragment_3018);
- types.add(UMLElementTypes.TimeConstraint_3019);
- types.add(UMLElementTypes.TimeObservation_3020);
- types.add(UMLElementTypes.DurationConstraint_3021);
- types.add(UMLElementTypes.DestructionOccurrenceSpecification_3022);
- types.add(UMLElementTypes.Constraint_3008);
- types.add(UMLElementTypes.Comment_3009);
- types.add(UMLElementTypes.DurationConstraint_3023);
- types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
- types.add(UMLElementTypes.Interaction_2001);
- types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
- types.add(UMLElementTypes.CombinedFragment_3004);
- types.add(UMLElementTypes.InteractionOperand_3005);
- types.add(UMLElementTypes.InteractionUse_3002);
- types.add(UMLElementTypes.Continuation_3016);
- types.add(UMLElementTypes.Lifeline_3001);
- types.add(UMLElementTypes.ActionExecutionSpecification_3006);
- types.add(UMLElementTypes.BehaviorExecutionSpecification_3003);
- types.add(UMLElementTypes.StateInvariant_3017);
- types.add(UMLElementTypes.CombinedFragment_3018);
- types.add(UMLElementTypes.TimeConstraint_3019);
- types.add(UMLElementTypes.TimeObservation_3020);
- types.add(UMLElementTypes.DurationConstraint_3021);
- types.add(UMLElementTypes.DestructionOccurrenceSpecification_3022);
- types.add(UMLElementTypes.Constraint_3008);
- types.add(UMLElementTypes.Comment_3009);
- types.add(UMLElementTypes.DurationConstraint_3023);
- types.add(UMLElementTypes.DurationObservation_3024);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(9);
- types.add(UMLElementTypes.Message_4003);
- types.add(UMLElementTypes.Message_4004);
- types.add(UMLElementTypes.Message_4005);
- types.add(UMLElementTypes.Message_4006);
- types.add(UMLElementTypes.Message_4007);
- types.add(UMLElementTypes.Message_4008);
- types.add(UMLElementTypes.Message_4009);
- types.add(UMLElementTypes.CommentAnnotatedElement_4010);
- types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
- types.add(UMLElementTypes.Interaction_2001);
- types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
- types.add(UMLElementTypes.CombinedFragment_3004);
- types.add(UMLElementTypes.InteractionOperand_3005);
- types.add(UMLElementTypes.InteractionUse_3002);
- types.add(UMLElementTypes.Continuation_3016);
- types.add(UMLElementTypes.Lifeline_3001);
- types.add(UMLElementTypes.ActionExecutionSpecification_3006);
- types.add(UMLElementTypes.BehaviorExecutionSpecification_3003);
- types.add(UMLElementTypes.StateInvariant_3017);
- types.add(UMLElementTypes.CombinedFragment_3018);
- types.add(UMLElementTypes.TimeConstraint_3019);
- types.add(UMLElementTypes.TimeObservation_3020);
- types.add(UMLElementTypes.DurationConstraint_3021);
- types.add(UMLElementTypes.DestructionOccurrenceSpecification_3022);
- types.add(UMLElementTypes.Constraint_3008);
- types.add(UMLElementTypes.Comment_3009);
- types.add(UMLElementTypes.DurationConstraint_3023);
- types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
- types.add(UMLElementTypes.Interaction_2001);
- types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
- types.add(UMLElementTypes.CombinedFragment_3004);
- types.add(UMLElementTypes.InteractionOperand_3005);
- types.add(UMLElementTypes.InteractionUse_3002);
- types.add(UMLElementTypes.Continuation_3016);
- types.add(UMLElementTypes.Lifeline_3001);
- types.add(UMLElementTypes.ActionExecutionSpecification_3006);
- types.add(UMLElementTypes.BehaviorExecutionSpecification_3003);
- types.add(UMLElementTypes.StateInvariant_3017);
- types.add(UMLElementTypes.CombinedFragment_3018);
- types.add(UMLElementTypes.TimeConstraint_3019);
- types.add(UMLElementTypes.TimeObservation_3020);
- types.add(UMLElementTypes.DurationConstraint_3021);
- types.add(UMLElementTypes.DestructionOccurrenceSpecification_3022);
- types.add(UMLElementTypes.Constraint_3008);
- types.add(UMLElementTypes.Comment_3009);
- types.add(UMLElementTypes.DurationConstraint_3023);
- types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
- types.add(UMLElementTypes.Interaction_2001);
- types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
- types.add(UMLElementTypes.CombinedFragment_3004);
- types.add(UMLElementTypes.InteractionOperand_3005);
- types.add(UMLElementTypes.InteractionUse_3002);
- types.add(UMLElementTypes.Continuation_3016);
- types.add(UMLElementTypes.Lifeline_3001);
- types.add(UMLElementTypes.ActionExecutionSpecification_3006);
- types.add(UMLElementTypes.BehaviorExecutionSpecification_3003);
- types.add(UMLElementTypes.StateInvariant_3017);
- types.add(UMLElementTypes.CombinedFragment_3018);
- types.add(UMLElementTypes.TimeConstraint_3019);
- types.add(UMLElementTypes.TimeObservation_3020);
- types.add(UMLElementTypes.DurationConstraint_3021);
- types.add(UMLElementTypes.DestructionOccurrenceSpecification_3022);
- types.add(UMLElementTypes.Constraint_3008);
- types.add(UMLElementTypes.Comment_3009);
- types.add(UMLElementTypes.DurationConstraint_3023);
- types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
- types.add(UMLElementTypes.Interaction_2001);
- types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
- types.add(UMLElementTypes.CombinedFragment_3004);
- types.add(UMLElementTypes.InteractionOperand_3005);
- types.add(UMLElementTypes.InteractionUse_3002);
- types.add(UMLElementTypes.Continuation_3016);
- types.add(UMLElementTypes.Lifeline_3001);
- types.add(UMLElementTypes.ActionExecutionSpecification_3006);
- types.add(UMLElementTypes.BehaviorExecutionSpecification_3003);
- types.add(UMLElementTypes.StateInvariant_3017);
- types.add(UMLElementTypes.CombinedFragment_3018);
- types.add(UMLElementTypes.TimeConstraint_3019);
- types.add(UMLElementTypes.TimeObservation_3020);
- types.add(UMLElementTypes.DurationConstraint_3021);
- types.add(UMLElementTypes.DestructionOccurrenceSpecification_3022);
- types.add(UMLElementTypes.Constraint_3008);
- types.add(UMLElementTypes.Comment_3009);
- types.add(UMLElementTypes.DurationConstraint_3023);
- types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
- types.add(UMLElementTypes.Interaction_2001);
- types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
- types.add(UMLElementTypes.CombinedFragment_3004);
- types.add(UMLElementTypes.InteractionOperand_3005);
- types.add(UMLElementTypes.InteractionUse_3002);
- types.add(UMLElementTypes.Continuation_3016);
- types.add(UMLElementTypes.Lifeline_3001);
- types.add(UMLElementTypes.ActionExecutionSpecification_3006);
- types.add(UMLElementTypes.BehaviorExecutionSpecification_3003);
- types.add(UMLElementTypes.StateInvariant_3017);
- types.add(UMLElementTypes.CombinedFragment_3018);
- types.add(UMLElementTypes.TimeConstraint_3019);
- types.add(UMLElementTypes.TimeObservation_3020);
- types.add(UMLElementTypes.DurationConstraint_3021);
- types.add(UMLElementTypes.DestructionOccurrenceSpecification_3022);
- types.add(UMLElementTypes.Constraint_3008);
- types.add(UMLElementTypes.Comment_3009);
- types.add(UMLElementTypes.DurationConstraint_3023);
- types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
- types.add(UMLElementTypes.Interaction_2001);
- types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
- types.add(UMLElementTypes.CombinedFragment_3004);
- types.add(UMLElementTypes.InteractionOperand_3005);
- types.add(UMLElementTypes.InteractionUse_3002);
- types.add(UMLElementTypes.Continuation_3016);
- types.add(UMLElementTypes.Lifeline_3001);
- types.add(UMLElementTypes.ActionExecutionSpecification_3006);
- types.add(UMLElementTypes.BehaviorExecutionSpecification_3003);
- types.add(UMLElementTypes.StateInvariant_3017);
- types.add(UMLElementTypes.CombinedFragment_3018);
- types.add(UMLElementTypes.TimeConstraint_3019);
- types.add(UMLElementTypes.TimeObservation_3020);
- types.add(UMLElementTypes.DurationConstraint_3021);
- types.add(UMLElementTypes.DestructionOccurrenceSpecification_3022);
- types.add(UMLElementTypes.Constraint_3008);
- types.add(UMLElementTypes.Comment_3009);
- types.add(UMLElementTypes.DurationConstraint_3023);
- types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
- types.add(UMLElementTypes.Interaction_2001);
- types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
- types.add(UMLElementTypes.CombinedFragment_3004);
- types.add(UMLElementTypes.InteractionOperand_3005);
- types.add(UMLElementTypes.InteractionUse_3002);
- types.add(UMLElementTypes.Continuation_3016);
- types.add(UMLElementTypes.Lifeline_3001);
- types.add(UMLElementTypes.ActionExecutionSpecification_3006);
- types.add(UMLElementTypes.BehaviorExecutionSpecification_3003);
- types.add(UMLElementTypes.StateInvariant_3017);
- types.add(UMLElementTypes.CombinedFragment_3018);
- types.add(UMLElementTypes.TimeConstraint_3019);
- types.add(UMLElementTypes.TimeObservation_3020);
- types.add(UMLElementTypes.DurationConstraint_3021);
- types.add(UMLElementTypes.DestructionOccurrenceSpecification_3022);
- types.add(UMLElementTypes.Constraint_3008);
- types.add(UMLElementTypes.Comment_3009);
- types.add(UMLElementTypes.DurationConstraint_3023);
- types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
- types.add(UMLElementTypes.Comment_3009);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
- types.add(UMLElementTypes.TimeConstraint_3019);
- types.add(UMLElementTypes.DurationConstraint_3021);
- types.add(UMLElementTypes.Constraint_3008);
- types.add(UMLElementTypes.DurationConstraint_3023);
- }
- return types;
- }
-
- /**
- * Handle for gates operator and covered lifelines
- */
- @Override
- protected void handleNotificationEvent(Notification notification) {
- Object feature = notification.getFeature();
-
- if(UMLPackage.eINSTANCE.getInteractionUse_RefersTo().equals(feature)) {
- if(notification.getOldValue() instanceof Interaction) {
- notifier.unlistenAll();
- // notifier.unlistenObject((Interaction) notification.getOldValue());
- }
- InteractionUse interactionUse = (InteractionUse)resolveSemanticElement();
- CommandHelper.executeCommandWithoutHistory(getEditingDomain(), RemoveCommand.create(getEditingDomain(), interactionUse, UMLPackage.eINSTANCE.getInteractionUse_ActualGate(), interactionUse.getActualGates()), true);
- if(notification.getNewValue() instanceof Interaction) {
- Interaction interaction = (Interaction)notification.getNewValue();
- notifier.listenObject(interaction);
-
- List<Gate> actualGates = interactionUse.getActualGates();
- List<Gate> formalGates = interaction.getFormalGates();
- for(Gate formalGate : formalGates) {
- Gate newActualGate = (Gate)EcoreUtil.create(UMLPackage.Literals.GATE);
- newActualGate.setName(formalGate.getName());
- CommandHelper.executeCommandWithoutHistory(getEditingDomain(), AddCommand.create(getEditingDomain(), resolveSemanticElement(), UMLPackage.eINSTANCE.getInteractionUse_ActualGate(), newActualGate),true);
- notifier.listenObject(formalGate);
- notifier.listenObject(newActualGate);
- }
- }
- } else if(UMLPackage.eINSTANCE.getInteractionFragment_Covered().equals(feature)) {
- activate();
- resizeInteractionFragmentFigure();
- } else if(UMLPackage.eINSTANCE.getInteraction_FormalGate().equals(feature)) {
- // Handle formal gate
- InteractionUse interactionUse = (InteractionUse)resolveSemanticElement();
- Object oldValue = notification.getOldValue();
- if(oldValue instanceof Gate) {
- notifier.unlistenObject((Gate)oldValue);
- List<Gate> actualGates = interactionUse.getActualGates();
- for(int i = actualGates.size() - 1; i >= 0; i--) {
- Gate element = actualGates.get(i);
- if(((Gate)oldValue).getName().equals(element.getName())) {
- notifier.unlistenObject(element);
- CommandHelper.executeCommandWithoutHistory(getEditingDomain(), RemoveCommand.create(getEditingDomain(), interactionUse, UMLPackage.eINSTANCE.getInteractionUse_ActualGate(), element),true);
- }
- }
- }
- Object newValue = notification.getNewValue();
- if(newValue instanceof Gate) {
- Gate actualGate = interactionUse.createActualGate(((Gate)newValue).getName());
- notifier.listenObject((Gate)newValue);
- notifier.listenObject(actualGate);
- }
- } else if(UMLPackage.eINSTANCE.getInteractionUse_ActualGate().equals(feature)) {
- if(notification.getEventType() == Notification.ADD) {
- // Block manual creation of actual gate
- if(notification.getNewValue() instanceof Gate) {
- Gate newActualGate = (Gate)notification.getNewValue();
- if(!checkActualGateExistence(newActualGate)) {
- MessageDialog.openError(Display.getCurrent().getActiveShell(), NO_ACTUAL_GATE_MANUAL_CREATION_DLG_TITLE, NO_ACTUAL_GATE_MANUAL_CREATION_DLG_MSG);
- CommandHelper.executeCommandWithoutHistory(getEditingDomain(), RemoveCommand.create(getEditingDomain(), resolveSemanticElement(), UMLPackage.eINSTANCE.getInteractionUse_ActualGate(), newActualGate), true);
- }
- }
- } else if(notification.getEventType() == Notification.REMOVE) {
- // Block manual deletion of actual gate
- if(notification.getOldValue() instanceof Gate) {
- Gate oldActualGate = (Gate)notification.getOldValue();
- if(checkActualGateExistence(oldActualGate)) {
- MessageDialog.openError(Display.getCurrent().getActiveShell(), NO_ACTUAL_GATE_MANUAL_DELETION_DLG_TITLE, NO_ACTUAL_GATE_MANUAL_DELETION_DLG_MSG);
- CommandHelper.executeCommandWithoutHistory(getEditingDomain(), AddCommand.create(getEditingDomain(), resolveSemanticElement(), UMLPackage.eINSTANCE.getInteractionUse_ActualGate(), oldActualGate), true);
- }
- }
- }
- } else if(UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature) && notification.getNotifier() instanceof Gate) {
- Gate gate = (Gate)notification.getNotifier();
- if(gate.eContainer() instanceof Interaction) {
- // Handle modification of formal gate's name
- InteractionUse interactionUse = (InteractionUse)resolveSemanticElement();
- List<Gate> actualGates = interactionUse.getActualGates();
- String oldValue = notification.getOldStringValue();
- String newValue = notification.getNewStringValue();
- for(Gate actualGate : actualGates) {
- if(oldValue == null && actualGate.getName() == null || oldValue != null && oldValue.equals(actualGate.getName())) {
- notifier.unlistenObject(actualGate); // Delete listener on gate
- actualGate.setName(newValue);
- notifier.listenObject(actualGate); // Add listener on gate
- }
- }
- } else if(gate.eContainer() instanceof InteractionUse) {
- // Block modification of actual gate's name
- notifier.unlistenObject(gate); // Delete listener on gate
- gate.setName(notification.getOldStringValue());
- notifier.listenObject(gate); // Add listener on gate
- }
- }
-
- if((getModel() != null) && (getModel() == notification.getNotifier())) {
- if(NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
- refreshLineWidth();
- }
- }
- refreshShadow();
-
- super.handleNotificationEvent(notification);
- }
-
- /**
- * Check if actual gate is attached to a formal gate
- *
- * @return true if there is a formal gate corresponding to the actual gate
- */
- private boolean checkActualGateExistence(Gate actualGate) {
- InteractionUse interactionUse = (InteractionUse)resolveSemanticElement();
- Interaction interaction = interactionUse.getRefersTo();
- if(interaction != null) {
- // Find if the corresponding formal gate exists
- for(Gate formalGate : interaction.getFormalGates()) {
- if(formalGate.getName().equals(actualGate.getName())) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Activate a listener for the interactionUse to Handle notification in the refered Interaction
- */
- @Override
- public void activate() {
- super.activate();
- if(resolveSemanticElement() instanceof InteractionUse) {
- InteractionUse interactionUse = (InteractionUse)resolveSemanticElement();
- Interaction interaction = interactionUse.getRefersTo();
- if(interaction != null) {
- // activate the listener on the referred interaction
- notifier.listenObject(interaction);
- for(Gate formalGate : interaction.getFormalGates()) {
- notifier.listenObject(formalGate);
- }
- }
-
- for(Gate actualGate : interactionUse.getActualGates()) {
- notifier.listenObject(actualGate);
- }
-
- }
- }
-
- /**
- * Deactivate a listener for the interactionUse to handle notification in the refered
- * Interaction
- */
- @Override
- public void deactivate() {
- super.deactivate();
- notifier.unlistenAll();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void removeNotify() {
- notifier.unlistenAll();
- super.removeNotify();
- }
-
- @Override
- public void performRequest(Request request) {
- if(request.getType().equals(REQ_OPEN)){
- InteractionUse interactionUse = (InteractionUse)resolveSemanticElement();
- Interaction interaction = interactionUse.getRefersTo();
- if(interaction == null) {
- MessageDialog.openWarning(Display.getCurrent().getActiveShell(), "Warning", "There is no referenced interaction!");
- return;
- }
- Diagram diagram = InteractionUseUtil.findDiagram(getNotationView(), interaction);
- if(diagram == null)
- MessageDialog.openWarning(Display.getCurrent().getActiveShell(), "Warning", "Cannot find diagram of the referenced interaction!");
- else
- InteractionUseUtil.openDiagram(diagram);
- return;
- }
- super.performRequest(request);
- }
-}

Back to the top