Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/AbstractRefreshCommand.java58
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/RefreshCommandForDo.java35
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/RefreshCommandForUndo.java31
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/EditPartUtils.java112
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/ViewUtils.java95
-rwxr-xr-xplugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/META-INF/MANIFEST.MF1
-rwxr-xr-xplugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/AbstractChangeInteractionTypeCommand.java5
-rwxr-xr-xplugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/CallBehaviorActionToInteractionDropStrategy.java4
-rwxr-xr-xplugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/CreateSnapshotForInteractionFromRefreshCommand.java15
-rwxr-xr-xplugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/CreateSnapshotForInteractionFromViewDescriptorCommand.java15
-rwxr-xr-xplugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/CreateSnapshotFromContextMenuCommand.java2
-rwxr-xr-xplugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/DropInteractionWithSnapshotCommand.java4
-rwxr-xr-xplugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/SwitchInteractionFormCommandHandler.java4
-rwxr-xr-xplugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/UpdateDiagramInSnapshotCommandHandler.java4
-rwxr-xr-xplugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/part/CallBehaviorActionAsInteractionEditPart.java2
-rwxr-xr-xplugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/policies/ActivityContentCompartmentCreationEditPolicy.java2
-rwxr-xr-xplugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/provider/DiagramContentProvider.java7
-rwxr-xr-xplugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/utils/CreateDiagramImage.java6
18 files changed, 375 insertions, 27 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/AbstractRefreshCommand.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/AbstractRefreshCommand.java
new file mode 100644
index 00000000000..16369c6d533
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/AbstractRefreshCommand.java
@@ -0,0 +1,58 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * 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
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.common.commands;
+
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.RootEditPart;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.papyrus.infra.gmfdiag.common.helper.DiagramHelper;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Refresh the {@link IFigure} of a given {@link GraphicalEditPart}.
+ * @since 3.0
+ */
+public abstract class AbstractRefreshCommand extends Command {
+
+ private final GraphicalEditPart editPartToRefresh;
+
+ private final RootEditPart rootEditPart;
+
+ public AbstractRefreshCommand(final GraphicalEditPart editPartToRefresh) {
+ this.editPartToRefresh = editPartToRefresh;
+ this.rootEditPart = editPartToRefresh.getRoot();
+ }
+
+ public GraphicalEditPart getEditPartToRefresh() {
+ return this.editPartToRefresh;
+ }
+
+ protected void refresh() {
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ if (AbstractRefreshCommand.this.editPartToRefresh.isActive()) {
+ DiagramHelper.refresh(AbstractRefreshCommand.this.editPartToRefresh, true);
+ // this is needed in order to update the bounds of the Figures from their layout manager constraints
+ AbstractRefreshCommand.this.editPartToRefresh.getFigure().invalidateTree();
+ } else if (AbstractRefreshCommand.this.rootEditPart.isActive()) {
+ /*
+ * If the EditPart we needed to refresh is not active anymore, then it probably means that we undid its
+ * creation, and re-created the object as part of a redo, with a different EditPart. In this case, just
+ * refresh everything.
+ */
+ DiagramHelper.refresh(AbstractRefreshCommand.this.rootEditPart, true);
+ }
+ }
+ });
+ }
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/RefreshCommandForDo.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/RefreshCommandForDo.java
new file mode 100644
index 00000000000..3edebbb93a2
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/RefreshCommandForDo.java
@@ -0,0 +1,35 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * 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
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.common.commands;
+
+import org.eclipse.gef.GraphicalEditPart;
+
+/**
+ * Refresh the {@link IFigure} of a given {@link GraphicalEditPart} on execute and redo of this command. This command
+ * must be placed at the end of a {@link CompoundCommand}, as the execute and redo are done in forward order.
+ * @since 3.0
+ */
+public class RefreshCommandForDo extends AbstractRefreshCommand {
+
+ public RefreshCommandForDo(final GraphicalEditPart editPartToRefresh) {
+ super(editPartToRefresh);
+ }
+
+ @Override
+ public void execute() {
+ refresh();
+ }
+
+ @Override
+ public void redo() {
+ refresh();
+ }
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/RefreshCommandForUndo.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/RefreshCommandForUndo.java
new file mode 100644
index 00000000000..187fd9778b2
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/RefreshCommandForUndo.java
@@ -0,0 +1,31 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * 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
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.common.commands;
+
+import org.eclipse.gef.GraphicalEditPart;
+
+/**
+ * Refresh the {@link IFigure} of a given {@link GraphicalEditPart} on undo of this command. <br/>
+ * <strong>This command must be created before the other ones in a CompoundCommand</strong> since the commands are
+ * executed in reverse when undoing.
+ * @since 3.0
+ */
+public class RefreshCommandForUndo extends AbstractRefreshCommand {
+
+ public RefreshCommandForUndo(final GraphicalEditPart editPartToRefresh) {
+ super(editPartToRefresh);
+ }
+
+ @Override
+ public void undo() {
+ refresh();
+ }
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/EditPartUtils.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/EditPartUtils.java
new file mode 100644
index 00000000000..dde77ced481
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/EditPartUtils.java
@@ -0,0 +1,112 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * 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
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.common.utils;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.TreeMap;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @since 3.0
+ */
+public class EditPartUtils {
+
+
+ public static EditPart findFirstChildEditPartWithId(final EditPart editPart, final String visualId) {
+ final List<? extends EditPart> result = findChildEditPartsWithId(editPart, visualId);
+ if (result.isEmpty()) {
+ return null;
+ }
+ return result.get(0);
+ }
+
+ public static List<? extends EditPart> findChildEditPartsWithId(final EditPart editPart, final String visualId) {
+ final List<EditPart> editParts = new ArrayList<EditPart>();
+ internalFindChildEditPartsWithId(editPart, visualId, editParts);
+ return editParts;
+ }
+
+ private static void internalFindChildEditPartsWithId(final EditPart editPart, final String visualId, final List<EditPart> result) {
+ final Object model = editPart.getModel();
+ if (model instanceof View) {
+ final View view = (View) model;
+ if( view.getType()!=null) {
+ if (view.getType().equals(visualId)) {
+ result.add(editPart);
+ }
+ }
+ }
+ @SuppressWarnings("unchecked")
+ final List<EditPart> children = editPart.getChildren();
+ for (final EditPart child : children) {
+ internalFindChildEditPartsWithId(child, visualId, result);
+ }
+ }
+
+ public static EditPart findParentEditPartWithId(final EditPart editPart, final String visualId) {
+ EditPart parent = editPart;
+ while (parent != null) {
+ final Object model = parent.getModel();
+ if (model instanceof View) {
+ final View parentView = (View) model;
+ if (parentView.getType()!=null) {
+ if (parentView.getType().equals(visualId)) {
+ return parent;
+ }
+ }
+ parent = parent.getParent();
+ } else {
+ break;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Find the EditPart whose Figure is closest to the given y-coordinate.
+ *
+ * @param ordinate
+ * the y-coordinate
+ * @param editParts
+ * the EditParts among which to choose
+ * @return the EditPart closest to the given vertical coordinate
+ */
+ public static GraphicalEditPart findEditPartClosestToOrdinate(final int ordinate, final List<? extends GraphicalEditPart> editParts) {
+ if (editParts.isEmpty()) {
+ return null;
+ }
+
+ final TreeMap<Integer, GraphicalEditPart> distanceMap = new TreeMap<Integer, GraphicalEditPart>();
+ for (final GraphicalEditPart editPart : editParts) {
+ final IFigure figure = editPart.getFigure();
+ final Rectangle bounds = new Rectangle(figure.getBounds());
+ figure.getParent().translateToAbsolute(bounds);
+ final int posY = bounds.y + bounds.height / 2;
+ final int distance = Math.abs(posY - ordinate);
+ distanceMap.put(Integer.valueOf(distance), editPart);
+ }
+ return distanceMap.values().iterator().next();
+ }
+
+
+ /** Reveals the given EditPart in its viewer */
+ public static void revealEditPart(final EditPart editPart) {
+ if (editPart != null && editPart.getViewer() != null) {
+ editPart.getViewer().reveal(editPart);
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/ViewUtils.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/ViewUtils.java
new file mode 100644
index 00000000000..d30229a6f73
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/ViewUtils.java
@@ -0,0 +1,95 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * 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
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.util;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartViewer;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.StructuredSelection;
+
+/**
+ * @since 3.0
+ */
+public class ViewUtils {
+
+
+ public static String getContainingDiagramType(final View view) {
+ if (view instanceof Diagram) {
+ final Diagram diagram = (Diagram) view;
+ return diagram.getType();
+ }
+ final EObject eContainer = view.eContainer();
+ if (eContainer instanceof View) {
+ final View parentView = (View) eContainer;
+ return getContainingDiagramType(parentView);
+ }
+ return null;
+ }
+
+
+ public static boolean isContained(final View child, final View parent) {
+ View view = child;
+ while (view != null) {
+ if (view == parent) {
+ return true;
+ }
+ final EObject eContainer = view.eContainer();
+ if (eContainer instanceof View) {
+ view = (View) eContainer;
+ } else {
+ break;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @since 3.0
+ */
+ public static boolean isViewFor(final View view, final EClass... eClasses) {
+ final EObject element = view.getElement();
+ for (final EClass eClass : eClasses) {
+ if (eClass.isInstance(element)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /** Returns whether the given View contains a child View for the given {@link EObject} */
+ public static boolean containsViewFor(final View parentView, final EObject eObject) {
+ if (parentView.getElement() == eObject) {
+ return true;
+ }
+ @SuppressWarnings("unchecked")
+ final EList<View> children = parentView.getChildren();
+ for (final View child : children) {
+ if (containsViewFor(child, eObject)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+
+ public static void selectInViewer(final View view, final EditPartViewer viewer) {
+ final EditPart editPart = (EditPart) viewer.getEditPartRegistry().get(view);
+ if (editPart != null) {
+ viewer.setSelection(new StructuredSelection(editPart));
+ }
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/META-INF/MANIFEST.MF
index 556416abcf3..4ff8d8eeb09 100755
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/META-INF/MANIFEST.MF
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/META-INF/MANIFEST.MF
@@ -16,7 +16,6 @@ Export-Package: org.eclipse.papyrus.uml.diagram.interactionoverview,
Require-Bundle: org.eclipse.gmf.runtime.diagram.ui.providers;bundle-version="[1.7.0,2.0.0)",
org.eclipse.papyrus.uml.diagram.activity;bundle-version="[3.0.0,4.0.0)";visibility:=reexport,
org.eclipse.papyrus.uml.tools;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.papyrus.uml.diagram.timing;bundle-version="[1.3.0,2.0.0)",
org.eclipse.gmf.runtime.diagram.ui.render;bundle-version="[1.7.0,2.0.0)",
org.eclipse.papyrus.uml.diagram.sequence;bundle-version="[3.0.0,4.0.0)";resolution:=optional,
org.eclipse.papyrus.uml.diagram.stereotype.edition;bundle-version="[2.0.0,3.0.0)",
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/AbstractChangeInteractionTypeCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/AbstractChangeInteractionTypeCommand.java
index ef8e06c03c1..be68a57b382 100755
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/AbstractChangeInteractionTypeCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/AbstractChangeInteractionTypeCommand.java
@@ -29,7 +29,6 @@ import org.eclipse.gmf.runtime.notation.Node;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.uml.diagram.interactionoverview.utils.CallBehaviorUtil;
import org.eclipse.papyrus.uml.diagram.interactionoverview.utils.CallBehaviorUtil.CallBehaviorActionType;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.ViewUtils;
import org.eclipse.uml2.uml.CallBehaviorAction;
public abstract class AbstractChangeInteractionTypeCommand extends
@@ -71,9 +70,7 @@ public abstract class AbstractChangeInteractionTypeCommand extends
// select the new callBehaviorAction View
parentEditPart.refresh();
- ViewUtils.selectInViewer(callBehaviorActionNode, parentEditPart.getViewer());
- EditPartViewer viewer = parentEditPart.getViewer();
- GraphicalEditPart newEditPart = (GraphicalEditPart) viewer.getEditPartRegistry().get(callBehaviorActionNode);
+ org.eclipse.papyrus.uml.diagram.common.util.ViewUtils.selectInViewer(callBehaviorActionNode, parentEditPart.getViewer());
return CommandResult.newOKCommandResult(callBehaviorActionNode);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/CallBehaviorActionToInteractionDropStrategy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/CallBehaviorActionToInteractionDropStrategy.java
index 790128fc81b..952e4d7639e 100755
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/CallBehaviorActionToInteractionDropStrategy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/CallBehaviorActionToInteractionDropStrategy.java
@@ -24,12 +24,12 @@ import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.commands.RefreshCommandForDo;
+import org.eclipse.papyrus.infra.gmfdiag.common.commands.RefreshCommandForUndo;
import org.eclipse.papyrus.infra.gmfdiag.common.service.palette.AspectUnspecifiedTypeConnectionTool.CreateAspectUnspecifiedTypeConnectionRequest;
import org.eclipse.papyrus.infra.gmfdiag.dnd.strategy.TransactionalDropStrategy;
import org.eclipse.papyrus.uml.diagram.interactionoverview.Activator;
import org.eclipse.papyrus.uml.diagram.interactionoverview.provider.ElementTypes;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForDo;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForUndo;
import org.eclipse.swt.graphics.Image;
import org.eclipse.uml2.uml.Activity;
import org.eclipse.uml2.uml.CallBehaviorAction;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/CreateSnapshotForInteractionFromRefreshCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/CreateSnapshotForInteractionFromRefreshCommand.java
index d90a79d836d..3723a2e5e9d 100755
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/CreateSnapshotForInteractionFromRefreshCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/CreateSnapshotForInteractionFromRefreshCommand.java
@@ -41,7 +41,6 @@ import org.eclipse.papyrus.uml.diagram.interactionoverview.utils.DiagramUtils;
import org.eclipse.papyrus.uml.diagram.interactionoverview.utils.URIUtils;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.SequenceDiagramEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TimingDiagramEditPart;
import org.eclipse.swt.graphics.Image;
import org.eclipse.uml2.uml.Behavior;
import org.eclipse.uml2.uml.CallBehaviorAction;
@@ -49,6 +48,16 @@ import org.eclipse.uml2.uml.CallBehaviorAction;
public class CreateSnapshotForInteractionFromRefreshCommand extends AbstractTransactionalCommand {
+ /**
+ * @since 3.0
+ */
+ protected static final String ORG_ECLIPSE_PAPYRUS_UML_DIAGRAM_TIMING = "org.eclipse.papyrus.uml.diagram.timing";
+
+ /**
+ * @since 3.0
+ */
+ protected static final String PAPYRUS_UML_TIMING_DIAGRAM = "PapyrusUMLTimingDiagram";
+
protected View callBehaviorView;
protected CallBehaviorAction callBehaviorAction;
@@ -124,8 +133,8 @@ public class CreateSnapshotForInteractionFromRefreshCommand extends AbstractTran
protected PreferencesHint getReferenceHint(final String type) {
if (SequenceDiagramEditPart.MODEL_ID.equals(type)) {
return UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT;
- } else if (TimingDiagramEditPart.MODEL_ID.equals(type)) {
- return org.eclipse.papyrus.uml.diagram.timing.part.UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT;
+ } else if (PAPYRUS_UML_TIMING_DIAGRAM.equals(type)) {
+ return new PreferencesHint(ORG_ECLIPSE_PAPYRUS_UML_DIAGRAM_TIMING);
} else if (InteractionOverviewDiagramEditPart.MODEL_ID.equals(type)) {
return Activator.DIAGRAM_PREFERENCES_HINT;
} else if (ModelEditPart.MODEL_ID.equals(type)) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/CreateSnapshotForInteractionFromViewDescriptorCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/CreateSnapshotForInteractionFromViewDescriptorCommand.java
index 52b3896b963..62235496fef 100755
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/CreateSnapshotForInteractionFromViewDescriptorCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/CreateSnapshotForInteractionFromViewDescriptorCommand.java
@@ -48,7 +48,6 @@ import org.eclipse.papyrus.uml.diagram.interactionoverview.utils.CreateDiagramIm
import org.eclipse.papyrus.uml.diagram.interactionoverview.utils.URIUtils;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.SequenceDiagramEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TimingDiagramEditPart;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PlatformUI;
@@ -59,6 +58,16 @@ import org.eclipse.uml2.uml.Interaction;
public class CreateSnapshotForInteractionFromViewDescriptorCommand extends AbstractTransactionalCommand {
+ /**
+ * @since 3.0
+ */
+ protected static final String ORG_ECLIPSE_PAPYRUS_UML_DIAGRAM_TIMING = "org.eclipse.papyrus.uml.diagram.timing";
+
+ /**
+ * @since 3.0
+ */
+ protected static final String PAPYRUS_UML_TIMING_DIAGRAM = "PapyrusUMLTimingDiagram";
+
protected ICommand createElementCommand;
protected GraphicalEditPart host;
@@ -143,8 +152,8 @@ public class CreateSnapshotForInteractionFromViewDescriptorCommand extends Abstr
protected PreferencesHint getReferenceHint(final String type) {
if (SequenceDiagramEditPart.MODEL_ID.equals(type)) {
return UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT;
- } else if (TimingDiagramEditPart.MODEL_ID.equals(type)) {
- return org.eclipse.papyrus.uml.diagram.timing.part.UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT;
+ } else if (PAPYRUS_UML_TIMING_DIAGRAM.equals(type)) {
+ return new PreferencesHint(ORG_ECLIPSE_PAPYRUS_UML_DIAGRAM_TIMING);
} else if (InteractionOverviewDiagramEditPart.MODEL_ID.equals(type)) {
return Activator.DIAGRAM_PREFERENCES_HINT;
} else if (ModelEditPart.MODEL_ID.equals(type)) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/CreateSnapshotFromContextMenuCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/CreateSnapshotFromContextMenuCommand.java
index b62c6add462..6b4bd140ba0 100755
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/CreateSnapshotFromContextMenuCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/CreateSnapshotFromContextMenuCommand.java
@@ -22,6 +22,7 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.EditPartUtils;
import org.eclipse.papyrus.infra.services.labelprovider.service.LabelProviderService;
import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor;
import org.eclipse.papyrus.infra.widgets.editors.TreeSelectorDialog;
@@ -32,7 +33,6 @@ import org.eclipse.papyrus.uml.diagram.interactionoverview.figures.InteractionWi
import org.eclipse.papyrus.uml.diagram.interactionoverview.part.Messages;
import org.eclipse.papyrus.uml.diagram.interactionoverview.provider.DiagramContentProvider;
import org.eclipse.papyrus.uml.diagram.interactionoverview.utils.CallBehaviorUtil;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PlatformUI;
import org.eclipse.uml2.uml.CallBehaviorAction;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/DropInteractionWithSnapshotCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/DropInteractionWithSnapshotCommand.java
index 3c2040e07c8..61b4c6d1799 100755
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/DropInteractionWithSnapshotCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/DropInteractionWithSnapshotCommand.java
@@ -23,10 +23,10 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
import org.eclipse.gmf.runtime.notation.Node;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.util.ViewUtils;
import org.eclipse.papyrus.uml.diagram.interactionoverview.provider.CustomViewProvider;
import org.eclipse.papyrus.uml.diagram.interactionoverview.utils.CallBehaviorUtil;
import org.eclipse.papyrus.uml.diagram.interactionoverview.utils.CallBehaviorUtil.CallBehaviorActionType;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.ViewUtils;
import org.eclipse.uml2.uml.CallBehaviorAction;
public class DropInteractionWithSnapshotCommand extends
@@ -61,8 +61,6 @@ public class DropInteractionWithSnapshotCommand extends
// select the new callBehaviorAction View
parentEditPart.refresh();
ViewUtils.selectInViewer(callBehaviorActionNode, parentEditPart.getViewer());
- EditPartViewer viewer = parentEditPart.getViewer();
- GraphicalEditPart newEditPart = (GraphicalEditPart) viewer.getEditPartRegistry().get(callBehaviorActionNode);
return CommandResult.newOKCommandResult(callBehaviorActionNode);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/SwitchInteractionFormCommandHandler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/SwitchInteractionFormCommandHandler.java
index 66275abd5d5..d36d08a2fc0 100755
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/SwitchInteractionFormCommandHandler.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/SwitchInteractionFormCommandHandler.java
@@ -21,12 +21,12 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.commands.RefreshCommandForDo;
+import org.eclipse.papyrus.infra.gmfdiag.common.commands.RefreshCommandForUndo;
import org.eclipse.papyrus.uml.diagram.common.handlers.GraphicalCommandHandler;
import org.eclipse.papyrus.uml.diagram.interactionoverview.edit.part.CallBehaviorActionAsInteractionEditPart;
import org.eclipse.papyrus.uml.diagram.interactionoverview.edit.part.CustomInteractionUseEditPartCN;
import org.eclipse.papyrus.uml.diagram.interactionoverview.part.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForDo;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForUndo;
public class SwitchInteractionFormCommandHandler extends GraphicalCommandHandler {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/UpdateDiagramInSnapshotCommandHandler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/UpdateDiagramInSnapshotCommandHandler.java
index 26322a18e84..9f7e7d40324 100755
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/UpdateDiagramInSnapshotCommandHandler.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/commands/UpdateDiagramInSnapshotCommandHandler.java
@@ -16,11 +16,11 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.CompoundCommand;
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.papyrus.infra.gmfdiag.common.commands.RefreshCommandForDo;
+import org.eclipse.papyrus.infra.gmfdiag.common.commands.RefreshCommandForUndo;
import org.eclipse.papyrus.uml.diagram.common.handlers.GraphicalCommandHandler;
import org.eclipse.papyrus.uml.diagram.interactionoverview.edit.part.CallBehaviorActionAsInteractionEditPart;
import org.eclipse.papyrus.uml.diagram.interactionoverview.part.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForDo;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForUndo;
public class UpdateDiagramInSnapshotCommandHandler extends GraphicalCommandHandler {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/part/CallBehaviorActionAsInteractionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/part/CallBehaviorActionAsInteractionEditPart.java
index adee520419c..d1cd6992995 100755
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/part/CallBehaviorActionAsInteractionEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/part/CallBehaviorActionAsInteractionEditPart.java
@@ -25,12 +25,12 @@ import org.eclipse.gef.requests.ChangeBoundsRequest;
import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.emf.gmf.util.GMFUnsafe;
+import org.eclipse.papyrus.infra.gmfdiag.common.commands.RefreshCommandForUndo;
import org.eclipse.papyrus.uml.diagram.activity.edit.parts.CallBehaviorActionEditPart;
import org.eclipse.papyrus.uml.diagram.interactionoverview.Activator;
import org.eclipse.papyrus.uml.diagram.interactionoverview.edit.commands.CreateSnapshotForInteractionFromRefreshCommand;
import org.eclipse.papyrus.uml.diagram.interactionoverview.figures.InteractionWithSnapshotFigure;
import org.eclipse.papyrus.uml.diagram.interactionoverview.utils.CallBehaviorUtil;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForUndo;
import org.eclipse.uml2.uml.Activity;
import org.eclipse.uml2.uml.CallBehaviorAction;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/policies/ActivityContentCompartmentCreationEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/policies/ActivityContentCompartmentCreationEditPolicy.java
index 75b1f1a6763..ff258f85429 100755
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/policies/ActivityContentCompartmentCreationEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/edit/policies/ActivityContentCompartmentCreationEditPolicy.java
@@ -19,12 +19,12 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
+import org.eclipse.papyrus.infra.gmfdiag.common.commands.RefreshCommandForDo;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.PapyrusCreationEditPolicy;
import org.eclipse.papyrus.uml.diagram.interactionoverview.edit.commands.AddHyperlinkDiagram;
import org.eclipse.papyrus.uml.diagram.interactionoverview.edit.commands.CreateSnapshotForInteractionFromViewDescriptorCommand;
import org.eclipse.papyrus.uml.diagram.interactionoverview.edit.part.CallBehaviorActionAsInteractionEditPart;
import org.eclipse.papyrus.uml.diagram.interactionoverview.part.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForDo;
public class ActivityContentCompartmentCreationEditPolicy extends PapyrusCreationEditPolicy {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/provider/DiagramContentProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/provider/DiagramContentProvider.java
index a1c34ace821..93105bbe2d3 100755
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/provider/DiagramContentProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/provider/DiagramContentProvider.java
@@ -25,7 +25,6 @@ import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart;
import org.eclipse.papyrus.uml.diagram.interactionoverview.Activator;
import org.eclipse.papyrus.uml.diagram.interactionoverview.edit.part.InteractionOverviewDiagramEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.SequenceDiagramEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TimingDiagramEditPart;
import org.eclipse.uml2.uml.Activity;
import org.eclipse.uml2.uml.Interaction;
@@ -37,6 +36,10 @@ import org.eclipse.uml2.uml.Interaction;
@Deprecated
public class DiagramContentProvider extends MoDiscoContentProvider implements IHierarchicContentProvider {
+ /**
+ * @since 3.0
+ */
+ protected static final String PAPYRUS_UML_TIMING_DIAGRAM = "PapyrusUMLTimingDiagram";
private final Interaction interaction;
public DiagramContentProvider(final Interaction interation) {
@@ -83,7 +86,7 @@ public class DiagramContentProvider extends MoDiscoContentProvider implements IH
return true;
}
// timing Diagram
- } else if (diagram.getType().equals(TimingDiagramEditPart.MODEL_ID)) {
+ } else if (PAPYRUS_UML_TIMING_DIAGRAM.equals(diagram.getType())) {
return true;
// InteractionOverviewDiagram
} else if (diagram.getType().equals(InteractionOverviewDiagramEditPart.MODEL_ID)) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/utils/CreateDiagramImage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/utils/CreateDiagramImage.java
index 0d7db02b53d..d0e06d7a900 100755
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/utils/CreateDiagramImage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src/org/eclipse/papyrus/uml/diagram/interactionoverview/utils/CreateDiagramImage.java
@@ -189,8 +189,10 @@ public class CreateDiagramImage {
}
private static boolean isValidLifelineEditPart(final GraphicalEditPart graphicalEditPart) {
- if (graphicalEditPart instanceof LifelineEditPart || graphicalEditPart instanceof LifelineEditPartCN || graphicalEditPart instanceof org.eclipse.papyrus.uml.diagram.timing.edit.parts.LifelineEditPart) {
- return true;
+ if(graphicalEditPart instanceof org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart ) {
+ if(((org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart) graphicalEditPart).resolveSemanticElement() instanceof Lifeline){
+ return true;
+ }
}
return false;
}

Back to the top