Clever! I'll be waiting for your idea on how to
bring interaction back... I
imagine something like coordinates on the bitmap to get the back elements as
object again... Anyway surely will be an interesting solution, like this
one.
Cheers,
Offray
El 18/03/15 a las 08:03, Alexandre Bergel escribió:
Hi!
Just to share our latest feature.
We have implemented a simple mechanism in Roassal to prevent the
environment to
be sluggish with many elements.
The class RTCache has the effect to remove the elements from a view,
create a
bitmap from them, and add the bitmap to the view. Simple and effective.
Consider the following script:
-=-=—=-=-=—=-=-=—=-=-=—=-=-=—=
v := RTView new.
v @ RTDraggableView.
colors := ColorPalette qualitative colors: 8 scheme:'Set1'.
elements := (RTEllipse new color: [ :aValue | colors atRandom alpha: 0.01
];
size: #yourself) elementsOn: ((1 to: 500000) collect: [ :vv | 10 atRandom
+ 5 ]).
elements do: [ :e | e translateTo: 500 atRandom @ 500 atRandom ].
v addAll: elements.
RTCache new cacheView: v.
v
-=-=—=-=-=—=-=-=—=-=-=—=-=-=—=
Without the line "RTCache new cacheView: v.” Pharo would be completely
unresponsive. 500 000 elements is quite a lot.
The drawback is that all interaction with the elements are lost. I have
some
idea on how to add them back. We will work on this in future work.
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________
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