Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAsma Smaoui2017-02-09 13:20:19 +0000
committerGerrit Code Review @ Eclipse.org2017-02-10 13:59:26 +0000
commitf24831c8bd0ba393b99563427d5002b4dfef6059 (patch)
treec925631fa50dab97d92f60e3b4ae3e7a9dd55b33 /extraplugins
parentadf4774aae48b56f994cf79329f6aac148388800 (diff)
downloadorg.eclipse.papyrus-f24831c8bd0ba393b99563427d5002b4dfef6059.tar.gz
org.eclipse.papyrus-f24831c8bd0ba393b99563427d5002b4dfef6059.tar.xz
org.eclipse.papyrus-f24831c8bd0ba393b99563427d5002b4dfef6059.zip
Bug 511917 - [Model import] update the model import tool to produce a
Port_NameLabel view without an explicit set of element * the toLabel() mapping that creates the DecorationNode PortNameLabel inherits from toPapyrusNode mapping that inherits from toPapyrusNodeView mapping that set the element : PortNameLabel should not in any case set the element, the element is set in the Port_Shape view. for the inherited ports this creates a conflict and did not display the label --> create an abstract mapping just like PapyrusConnectorLabel and ensure that we did not set the element in this mapping. toLabel() inherits now the new mapping * add junit test to be sure that for all PortNameLabel View no element was set Change-Id: I621a1b9fbaaf855977473f8da1db379cefae97eb Signed-off-by: Asma Smaoui <asma.smaoui@cea.fr>
Diffstat (limited to 'extraplugins')
-rw-r--r--extraplugins/migration/org.eclipse.papyrus.migration.rsa/transform/RSAStructureDiagram.qvto5
-rw-r--r--extraplugins/migration/org.eclipse.papyrus.migration.rsa/transform/RSAToPapyrus.qvto12
2 files changed, 14 insertions, 3 deletions
diff --git a/extraplugins/migration/org.eclipse.papyrus.migration.rsa/transform/RSAStructureDiagram.qvto b/extraplugins/migration/org.eclipse.papyrus.migration.rsa/transform/RSAStructureDiagram.qvto
index 0fa595ebf21..262f3eee21e 100644
--- a/extraplugins/migration/org.eclipse.papyrus.migration.rsa/transform/RSAStructureDiagram.qvto
+++ b/extraplugins/migration/org.eclipse.papyrus.migration.rsa/transform/RSAStructureDiagram.qvto
@@ -224,7 +224,6 @@ mapping BasicDecorationNode::toConnectorLabel() : DecorationNode inherits Node::
self.type = 'NameLabel' or
self.type = 'KindLabel' or
self.type = 'PartTextCompartment' or
- self.type = 'PartName' or
self.type = 'CommentBody'
)
}{
@@ -233,14 +232,14 @@ mapping BasicDecorationNode::toConnectorLabel() : DecorationNode inherits Node::
/****** Compartments *******/
-mapping BasicDecorationNode::toLabel() : DecorationNode inherits Node::toPapyrusNode when {
+mapping BasicDecorationNode::toLabel() : DecorationNode inherits Node::toPapyrusNodeLabel when {
not self.getType().oclIsUndefined() and
self.element.oclIsKindOf(uml::NamedElement) and
self.type = 'Name' or self.type = 'PartName' or self.type = 'PortName'
}{
// add the layoutconstraint fot the PortNamelabel
if (self.type = 'PortName'){
- var thislayoutConstraint := (self.layoutConstraint.map toLayout(self.diagram)).oclAsType(Location);
+ var thislayoutConstraint := result.layoutConstraint.oclAsType(Location);
thislayoutConstraint.x:=thislayoutConstraint.x -10; // to fit better RSA layout
thislayoutConstraint.y:=thislayoutConstraint.y -10; // to fit better RSA layout
result.layoutConstraint := thislayoutConstraint;
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 1394ed2a4ac..330baf01adf 100644
--- a/extraplugins/migration/org.eclipse.papyrus.migration.rsa/transform/RSAToPapyrus.qvto
+++ b/extraplugins/migration/org.eclipse.papyrus.migration.rsa/transform/RSAToPapyrus.qvto
@@ -112,6 +112,18 @@ abstract mapping Node::toPapyrusConnectorLabel() : Node {
//Do not set children
}
+abstract mapping Node::toPapyrusNodeLabel() : Node {
+
+ result.visible := self.visible;
+
+ result.type := self.getType();
+
+ result.layoutConstraint := (self.layoutConstraint.map toLayout(self.diagram)).oclAsType(Location);
+
+ //Do not set element
+ //Do not set children
+}
+
abstract mapping Shape::toPapyrusShape() : Shape inherits Node::toPapyrusNode, FillStyle::toFillStyle, FontStyle::toFontStyle, LineStyle::toLineStyle{
result.layoutConstraint := self.layoutConstraint.map toLayout(self.diagram);

Back to the top