dishevelled.org iconbundle provides bundles of variants for icon images. The iconbundle project requires java version 1.4 or later.
IconBundle iconBundle = new SVGIconBundle(new File("text-x-generic.svg"));
A library has been created that allows static access to Tango Project icon bundles and icon sizes, taking full advantage of both the static .png icons for small sizes and the scalable .svg icons for larger sizes.
All variants of this base image, for different text directions, sizes, and states, are available from this icon bundle. An AWT or Swing component may be passed to the icon bundle to provide hints as to e.g. selection colors for the image.
JComponent label = new JLabel(); Image rtlNormal48x48 = iconBundle.getImage(label, IconTextDirection.RIGHT_TO_LEFT, IconState.NORMAL, IconSize.DEFAULT_48X48); Image ltrSelected32x32 = iconBundle.getImage(label, IconTextDirection.LEFT_TO_RIGHT, IconState.SELECTED, IconSize.DEFAULT_32X32); Image ltrMouseover16x16 = iconBundle.getImage(label, IconTextDirection.LEFT_TO_RIGHT, IconState.SELECTED, IconSize.DEFAULT_16X16);
The image above shows all possible state variants of the base image. From left to right these are: normal, active, mouseover, selected, dragging, and disabled. Filters for rendering the different variants were developed to match the look of icon styles as in Gnome GTK+.
Some implementations of IconBundle may render variants on the fly, some implementations may load variant images from files, URLs, or resources, and some may provide some combination thereof. Any implementation of IconBundle may be wrapped by a CachingIconBundle to cache images.