Fwd: TableView API, no lazy retrieval of visible cell content possible?
krueger at lesspain.de
Wed Jan 28 14:57:47 UTC 2015
forgot again to reply to all. If anyone ever considers changing the default
settings of the list server, +1 from me.
---------- Forwarded message ----------
From: Robert Krüger <krueger at lesspain.de>
Date: Wed, Jan 28, 2015 at 3:47 PM
Subject: Re: TableView API, no lazy retrieval of visible cell content
To: Werner Lehmann <lehmann at media-interactive.de>
On Wed, Jan 28, 2015 at 3:13 PM, Robert Krüger <krueger at lesspain.de> wrote:
> On Wed, Jan 28, 2015 at 1:59 PM, Werner Lehmann <
> lehmann at media-interactive.de> wrote:
>> I think Tomas is right, load your thumbnails on demand when updateItem is
>> called for an item with missing thumbnail. You say that the cell of a
>> visible item gets reused for another item. If that is the case I guess that
>> the item is "moved" to another cell. Wouldn't it be possible to have an
>> image property on your items and the lazy loading is done on the item,
>> triggered when the item is passed to updateItem of any cell? That
> That is exactly what I have implemented but the problem is as described
> - Too many non-visible images are loaded (I could probably live with that
> for a while)
> - I have yet to find a criterion to decide an image is no longer needed
> and thus its loading job needs to be removed from the job stack (see below)
>> should trigger the demand-loading and it would be robust against the
>> tableview exchanging cells for individual items.
> As to the question when to start or stop lazy loading for items, I would
>> add the load-demands to a stack. Each time the image for a new item is
>> requested it is put to the top of the stack and you have one or more
>> threads processing items on the stack (LIFO). An an image is requested
>> which is already on the stack move it to the top of the stack. If an item
>> is removed from a cell remove it from the stack. That should do it.
> That's what I am doing already.
To clarify: I am using the stack approach you describe and I remove it from
the stack when updateItem for a table cell is called that already has a
different item set. Then I remove the already set item from the stack but
that never seems to happen in my example.
Lesspain GmbH & Co. KG
More information about the openjfx-dev