Exemplo n.º 1
0
 def on_item_click(self, item, position):
     if item.kind == "box" and item.owner.is_transition():
         self.fire_transition(item.owner)
     elif item.kind == "activation":
         if not self.check_last_active():
             return
         process_id, transition = item.owner
         if self.simview.button_auto_receive.get_active():
             callback = lambda: self.simulation.receive_all()
         else:
             callback = None
         self.simulation.finish_transition(process_id, callback)
     elif item.kind == "packet" and item.packet_data is not None:
         if not self.check_last_active():
             return
         process_id, origin_id = item.packet_data
         self.simulation.receive(process_id, origin_id)
     else:
         NetViewCanvasConfig.on_item_click(self, item, position)
Exemplo n.º 2
0
 def set_highlight(self):
     NetViewCanvasConfig.set_highlight(self)
     enabled = self.perspective.get_enabled_transitions()
     for transition in self.net.transitions():
         if transition.id in enabled:
            transition.box.highlight = (0, 255, 0, 0.85)