TableView API, no lazy retrieval of visible cell content possible?
lehmann at media-interactive.de
Wed Jan 28 12:59:57 UTC 2015
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
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.
On 28.01.2015 09:30, Robert Krüger wrote:
> Doesn't help. The patterns of this property being changed are just as
> unusable for my purposes as with the other approaches (e.g. I can clearly
> see that item is set to a different value for a cell that is still visible,
More information about the openjfx-dev