Example #1
0
 def dropEvent(self, event):
     pos = self.mapToScene(event.pos())
     geo_pos = self.world_map.to_geographical_coordinates(pos.x(), pos.y())
     if event.mimeData().hasFormat('application/x-dnditemdata'):
         new_gnode = GraphicalNetworkNode(self)
         new_gnode.setPos(pos)
         # update the nodes coordinates at creation
         new_gnode.node.longitude, new_gnode.node.latitude = geo_pos
Example #2
0
 def dropEvent(self, event):
     pos = self.mapToScene(event.pos())
     geo_pos = self.world_map.to_geographical_coordinates(pos.x(), pos.y())
     if event.mimeData().hasFormat('application/x-dnditemdata'):
         new_gnode = GraphicalNetworkNode(self)
         new_gnode.setPos(pos)
         # update the nodes coordinates at creation
         new_gnode.node.longitude, new_gnode.node.latitude = geo_pos
Example #3
0
 def dropEvent(self, event):
     pos = self.mapToScene(event.pos())
     if event.mimeData().hasFormat('application/x-dnditemdata'):
         network_gnode = GraphicalNetworkNode(self.network_view)
         # add the node to the logical site
         self.site.ps['node'].add(network_gnode.node)
         new_node = GraphicalNetworkNode(self, network_gnode.node)
         new_node.setPos(pos)
Example #4
0
 def dropEvent(self, event):
     pos = self.mapToScene(event.pos())
     if event.mimeData().hasFormat('application/x-dnditemdata'):
         from graphical_objects.graphical_network_node import GraphicalNetworkNode
         new_gnode = GraphicalNetworkNode(self)
         if new_gnode.node.subtype != 'port':
             self.node.structure[new_gnode.node.name] = new_gnode.node.structure
         else:
             self.node.structure[new_gnode.node.name] = []
         new_gnode.setPos(pos)
Example #5
0
 def dropEvent(self, event):
     pos = self.mapToScene(event.pos())
     if event.mimeData().hasFormat('application/x-dnditemdata'):
         from graphical_objects.graphical_network_node import GraphicalNetworkNode
         new_gnode = GraphicalNetworkNode(self)
         if new_gnode.node.subtype != 'port':
             self.node.structure[
                 new_gnode.node.name] = new_gnode.node.structure
         else:
             self.node.structure[new_gnode.node.name] = []
         new_gnode.setPos(pos)
Example #6
0
 def add_to_site(self, *objects):
     for obj in objects:
         if obj not in self.site.ps[obj.class_type]:
             self.site.add_to_site(obj)
             if obj.class_type == 'node':
                 self.gobj[obj] = GraphicalNetworkNode(self, obj)
             elif obj.class_type == 'link':
                 self.add_to_site(obj.source, obj.destination)
                 self.gobj[obj] = GraphicalLink(self, obj)
Example #7
0
 def draw_objects(self, *objects):
     for obj in objects:
         if obj.class_type == 'node' and self not in obj.gnode:
             GraphicalNetworkNode(self, obj)
         if obj.class_type == 'link' and self not in obj.glink:
             if 'vc' in obj.subtype:
                 continue
             self.draw_objects(obj.source, obj.destination)
             GraphicalLink(self, obj)
Example #8
0
 def dropEvent(self, event):
     pos = self.mapToScene(event.pos())
     if event.mimeData().hasFormat('application/x-dnditemdata'):
         network_gnode = GraphicalNetworkNode(self.network_view)
         new_node = GraphicalNetworkNode(self, network_gnode.node)
         new_node.setPos(pos)
Example #9
0
 def dropEvent(self, event):
     pos = self.mapToScene(event.pos())
     if event.mimeData().hasFormat('application/x-dnditemdata'):
         from graphical_objects.graphical_network_node import GraphicalNetworkNode
         new_gnode = GraphicalNetworkNode(self)
         new_gnode.setPos(pos)