Graphics/PackageDiagramBuilder.py

branch
Py2 comp.
changeset 2602
affc66a603c7
parent 2525
8b507a9a2d40
child 3057
10516539f238
equal deleted inserted replaced
2601:f415080106ba 2602:affc66a603c7
9 9
10 from __future__ import unicode_literals # __IGNORE_WARNING__ 10 from __future__ import unicode_literals # __IGNORE_WARNING__
11 11
12 import glob 12 import glob
13 import os.path 13 import os.path
14 import itertools 14 try: # Py3
15 from itertools import zip_longest
16 except ImportError:
17 from itertools import izip_longest as zip_longest
15 18
16 from PyQt4.QtGui import QProgressDialog, QApplication, QGraphicsTextItem 19 from PyQt4.QtGui import QProgressDialog, QApplication, QGraphicsTextItem
17 20
18 from .UMLDiagramBuilder import UMLDiagramBuilder 21 from .UMLDiagramBuilder import UMLDiagramBuilder
19 22
326 329
327 # distribute each generation across the width and the 330 # distribute each generation across the width and the
328 # generations across height 331 # generations across height
329 y = 10.0 332 y = 10.0
330 for currentWidth, currentHeight, generation in \ 333 for currentWidth, currentHeight, generation in \
331 itertools.zip_longest(widths, heights, generations): 334 zip_longest(widths, heights, generations):
332 x = 10.0 335 x = 10.0
333 # whiteSpace is the space between any two elements 336 # whiteSpace is the space between any two elements
334 whiteSpace = (width - currentWidth - 20) / (len(generation) - 1.0 or 2.0) 337 whiteSpace = (width - currentWidth - 20) / (len(generation) - 1.0 or 2.0)
335 for className in generation: 338 for className in generation:
336 cw = self.__getCurrentShape(className) 339 cw = self.__getCurrentShape(className)

eric ide

mercurial