@@ -148,13 +148,17 @@ ClassView.prototype.render = function (data) {
148
148
}
149
149
150
150
joint . layout . DirectedGraph . layout ( this . graph , {
151
- setLinkVertices : false ,
151
+ setLinkVertices : true ,
152
152
nodeSep : 100 ,
153
153
rankSep : 100
154
154
} ) ;
155
155
156
156
this . updateSizes ( ) ;
157
157
158
+ for ( var i in this . links ) {
159
+ this . paper . findViewByModel ( this . links [ i ] ) . update ( ) ;
160
+ }
161
+
158
162
var bb = this . paper . getContentBBox ( ) , q = this . paper ;
159
163
this . paper . setOrigin (
160
164
q . options . width / 2 - bb . width / 2 ,
@@ -302,71 +306,4 @@ ClassView.prototype.init = function () {
302
306
self . zoom ( null ) ;
303
307
} ) ;
304
308
305
- //var classes = {
306
- //
307
- // mammal: new uml.Interface({
308
- // position: { x:300 , y: 50 },
309
- // size: { width: 240, height: 100 },
310
- // name: 'Mammal',
311
- // attributes: ['dob: Date'],
312
- // methods: ['+ setDateOfBirth(dob: Date): Void','+ getAgeAsDays(): Numeric']
313
- // }),
314
- //
315
- // person: new uml.Abstract({
316
- // position: { x:300 , y: 300 },
317
- // size: { width: 240, height: 100 },
318
- // name: 'Person',
319
- // attributes: ['firstName: String','lastName: String'],
320
- // methods: ['+ setName(first: String, last: String): Void','+ getName(): String']
321
- // }),
322
- //
323
- // bloodgroup: new uml.Class({
324
- // position: { x:20 , y: 190 },
325
- // size: { width: 220, height: 100 },
326
- // name: 'BloodGroup',
327
- // attributes: ['bloodGroup: String'],
328
- // methods: ['+ isCompatible(bG: String): Boolean']
329
- // }),
330
- //
331
- // address: new uml.Class({
332
- // position: { x:630 , y: 190 },
333
- // size: { width: 160, height: 100 },
334
- // name: 'Address',
335
- // attributes: ['houseNumber: Integer','streetName: String','town: String','postcode: String'],
336
- // methods: []
337
- // }),
338
- //
339
- // man: new uml.Class({
340
- // position: { x:200 , y: 500 },
341
- // size: { width: 180, height: 50 },
342
- // name: 'Man'
343
- // }),
344
- //
345
- // woman: new uml.Class({
346
- // position: { x:450 , y: 500 },
347
- // size: { width: 180, height: 50 },
348
- // name: 'Woman',
349
- // methods: ['+ giveABrith(): Person []']
350
- // })
351
- //
352
- //
353
- //};
354
- //
355
- //_.each(classes, function(c) { graph.addCell(c); });
356
- //
357
- //var relations = [
358
- // new uml.Generalization({
359
- // source: { id: classes.man.id },
360
- // target: { id: classes.person.id },
361
- // router: { name: 'manhattan' },
362
- // connector: { name: 'rounded' }
363
- // }),
364
- // new uml.Generalization({ source: { id: classes.woman.id }, target: { id: classes.person.id }}),
365
- // new uml.Implementation({ source: { id: classes.person.id }, target: { id: classes.mammal.id }}),
366
- // new uml.Aggregation({ source: { id: classes.person.id }, target: { id: classes.address.id }}),
367
- // new uml.Composition({ source: { id: classes.person.id }, target: { id: classes.bloodgroup.id }})
368
- //];
369
- //
370
- //_.each(relations, function(r) { graph.addCell(r); });
371
-
372
309
} ;
0 commit comments