Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/CreateLollipopPortCommand.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/CustomPortCreateCommand.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/LollipopToRectangleCommand.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/RectangleToLollipopCommand.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/AssociationClassViewCreateCommand.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/BranchDependenctReorientCommand.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/DependencyDiamonViewCreateCommand.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/ElementToStereotypedShape.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/helpers/MultiDependencyHelper.java24
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/policies/CustomDiagramDragDropEditPolicy.java16
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/policies/CustomGraphicalNodeEditPolicy.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/policies/itemsemantic/CustomDependencyBranchSemanticEditPolicy.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/migration/ComponentReconciler.java76
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/migration/ComponentReconcilerForCompartment.java45
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/migration/ComponentReconciler_1_2_0.java286
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/migration/ComponentReconcilier.java75
16 files changed, 417 insertions, 129 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/CreateLollipopPortCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/CreateLollipopPortCommand.java
index b4515e9488c..15a07cddfb4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/CreateLollipopPortCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/CreateLollipopPortCommand.java
@@ -123,7 +123,7 @@ public class CreateLollipopPortCommand extends RecordingCommand {
* kind of the interface REQUIRED or PROVIDED
*/
protected void createEdge(UMLViewProvider umlViewProvider, Node node, String kind) {
- Edge edge = umlViewProvider.createLink_4018(((View) porteditPart.getModel()).getDiagram(), -1, true, porteditPart.getDiagramPreferencesHint());
+ Edge edge = umlViewProvider.createLink_InterfacePortEdge(((View) porteditPart.getModel()).getDiagram(), -1, true, porteditPart.getDiagramPreferencesHint());
IdentityAnchor anchor = NotationFactory.eINSTANCE.createIdentityAnchor();
edge.setSourceAnchor(anchor);
anchor = NotationFactory.eINSTANCE.createIdentityAnchor();
@@ -146,7 +146,7 @@ public class CreateLollipopPortCommand extends RecordingCommand {
* @return the node
*/
protected Node createInterfacenode(UMLViewProvider umlViewProvider, EditPart container, EObject currentInterface) {
- Node node = umlViewProvider.createInterface_2003(currentInterface, (View) container.getModel(), -1, true, porteditPart.getDiagramPreferencesHint());
+ Node node = umlViewProvider.createInterface_Shape(currentInterface, (View) container.getModel(), -1, true, porteditPart.getDiagramPreferencesHint());
((Bounds) node.getLayoutConstraint()).setWidth(20);
((Bounds) node.getLayoutConstraint()).setHeight(20);
return node;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/CustomPortCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/CustomPortCreateCommand.java
index eb8ace1c115..7180fad0e0f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/CustomPortCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/CustomPortCreateCommand.java
@@ -73,7 +73,7 @@ public class CustomPortCreateCommand extends org.eclipse.papyrus.uml.diagram.com
StructuredClassifier owner = (StructuredClassifier) ((Property) getElementToEdit()).getType();
owner.getOwnedAttributes().add(newElement);
- ElementInitializers.getInstance().init_Port_3069(newElement);
+ ElementInitializers.getInstance().init_Port_Shape(newElement);
doConfigure(newElement, monitor, info);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/LollipopToRectangleCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/LollipopToRectangleCommand.java
index 6b493c30bc9..6767c709cc4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/LollipopToRectangleCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/LollipopToRectangleCommand.java
@@ -87,7 +87,7 @@ public class LollipopToRectangleCommand extends AbstractTransactionalCommand {
// creation of the node
UMLViewProvider umlViewProvider = new UMLViewProvider();
View container = (View) elementEditPart.getNotationView().eContainer();
- Node interfaceView = umlViewProvider.createInterface_3205(elementEditPart.resolveSemanticElement(), container, -1, true, elementEditPart.getDiagramPreferencesHint());
+ Node interfaceView = umlViewProvider.createInterface_ClassifierShape(elementEditPart.resolveSemanticElement(), container, -1, true, elementEditPart.getDiagramPreferencesHint());
interfaceView.setLayoutConstraint(((Node) elementEditPart.getNotationView()).getLayoutConstraint());
if (interfaceView.getLayoutConstraint() instanceof Bounds) {
((Bounds) interfaceView.getLayoutConstraint()).setWidth(200);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/RectangleToLollipopCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/RectangleToLollipopCommand.java
index 694a016afad..7490618030c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/RectangleToLollipopCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/RectangleToLollipopCommand.java
@@ -86,7 +86,7 @@ public class RectangleToLollipopCommand extends AbstractTransactionalCommand {
// creation of the node
UMLViewProvider umlViewProvider = new UMLViewProvider();
View container = (View) elementEditPart.getNotationView().eContainer();
- Node interfaceView = umlViewProvider.createInterface_2003(elementEditPart.resolveSemanticElement(), container, -1, true, elementEditPart.getDiagramPreferencesHint());
+ Node interfaceView = umlViewProvider.createInterface_Shape(elementEditPart.resolveSemanticElement(), container, -1, true, elementEditPart.getDiagramPreferencesHint());
interfaceView.setLayoutConstraint(((Node) elementEditPart.getNotationView()).getLayoutConstraint());
if (interfaceView.getLayoutConstraint() instanceof Bounds) {
((Bounds) interfaceView.getLayoutConstraint()).setWidth(20);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/AssociationClassViewCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/AssociationClassViewCreateCommand.java
index b6096538ce5..7f74a7a0bd4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/AssociationClassViewCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/AssociationClassViewCreateCommand.java
@@ -96,7 +96,7 @@ public class AssociationClassViewCreateCommand extends AbstractTransactionalComm
CreateElementRequestAdapter requestAdapter = createConnectionViewAndElementRequest.getConnectionViewAndElementDescriptor().getCreateElementRequestAdapter();
CreateRelationshipRequest createElementRequest = (CreateRelationshipRequest) requestAdapter.getAdapter(CreateRelationshipRequest.class);
UMLViewProvider viewProvider = new UMLViewProvider();
- node = viewProvider.createDependency_3203(createElementRequest.getNewElement(), this.containerView, -1, true, preferenceHint);
+ node = viewProvider.createDependency_Shape(createElementRequest.getNewElement(), this.containerView, -1, true, preferenceHint);
// this.node = factory.createView(new
// SemanticAdapter(createElementRequest.getNewElement()),
// this.containerView, ((IHintedType)
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/BranchDependenctReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/BranchDependenctReorientCommand.java
index a0d8708f458..9f546ae6ffa 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/BranchDependenctReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/BranchDependenctReorientCommand.java
@@ -51,7 +51,7 @@ public class BranchDependenctReorientCommand extends DependencyBranchReorientCom
return false;
}
Package container = (Package) getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistDependency_4017(container, getLink(), getNewSource(), target);
+ return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistDependency_BranchEdge(container, getLink(), getNewSource(), target);
}
@@ -69,7 +69,7 @@ public class BranchDependenctReorientCommand extends DependencyBranchReorientCom
return false;
}
Package container = (Package) getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistDependency_4017(container, getLink(), source, getNewTarget());
+ return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistDependency_BranchEdge(container, getLink(), source, getNewTarget());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/DependencyDiamonViewCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/DependencyDiamonViewCreateCommand.java
index dbf2b36b759..c4ef7b7672a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/DependencyDiamonViewCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/DependencyDiamonViewCreateCommand.java
@@ -90,7 +90,7 @@ public class DependencyDiamonViewCreateCommand extends AbstractTransactionalComm
// ((IHintedType) UMLElementTypes.Dependency_2014)
// .getSemanticHint(), -1, true, preferenceHint);
UMLViewProvider viewProvider = new UMLViewProvider();
- node = viewProvider.createDependency_3203(((EObject) semanticApdater.getAdapter(EObject.class)), this.containerView, -1, true, preferenceHint);
+ node = viewProvider.createDependency_Shape(((EObject) semanticApdater.getAdapter(EObject.class)), this.containerView, -1, true, preferenceHint);
// put to the good position
Location notationLocation = NotationFactory.eINSTANCE.createLocation();
notationLocation.setX(location.x);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/ElementToStereotypedShape.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/ElementToStereotypedShape.java
index 9491df00b21..c443a234d30 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/ElementToStereotypedShape.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/ElementToStereotypedShape.java
@@ -51,7 +51,7 @@ public class ElementToStereotypedShape extends RecordingCommand {
// creation of the node
UMLViewProvider umlViewProvider = new UMLViewProvider();
- Node packageview = umlViewProvider.createNamedElement_3204(elementEditPart.resolveSemanticElement(), (View) elementEditPart.getNotationView().eContainer(), -1, true, elementEditPart.getDiagramPreferencesHint());
+ Node packageview = umlViewProvider.createNamedElement_DefaultShape(elementEditPart.resolveSemanticElement(), (View) elementEditPart.getNotationView().eContainer(), -1, true, elementEditPart.getDiagramPreferencesHint());
packageview.setLayoutConstraint(((Node) elementEditPart.getNotationView()).getLayoutConstraint());
// copy of all eannotations
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/helpers/MultiDependencyHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/helpers/MultiDependencyHelper.java
index 328d271ce46..b65b21e247c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/helpers/MultiDependencyHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/helpers/MultiDependencyHelper.java
@@ -106,15 +106,15 @@ public class MultiDependencyHelper extends ElementHelper {
}
}
// descriptor for the branch
- ConnectionViewDescriptor viewBranchDescriptor = new ConnectionViewDescriptor(UMLElementTypes.Dependency_4017, ((IHintedType) UMLElementTypes.Dependency_4017).getSemanticHint(), diagramPreferencesHint);
+ ConnectionViewDescriptor viewBranchDescriptor = new ConnectionViewDescriptor(UMLElementTypes.Dependency_BranchEdge, ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), diagramPreferencesHint);
// the editpart exist -> only creation of the branch
if (sourceEditPart != null) {
CustomDeferredCreateConnectionViewCommand aBranchCommand = null;
if (constructSource) {
- aBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_4017).getSemanticHint(), new SemanticAdapter(null, sourceEditPart.getModel()), (IAdaptable) nodeCreation
+ aBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), new SemanticAdapter(null, sourceEditPart.getModel()), (IAdaptable) nodeCreation
.getCommandResult().getReturnValue(), sourceEditPart.getViewer(), ((IGraphicalEditPart) sourceEditPart).getDiagramPreferencesHint(), viewBranchDescriptor, null);
} else {
- aBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_4017).getSemanticHint(), (IAdaptable) nodeCreation.getCommandResult().getReturnValue(), new SemanticAdapter(null,
+ aBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), (IAdaptable) nodeCreation.getCommandResult().getReturnValue(), new SemanticAdapter(null,
sourceEditPart.getModel()), sourceEditPart.getViewer(), ((IGraphicalEditPart) sourceEditPart).getDiagramPreferencesHint(), viewBranchDescriptor, null);
}
aBranchCommand.setElement(dependency);
@@ -131,10 +131,10 @@ public class MultiDependencyHelper extends ElementHelper {
// Creation of the branch
CustomDeferredCreateConnectionViewCommand aBranchCommand = null;
if (constructSource) {
- aBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_4017).getSemanticHint(), (IAdaptable) nodeCreationCommand.getCommandResult().getReturnValue(),
+ aBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), (IAdaptable) nodeCreationCommand.getCommandResult().getReturnValue(),
(IAdaptable) nodeCreation.getCommandResult().getReturnValue(), viewer, diagramPreferencesHint, viewBranchDescriptor, null);
} else {
- aBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_4017).getSemanticHint(), (IAdaptable) nodeCreation.getCommandResult().getReturnValue(),
+ aBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), (IAdaptable) nodeCreation.getCommandResult().getReturnValue(),
(IAdaptable) nodeCreationCommand.getCommandResult().getReturnValue(), viewer, diagramPreferencesHint, viewBranchDescriptor, null);
}
aBranchCommand.setElement(dependency);
@@ -187,8 +187,8 @@ public class MultiDependencyHelper extends ElementHelper {
feature = UMLPackage.eINSTANCE.getDependency_Client();
}
// 0. add the branch graphically
- ConnectionViewDescriptor viewDescriptor = new ConnectionViewDescriptor(UMLElementTypes.Dependency_4017, ((IHintedType) UMLElementTypes.Dependency_4017).getSemanticHint(), ((IGraphicalEditPart) sourceEditPart).getDiagramPreferencesHint());
- CustomDeferredCreateConnectionViewCommand aBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_4017).getSemanticHint(), new SemanticAdapter(null, sourceEditPart.getModel()),
+ ConnectionViewDescriptor viewDescriptor = new ConnectionViewDescriptor(UMLElementTypes.Dependency_BranchEdge, ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), ((IGraphicalEditPart) sourceEditPart).getDiagramPreferencesHint());
+ CustomDeferredCreateConnectionViewCommand aBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), new SemanticAdapter(null, sourceEditPart.getModel()),
new SemanticAdapter(null, targetEditPart.getModel()), sourceEditPart.getViewer(), ((IGraphicalEditPart) sourceEditPart).getDiagramPreferencesHint(), viewDescriptor, null);
aBranchCommand.setElement(dependency);
command = new CompoundCommand();
@@ -338,14 +338,14 @@ public class MultiDependencyHelper extends ElementHelper {
// ---------------------------------------------------------
// 4. reconstruction of the old link by taking in account the old
// connection
- ConnectionViewDescriptor viewDescriptor = new ConnectionViewDescriptor(UMLElementTypes.Dependency_4017, ((IHintedType) UMLElementTypes.Dependency_4017).getSemanticHint(), ((IGraphicalEditPart) sourceEditPart).getDiagramPreferencesHint());
+ ConnectionViewDescriptor viewDescriptor = new ConnectionViewDescriptor(UMLElementTypes.Dependency_BranchEdge, ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), ((IGraphicalEditPart) sourceEditPart).getDiagramPreferencesHint());
// 5. reconstruction of the first branch between old source to node
- ICommand firstBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_4017).getSemanticHint(), new SemanticAdapter(null, dependencyViewSource), (IAdaptable) nodeCreation
+ ICommand firstBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), new SemanticAdapter(null, dependencyViewSource), (IAdaptable) nodeCreation
.getCommandResult().getReturnValue(), sourceEditPart.getViewer(), ((IGraphicalEditPart) sourceEditPart).getDiagramPreferencesHint(), viewDescriptor, null);
((CustomDeferredCreateConnectionViewCommand) firstBranchCommand).setElement(dependency);
((CompoundCommand) command).add(new ICommandProxy(firstBranchCommand));
// 6. reconstruction of the second branch between node to old target
- ICommand secondBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_4017).getSemanticHint(), (IAdaptable) nodeCreation.getCommandResult().getReturnValue(), new SemanticAdapter(
+ ICommand secondBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), (IAdaptable) nodeCreation.getCommandResult().getReturnValue(), new SemanticAdapter(
null, dependencyViewTarget), sourceEditPart.getViewer(), ((IGraphicalEditPart) sourceEditPart).getDiagramPreferencesHint(), viewDescriptor, null);
((CustomDeferredCreateConnectionViewCommand) secondBranchCommand).setElement(dependency);
((CompoundCommand) command).add(new ICommandProxy(secondBranchCommand));
@@ -353,11 +353,11 @@ public class MultiDependencyHelper extends ElementHelper {
ICommand thirdBranchCommand = null;
if (dependencyView.equals((sourceEditPart.getModel()))) {
// third branch node and target
- thirdBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_4017).getSemanticHint(), (IAdaptable) nodeCreation.getCommandResult().getReturnValue(), new SemanticAdapter(null,
+ thirdBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), (IAdaptable) nodeCreation.getCommandResult().getReturnValue(), new SemanticAdapter(null,
targetEditPart.getModel()), sourceEditPart.getViewer(), ((IGraphicalEditPart) sourceEditPart).getDiagramPreferencesHint(), viewDescriptor, null);
} else {
// // third branch source and node
- thirdBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_4017).getSemanticHint(), new SemanticAdapter(null, sourceEditPart.getModel()), (IAdaptable) nodeCreation
+ thirdBranchCommand = new CustomDeferredCreateConnectionViewCommand(getEditingDomain(), ((IHintedType) UMLElementTypes.Dependency_BranchEdge).getSemanticHint(), new SemanticAdapter(null, sourceEditPart.getModel()), (IAdaptable) nodeCreation
.getCommandResult().getReturnValue(), sourceEditPart.getViewer(), ((IGraphicalEditPart) sourceEditPart).getDiagramPreferencesHint(), viewDescriptor, null);
}
((CustomDeferredCreateConnectionViewCommand) thirdBranchCommand).setElement(dependency);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/policies/CustomDiagramDragDropEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/policies/CustomDiagramDragDropEditPolicy.java
index 07603977f04..8df653af0f7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/policies/CustomDiagramDragDropEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/policies/CustomDiagramDragDropEditPolicy.java
@@ -335,11 +335,11 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
// return UnexecutableCommand.INSTANCE;
// }
if (CommentEditPart.VISUAL_ID.equals(nodeVISUALID)) {
- return getDropCommentCommand((Comment) semanticLink, getViewer(), getDiagramPreferencesHint(), dropRequest.getLocation(), ((GraphicalEditPart) getHost()).getNotationView(), (IHintedType) UMLElementTypes.Comment_3201,
- (IHintedType) UMLElementTypes.CommentAnnotatedElement_4015);
+ return getDropCommentCommand((Comment) semanticLink, getViewer(), getDiagramPreferencesHint(), dropRequest.getLocation(), ((GraphicalEditPart) getHost()).getNotationView(), (IHintedType) UMLElementTypes.Comment_Shape,
+ (IHintedType) UMLElementTypes.Comment_AnnotatedElementEdge);
} else if (CommentEditPartPCN.VISUAL_ID.equals(nodeVISUALID)) {
- return getDropCommentCommand((Comment) semanticLink, getViewer(), getDiagramPreferencesHint(), dropRequest.getLocation(), ((GraphicalEditPart) getHost()).getNotationView(), (IHintedType) UMLElementTypes.Comment_3074,
- (IHintedType) UMLElementTypes.CommentAnnotatedElement_4015);
+ return getDropCommentCommand((Comment) semanticLink, getViewer(), getDiagramPreferencesHint(), dropRequest.getLocation(), ((GraphicalEditPart) getHost()).getNotationView(), (IHintedType) UMLElementTypes.Comment_Shape_CN,
+ (IHintedType) UMLElementTypes.Comment_AnnotatedElementEdge);
}
return UnexecutableCommand.INSTANCE;
}
@@ -363,11 +363,11 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
// return UnexecutableCommand.INSTANCE;
// }
if (ConstraintEditPart.VISUAL_ID.equals(nodeVISUALID)) {
- return getDropConstraintCommand((Constraint) semanticLink, getViewer(), getDiagramPreferencesHint(), dropRequest.getLocation(), ((GraphicalEditPart) getHost()).getNotationView(), (IHintedType) UMLElementTypes.Constraint_3199,
- (IHintedType) UMLElementTypes.ConstraintConstrainedElement_4009);
+ return getDropConstraintCommand((Constraint) semanticLink, getViewer(), getDiagramPreferencesHint(), dropRequest.getLocation(), ((GraphicalEditPart) getHost()).getNotationView(), (IHintedType) UMLElementTypes.Constraint_Shape,
+ (IHintedType) UMLElementTypes.Constraint_ConstrainedElementEdge);
} else if (ConstraintEditPartPCN.VISUAL_ID.equals(nodeVISUALID)) {
- return getDropConstraintCommand((Constraint) semanticLink, getViewer(), getDiagramPreferencesHint(), dropRequest.getLocation(), ((GraphicalEditPart) getHost()).getNotationView(), (IHintedType) UMLElementTypes.Constraint_3075,
- (IHintedType) UMLElementTypes.ConstraintConstrainedElement_4009);
+ return getDropConstraintCommand((Constraint) semanticLink, getViewer(), getDiagramPreferencesHint(), dropRequest.getLocation(), ((GraphicalEditPart) getHost()).getNotationView(), (IHintedType) UMLElementTypes.Constraint_Shape_CN,
+ (IHintedType) UMLElementTypes.Constraint_ConstrainedElementEdge);
}
return UnexecutableCommand.INSTANCE;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/policies/CustomGraphicalNodeEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/policies/CustomGraphicalNodeEditPolicy.java
index 75c89cc896a..6df46f63475 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/policies/CustomGraphicalNodeEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/policies/CustomGraphicalNodeEditPolicy.java
@@ -151,7 +151,7 @@ public class CustomGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
// case of associationClass
CreateElementRequestAdapter requestAdapter = ((CreateConnectionViewAndElementRequest) request).getConnectionViewAndElementDescriptor().getCreateElementRequestAdapter();
CreateRelationshipRequest createElementRequest = (CreateRelationshipRequest) requestAdapter.getAdapter(CreateRelationshipRequest.class);
- if (UMLElementTypes.Dependency_4017.equals(createElementRequest.getElementType())) {
+ if (UMLElementTypes.Dependency_BranchEdge.equals(createElementRequest.getElementType())) {
MultiDependencyHelper multiDependencyHelper = new MultiDependencyHelper(getEditingDomain());
return multiDependencyHelper.getCommand(((CreateConnectionViewAndElementRequest) request), c);
} else {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/policies/itemsemantic/CustomDependencyBranchSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/policies/itemsemantic/CustomDependencyBranchSemanticEditPolicy.java
index 74d6ab4cfc2..fd4dfacd2f4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/policies/itemsemantic/CustomDependencyBranchSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/policies/itemsemantic/CustomDependencyBranchSemanticEditPolicy.java
@@ -27,7 +27,7 @@ public class CustomDependencyBranchSemanticEditPolicy extends DependencyBranchIt
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Dependency_4017 == req.getElementType()) {
+ if (UMLElementTypes.Dependency_BranchEdge == req.getElementType()) {
return UnexecutableCommand.INSTANCE;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/migration/ComponentReconciler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/migration/ComponentReconciler.java
new file mode 100644
index 00000000000..1c315529b66
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/migration/ComponentReconciler.java
@@ -0,0 +1,76 @@
+/*****************************************************************************
+ * Copyright (c) 2010, 2015 CEA LIST and others.
+ *
+ * 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:
+ * Mickael ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and Implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.component.custom.migration;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.infra.gmfdiag.common.commands.InsertFloatingLabelFromMapCommand;
+import org.eclipse.papyrus.infra.gmfdiag.common.reconciler.DiagramReconciler;
+
+/**
+ * Component Diagram Reconciler from 1.0.0 to 1.1.0
+ */
+public class ComponentReconciler extends DiagramReconciler {
+
+ private final static String ComponentEditPart_VISUAL_ID = "2002";
+ private final static String ComponentFloatingLabelEditPart_VISUAL_ID = "6030";
+ private final static String ComponentEditPartCN_VISUAL_ID = "3070";
+ private final static String ComponentFloatingLabelEditPartCN_VISUAL_ID = "6026";
+ private final static String ComponentEditPartPCN_VISUAL_ID = "3071";
+ private final static String ComponentFloatingLabelEditPartPCN_VISUAL_ID = "6027";
+ private final static String DependencyNodeEditPart_VISUAL_ID = "3203";
+ private final static String DependencyNodeFloatingLabelEditPart_VISUAL_ID = "6029";
+ private final static String InterfaceEditPart_VISUAL_ID = "2003";
+ private final static String InterfaceFloatingLabelEditPart_VISUAL_ID = "6032";
+ private final static String InterfaceEditPartPCN_VISUAL_ID = "3072";
+ private final static String InterfaceFloatingLabelEditPartPCN_VISUAL_ID = "6028";
+ private final static String RectangleInterfaceEditPart_VISUAL_ID = "3205";
+ private final static String RectangleInterfaceFloatingLabelEditPart_VISUAL_ID = "6031";
+ private final static String RectangleInterfaceEditPartCN_VISUAL_ID = "3078";
+ private final static String RectangleInterfaceFloatingLabelEditPartCN_VISUAL_ID = "6033";
+
+ /**
+ * Gets the reconcile command.
+ *
+ * @param diagram
+ * the diagram
+ * @return the reconcile command
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.reconciler.DiagramReconciler#getReconcileCommand(org.eclipse.gmf.runtime.notation.Diagram)
+ */
+ @Override
+ public ICommand getReconcileCommand(Diagram diagram) {
+ return new InsertFloatingLabelFromMapCommand(diagram, getFloatingLabelMap());
+ }
+
+ /**
+ * Gets the floating label map to add.
+ *
+ * @return the floating label map
+ */
+ private Map<String, String> getFloatingLabelMap() {
+ Map<String, String> map = new HashMap<String, String>();
+ map.put(ComponentEditPart_VISUAL_ID, ComponentFloatingLabelEditPart_VISUAL_ID);
+ map.put(ComponentEditPartCN_VISUAL_ID, ComponentFloatingLabelEditPartCN_VISUAL_ID);
+ map.put(ComponentEditPartPCN_VISUAL_ID, ComponentFloatingLabelEditPartPCN_VISUAL_ID);
+ map.put(DependencyNodeEditPart_VISUAL_ID, DependencyNodeFloatingLabelEditPart_VISUAL_ID);
+ map.put(InterfaceEditPart_VISUAL_ID, InterfaceFloatingLabelEditPart_VISUAL_ID);
+ map.put(InterfaceEditPartPCN_VISUAL_ID, InterfaceFloatingLabelEditPartPCN_VISUAL_ID);
+ map.put(RectangleInterfaceEditPart_VISUAL_ID, RectangleInterfaceFloatingLabelEditPart_VISUAL_ID);
+ map.put(RectangleInterfaceEditPartCN_VISUAL_ID, RectangleInterfaceFloatingLabelEditPartCN_VISUAL_ID);
+
+ return map;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/migration/ComponentReconcilerForCompartment.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/migration/ComponentReconcilerForCompartment.java
index ac96a238078..2310e174385 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/migration/ComponentReconcilerForCompartment.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/migration/ComponentReconcilerForCompartment.java
@@ -17,36 +17,37 @@ import java.util.Arrays;
import java.util.List;
import org.eclipse.papyrus.infra.gmfdiag.common.reconciler.ReconcilerForCompartment;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.ComponentCompositeCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.ComponentCompositeCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.ComponentCompositeCompartmentEditPartPCN;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.InterfaceAttributeCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.InterfaceAttributeCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.InterfaceOperationCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.InterfaceOperationCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.ModelPackageableElementCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.ModelPackageableElementCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.PackagePackageableElementCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.PackagePackageableElementCompartmentEditPartCN;
/**
* Diagram Reconciler for compartment from 1.1.0 to 1.2.0
*/
public class ComponentReconcilerForCompartment extends ReconcilerForCompartment {
+ private static final String ComponentCompositeCompartmentEditPart_VISUAL_ID = "7001";
+ private static final String ModelPackageableElementCompartmentEditPart_VISUAL_ID = "7006";
+ private static final String PackagePackageableElementCompartmentEditPart_VISUAL_ID = "7002";
+ private static final String ModelPackageableElementCompartmentEditPartCN_VISUAL_ID = "7007";
+ private static final String PackagePackageableElementCompartmentEditPartCN_VISUAL_ID = "7005";
+ private static final String ComponentCompositeCompartmentEditPartCN_VISUAL_ID = "7003";
+ private static final String ComponentCompositeCompartmentEditPartPCN_VISUAL_ID = "7004";
+ private static final String InterfaceAttributeCompartmentEditPart_VISUAL_ID = "7008";
+ private static final String InterfaceOperationCompartmentEditPart_VISUAL_ID = "7009";
+ private static final String InterfaceAttributeCompartmentEditPartCN_VISUAL_ID = "7010";
+ private static final String InterfaceOperationCompartmentEditPartCN_VISUAL_ID = "7011";
+
/** The compartments visual id. */
private List<String> compartmentsVisualID = Arrays.asList(
- ComponentCompositeCompartmentEditPart.VISUAL_ID,
- ModelPackageableElementCompartmentEditPart.VISUAL_ID,
- PackagePackageableElementCompartmentEditPart.VISUAL_ID,
- ModelPackageableElementCompartmentEditPartCN.VISUAL_ID,
- PackagePackageableElementCompartmentEditPartCN.VISUAL_ID,
- ComponentCompositeCompartmentEditPartCN.VISUAL_ID,
- ComponentCompositeCompartmentEditPartPCN.VISUAL_ID,
- InterfaceAttributeCompartmentEditPart.VISUAL_ID,
- InterfaceOperationCompartmentEditPart.VISUAL_ID,
- InterfaceAttributeCompartmentEditPartCN.VISUAL_ID,
- InterfaceOperationCompartmentEditPartCN.VISUAL_ID);
+ ComponentCompositeCompartmentEditPart_VISUAL_ID,
+ ModelPackageableElementCompartmentEditPart_VISUAL_ID,
+ PackagePackageableElementCompartmentEditPart_VISUAL_ID,
+ ModelPackageableElementCompartmentEditPartCN_VISUAL_ID,
+ PackagePackageableElementCompartmentEditPartCN_VISUAL_ID,
+ ComponentCompositeCompartmentEditPartCN_VISUAL_ID,
+ ComponentCompositeCompartmentEditPartPCN_VISUAL_ID,
+ InterfaceAttributeCompartmentEditPart_VISUAL_ID,
+ InterfaceOperationCompartmentEditPart_VISUAL_ID,
+ InterfaceAttributeCompartmentEditPartCN_VISUAL_ID,
+ InterfaceOperationCompartmentEditPartCN_VISUAL_ID);
/**
* Gets the compartments visual id.
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/migration/ComponentReconciler_1_2_0.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/migration/ComponentReconciler_1_2_0.java
new file mode 100644
index 00000000000..3502d2b2411
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/migration/ComponentReconciler_1_2_0.java
@@ -0,0 +1,286 @@
+/*****************************************************************************
+ * Copyright (c) 2010, 2015 CEA LIST and others.
+ *
+ * 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:
+ * Florian Noyrit (CEA) florian.noyrit@cea.fr - Initial API and Implementation
+ * Mickael ADAM (ALL4TEC) mickael.adam@all4tec.net - reconciler to add floating label
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.component.custom.migration;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.AbstractCommand;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.reconciler.DiagramReconciler;
+
+/**
+ * Component Diagram Reconciler from 1.1.0 to 1.2.0
+ */
+public class ComponentReconciler_1_2_0 extends DiagramReconciler {
+
+ @Override
+ public ICommand getReconcileCommand(Diagram diagram) {
+ CompositeCommand cc = new CompositeCommand("Migrate diagram from 1.1.0 to 1.2.0");
+ cc.add(new ChangeVisualIDsCommand(diagram));
+ return cc;
+ }
+
+ protected class ChangeVisualIDsCommand extends AbstractCommand {
+
+ protected final Diagram diagram;
+
+ public ChangeVisualIDsCommand(Diagram diagram) {
+ super("Change the diagram's visual ids from 1.1.0 to 1.2.0");
+ this.diagram = diagram;
+ }
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ TreeIterator<EObject> allContentIterator = diagram.eAllContents();
+
+ while (allContentIterator.hasNext()) {
+ EObject eObject = allContentIterator.next();
+ if (eObject instanceof View) {
+ View view = (View) eObject;
+ view.setType(getNewVisualID(view.getType()));
+ }
+ }
+
+ return CommandResult.newOKCommandResult();
+ }
+
+ @Override
+ public boolean canUndo() {
+ return false;
+ }
+
+ @Override
+ public boolean canRedo() {
+ return false;
+ }
+
+ @Override
+ protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ throw new ExecutionException("Should not be called, canRedo false");
+ }
+
+ @Override
+ protected CommandResult doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ throw new ExecutionException("Should not be called, canUndo false");
+ }
+ }
+
+ public static String getNewVisualID(String oldVisualID) {
+ switch (oldVisualID) {
+ case "1000":
+ return "Package_ComponentDiagram";
+ case "3069":
+ return "Port_Shape";
+ case "5006":
+ return "Port_NameLabel";
+ case "5007":
+ return "Port_StereotypeLabel";
+ case "3077":
+ return "Model_Shape_CN";
+ case "5264":
+ return "Model_NameLabel_CN";
+ case "3076":
+ return "Package_Shape_CN";
+ case "5261":
+ return "Package_NameLabel_CN";
+ case "3078":
+ return "Interface_ClassifierShape_CN";
+ case "5267":
+ return "Interface_ClassifierNameLabel_CN";
+ case "6033":
+ return "Interface_ClassifierFloatingNameLabel_CN";
+ case "3070":
+ return "Component_PackagedElementShape_CCN";
+ case "5256":
+ return "Component_NameLabel_CCN";
+ case "6026":
+ return "Component_FloatingNameLabel_CCN";
+ case "3071":
+ return "Component_PackagedElementShape_CN";
+ case "5257":
+ return "Component_NameLabel_CN";
+ case "6027":
+ return "Component_FloatingNameLabel_CN";
+ case "3074":
+ return "Comment_Shape_CN";
+ case "5258":
+ return "Comment_BodyLabel_CN";
+ case "3075":
+ return "Constraint_Shape_CN";
+ case "5259":
+ return "Constraint_NameLabel_CN";
+ case "5260":
+ return "Constraint_BodyLabel_CN";
+ case "1":
+ return "Property_InterfaceAttributeLabel";
+ case "5":
+ return "Operation_InterfaceOperationLabel";
+ case "6":
+ return "Reception_InterfaceReceptionLabel";
+ case "3072":
+ return "Interface_Shape_CN";
+ case "0":
+ return "Interface_NameLabel_CN";
+ case "6028":
+ return "Interface_FloatingNameLabel_CN";
+ case "3079":
+ return "Property_Shape";
+ case "5268":
+ return "Property_NameLabel";
+ case "3203":
+ return "Dependency_Shape";
+ case "5008":
+ return "Dependency_MultiNameLabel";
+ case "6029":
+ return "Dependency_FloatingNameLabel";
+ case "2002":
+ return "Component_PackagedElementShape";
+ case "5004":
+ return "Component_NameLabel";
+ case "6030":
+ return "Component_FloatingNameLabel";
+ case "3202":
+ return "Model_Shape";
+ case "5262":
+ return "Model_NameLabel";
+ case "3200":
+ return "Package_Shape";
+ case "5254":
+ return "Package_NameLabel";
+ case "3205":
+ return "Interface_ClassifierShape";
+ case "5266":
+ return "Interface_ClassifierNameLabel";
+ case "6031":
+ return "Interface_ClassifierFloatingNameLabel";
+ case "3201":
+ return "Comment_Shape";
+ case "5255":
+ return "Comment_BodyLabel";
+ case "3199":
+ return "Constraint_Shape";
+ case "5252":
+ return "Constraint_NameLabel";
+ case "5253":
+ return "Constraint_BodyLabel";
+ case "3204":
+ return "NamedElement_DefaultShape";
+ case "5265":
+ return "NamedElement_NameLabel";
+ case "2003":
+ return "Interface_Shape";
+ case "5005":
+ return "Interface_NameLabel";
+ case "6032":
+ return "Interface_FloatingNameLabel";
+ case "4001":
+ return "Usage_Edge";
+ case "6016":
+ return "Usage_NameLabel";
+ case "6017":
+ return "Usage_StereotypeLabel";
+ case "4006":
+ return "InterfaceRealization_Edge";
+ case "6010":
+ return "InterfaceRealization_NameLabel";
+ case "6011":
+ return "InterfaceRealization_StereotypeLabel";
+ case "4003":
+ return "Generalization_Edge";
+ case "2":
+ return "Generalization_StereotypeLabel";
+ case "4012":
+ return "Substitution_Edge";
+ case "6006":
+ return "Substitution_NameLabel";
+ case "6020":
+ return "Substitution_StereotypeLabel";
+ case "4014":
+ return "Manifestation_Edge";
+ case "6008":
+ return "Manifestation_NameLabel";
+ case "6022":
+ return "Manifestation_StereotypeLabel";
+ case "4007":
+ return "ComponentRealization_Edge";
+ case "3":
+ return "ComponentRealization_NameLabel";
+ case "4":
+ return "ComponentRealization_StereotypeLabel";
+ case "4013":
+ return "Abstraction_Edge";
+ case "6007":
+ return "Abstraction_NameLabel";
+ case "6021":
+ return "Abstraction_StereotypeLabel";
+ case "4016":
+ return "Link_DescriptorEdge";
+ case "4015":
+ return "Comment_AnnotatedElementEdge";
+ case "4009":
+ return "Constraint_ConstrainedElementEdge";
+ case "4010":
+ return "Dependency_Edge";
+ case "6009":
+ return "Dependency_NameLabel";
+ case "6023":
+ return "Dependency_StereotypeLabel";
+ case "4017":
+ return "Dependency_BranchEdge";
+ case "4018":
+ return "Link_InterfacePortEdge";
+ case "4019":
+ return "Connector_Edge";
+ case "6024":
+ return "Connector_StereotypeLabel";
+ case "6025":
+ return "Connector_NameLabel";
+ case "7001":
+ return "Component_StructureCompartment";
+ case "7006":
+ return "Model_PackagedElementCompartment";
+ case "7002":
+ return "Package_PackagedElementCompartment";
+ case "7007":
+ return "Model_PackagedElementCompartment_CN";
+ case "7005":
+ return "Package_PackagedElementCompartment_CN";
+ case "7003":
+ return "Component_StructureCompartment_CCN";
+ case "7004":
+ return "Component_StructureCompartment_CN";
+ case "7008":
+ return "Interface_AttributeCompartment";
+ case "7009":
+ return "Interface_OperationCompartment";
+ case "7010":
+ return "Interface_AttributeCompartment_CN";
+ case "7011":
+ return "Interface_OperationCompartment_CN";
+ default:
+ return defaultGetNewVisualID(oldVisualID);
+ }
+ }
+
+ private static String defaultGetNewVisualID(String oldVisualID) {
+ return oldVisualID;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/migration/ComponentReconcilier.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/migration/ComponentReconcilier.java
deleted file mode 100644
index 34b5cef6a56..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/migration/ComponentReconcilier.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2015 CEA LIST and others.
- *
- * 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:
- * Mickael ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and Implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.component.custom.migration;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.papyrus.infra.gmfdiag.common.commands.InsertFloatingLabelFromMapCommand;
-import org.eclipse.papyrus.infra.gmfdiag.common.reconciler.DiagramReconciler;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.ComponentEditPart;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.ComponentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.ComponentEditPartPCN;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.ComponentFloatingLabelEditPart;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.ComponentFloatingLabelEditPartCN;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.ComponentFloatingLabelEditPartPCN;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.DependencyNodeEditPart;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.DependencyNodeFloatingLabelEditPart;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.InterfaceEditPart;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.InterfaceEditPartPCN;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.InterfaceFloatingLabelEditPart;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.InterfaceFloatingLabelEditPartPCN;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.RectangleInterfaceEditPart;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.RectangleInterfaceEditPartCN;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.RectangleInterfaceFloatingLabelEditPart;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.RectangleInterfaceFloatingLabelEditPartCN;
-
-/**
- * Component Diagram Reconciler from 1.0.0 to 1.1.0
- */
-public class ComponentReconcilier extends DiagramReconciler {
-
- /**
- * Gets the reconcile command.
- *
- * @param diagram
- * the diagram
- * @return the reconcile command
- * @see org.eclipse.papyrus.infra.gmfdiag.common.reconciler.DiagramReconciler#getReconcileCommand(org.eclipse.gmf.runtime.notation.Diagram)
- */
- @Override
- public ICommand getReconcileCommand(Diagram diagram) {
- return new InsertFloatingLabelFromMapCommand(diagram, getFloatingLabelMap());
- }
-
- /**
- * Gets the floating label map to add.
- *
- * @return the floating label map
- */
- private Map<String, String> getFloatingLabelMap() {
- Map<String, String> map = new HashMap<String, String>();
- map.put(String.valueOf(ComponentEditPart.VISUAL_ID), String.valueOf(ComponentFloatingLabelEditPart.VISUAL_ID));
- map.put(String.valueOf(ComponentEditPartCN.VISUAL_ID), String.valueOf(ComponentFloatingLabelEditPartCN.VISUAL_ID));
- map.put(String.valueOf(ComponentEditPartPCN.VISUAL_ID), String.valueOf(ComponentFloatingLabelEditPartPCN.VISUAL_ID));
- map.put(String.valueOf(DependencyNodeEditPart.VISUAL_ID), String.valueOf(DependencyNodeFloatingLabelEditPart.VISUAL_ID));
- map.put(String.valueOf(InterfaceEditPart.VISUAL_ID), String.valueOf(InterfaceFloatingLabelEditPart.VISUAL_ID));
- map.put(String.valueOf(InterfaceEditPartPCN.VISUAL_ID), String.valueOf(InterfaceFloatingLabelEditPartPCN.VISUAL_ID));
- map.put(String.valueOf(RectangleInterfaceEditPart.VISUAL_ID), String.valueOf(RectangleInterfaceFloatingLabelEditPart.VISUAL_ID));
- map.put(String.valueOf(RectangleInterfaceEditPartCN.VISUAL_ID), String.valueOf(RectangleInterfaceFloatingLabelEditPartCN.VISUAL_ID));
-
- return map;
- }
-}

Back to the top