eric6/Graphics/PackageDiagramBuilder.py

changeset 8286
62ae22eae123
parent 8277
ea734702ae94
child 8289
871b40c5a77a
equal deleted inserted replaced
8285:1816b622aef2 8286:62ae22eae123
241 for modName in list(modules.keys()): 241 for modName in list(modules.keys()):
242 module = modules[modName] 242 module = modules[modName]
243 todo = [module.createHierarchy()] 243 todo = [module.createHierarchy()]
244 while todo: 244 while todo:
245 hierarchy = todo[0] 245 hierarchy = todo[0]
246 for className in list(hierarchy.keys()): 246 for className in hierarchy:
247 cw = self.__getCurrentShape(className) 247 cw = self.__getCurrentShape(className)
248 if not cw and className.find('.') >= 0: 248 if not cw and className.find('.') >= 0:
249 cw = self.__getCurrentShape(className.split('.')[-1]) 249 cw = self.__getCurrentShape(className.split('.')[-1])
250 if cw: 250 if cw:
251 self.allClasses[className] = cw 251 self.allClasses[className] = cw
333 height += currentHeight 333 height += currentHeight
334 334
335 # store generation info 335 # store generation info
336 widths.append(currentWidth) 336 widths.append(currentWidth)
337 heights.append(currentHeight) 337 heights.append(currentHeight)
338 338
339 # add in some whitespace 339 # add in some whitespace
340 width *= whiteSpaceFactor 340 width *= whiteSpaceFactor
341 height = height * whiteSpaceFactor - 20 341 height = height * whiteSpaceFactor - 20
342 verticalWhiteSpace = 40.0 342 verticalWhiteSpace = 40.0
343 343
344 sceneRect = self.umlView.sceneRect() 344 sceneRect = self.umlView.sceneRect()
345 width += 50.0 345 width += 50.0
346 height += 50.0 346 height += 50.0
347 swidth = width < sceneRect.width() and sceneRect.width() or width 347 swidth = sceneRect.width() if width < sceneRect.width() else width
348 sheight = height < sceneRect.height() and sceneRect.height() or height 348 sheight = sceneRect.height() if height < sceneRect.height() else height
349 self.umlView.setSceneSize(swidth, sheight) 349 self.umlView.setSceneSize(swidth, sheight)
350 350
351 # distribute each generation across the width and the 351 # distribute each generation across the width and the
352 # generations across height 352 # generations across height
353 y = 10.0 353 y = 10.0

eric ide

mercurial