DVL1 dishevelled.org

Skip to: [content] [navigation]

dishevelled.org iconbundle 1.1-SNAPSHOT :: Downloads | Repository | Javadocs | Checkstyle | Test coverage | Changes

Summary

dishevelled.org iconbundle provides bundles of variants for icon images. The iconbundle project requires java version 1.4 or later.

Example

For example, consider the scalable image text-x-generic.svg from the Tango Project as a base image. An instance of IconBundle can be created from this SVG base image:

IconBundle iconBundle = new SVGIconBundle(new File("text-x-generic.svg"));
New:
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.

See:
> http://www.dishevelled.org/iconbundle-tango

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);
All possible state variants of the Tango Project text-x-generic base image.

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.

Acknowledgements

SourceForge.net Logo