Laurent
Cheers,
Doru
On 21 Apr 2011, at 09:34, laurent laffont wrote:
Thanks for your help but I'm a little lost
:)
I think I should rephrase my needs.
I have the class Bibacarte (this name is real). I open the Moose Code Browser, select
this class, right-click Open in Mondrian Easel.
So now I have Mondrian opened on class->Bibacarte.
class class => FAMIXClass
class asString => 'Bibacarte in net::sa::afi::home (Type)'
class queryAllIncomingInvocations a MooseIncomingQueryResult(creerAbonne ->
#Bibacarte() (Invocation) compare -> #getId() (Invocation) chargerCarte -> #getId()
(Invocation) controlerCodeBarre -> #getId() (Invocation) getHistoCarte -> #getId()
(Invocation) equals -> #getId() (Invocation) .......
class queryAllIncomingInvocations size => 103
It seems #queryAllIncomingInvocations is the right method that returns all methods that
reference Bibacarte
I want to group all these invocations per class, and in the visualization the higher the
number of invocations is, the bigger is the rectangle.
In the class rectangle I want to see the methods that invoke a method on Bibacarte (a
rectangle by method - I don't want to see methods that don't invoke a method on
Bibacarte). Now the more a method invoke a Bibacarte method, the bigger (or darker) the
rectangle is.
I'm searching / learning in Moose but that's not a tiny platform :)
Laurent.
On Wed, Apr 20, 2011 at 11:49 PM, Simon Denier <simon.denier(a)gmail.com> wrote:
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(a)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(a)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(a)iam.unibe.ch
>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> _______________________________________________
> Moose-dev mailing list
> Moose-dev(a)iam.unibe.ch
>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
Simon Denier
_______________________________________________
Moose-dev mailing list
Moose-dev(a)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(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
Simon Denier
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
"Reasonable is what we are accustomed with."
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch