Class ImageCacher.Embedded

java.lang.Object
org.apache.batik.svggen.ImageCacher
org.apache.batik.svggen.ImageCacher.Embedded
All Implemented Interfaces:
XMLConstants, ErrorConstants, SVGSyntax, CSSConstants, SVGConstants
Enclosing class:
ImageCacher

public static class ImageCacher.Embedded extends ImageCacher
Cache implementation for images embedded in the SVG file.
  • Constructor Details

    • Embedded

      public Embedded()
  • Method Details

    • setDOMTreeManager

      public void setDOMTreeManager(DOMTreeManager domTreeManager)
      Sets the DOMTreeManager this cacher should work on.
      Overrides:
      setDOMTreeManager in class ImageCacher
      Parameters:
      domTreeManager - the DOMTreeManager for the tree this cacher works on
    • getCacheableData

      Object getCacheableData(ByteArrayOutputStream os)
      Description copied from class: ImageCacher
      Returns an object which can be cached. Implementation must determine which information should actually be stored.
      Specified by:
      getCacheableData in class ImageCacher
      Parameters:
      os - the byte stream which is to be coerced
    • imagesMatch

      boolean imagesMatch(Object o1, Object o2)
      Description copied from class: ImageCacher
      Determines if two images are equal. Interpretation of the objects referred to by o1 and o2 is entirely implementation-dependent.
      Specified by:
      imagesMatch in class ImageCacher
      Parameters:
      o1 - object referring to one image
      o2 - object referring to the other image
    • createEntry

      ImageCacher.ImageCacheEntry createEntry(int checksum, Object data, int width, int height, SVGGeneratorContext ctx)
      Description copied from class: ImageCacher
      Creates a new entry for keeping in the cache.
      Specified by:
      createEntry in class ImageCacher
      Parameters:
      checksum - the checksum from which the hash key is derived
      data - the data to be cached
      width - image width
      height - image height
      ctx - the SVGGeneratorContext
    • addToTree

      private void addToTree(String id, String href, int width, int height, SVGGeneratorContext ctx)
      Adds a new image element to the defs section for cached images.