Graphics/UMLClassDiagramBuilder.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2602
affc66a603c7
parent 2992
dbdf27746da5
child 3060
5883ce99ee12
--- a/Graphics/UMLClassDiagramBuilder.py	Tue Oct 15 22:03:54 2013 +0200
+++ b/Graphics/UMLClassDiagramBuilder.py	Fri Oct 18 23:00:41 2013 +0200
@@ -33,7 +33,8 @@
         @param view reference to the view object (UMLGraphicsView)
         @param project reference to the project object (Project)
         @param file file name of a python module to be shown (string)
-        @keyparam noAttrs flag indicating, that no attributes should be shown (boolean)
+        @keyparam noAttrs flag indicating, that no attributes should be shown
+            (boolean)
         """
         super(UMLClassDiagramBuilder, self).__init__(dialog, view, project)
         self.setObjectName("UMLClassDiagramBuilder")
@@ -76,8 +77,8 @@
         try:
             extensions = Preferences.getPython("PythonExtensions") + \
                 Preferences.getPython("Python3Extensions") + ['.rb']
-            module = Utilities.ModuleParser.readModule(self.file, extensions=extensions,
-                                                       caching=False)
+            module = Utilities.ModuleParser.readModule(
+                self.file, extensions=extensions, caching=False)
         except ImportError:
             ct = QGraphicsTextItem(None)
             ct.setHtml(
@@ -143,8 +144,8 @@
             self.umlView.autoAdjustSceneSize(limit=True)
         else:
             ct = QGraphicsTextItem(None)
-            ct.setHtml(
-                self.trUtf8("The module <b>'{0}'</b> does not contain any classes.")\
+            ct.setHtml(self.trUtf8(
+                "The module <b>'{0}'</b> does not contain any classes.")
                 .format(self.file))
             self.scene.addItem(ct)
         
@@ -153,6 +154,11 @@
         Private method to arrange the shapes on the canvas.
         
         The algorithm is borrowed from Boa Constructor.
+        
+        @param nodes list of nodes to arrange
+        @param routes list of routes
+        @param whiteSpaceFactor factor to increase whitespace between
+            items (float)
         """
         from . import GraphicsUtilities
         generations = GraphicsUtilities.sort(nodes, routes)
@@ -162,7 +168,8 @@
         for generation in generations:
             sizes.append([])
             for child in generation:
-                sizes[-1].append(self.__getCurrentShape(child).sceneBoundingRect())
+                sizes[-1].append(
+                    self.__getCurrentShape(child).sceneBoundingRect())
         
         # calculate total width and total height
         width = 0
@@ -211,7 +218,8 @@
                 zip_longest(widths, heights, generations):
             x = 10.0
             # whiteSpace is the space between any two elements
-            whiteSpace = (width - currentWidth - 20) / (len(generation) - 1.0 or 2.0)
+            whiteSpace = (width - currentWidth - 20) / \
+                (len(generation) - 1.0 or 2.0)
             for className in generation:
                 cw = self.__getCurrentShape(className)
                 cw.setPos(x, y)

eric ide

mercurial