Opened 21 months ago
Last modified 14 months ago
#6797 new defect
Loading of http:// images blocks user input. It should be done in background
| Reported by: | bastiK | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Component: | Core |
| Version: | Keywords: | ||
| Cc: |
Description (last modified by bastiK)
...continued from #6137.
At the moment, we load images in EDT. When there is delay in the network, the user interface may block for some time. Instead, we should fetch the images asynchronously in a background thread.
Attachments (3)
Change History (12)
comment:1 Changed 21 months ago by bastiK
comment:2 Changed 21 months ago by bastiK
Replying to cmuelle8:
Replying to bastiK:
- First the preliminary icon is shown on the map, but when loading is finished, no repaint is done.
In MapPainter.java, function drawNodeIcon(), line
icon.paintIcon ( nc, g, [...]nc is used as a Component implementing ImageObserver. Maybe we can leverage this and use AWT functionality for asynchronous image loading, no need to write code twice.
Sure, whatever works best. No need to force it, though.
comment:3 Changed 16 months ago by bastiK
In [4822/josm]:
comment:4 Changed 16 months ago by bastiK
In [4823/josm]:
Changed 16 months ago by bastiK
comment:5 Changed 16 months ago by bastiK
- Description modified (diff)
First version. Should work, but is there a better (simpler) way to do this?
Changed 16 months ago by bastiK
comment:6 Changed 16 months ago by bastiK
Improved version.
FIXME: Text label position is not updated when the image is loaded and the final image is smaller or larger than the dummy image.
comment:7 Changed 15 months ago by bastiK
Fixed wrong label position, this should work now.
comment:8 Changed 15 months ago by bastiK
In 5054/josm:
comment:9 Changed 14 months ago by bastiK
FIXME: update disabled image cache



Replying to cmuelle8:
You are right, it can be fixed relatively easy. The name is not enough, because there can be multiple zip archives that contain icons with the same name. See MapPaintStyles.IconReference class for a full description. My point was, that the patch doesn't quite work like this, but there is more to do...