diff options
author | Camille Letavernier | 2016-05-09 15:14:40 +0000 |
---|---|---|
committer | Camille Letavernier | 2016-05-09 16:35:44 +0000 |
commit | f522f05d268adeb6f4ed35a442434b7965c0ac36 (patch) | |
tree | 0102fb1e340d7aa29238e78fa48aec11b09b6ad4 | |
parent | 2bb7beb4e0ea560508fcb58a1c8d863a6da29107 (diff) | |
download | org.eclipse.papyrus-f522f05d268adeb6f4ed35a442434b7965c0ac36.tar.gz org.eclipse.papyrus-f522f05d268adeb6f4ed35a442434b7965c0ac36.tar.xz org.eclipse.papyrus-f522f05d268adeb6f4ed35a442434b7965c0ac36.zip |
493249: [Model Import] Association Classes are not properly imported
https://bugs.eclipse.org/bugs/show_bug.cgi?id=493249
Change-Id: Ic419f0486ff59e3c44d420f2da961f7f21ca7134
Signed-off-by: Camille Letavernier <camille.letavernier@cea.fr>
-rw-r--r-- | extraplugins/migration/org.eclipse.papyrus.migration.rsa/transform/RSAClassDiagram.qvto | 12 | ||||
-rw-r--r-- | extraplugins/migration/org.eclipse.papyrus.migration.rsa/transform/RSAToPapyrus.qvto | 3 |
2 files changed, 10 insertions, 5 deletions
diff --git a/extraplugins/migration/org.eclipse.papyrus.migration.rsa/transform/RSAClassDiagram.qvto b/extraplugins/migration/org.eclipse.papyrus.migration.rsa/transform/RSAClassDiagram.qvto index 56db22a60c0..b508cfc3a0d 100644 --- a/extraplugins/migration/org.eclipse.papyrus.migration.rsa/transform/RSAClassDiagram.qvto +++ b/extraplugins/migration/org.eclipse.papyrus.migration.rsa/transform/RSAClassDiagram.qvto @@ -84,8 +84,7 @@ mapping inout Shape::addConstraintDecoration() when { mapping inout Diagram::handleAssociationClasses() { graphics.objectsOfType(Shape)->select(type = '2013').map updateLocation(); - self.children := self.children->union(graphics.objectsOfType(Node)->select(type = '2013')); - self.edges := self.edges->union(graphics.objectsOfType(Connector)->select(type = '4016')); + self.children := self.children->union(graphics.objectsOfKind(Node)->select(diagram = self and type = '2013')); } mapping inout Shape::updateLocation() { @@ -105,6 +104,9 @@ mapping inout Shape::updateLocation() { bounds.y := (((sourcePosition.y + targetPosition.y)/2) + bounds.y).round(); } +/** +* From the Dashed edge of an Association Class, returns the actual Association connector +*/ query Connector::findConnector() : Connector { var view := if self.source.oclIsKindOf(Connector) then self.source else self.target endif; return view.oclAsType(Connector); @@ -130,10 +132,10 @@ mapping UMLConnector::toAssociationClass() : Connector inherits Connector::toPap bendpoints := object RelativeBendpoints{}; sourceAnchor := object IdentityAnchor{}; targetAnchor := object IdentityAnchor{}; - }; - + var targetDiagram := self.diagram.map generateDiagram(); + targetDiagram.edges += dashedEdge; } @@ -196,12 +198,14 @@ mapping UMLShape::toPapyrusShape() : Shape inherits Shape::toPapyrusShape when { /****** Connector Labels ******/ mapping BasicDecorationNode::toConnectorLabel() : DecorationNode inherits Node::toPapyrusConnectorLabel when { + not self.getType().oclIsUndefined() and ( self.type = 'ToMultiplicityLabel' or self.type = 'ToRoleLabel' or self.type = 'FromMultiplicityLabel' or self.type = 'FromRoleLabel' or self.type = 'NameLabel' or self.type = 'KindLabel' + ) }{ } diff --git a/extraplugins/migration/org.eclipse.papyrus.migration.rsa/transform/RSAToPapyrus.qvto b/extraplugins/migration/org.eclipse.papyrus.migration.rsa/transform/RSAToPapyrus.qvto index 08976c75595..ce565ddbe42 100644 --- a/extraplugins/migration/org.eclipse.papyrus.migration.rsa/transform/RSAToPapyrus.qvto +++ b/extraplugins/migration/org.eclipse.papyrus.migration.rsa/transform/RSAToPapyrus.qvto @@ -143,7 +143,8 @@ abstract mapping Diagram::toPapyrusDiagram() : notation::Diagram inherits notati result.element := self.findElement().oclAsType(EObject); // log(result.element.eClass().name); // log(result.element.toString()); - result.edges := self.edges.map toEdge(); + var targetEdges := self.edges.map toEdge(); + result.edges += targetEdges; } end { |