Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2017-01-09 12:28:36 +0000
committerGerrit Code Review @ Eclipse.org2017-01-10 08:37:29 +0000
commitde66c48c2504f0a77ae7820b862d746187e08ebb (patch)
tree5c17ba8099d243aad994b27648d2eac973121025
parente4c0f269dcd3c24f353ec26de72a6da2d4555bf0 (diff)
downloadorg.eclipse.papyrus-de66c48c2504f0a77ae7820b862d746187e08ebb.tar.gz
org.eclipse.papyrus-de66c48c2504f0a77ae7820b862d746187e08ebb.tar.xz
org.eclipse.papyrus-de66c48c2504f0a77ae7820b862d746187e08ebb.zip
Bug 510099: [Importer] [Rhapsody] Routing of Link is not managed by the import tool
Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
-rw-r--r--extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/RhapsodyToPapyrusDiagamCommon.qvto28
-rw-r--r--extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11BlockDefinitionDiagram.qvto3
-rw-r--r--extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11InternalBlockDiagram.qvto8
-rw-r--r--extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11ParametricDiagram.qvto8
-rwxr-xr-xplugins/doc/org.eclipse.papyrus.migration.rhapsody.doc/src/site/mediawiki/rhapsodyMigrationDev.mediawiki2
-rwxr-xr-xplugins/doc/org.eclipse.papyrus.migration.rhapsody.doc/src/site/mediawiki/rhapsodyMigrationUser.mediawiki3
6 files changed, 52 insertions, 0 deletions
diff --git a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/RhapsodyToPapyrusDiagamCommon.qvto b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/RhapsodyToPapyrusDiagamCommon.qvto
index 9a16af2e014..a2b77c1b276 100644
--- a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/RhapsodyToPapyrusDiagamCommon.qvto
+++ b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/RhapsodyToPapyrusDiagamCommon.qvto
@@ -150,3 +150,31 @@ helper createCSSForceValue(detailKey:String):EAnnotation{
var eAnnotation:EAnnotation:= object EAnnotation { source:="PapyrusCSSForceValue" ; details+=object EStringToStringMapEntry { key:=detailKey; value:="true"}};
return eAnnotation;
}
+
+/**
+* Return the routing to use for the given connector.
+* The current implementations returns always Manual routing to avoid problems with anchors, bendopints and snapToGrid
+*/
+query umlrhapsody::GraphElementsType::getConnectorRouting():notation::Routing{
+ var routing:Routing:=Routing::Manual;
+ var rpyValue:String;
+ if(self.oclIsKindOf(CGIObjectLink)){
+ rpyValue:=self.oclAsType(CGIObjectLink).m_line_style;
+ }elif(self.oclIsTypeOf(CGIAnchor)){
+ rpyValue:=self.oclAsType(CGIAnchor).m_line_style;
+ }elif(self.oclIsTypeOf(CGIAssociationEnd)){
+ rpyValue:=self.oclAsType(CGIAssociationEnd).m_line_style;
+ }else{
+ log("The object " + self.toString() + " is not yet managed to get its routing")
+ };
+
+ routing:=switch{
+ case (rpyValue="0") Routing::Manual;
+ case (rpyValue="1") Routing::Manual; //spline in Rhapsody
+ case (rpyValue="2") Routing::Rectilinear;
+ };
+
+ //as we currently get trouble with anchos, bendpoints and snap to grid, we always return Manual
+ routing:=Routing::Manual;
+ return routing;
+}
diff --git a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11BlockDefinitionDiagram.qvto b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11BlockDefinitionDiagram.qvto
index 0531d40dc9c..5ec7772586b 100644
--- a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11BlockDefinitionDiagram.qvto
+++ b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11BlockDefinitionDiagram.qvto
@@ -758,6 +758,9 @@ mapping umlrhapsody::CGIAssociationEnd::toSysML11BDDAssociationEdge() : Connecto
eObjectValue:=association.memberEnd->asSequence()->at(2).oclAsType(EObject); //TODO
};
+ //manage connector routing
+ routing:=self.oclAsType(GraphElementsType).getConnectorRouting();
+ eAnnotations+=createCSSForceValue("routing");
}
diff --git a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11InternalBlockDiagram.qvto b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11InternalBlockDiagram.qvto
index e868a22e595..fd85d473c8b 100644
--- a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11InternalBlockDiagram.qvto
+++ b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11InternalBlockDiagram.qvto
@@ -110,6 +110,10 @@ mapping rhapsodymetamodel::CGIAnchor::graphElementsTypeToIBDCommentLink(cgiClass
var sourceNode:M_pRootType:=self.m_pSource;
var targetNode:M_pRootType:=self.m_pTarget;
addAnchorsAndBendpoints(self,result);
+
+ //manage connector routing
+ routing:=self.oclAsType(GraphElementsType).getConnectorRouting();
+ eAnnotations+=createCSSForceValue("routing");
}
@@ -141,6 +145,10 @@ mapping rhapsodymetamodel::CGIObjectLink::graphElementsTypeToIBDConnector(cgiCla
y:=-10; //TODO : a dummy value
};
};
+
+ //manage connector routing
+ routing:=self.oclAsType(GraphElementsType).getConnectorRouting();
+ eAnnotations+=createCSSForceValue("routing");
}
diff --git a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11ParametricDiagram.qvto b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11ParametricDiagram.qvto
index 35d8f946c84..d0640f0569f 100644
--- a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11ParametricDiagram.qvto
+++ b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11ParametricDiagram.qvto
@@ -144,6 +144,10 @@ mapping rhapsodymetamodel::CGIAnchor::graphElementsTypeToPDCommentLink(cgiClassC
var sourceNode:M_pRootType:=self.m_pSource;
var targetNode:M_pRootType:=self.m_pTarget;
addAnchorsAndBendpoints(self,result);
+
+ //manage connector routing
+ routing:=self.oclAsType(GraphElementsType).getConnectorRouting();
+ eAnnotations+=createCSSForceValue("routing");
}
/**
@@ -174,6 +178,10 @@ mapping rhapsodymetamodel::CGIObjectLink::graphElementsTypeToPDConnector(cgiClas
y:=-10; //TODO : a dummy value
};
};
+
+ //manage connector routing
+ routing:=self.oclAsType(GraphElementsType).getConnectorRouting();
+ eAnnotations+=createCSSForceValue("routing");
}
//TODO : calling resolve method could not work in soem case : if we are mapping a link linked to another link not yet mapped -> we will not able to resolve it!
diff --git a/plugins/doc/org.eclipse.papyrus.migration.rhapsody.doc/src/site/mediawiki/rhapsodyMigrationDev.mediawiki b/plugins/doc/org.eclipse.papyrus.migration.rhapsody.doc/src/site/mediawiki/rhapsodyMigrationDev.mediawiki
index 43907a44557..941d017f649 100755
--- a/plugins/doc/org.eclipse.papyrus.migration.rhapsody.doc/src/site/mediawiki/rhapsodyMigrationDev.mediawiki
+++ b/plugins/doc/org.eclipse.papyrus.migration.rhapsody.doc/src/site/mediawiki/rhapsodyMigrationDev.mediawiki
@@ -123,3 +123,5 @@ To ease future fixes for generated corrupted models, an '''EMF EAnnotation''' is
This work is done by the QVTo library <code>RhapsodyToPapyrusUtils</code>, with the helper method <code>createEAnnotationForVersioning</code>.
+==Diagram Styling==
+As we want to get the same style in import models than in the Rhapsody source model, we need to add EAnnoation PapyrusCSSForceValue to override the styling done by CSS stylesheet. The method to create a such EAnnotation is provided by the QVTo library <code>RhapsodyToPapyrusDiagamCommon</code>, by the helper <code>createCSSForceValue</code>.
diff --git a/plugins/doc/org.eclipse.papyrus.migration.rhapsody.doc/src/site/mediawiki/rhapsodyMigrationUser.mediawiki b/plugins/doc/org.eclipse.papyrus.migration.rhapsody.doc/src/site/mediawiki/rhapsodyMigrationUser.mediawiki
index 1e105392efd..d8a467e9962 100755
--- a/plugins/doc/org.eclipse.papyrus.migration.rhapsody.doc/src/site/mediawiki/rhapsodyMigrationUser.mediawiki
+++ b/plugins/doc/org.eclipse.papyrus.migration.rhapsody.doc/src/site/mediawiki/rhapsodyMigrationUser.mediawiki
@@ -233,3 +233,6 @@ In it, you will find the Papyrus model, with these files:
If you are in the Project Explorer, a shortest method allows you to import a selected ''*.rpy'' file, doing '''Right-Click > Import SysML Rhapsody Model'''.
+
+==Why my CSS are ignored in imported Diagrams?==
+The goal of the Papyrus Rhapsody Import Model feature is to provide the same display for a given Rhapsody Diagram and its equivalent in Papyrus. As the CSS stylesheet can impact the display of the diagram, our transformation process add a specific information to each imported display property to bypass CSS renderer. Technically we add an '''EAnnotation''' named '''PapyrusCSSForceValue''' to ignore CSS value. All CSS customizations can be impacted, like connector routing or compartment visibility.

Back to the top