Glamour Roassal edgesFrom in nested layout (4.8)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Glamour Roassal edgesFrom in nested layout (4.8)

Stephan Eggermont-3
Hi,

I am trying  to get the edges to superclass to cross the package boundary.
Could be related to Issue 845

Cheers,
  Stephan

                a roassal
                        title: 'Complexity';
                        painting: [:view|
                                | packages classes allClasses |
                                packages := RPackageOrganizer default packages select: [ :p | p packageName beginsWith: 'Inno-'  ].
                                allClasses := IdentitySet new.
                                packages do: [ :package  | allClasses addAll: package classes ].
                                view shape rectangle.
                                view nodes: packages forEach: [ :aPackage |
                                        view interaction action: #browse.
                                        view shape rectangle
                                                width: [:cls | cls instVarNames size * 3];
                                                height: [:cls | cls methods size ];
                                                fillColor: (RONColorLinearNormalizer
                                                        inContext: (allClasses)
                                                        withCommand:  [:cls | cls methods inject: 0 into: [:sum :el | sum + el getSource lineCount]]
                                                        lowColor: Color green  highColor: Color red).
                                        view nodes: aPackage classes.
                                        view edgesFrom: #superclass.
                                        view treeLayout ].
                                 view gridLayout ]


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

PastedGraphic-2.png (17K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Glamour Roassal edgesFrom in nested layout (4.8)

Tudor Girba-2
There are two ways, but the currently supported way is to define the edges outside of the forEach: block.

| packages classes allClasses |
                                packages := RPackageOrganizer default packages select: [ :p | p packageName beginsWith: 'GT-'  ].
                                allClasses := IdentitySet new.
                                packages do: [ :package  | allClasses addAll: package classes ].
                                view shape rectangle.
                                view nodes: packages forEach: [ :aPackage |
                                        view interaction action: #browse.
                                        view shape rectangle
                                                width: [:cls | cls instVarNames size * 3];
                                                height: [:cls | cls methods size ];
                                                fillColor: (RONColorLinearNormalizer
                                                        inContext: (allClasses)
                                                        withCommand:  [:cls | cls methods inject: 0 into: [:sum :el | sum + el getSource lineCount]]
                                                        lowColor: Color green  highColor: Color red).
                                        view nodes: aPackage classes.
                                       
                                        view treeLayout ].

          view edges:allClasses from: #superclass to: #yourself.

                                view gridLayout

Cheers,
Doru


On Mar 22, 2013, at 6:15 PM, Stephan Eggermont <[hidden email]> wrote:

> Hi,
>
> I am trying  to get the edges to superclass to cross the package boundary.
> Could be related to Issue 845
>
> Cheers,
>  Stephan
>
> a roassal
> title: 'Complexity';
> painting: [:view|
> | packages classes allClasses |
> packages := RPackageOrganizer default packages select: [ :p | p packageName beginsWith: 'Inno-'  ].
> allClasses := IdentitySet new.
> packages do: [ :package  | allClasses addAll: package classes ].
> view shape rectangle.
> view nodes: packages forEach: [ :aPackage |
> view interaction action: #browse.
> view shape rectangle
> width: [:cls | cls instVarNames size * 3];
> height: [:cls | cls methods size ];
> fillColor: (RONColorLinearNormalizer
> inContext: (allClasses)
> withCommand:  [:cls | cls methods inject: 0 into: [:sum :el | sum + el getSource lineCount]]
> lowColor: Color green  highColor: Color red).
> view nodes: aPackage classes.
> view edgesFrom: #superclass.
> view treeLayout ].
> view gridLayout ]
>
> <PastedGraphic-2.png>_______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"Every successful trip needs a suitable vehicle."





_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev