Graphics/UMLClassDiagram.py

changeset 35
42f5cfc851da
parent 13
1af94a91f439
child 413
3d82e6eb3516
child 792
a13346916170
equal deleted inserted replaced
34:93367928a93b 35:42f5cfc851da
4 # 4 #
5 5
6 """ 6 """
7 Module implementing a dialog showing a UML like class diagram. 7 Module implementing a dialog showing a UML like class diagram.
8 """ 8 """
9
10 import itertools
9 11
10 from PyQt4.QtCore import * 12 from PyQt4.QtCore import *
11 from PyQt4.QtGui import * 13 from PyQt4.QtGui import *
12 14
13 import Utilities.ModuleParser 15 import Utilities.ModuleParser
182 184
183 # distribute each generation across the width and the 185 # distribute each generation across the width and the
184 # generations across height 186 # generations across height
185 y = 10.0 187 y = 10.0
186 for currentWidth, currentHeight, generation in \ 188 for currentWidth, currentHeight, generation in \
187 map(None, widths, heights, generations): 189 itertools.zip_longest(widths, heights, generations):
188 x = 10.0 190 x = 10.0
189 # whiteSpace is the space between any two elements 191 # whiteSpace is the space between any two elements
190 whiteSpace = (width - currentWidth - 20) / (len(generation) - 1.0 or 2.0) 192 whiteSpace = (width - currentWidth - 20) / (len(generation) - 1.0 or 2.0)
191 for className in generation: 193 for className in generation:
192 cw = self.__getCurrentShape(className) 194 cw = self.__getCurrentShape(className)

eric ide

mercurial