Graphics/PackageDiagramBuilder.py

changeset 3035
36e9f388958b
parent 3034
7ce719013078
child 3060
5883ce99ee12
child 3071
83d066710d60
equal deleted inserted replaced
3034:7ce719013078 3035:36e9f388958b
203 if not modules: 203 if not modules:
204 ct = QGraphicsTextItem(None, self.scene) 204 ct = QGraphicsTextItem(None, self.scene)
205 ct.setHtml( 205 ct.setHtml(
206 self.trUtf8( 206 self.trUtf8(
207 "The package <b>'{0}'</b> does not contain any modules.") 207 "The package <b>'{0}'</b> does not contain any modules.")
208 .format(self.package)) 208 .format(self.package))
209 return 209 return
210 210
211 # step 1: build all classes found in the modules 211 # step 1: build all classes found in the modules
212 classesFound = False 212 classesFound = False
213 213
219 if not classesFound: 219 if not classesFound:
220 ct = QGraphicsTextItem(None, self.scene) 220 ct = QGraphicsTextItem(None, self.scene)
221 ct.setHtml( 221 ct.setHtml(
222 self.trUtf8( 222 self.trUtf8(
223 "The package <b>'{0}'</b> does not contain any classes.") 223 "The package <b>'{0}'</b> does not contain any classes.")
224 .format(self.package)) 224 .format(self.package))
225 return 225 return
226 226
227 # step 2: build the class hierarchies 227 # step 2: build the class hierarchies
228 routes = [] 228 routes = []
229 nodes = [] 229 nodes = []
242 if cw and cw.noAttrs != self.noAttrs: 242 if cw and cw.noAttrs != self.noAttrs:
243 cw = None 243 cw = None
244 if cw and not (cw.external and 244 if cw and not (cw.external and
245 (className in module.classes or 245 (className in module.classes or
246 className in module.modules) 246 className in module.modules)
247 ): 247 ):
248 if className not in nodes: 248 if className not in nodes:
249 nodes.append(className) 249 nodes.append(className)
250 else: 250 else:
251 if className in module.classes: 251 if className in module.classes:
252 # this is a local class (defined in this module) 252 # this is a local class (defined in this module)
421 """ 421 """
422 from .AssociationItem import AssociationItem, Generalisation 422 from .AssociationItem import AssociationItem, Generalisation
423 for route in routes: 423 for route in routes:
424 if len(route) > 1: 424 if len(route) > 1:
425 assoc = AssociationItem( 425 assoc = AssociationItem(
426 self.__getCurrentShape(route[1]), 426 self.__getCurrentShape(route[1]),
427 self.__getCurrentShape(route[0]), 427 self.__getCurrentShape(route[0]),
428 Generalisation, 428 Generalisation,
429 topToBottom=True) 429 topToBottom=True)
430 self.scene.addItem(assoc) 430 self.scene.addItem(assoc)
431 431
432 def getPersistenceData(self): 432 def getPersistenceData(self):
433 """ 433 """
434 Public method to get a string for data to be persisted. 434 Public method to get a string for data to be persisted.

eric ide

mercurial