flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cristian Spiescu <cristian.spie...@gmail.com>
Subject Re: Container with absolute layout + virtual layout optimization
Date Wed, 29 May 2013 17:05:46 GMT
I'm using Flex 4 containers. I have looked at the pieces of code you are 
mentioning. I think that my case is simpler, because I have the 
following constraint: the x, y, width, height that are stored in the 
model element can be queried (via an interface) by the visual container. 
I.e. the visual container knows immediately these values, so it executes 
the mechanism that I described.

The existing virtualized containers, from what I understood, have a 
sophisticated mechanism of finding and caching the right sizes (which in 
my case is not necessary).

On 29.05.2013 19:33, Alex Harui wrote:
> Are you using Flex 4 containers or Flex 3 containers?  For Flex 4
> containers, it might be best to customize a Layout and borrow
> virtualization code from the other Layout classes
>
> On 5/29/13 9:26 AM, "Cristian Spiescu" <cristian.spiescu@gmail.com> wrote:
>
>> Hello!
>>
>> I have a container that renders data, with renderers positioned
>> absolutely (i.e. a diagram). The optimization need is basically the same
>> as with any other container: recycling renderers.
>>
>> My approach is the following: on every updateDisplayList(), I scan the
>> list of model elements, to see
>> * what are the models that are in the current viewable area (according
>> to the scroll bar positions); among them there are
>>    ** A) model elements that have a renderer and
>>    ** B) model elements that haven't got a renderer (e.g. he have just
>> scrolled in that area)
>> * what are the model elements that are not in the viewable area C)
>>
>> Then I reuse the renderers C, for the model elements B (i.e. they only
>> change the position). Of course, new renderers may be added, if the ones
>> that already exist (C) are not enough.
>>
>> My problem is that scrolling (on mobile and even on the web version) is
>> not very smooth. Have you got any hints regarding:
>> * Is "updateDisplayList()" the correct place to do this kind of
>> processing?
>> * I guess that the fastest way to reuse a renderer is to change its
>> position, right? Removing it or adding it to the parent: are operations
>> that are more expensive, right?
>> * Are there any other similar mechanisms which I could reuse our inspire
>> from?
>>
>> Thank you in advance.
>> Best regards,
>> Cristian.


Mime
View raw message