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, buildFunction=self.__buildClasses, parent=parent) |
40 UMLDialog.__init__(self, "PackageDiagram", buildFunction=self.__buildClasses, |
|
41 parent=parent) |
41 |
42 |
42 self.package = Utilities.normabspath(package) |
43 self.package = Utilities.normabspath(package) |
43 self.allClasses = {} |
44 self.allClasses = {} |
44 self.noAttrs = noAttrs |
45 self.noAttrs = noAttrs |
|
46 |
|
47 self.umlView.setPersistenceData("package={0}".format(self.package)) |
45 |
48 |
46 pname = project.getProjectName() |
49 pname = project.getProjectName() |
47 if pname: |
50 if pname: |
48 name = self.trUtf8("Package Diagram {0}: {1}").format( |
51 name = self.trUtf8("Package Diagram {0}: {1}").format( |
49 pname, project.getRelativePath(self.package)) |
52 pname, project.getRelativePath(self.package)) |
279 name = _class.name |
282 name = _class.name |
280 if isRbModule: |
283 if isRbModule: |
281 name = "{0} (Module)".format(name) |
284 name = "{0} (Module)".format(name) |
282 cl = ClassModel(name, meths[:], attrs[:]) |
285 cl = ClassModel(name, meths[:], attrs[:]) |
283 cw = ClassItem(cl, False, x, y, noAttrs=self.noAttrs, scene=self.scene) |
286 cw = ClassItem(cl, False, x, y, noAttrs=self.noAttrs, scene=self.scene) |
|
287 cw.setId(self.umlView.getItemId()) |
284 self.allClasses[className] = cw |
288 self.allClasses[className] = cw |
285 |
289 |
286 def __addExternalClass(self, _class, x, y): |
290 def __addExternalClass(self, _class, x, y): |
287 """ |
291 """ |
288 Private method to add a class defined outside the module. |
292 Private method to add a class defined outside the module. |
294 @param x x-coordinate (float) |
298 @param x x-coordinate (float) |
295 @param y y-coordinate (float) |
299 @param y y-coordinate (float) |
296 """ |
300 """ |
297 cl = ClassModel(_class) |
301 cl = ClassModel(_class) |
298 cw = ClassItem(cl, True, x, y, noAttrs=self.noAttrs, scene=self.scene) |
302 cw = ClassItem(cl, True, x, y, noAttrs=self.noAttrs, scene=self.scene) |
|
303 cw.setId(self.umlView.getItemId()) |
299 self.allClasses[_class] = cw |
304 self.allClasses[_class] = cw |
300 |
305 |
301 def __createAssociations(self, routes): |
306 def __createAssociations(self, routes): |
302 """ |
307 """ |
303 Private method to generate the associations between the class shapes. |
308 Private method to generate the associations between the class shapes. |