Graphics/PackageDiagram.py

changeset 2027
144463496a54
parent 2026
18f2b30ed046
child 2028
30247d523fdb
equal deleted inserted replaced
2026:18f2b30ed046 2027:144463496a54
35 @param package name of a python package to be shown (string) 35 @param package name of a python package to be shown (string)
36 @param parent parent widget of the view (QWidget) 36 @param parent parent widget of the view (QWidget)
37 @param name name of the view widget (string) 37 @param name name of the view widget (string)
38 @keyparam noAttrs flag indicating, that no attributes should be shown (boolean) 38 @keyparam noAttrs flag indicating, that no attributes should be shown (boolean)
39 """ 39 """
40 UMLDialog.__init__(self, parent=parent) 40 UMLDialog.__init__(self, buildFunction=self.__buildClasses, parent=parent)
41 41
42 self.package = Utilities.normabspath(package) 42 self.package = Utilities.normabspath(package)
43 self.allClasses = {} 43 self.allClasses = {}
44 self.noAttrs = noAttrs 44 self.noAttrs = noAttrs
45 45
190 190
191 del todo[0] 191 del todo[0]
192 192
193 self.__arrangeClasses(nodes, routes[:]) 193 self.__arrangeClasses(nodes, routes[:])
194 self.__createAssociations(routes) 194 self.__createAssociations(routes)
195 self.umlView.autoAdjustSceneSize(limit=True)
195 196
196 def __arrangeClasses(self, nodes, routes, whiteSpaceFactor=1.2): 197 def __arrangeClasses(self, nodes, routes, whiteSpaceFactor=1.2):
197 """ 198 """
198 Private method to arrange the shapes on the canvas. 199 Private method to arrange the shapes on the canvas.
199 200
306 self.__getCurrentShape(route[0]), 307 self.__getCurrentShape(route[0]),
307 Generalisation, 308 Generalisation,
308 topToBottom=True) 309 topToBottom=True)
309 self.scene.addItem(assoc) 310 self.scene.addItem(assoc)
310 311
311 def show(self):
312 """
313 Overriden method to show the dialog.
314 """
315 self.__buildClasses()
316 UMLDialog.show(self)
317
318 def relayout(self): 312 def relayout(self):
319 """ 313 """
320 Method to relayout the diagram. 314 Method to relayout the diagram.
321 """ 315 """
322 self.allClasses.clear() 316 self.allClasses.clear()

eric ide

mercurial