Dear all,
I'm trying to use Moose but I didn't found documentation about the scription in Easel. I try to get a map of all classes of my project with the call links. If a method of a class call to an other method of an other class I would like to have an edge between the two classes.
Can someone help me ? Here is the code I currently have: view nodes: classGroup using: (RectangleShape withBorder height: #numberOfMethods; width: #numberOfAttributes; linearFillColor: #numberOfLinesOfCode within: classGroup). view edges: classGroup from: #yourself toAll: #directSubclasses. view treeLayout.
Thanks in advance,
Antoine C.
On 1 mai 09, at 21:32, Antoine Cailliau wrote:
Dear all,
I'm trying to use Moose but I didn't found documentation about the scription in Easel. I try to get a map of all classes of my project with the call links. If a method of a class call to an other method of an other class I would like to have an edge between the two classes.
Can someone help me ? Here is the code I currently have: view nodes: classGroup using: (RectangleShape withBorder height: #numberOfMethods; width: #numberOfAttributes; linearFillColor: #numberOfLinesOfCode within: classGroup). view edges: classGroup from: #yourself toAll: #directSubclasses. view treeLayout.
Hi Antoine
It's pretty simple if you have the right packages already loaded
Just replace directSubclasses with referencedClasses and you will be done. If #referencedClasses is unknown, you need to load the Cook bundle from the SCG store (for VW) or the Moose-Cook package from squeaksource/Moose (for Pharo)
view nodes: elements using: (MORectangleShape withBorder height: #numberOfMethods; width: #numberOfAttributes; linearFillColor: #numberOfLinesOfCode within: elements). view edges: elements from: #yourself toAll: #referencedClasses. view treeLayout.
If you want both the inheritance and the calls, a basic way would be:
view nodes: elements using: (MORectangleShape withBorder height: #numberOfMethods; width: #numberOfAttributes; linearFillColor: #numberOfLinesOfCode within: elements). view shape: MOArrowedOrthoVerticalLineShape new. view edges: elements from: #yourself toAll: #directSubclasses. view shape: (MOArrowedLineShape new color: Color red); yourself. view edges: elements from: #yourself toAll: #referencedClasses. view treeLayout.
More stuff is possible with nested nodes.
-- Simon
Hi Antoine,
Simon suggested a good script. I would like something in it that you may find interesting.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | inhEdges | view nodes: elements using: (MORectangleShape withBorder height: #numberOfMethods; width: #numberOfAttributes; linearFillColor: #numberOfLinesOfCode within: elements).
view shape: MOArrowedOrthoVerticalLineShape new.
inhEdges := view edges: elements from: #yourself toAll: #directSubclasses.
view shape: (MOArrowedLineShape new color: Color red); yourself.
view edges: elements from: #yourself toAll: #referencedClasses.
view treeLayout userDefinedEdges: inhEdges. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The userDefinedEdges: takes in parameters the list of edges you want to see the layout driven by. I guess you want the tree layout to exhibit the inheritance link.
Cheers, Alexandre
On 1 May 2009, at 22:49, Simon Denier wrote:
On 1 mai 09, at 21:32, Antoine Cailliau wrote:
Dear all,
I'm trying to use Moose but I didn't found documentation about the scription in Easel. I try to get a map of all classes of my project with the call links. If a method of a class call to an other method of an other class I would like to have an edge between the two classes.
Can someone help me ? Here is the code I currently have: view nodes: classGroup using: (RectangleShape withBorder height: #numberOfMethods; width: #numberOfAttributes; linearFillColor: #numberOfLinesOfCode within: classGroup). view edges: classGroup from: #yourself toAll: #directSubclasses. view treeLayout.
Hi Antoine
It's pretty simple if you have the right packages already loaded
Just replace directSubclasses with referencedClasses and you will be done. If #referencedClasses is unknown, you need to load the Cook bundle from the SCG store (for VW) or the Moose-Cook package from squeaksource/Moose (for Pharo)
view nodes: elements using: (MORectangleShape withBorder height: #numberOfMethods; width: #numberOfAttributes; linearFillColor: #numberOfLinesOfCode within: elements). view edges: elements from: #yourself toAll: #referencedClasses. view treeLayout.
If you want both the inheritance and the calls, a basic way would be:
view nodes: elements using: (MORectangleShape withBorder height: #numberOfMethods; width: #numberOfAttributes; linearFillColor: #numberOfLinesOfCode within: elements). view shape: MOArrowedOrthoVerticalLineShape new. view edges: elements from: #yourself toAll: #directSubclasses. view shape: (MOArrowedLineShape new color: Color red); yourself. view edges: elements from: #yourself toAll: #referencedClasses. view treeLayout.
More stuff is possible with nested nodes.
-- Simon
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Hi,
Thanks for your answers, it was exactly what I was looking for. I didn't know the Cook bundle.
You were right, it is from far more interessting with the nested nodes.
Regards,
Antoine C.
On Sat, May 02, 2009 at 08:58:49AM +0200, Alexandre Bergel wrote:
Hi Antoine,
Simon suggested a good script. I would like something in it that you may find interesting.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | inhEdges | view nodes: elements using: (MORectangleShape withBorder height: #numberOfMethods; width: #numberOfAttributes; linearFillColor: #numberOfLinesOfCode within: elements).
view shape: MOArrowedOrthoVerticalLineShape new.
inhEdges := view edges: elements from: #yourself toAll: #directSubclasses.
view shape: (MOArrowedLineShape new color: Color red); yourself.
view edges: elements from: #yourself toAll: #referencedClasses.
view treeLayout userDefinedEdges: inhEdges.
The userDefinedEdges: takes in parameters the list of edges you want to see the layout driven by. I guess you want the tree layout to exhibit the inheritance link.
Cheers, Alexandre
On 1 May 2009, at 22:49, Simon Denier wrote:
On 1 mai 09, at 21:32, Antoine Cailliau wrote:
Dear all,
I'm trying to use Moose but I didn't found documentation about the scription in Easel. I try to get a map of all classes of my project with the call links. If a method of a class call to an other method of an other class I would like to have an edge between the two classes.
Can someone help me ? Here is the code I currently have: view nodes: classGroup using: (RectangleShape withBorder height: #numberOfMethods; width: #numberOfAttributes; linearFillColor: #numberOfLinesOfCode within: classGroup). view edges: classGroup from: #yourself toAll: #directSubclasses. view treeLayout.
Hi Antoine
It's pretty simple if you have the right packages already loaded
Just replace directSubclasses with referencedClasses and you will be done. If #referencedClasses is unknown, you need to load the Cook bundle from the SCG store (for VW) or the Moose-Cook package from squeaksource/Moose (for Pharo)
view nodes: elements using: (MORectangleShape withBorder height: #numberOfMethods; width: #numberOfAttributes; linearFillColor: #numberOfLinesOfCode within: elements). view edges: elements from: #yourself toAll: #referencedClasses. view treeLayout.
If you want both the inheritance and the calls, a basic way would be:
view nodes: elements using: (MORectangleShape withBorder height: #numberOfMethods; width: #numberOfAttributes; linearFillColor: #numberOfLinesOfCode within: elements). view shape: MOArrowedOrthoVerticalLineShape new. view edges: elements from: #yourself toAll: #directSubclasses. view shape: (MOArrowedLineShape new color: Color red); yourself. view edges: elements from: #yourself toAll: #referencedClasses. view treeLayout.
More stuff is possible with nested nodes.
-- Simon
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Hi,
inhEdges := view edges: elements from: #yourself toAll: #directSubclasses.
This returns the viewRenderer. I modified the methods for
edges: collection from: parentBlock toAll: childBlock | tempShape tempCollection | tempShape := self edgeShape. tempCollection := collection collect: [:each | self edges: (childBlock mondrianValue: each) from: [:x | parentBlock value: each] to: #yourself using: tempShape ]. self resetDefaults. ^ tempCollection.
Hi Antoine,
Thanks for the bug report.
Indeed, there should be a returned placeholder, but your solution returns a collection of placeholders. I will try to look into this.
Just a note. You define the inheritance edges as: inhEdges := view edges: elements from: #yourself toAll: #directSubclasses.
But, if you are in a single inheritance world, you could traverse it as: inhEdges := view edges: elements from: #superclass to: #yourself.
Cheers, Doru
On 2 May 2009, at 13:58, Antoine Cailliau wrote:
Hi,
inhEdges := view edges: elements from: #yourself toAll: #directSubclasses.
This returns the viewRenderer. I modified the methods for
edges: collection from: parentBlock toAll: childBlock | tempShape tempCollection | tempShape := self edgeShape. tempCollection := collection collect: [:each | self edges: (childBlock mondrianValue: each) from: [:x | parentBlock value: each] to: #yourself using: tempShape ]. self resetDefaults. ^ tempCollection. _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com
"Beauty is where we see it."