On 20 avr. 2011, at 20:45, Tudor Girba wrote:
Hi,
On 20 Apr 2011, at 20:19, Simon Denier wrote:
On 20 avr. 2011, at 17:42, laurent laffont wrote:
On Wed, Apr 20, 2011 at 5:27 PM, Tudor Girba tudor.girba@gmail.com wrote: Hi Laurent,
You are getting in the right mode :).
- Select the group of classes you want to visualize
- Right click and select Open in Mondrian Easel
- Add and generate view:
view shape rectangle height: [:each | each invokingClasses size]. view nodes: classGroup. view edgesFrom: #superclass. view treeLayout
hehe, start to look interesting ;)
But now in each rectangle (that is a class) I want a rectangle per method which height is also dependent on the number of references on the class Zork.
Then I should be able to right-click a method => browse source.
view shape rectangle height: [:each | each invokingClasses size]. view nodes: classGroup forEach: [ :cls | view shape rectangle height: [ :m | m invokingClasses size ]. view interaction item: 'browse' action: #browseSource. view nodes: cls methods ]. view edgesFrom: #superclass. view treeLayout
I think Laurent wanted only specific references to count. Here is a possible script:
| targetMethods | targetMethods := classGroup flatCollect: #methods. view interaction menu: #mooseMenu. view nodes: classGroup forEach: [:each | view shape rectangle linearFillColor: [:method | (method invokingMethods select: [:m | m belongsTo name = 'Zork']) size]
method queryIncomingInvocations opposites withinClass: (model entityNamed: 'Zork')
http://www.moosetechnology.org/docs/famix/MooseChef ;)
Just need to rewrite FAMIXMethod>>invokingMethods ^ self queryIncomingInvocations opposites
And you can do zorkClass := model entityNamed: 'Zork'. (...) method invokingMethods withinClass: zorkClass
within: targetMethods.
view interaction menu: #mooseMenu. view nodes: each methods. view gridLayout gapSize: 2]. view edgesFrom: #superclass. view treeLayout
Cheers, Doru
But soon you will discover that it's better to use other property (like a linear gradient in fill color) to distinguish some entities
Laurent.
Cheers, Doru
On 20 Apr 2011, at 17:03, laurent laffont wrote:
Hi,
In a Java project I have a class - let's call it Zork.
I want to build a visualization which show which classes and methods use the most this class (for example the bigger the square is the more the method / class uses it).
I'm sure it's possible but I'm a Moose newbie :)
How can I do it ?
Laurent Laffont - @lolgzs
Pharo Smalltalk Screencasts: http://www.pharocasts.com/ Blog: http://magaloma.blogspot.com/ Developer group: http://cara74.seasidehosting.st
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com
"No matter how many recipes we know, we still value a chef."
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- Simon Denier
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com
"Don't give to get. Just give."
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- Simon Denier