eric6/Graphics/UMLClassDiagramBuilder.py

changeset 8270
6ba3564b7161
parent 8257
28146736bbfc
child 8273
698ae46f40a4
child 8277
ea734702ae94
equal deleted inserted replaced
8269:87f521f359d5 8270:6ba3564b7161
198 verticalWhiteSpace = 40.0 198 verticalWhiteSpace = 40.0
199 199
200 sceneRect = self.umlView.sceneRect() 200 sceneRect = self.umlView.sceneRect()
201 width += 50.0 201 width += 50.0
202 height += 50.0 202 height += 50.0
203 swidth = width < sceneRect.width() and sceneRect.width() or width 203 swidth = sceneRect.width() if width < sceneRect.width() else width
204 sheight = height < sceneRect.height() and sceneRect.height() or height 204 sheight = sceneRect.height() if height < sceneRect.height() else height
205 self.umlView.setSceneSize(swidth, sheight) 205 self.umlView.setSceneSize(swidth, sheight)
206 206
207 # distribute each generation across the width and the 207 # distribute each generation across the width and the
208 # generations across height 208 # generations across height
209 y = 10.0 209 y = 10.0
271 """ 271 """
272 Private method to generate the associations between the class shapes. 272 Private method to generate the associations between the class shapes.
273 273
274 @param routes list of relationsships 274 @param routes list of relationsships
275 """ 275 """
276 from .AssociationItem import AssociationItem, Generalisation 276 from .AssociationItem import AssociationItem, AssociationType
277 for route in routes: 277 for route in routes:
278 if len(route) > 1: 278 if len(route) > 1:
279 assoc = AssociationItem( 279 assoc = AssociationItem(
280 self.__getCurrentShape(route[1]), 280 self.__getCurrentShape(route[1]),
281 self.__getCurrentShape(route[0]), 281 self.__getCurrentShape(route[0]),
282 Generalisation, 282 AssociationType.GENERALISATION,
283 topToBottom=True, 283 topToBottom=True,
284 colors=self.umlView.getDrawingColors()) 284 colors=self.umlView.getDrawingColors())
285 self.scene.addItem(assoc) 285 self.scene.addItem(assoc)
286 286
287 def getPersistenceData(self): 287 def getPersistenceData(self):

eric ide

mercurial