Graphics/ImportsDiagram.py

changeset 2027
144463496a54
parent 2026
18f2b30ed046
child 2030
db11a2fe9bbc
equal deleted inserted replaced
2026:18f2b30ed046 2027:144463496a54
39 @param parent parent widget of the view (QWidget) 39 @param parent parent widget of the view (QWidget)
40 @param name name of the view widget (string) 40 @param name name of the view widget (string)
41 @keyparam showExternalImports flag indicating to show exports from outside 41 @keyparam showExternalImports flag indicating to show exports from outside
42 the package (boolean) 42 the package (boolean)
43 """ 43 """
44 UMLDialog.__init__(self, parent=parent) 44 UMLDialog.__init__(self, buildFunction=self.__buildImports, parent=parent)
45 45
46 self.showExternalImports = showExternalImports 46 self.showExternalImports = showExternalImports
47 self.packagePath = Utilities.normabspath(package) 47 self.packagePath = Utilities.normabspath(package)
48 self.package = os.path.splitdrive(self.packagePath)[1].replace(os.sep, '.')[1:] 48 self.package = os.path.splitdrive(self.packagePath)[1].replace(os.sep, '.')[1:]
49 hasInit = True 49 hasInit = True
209 if rect.height() > sceneRect.height(): 209 if rect.height() > sceneRect.height():
210 sceneRect.setHeight(rect.height()) 210 sceneRect.setHeight(rect.height())
211 self.umlView.setSceneSize(sceneRect.width(), sceneRect.height()) 211 self.umlView.setSceneSize(sceneRect.width(), sceneRect.height())
212 212
213 self.__createAssociations(shapes) 213 self.__createAssociations(shapes)
214 self.umlView.autoAdjustSceneSize(limit=True)
214 215
215 def __addModule(self, name, classes, x, y): 216 def __addModule(self, name, classes, x, y):
216 """ 217 """
217 Private method to add a module to the diagram. 218 Private method to add a module to the diagram.
218 219
238 assoc = AssociationItem( 239 assoc = AssociationItem(
239 shapes[module][0], shapes[rel][0], 240 shapes[module][0], shapes[rel][0],
240 Imports) 241 Imports)
241 self.scene.addItem(assoc) 242 self.scene.addItem(assoc)
242 243
243 def show(self): 244 def relayout(self):
244 """ 245 """
245 Overriden method to show the dialog. 246 Method to relayout the diagram.
246 """ 247 """
247 self.__buildImports() 248 self.__buildImports()
248 UMLDialog.show(self)
249
250 def relayout(self):
251 """
252 Method to relayout the diagram.
253 """
254 self.__buildImports()

eric ide

mercurial