Graphics/PackageDiagram.py

changeset 35
42f5cfc851da
parent 28
dde24fc7f7ba
child 40
c2e5472b112c
equal deleted inserted replaced
34:93367928a93b 35:42f5cfc851da
7 Module implementing a dialog showing a UML like class diagram of a package. 7 Module implementing a dialog showing a UML like class diagram of a package.
8 """ 8 """
9 9
10 import glob 10 import glob
11 import os.path 11 import os.path
12 import itertools
12 13
13 from PyQt4.QtCore import * 14 from PyQt4.QtCore import *
14 from PyQt4.QtGui import * 15 from PyQt4.QtGui import *
15 16
16 from .UMLDialog import UMLDialog 17 from .UMLDialog import UMLDialog
231 232
232 # distribute each generation across the width and the 233 # distribute each generation across the width and the
233 # generations across height 234 # generations across height
234 y = 10.0 235 y = 10.0
235 for currentWidth, currentHeight, generation in \ 236 for currentWidth, currentHeight, generation in \
236 map(None, widths, heights, generations): 237 itertools.zip_longest(widths, heights, generations):
237 x = 10.0 238 x = 10.0
238 # whiteSpace is the space between any two elements 239 # whiteSpace is the space between any two elements
239 whiteSpace = (width - currentWidth - 20) / (len(generation) - 1.0 or 2.0) 240 whiteSpace = (width - currentWidth - 20) / (len(generation) - 1.0 or 2.0)
240 for className in generation: 241 for className in generation:
241 cw = self.__getCurrentShape(className) 242 cw = self.__getCurrentShape(className)

eric ide

mercurial