diff options
author | Camille Letavernier | 2014-09-17 14:09:12 +0000 |
---|---|---|
committer | Camille Letavernier | 2014-09-17 14:13:19 +0000 |
commit | 4973ad68f3b51e92d294dc0337eb8fb57d0433d2 (patch) | |
tree | 65949f6322f83ca29be9c52410797384f5d3da36 /extraplugins/migration/org.eclipse.papyrus.migration.rsa/transform/RSAToPapyrus.qvto | |
parent | 4b59a51439268cae9114f6109faa0d4110729691 (diff) | |
download | org.eclipse.papyrus-4973ad68f3b51e92d294dc0337eb8fb57d0433d2.tar.gz org.eclipse.papyrus-4973ad68f3b51e92d294dc0337eb8fb57d0433d2.tar.xz org.eclipse.papyrus-4973ad68f3b51e92d294dc0337eb8fb57d0433d2.zip |
410986: [Diagram Import] Papyrus shall enable to import layout
information of other tools models
https://bugs.eclipse.org/bugs/show_bug.cgi?id=410986
- Fix lineWidth, lineColor for Connectors
- Fir initial diagram name for unnamed diagrams
Diffstat (limited to 'extraplugins/migration/org.eclipse.papyrus.migration.rsa/transform/RSAToPapyrus.qvto')
-rw-r--r-- | extraplugins/migration/org.eclipse.papyrus.migration.rsa/transform/RSAToPapyrus.qvto | 25 |
1 files changed, 23 insertions, 2 deletions
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 a863bb69f6a..b2b54b201e7 100644 --- a/extraplugins/migration/org.eclipse.papyrus.migration.rsa/transform/RSAToPapyrus.qvto +++ b/extraplugins/migration/org.eclipse.papyrus.migration.rsa/transform/RSAToPapyrus.qvto @@ -65,7 +65,7 @@ abstract mapping Edge::toPapyrusEdge() : Edge inherits View::toPapyrusView { result.target := self.target.map toView(); } -abstract mapping Connector::toPapyrusConnector() : Connector inherits Edge::toPapyrusEdge, RoutingStyle::toRoutingstyle{}; +abstract mapping Connector::toPapyrusConnector() : Connector inherits Edge::toPapyrusEdge, RoutingStyle::toRoutingstyle, LineStyle::toLineStyle {}; abstract mapping Connector::toCommentLink() : Connector inherits Connector::toPapyrusConnector{}; @@ -117,7 +117,7 @@ abstract mapping UMLShapeCompartment::toAbstractStructureCompartment() : Decorat abstract mapping Diagram::toPapyrusDiagram() : notation::Diagram inherits notation::View::toPapyrusView { population { - result.name := self.name; + result.name := self.getName(); /* Papyrus uses Pixel, whereas RSA uses Himetric. Forcing the conversion to Pixel is a bad idea */ result.measurementUnit := MeasurementUnit::Pixel; @@ -134,6 +134,27 @@ abstract mapping Diagram::toPapyrusDiagram() : notation::Diagram inherits notati } } +query Diagram::getName() : String{ + return if self.name.oclIsUndefined() or self.name = '' then { + var element := self.findElement(); + return if element.oclIsKindOf(NamedElement) then + element.oclAsType(NamedElement).getDiagramName() + else + '' + endif; + } else + self.name + endif; +} + +query NamedElement::getDiagramName() : String { + return if self.oclIsKindOf(Behavior) then + self.owner.oclAsType(NamedElement).getDiagramName() + else + self.name + endif; +} + query Diagram::findElement() : Element { return if self.container().container().oclIsUndefined() then semantics.rootObjects()[Element]->any(true) else self.container().container().oclAsType(Element) endif; } |