|
|
@@ -1,7 +1,7 @@
|
|
|
"""
|
|
|
Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
|
|
|
|
|
|
-Date: Fri Oct 6 08:46:10 2017
|
|
|
+Date: Fri Oct 6 09:28:21 2017
|
|
|
|
|
|
Model author: Yentl Van Tendeloo
|
|
|
Model name: Modelverse Visual Editor - Tkinter Version
|
|
|
@@ -7324,6 +7324,7 @@ class ConnectingLine(RuntimeClassBase, SCCDWidget):
|
|
|
_init_0 = Transition(self, self.states["/init"], [self.states["/main"]])
|
|
|
_init_0.setAction(self._init_0_exec)
|
|
|
_init_0.setTrigger(None)
|
|
|
+ _init_0.setGuard(self._init_0_guard)
|
|
|
self.states["/init"].addTransition(_init_0)
|
|
|
|
|
|
# transition /main
|
|
|
@@ -7406,7 +7407,11 @@ class ConnectingLine(RuntimeClassBase, SCCDWidget):
|
|
|
|
|
|
self.containing_canvas.group_location[self.cs_element['id']] = (middle_x, middle_y)
|
|
|
|
|
|
- line1 = self.containing_canvas.create_line(source_x, source_y, middle_x, middle_y, fill=self.cs_element['lineColour'], width=self.cs_element['lineWidth'], arrow=tk.LAST if self.cs_element['arrow'] else tk.NONE)
|
|
|
+ if self.cs_element['arrow']:
|
|
|
+ lw = self.cs_element['lineWidth']
|
|
|
+ line1 = self.containing_canvas.create_line(source_x, source_y, middle_x, middle_y, fill=self.cs_element['lineColour'], width=self.cs_element['lineWidth'], arrow=tk.LAST, arrowshape=(lw*8, lw*10, lw*3))
|
|
|
+ else:
|
|
|
+ line1 = self.containing_canvas.create_line(source_x, source_y, middle_x, middle_y, fill=self.cs_element['lineColour'], width=self.cs_element['lineWidth'])
|
|
|
line2 = self.containing_canvas.create_line(middle_x, middle_y, target_x, target_y, fill=self.cs_element['lineColour'], width=self.cs_element['lineWidth'])
|
|
|
self.cs_element['elem'] = (line1, line2)
|
|
|
self.elements.add(line1)
|
|
|
@@ -7418,6 +7423,9 @@ class ConnectingLine(RuntimeClassBase, SCCDWidget):
|
|
|
self.set_bindable_and_tagorid(self.containing_canvas, line1)
|
|
|
self.set_bindable_and_tagorid(self.containing_canvas, line2)
|
|
|
|
|
|
+ def _init_0_guard(self, parameters):
|
|
|
+ return self.cs_element['__source'] in self.containing_canvas.group_location and self.cs_element['__target'] in self.containing_canvas.group_location
|
|
|
+
|
|
|
def _main_0_guard(self, parameters):
|
|
|
ID = parameters[0]
|
|
|
return id(self) == ID
|
|
|
@@ -7425,7 +7433,6 @@ class ConnectingLine(RuntimeClassBase, SCCDWidget):
|
|
|
def _main_1_exec(self, parameters):
|
|
|
element = parameters[0]
|
|
|
new_location = parameters[1]
|
|
|
- print("Moving line %s with source %s and target %s" % (self.cs_element['id'], self.cs_element['__source'], self.cs_element['__target']))
|
|
|
source_x, source_y, _, _ = self.containing_canvas.coords(self.cs_element['elem'][0])
|
|
|
_, _, target_x, target_y = self.containing_canvas.coords(self.cs_element['elem'][1])
|
|
|
|
|
|
@@ -7433,13 +7440,11 @@ class ConnectingLine(RuntimeClassBase, SCCDWidget):
|
|
|
# Changed source of our link
|
|
|
source_x = new_location[0] + self.cs_element['offsetSourceX']
|
|
|
source_y = new_location[1] + self.cs_element['offsetSourceY']
|
|
|
- print("Move source of line " + self.cs_element['id'])
|
|
|
|
|
|
if element == self.cs_element['__target']:
|
|
|
# Changed target of our link
|
|
|
target_x = new_location[0] + self.cs_element['offsetTargetX']
|
|
|
target_y = new_location[1] + self.cs_element['offsetTargetY']
|
|
|
- print("Move target of line " + self.cs_element['id'])
|
|
|
|
|
|
self.middle_x = (source_x + target_x) / 2
|
|
|
self.middle_y = (source_y + target_y) / 2
|
|
|
@@ -7700,6 +7705,7 @@ class CanvasElement(RuntimeClassBase, SCCDWidget):
|
|
|
|
|
|
def _main_0_exec(self, parameters):
|
|
|
element = parameters[0]
|
|
|
+ print("Create element with ID %s" % (element['id']))
|
|
|
elem_x = self.coordinates[0] + element["x"]
|
|
|
elem_y = self.coordinates[1] + element["y"]
|
|
|
if element["type"] == "Rectangle":
|