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 <akevalion(a)gmail.com> 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
.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=
[image: 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
http://objectprofile.com/examples/circle.html
Cheers,
Milton
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
www.tudorgirba.com
"Every thing has its own flow"