RTCircularTreeMapBuilder

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

RTCircularTreeMapBuilder

akevalion
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: RTCircularTreeMapBuilder

Tudor Girba-2
Great piece of work, Milton!

I wanted this one since a long time :)

Doru

On Wed, Jan 21, 2015 at 8:29 PM, milton mamani <[hidden email]> wrote:
Hi!,

I want to present you RTCircularTreeMapBuilder a variation of RTTreeMapBuilder.

For example to visualize the RTObject subclasses, type the next piece of code:

.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=
 | b | b := RTCircularTreeMapBuilder new. b shape color: Color transparent; borderWidth: 1; borderColor: Color black; if: [ :cls | cls subclasses isEmpty ] fillColor: [ :cls| (Smalltalk includesKey: (cls name, 'Test') asSymbol) ifTrue: [ Color green ] ifFalse: [ Color purple ] ]. b baseradius: 200; weight: [ :cls | cls withAllSubclasses size]. b explore: RTObject using: #subclasses. b build. ^ b view
.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=

Imágenes integradas 2
Another example in the file system.

.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=
| b dirSize |
b := RTCircularTreeMapBuilder new.
b shape
color: Color transparent;
borderWidth: 1;
borderColor: Color white;
if: [ :f | f isDirectory ] fillColor: Color transparent;
if: [ :f | f isDirectory not ] fillColor: Color white.
dirSize := nil.
dirSize := [ :file | | size |
file isDirectory 
ifTrue: [
size := 0.
file children do: [ :child | size := size + (dirSize value: child)].
size isZero ifTrue: [ 1 ] ifFalse: [ size ] ]
ifFalse: [ size := file size.
size isNumber ifTrue: [ size ] ifFalse: [ 1 ] ] ].
b
baseradius: 200;
weight: [:file | file isDirectory ifTrue: [ dirSize value: file ] ifFalse: [ file size ] ].
b explore: FileLocator home asFileReference
using: [:file | | children |
[ children := file isDirectory ifTrue: [ file children ] ifFalse: [ #() ] ]
on: Error do: [ children := #() ].
children ] .
b build.
b view canvas color: Color black.
b view
.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=

You can see the result in the next link

Cheers,
Milton

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




--

"Every thing has its own flow"

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