Exemplo n.º 1
0
 def create_canvasitems(diagram, canvasitems, parent=None):
     """
     Canvas is a read gaphas.Canvas, items is a list of parser.canvasitem's
     """
     for item in canvasitems:
         item = upgrade_canvas_item_to_1_1_0(item)
         cls = getattr(diagramitems, item.type)
         item.element = diagram.create_as(cls, item.id, parent=parent)
         create_canvasitems(diagram, item.canvasitems, parent=item.element)
Exemplo n.º 2
0
 def create_canvasitems(canvas, canvasitems, parent=None):
     """
     Canvas is a read gaphas.Canvas, items is a list of parser.canvasitem's
     """
     for item in canvasitems:
         cls = getattr(items, item.type)
         item.element = diagram.create_as(cls, item.id)
         canvas.add(item.element, parent=parent)
         assert canvas.get_parent(item.element) is parent
         create_canvasitems(canvas, item.canvasitems, parent=item.element)
Exemplo n.º 3
0
 def create_canvasitems(canvas, canvasitems, parent=None):
     """
     Canvas is a read gaphas.Canvas, items is a list of parser.canvasitem's
     """
     for item in canvasitems:
         cls = getattr(items, item.type)
         item.element = diagram.create_as(cls, item.id)
         canvas.add(item.element, parent=parent)
         assert canvas.get_parent(item.element) is parent
         create_canvasitems(canvas, item.canvasitems, parent=item.element)
Exemplo n.º 4
0
 def create_canvasitems(diagram, canvasitems, parent=None):
     """
     Canvas is a read gaphas.Canvas, items is a list of parser.canvasitem's
     """
     for item in canvasitems:
         item = upgrade_canvas_item_to_1_0_2(item)
         if version_lower_than(gaphor_version, (1, 1, 0)):
             item = upgrade_presentation_item_to_1_1_0(item)
         cls = getattr(diagramitems, item.type)
         item.element = diagram.create_as(cls, item.id, parent=parent)
         create_canvasitems(diagram, item.canvasitems, parent=item.element)
Exemplo n.º 5
0
 def create_canvasitems(canvas, canvasitems, parent=None):
     """Canvas is a read gaphas.Canvas, items is a list of 
     parser.canvasitem's."""
     
     logger.debug('Creating canvas items')
     logger.debug('CANVAS: %s'%canvas)
     logger.debug('CANVAS ITEMS: %s'%canvasitems)
     logger.debug('PARENT: %s'%parent)
     
     for item in canvasitems:
         cls = getattr(items, item.type)
         item.element = diagram.create_as(cls, item.id)
         canvas.add(item.element, parent=parent)
         assert canvas.get_parent(item.element) is parent
         create_canvasitems(canvas, item.canvasitems, parent=item.element)