aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorghillairet2012-05-14 11:55:21 (EDT)
committermgolubev2012-05-14 11:55:21 (EDT)
commit3789b7d9569493fa5511275071b8faab3f517557 (patch)
treefed59e23844b180f49479732baf77c705cafbd2c
parenta57ff4189d05eed4dbcec059a5ce790f3bab67df (diff)
downloadorg.eclipse.gmf-tooling-3789b7d9569493fa5511275071b8faab3f517557.zip
org.eclipse.gmf-tooling-3789b7d9569493fa5511275071b8faab3f517557.tar.gz
org.eclipse.gmf-tooling-3789b7d9569493fa5511275071b8faab3f517557.tar.bz2
add call to CustomBehaviour mapping
-rw-r--r--plugins/org.eclipse.gmf.bridge/transforms/CustomBehaviours.qvto36
-rw-r--r--plugins/org.eclipse.gmf.bridge/transforms/Map2Gen.qvto2
2 files changed, 37 insertions, 1 deletions
diff --git a/plugins/org.eclipse.gmf.bridge/transforms/CustomBehaviours.qvto b/plugins/org.eclipse.gmf.bridge/transforms/CustomBehaviours.qvto
index d9f3ab2..6a13e8e 100644
--- a/plugins/org.eclipse.gmf.bridge/transforms/CustomBehaviours.qvto
+++ b/plugins/org.eclipse.gmf.bridge/transforms/CustomBehaviours.qvto
@@ -10,16 +10,50 @@
*/
library CustomBehaviours;
+import Mappings;
+
modeltype GMFMAP uses mappings('http://www.eclipse.org/gmf/2006/mappings');
modeltype GMFGEN uses gmfgen('http://www.eclipse.org/gmf/2009/GenModel');
modeltype GMFGRAPH uses gmfgraph('http://www.eclipse.org/gmf/2006/GraphicalDefinition');
modeltype ECORE uses ecore('http://www.eclipse.org/emf/2002/Ecore');
--
+-- Custom Behaviour
+--
+
+helper GMFMAP::Mapping::customBehaviours() {
+ self.nodes->collect(e |
+ if e.resolveone(GenTopLevelNode).visualID <= 0 then {
+ var genNode := e.resolveone(GenTopLevelNode);
+ genNode.behaviour += e.child.visualEffects->map createVisualEffects(genNode);
+ e.child.children->collect(customBehaviours());
+ } endif
+ );
+
+ self.links->collect(customBehaviours());
+-- self.getCompartments()->collect(e | e.c.customBehaviours(e.n, e.r));
+
+ return;
+}
+
+helper GMFMAP::ChildReference::customBehaviours() {
+ var node := self.findProcessableChildReference();
+ if not node.oclIsUndefined() then
+ node.map structure(node.child).behaviour +=
+ node.child.visualEffects->map createVisualEffects(node.map structure(node.child))
+ endif
+}
+
+helper GMFMAP::LinkMapping::customBehaviours() {
+ self.map structure().behaviour += self.visualEffects->map createVisualEffects(self.map structure());
+ return;
+}
+
+--
-- VisualEffect
--
-mapping GMFMAP::VisualEffectMapping::createVisualEffects(parent: GMFGEN::GenNode): GMFGEN::GenVisualEffect {
+mapping GMFMAP::VisualEffectMapping::createVisualEffects(parent: GMFGEN::GenCommonBase): GMFGEN::GenVisualEffect {
name := self.diagramPin.name;
pinKind := self.diagramPin.oclAsType(EObject).eClass().name;
operationName := self.diagramPin.getOperationName();
diff --git a/plugins/org.eclipse.gmf.bridge/transforms/Map2Gen.qvto b/plugins/org.eclipse.gmf.bridge/transforms/Map2Gen.qvto
index d42042f..148ff49 100644
--- a/plugins/org.eclipse.gmf.bridge/transforms/Map2Gen.qvto
+++ b/plugins/org.eclipse.gmf.bridge/transforms/Map2Gen.qvto
@@ -23,6 +23,7 @@ import ModeledViewmaps;
import Identity;
import Audits;
import Parsers;
+import CustomBehaviours;
import gmf.GenModelAccess;
modeltype GMFMAP uses mappings('http://www.eclipse.org/gmf/2006/mappings');
@@ -53,6 +54,7 @@ main() {
genEditor.editor := object GenEditorView {};
mapRoot.visualIdentity(); -- generate visual IDs for each node.
+ mapRoot.customBehaviours();
if useInTransformationCodeGen then
Viewmaps::viewmaps(mapRoot, genEditor.diagram) -- adds viewmaps to each nodes.