IlvDiagrammer does not refresh after I update my icon files

Article ID: 2328
Last updated: 29 May, 2018
Article ID: 2328
Last updated: 29 May, 2018
Revision: 3
Views: 679
Posted: 18 Jun, 2010
by Dean J.
Updated: 29 May, 2018
by Gargani A.

Question

Why does IlvDiagrammer not refresh after I update my icon files?

Answer

In an IlvDiagrammer, you can have many nodes with their own icons. These icons can be loaded from files that contain bitmap or SVG information.

Although it is possible to modify and update the underlying files at runtime, the icons in the application might not update. This is because some caching occurs at the lower levels.

For bitmaps, the underlying IlvIcon relies on an Image which implements some caching. You can retrieve the Image with the IlvIcon.getImage() method, then use the Image.clearCache() method to clear its cache.

For SVG files, the underlying IlvURLGraphic also caches the image. JViews 8.0 introduces the IlvURLGraphic.flush() method to clear this cache. Users of earlier versions may have to move to bitmaps (and follow the pattern above), or move to a different design pattern (described below).

As an alternative, you may avoid this type of updating. Instead of modifying existing icon files, consider saving the new icon with a separate and unique filename, then adjusting the CSS to refer to the new icon's filename. This avoids the caching of the icons and allows new images to be reliably displayed.

  • To avoid updating the CSS, you can have the icon location refer to a model property, and then change the model property (to the new icon filename) at runtime. For details, see the Using CSS Syntax in the Style Sheet chapter in the "Developing with the SDK" manual of JViews Diagrammer.
This article was:   Helpful | Not helpful
Report an issue
Article ID: 2328
Last updated: 29 May, 2018
Revision: 3
Views: 679
Posted: 18 Jun, 2010 by Dean J.
Updated: 29 May, 2018 by Gargani A.
Also listed in


Others in this category