示例#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)
示例#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)
示例#3
0
文件: storage.py 项目: dieterv/gaphor
 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)
示例#4
0
文件: storage.py 项目: przor3n/gaphor
 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)
示例#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)