Graphics/ApplicationDiagramBuilder.py

changeset 2401
4f428de32b69
parent 2334
fc69ad77e18a
child 2402
304fcefd3b04
equal deleted inserted replaced
2400:c1726b754f96 2401:4f428de32b69
13 from PyQt4.QtGui import QApplication, QProgressDialog 13 from PyQt4.QtGui import QApplication, QProgressDialog
14 14
15 from E5Gui import E5MessageBox 15 from E5Gui import E5MessageBox
16 16
17 from .UMLDiagramBuilder import UMLDiagramBuilder 17 from .UMLDiagramBuilder import UMLDiagramBuilder
18 from .PackageItem import PackageItem, PackageModel 18
19 from .AssociationItem import AssociationItem, Imports
20
21 import Utilities.ModuleParser
22 import Utilities 19 import Utilities
23
24 import Preferences 20 import Preferences
25 21
26 22
27 class ApplicationDiagramBuilder(UMLDiagramBuilder): 23 class ApplicationDiagramBuilder(UMLDiagramBuilder):
28 """ 24 """
64 prog = 0 60 prog = 0
65 progress = QProgressDialog(self.trUtf8("Parsing modules..."), 61 progress = QProgressDialog(self.trUtf8("Parsing modules..."),
66 None, 0, tot, self.parent()) 62 None, 0, tot, self.parent())
67 progress.show() 63 progress.show()
68 QApplication.processEvents() 64 QApplication.processEvents()
65
66 import Utilities.ModuleParser
69 for module in modules: 67 for module in modules:
70 progress.setValue(prog) 68 progress.setValue(prog)
71 QApplication.processEvents() 69 QApplication.processEvents()
72 prog += 1 70 prog += 1
73 if module.endswith("__init__.py"): 71 if module.endswith("__init__.py"):
221 @param modules list of module names contained in the package 219 @param modules list of module names contained in the package
222 (list of strings) 220 (list of strings)
223 @param x x-coordinate (float) 221 @param x x-coordinate (float)
224 @param y y-coordinate (float) 222 @param y y-coordinate (float)
225 """ 223 """
224 from .PackageItem import PackageItem, PackageModel
226 modules.sort() 225 modules.sort()
227 pm = PackageModel(name, modules) 226 pm = PackageModel(name, modules)
228 pw = PackageItem(pm, x, y, noModules=self.noModules, scene=self.scene) 227 pw = PackageItem(pm, x, y, noModules=self.noModules, scene=self.scene)
229 pw.setId(self.umlView.getItemId()) 228 pw.setId(self.umlView.getItemId())
230 return pw 229 return pw
233 """ 232 """
234 Private method to generate the associations between the package shapes. 233 Private method to generate the associations between the package shapes.
235 234
236 @param shapes list of shapes 235 @param shapes list of shapes
237 """ 236 """
237 from .AssociationItem import AssociationItem, Imports
238 for package in shapes: 238 for package in shapes:
239 for rel in shapes[package][1]: 239 for rel in shapes[package][1]:
240 assoc = AssociationItem( 240 assoc = AssociationItem(
241 shapes[package][0], shapes[rel][0], 241 shapes[package][0], shapes[rel][0],
242 Imports) 242 Imports)

eric ide

mercurial