Browse Source

No longer open attribute editor for non-SCD models

Yentl Van Tendeloo 7 years ago
parent
commit
e95fc25d20
2 changed files with 4 additions and 3 deletions
  1. 1 1
      classes/canvas/canvas_element.xml
  2. 3 2
      frontend.py

+ 1 - 1
classes/canvas/canvas_element.xml

@@ -151,7 +151,7 @@
                 <parameter name="ID"/>
                 <parameter name="ID"/>
             </transition>
             </transition>
 
 
-            <transition event="middle-click" cond="id(self) == ID and control_pressed" target=".">
+            <transition event="middle-click" cond="id(self) == ID and control_pressed and current_metamodel == 'formalisms/SimpleClassDiagrams'" target=".">
                 <parameter name="ID"/>
                 <parameter name="ID"/>
                 <raise event="modify_defined_attrs" scope="narrow" target="'parent/parent'">
                 <raise event="modify_defined_attrs" scope="narrow" target="'parent/parent'">
                     <parameter expr="self.as_element"/>
                     <parameter expr="self.as_element"/>

+ 3 - 2
frontend.py

@@ -1,7 +1,7 @@
 """
 """
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 
 
-Date:   Tue May 29 09:07:36 2018
+Date:   Tue May 29 09:38:53 2018
 
 
 Model author: Yentl Van Tendeloo
 Model author: Yentl Van Tendeloo
 Model name:   Modelverse Visual Editor - Tkinter Version 
 Model name:   Modelverse Visual Editor - Tkinter Version 
@@ -14552,6 +14552,7 @@ class CanvasElement(RuntimeClassBase, SCCDWidget):
     
     
     def _main_0_exec(self, parameters):
     def _main_0_exec(self, parameters):
         element = parameters[0]
         element = parameters[0]
+        print("MM: " + str(current_metamodel))
         elem_x = self.coordinates[0] + element["x"]
         elem_x = self.coordinates[0] + element["x"]
         elem_y = self.coordinates[1] + element["y"]
         elem_y = self.coordinates[1] + element["y"]
         if element["type"] == "Rectangle":
         if element["type"] == "Rectangle":
@@ -14587,7 +14588,7 @@ class CanvasElement(RuntimeClassBase, SCCDWidget):
     
     
     def _main_3_guard(self, parameters):
     def _main_3_guard(self, parameters):
         ID = parameters[0]
         ID = parameters[0]
-        return id(self) == ID and control_pressed
+        return id(self) == ID and control_pressed and current_metamodel == 'formalisms/SimpleClassDiagrams'
     
     
     def _main_4_exec(self, parameters):
     def _main_4_exec(self, parameters):
         ID = parameters[0]
         ID = parameters[0]