Class ThumbnailRegistryEntry

  • All Implemented Interfaces:
    org.apache.batik.ext.awt.image.spi.ErrorConstants, org.apache.batik.ext.awt.image.spi.RegistryEntry, org.apache.batik.ext.awt.image.spi.URLRegistryEntry, org.apache.batik.util.ParsedURLProtocolHandler

    public class ThumbnailRegistryEntry
    extends org.apache.batik.ext.awt.image.spi.AbstractRegistryEntry
    implements org.apache.batik.ext.awt.image.spi.URLRegistryEntry, org.apache.batik.util.ParsedURLProtocolHandler
    Access images via an internal image registry.
    Since:
    0.5.0
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int counter
      Object counter
      private static it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<java.lang.ref.SoftReference<java.awt.image.RenderedImage>> images
      The image cache.
      static java.lang.String INTERNAL_MIME_TYPE
      Mime type
      static java.lang.String INTERNAL_PREFIX
      ELKI internal thumbnail protocol prefix
      static java.lang.String INTERNAL_PROTOCOL
      ELKI internal thumbnail protocol id.
      private static Logging LOG
      The logger class.
      static float PRIORITY
      The priority of this entry.
      • Fields inherited from interface org.apache.batik.ext.awt.image.spi.ErrorConstants

        ERR_STREAM_FORMAT_UNREADABLE, ERR_STREAM_UNREADABLE, ERR_URL_FORMAT_UNREADABLE, ERR_URL_UNINTERPRETABLE, ERR_URL_UNREACHABLE, RESOURCES
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getProtocolHandled()  
      static org.apache.batik.ext.awt.image.renderable.Filter handleURL​(org.apache.batik.util.ParsedURL url)
      Statically handle the URL access.
      org.apache.batik.ext.awt.image.renderable.Filter handleURL​(org.apache.batik.util.ParsedURL url, boolean needRawData)  
      boolean isCompatibleURL​(org.apache.batik.util.ParsedURL url)  
      static boolean isCompatibleURLStatic​(org.apache.batik.util.ParsedURL url)
      Test for a compatible URL.
      org.apache.batik.util.ParsedURLData parseURL​(java.lang.String urlStr)  
      org.apache.batik.util.ParsedURLData parseURL​(org.apache.batik.util.ParsedURL basepurl, java.lang.String urlStr)  
      static int registerImage​(java.awt.image.RenderedImage img)
      Put an image into the repository (note: the repository is only keeping a weak reference!)
      • Methods inherited from class org.apache.batik.ext.awt.image.spi.AbstractRegistryEntry

        getFormatName, getMimeTypes, getPriority, getStandardExtensions
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.apache.batik.ext.awt.image.spi.RegistryEntry

        getFormatName, getMimeTypes, getPriority, getStandardExtensions
    • Field Detail

      • INTERNAL_PROTOCOL

        public static final java.lang.String INTERNAL_PROTOCOL
        ELKI internal thumbnail protocol id.
        See Also:
        Constant Field Values
      • INTERNAL_PREFIX

        public static final java.lang.String INTERNAL_PREFIX
        ELKI internal thumbnail protocol prefix
        See Also:
        Constant Field Values
      • INTERNAL_MIME_TYPE

        public static final java.lang.String INTERNAL_MIME_TYPE
        Mime type
        See Also:
        Constant Field Values
      • PRIORITY

        public static final float PRIORITY
        The priority of this entry.
        See Also:
        Constant Field Values
      • LOG

        private static final Logging LOG
        The logger class.
      • images

        private static final it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<java.lang.ref.SoftReference<java.awt.image.RenderedImage>> images
        The image cache.
      • counter

        private static int counter
        Object counter
    • Constructor Detail

      • ThumbnailRegistryEntry

        public ThumbnailRegistryEntry()
        Constructor. Note: there will usually be two instances created. One for handling the image type, one for the URL handling. This is ok.
    • Method Detail

      • registerImage

        public static int registerImage​(java.awt.image.RenderedImage img)
        Put an image into the repository (note: the repository is only keeping a weak reference!)
        Parameters:
        img - Image to put
        Returns:
        Key
      • isCompatibleURL

        public boolean isCompatibleURL​(org.apache.batik.util.ParsedURL url)
        Specified by:
        isCompatibleURL in interface org.apache.batik.ext.awt.image.spi.URLRegistryEntry
      • isCompatibleURLStatic

        public static boolean isCompatibleURLStatic​(org.apache.batik.util.ParsedURL url)
        Test for a compatible URL.
        Parameters:
        url - URL
        Returns:
        Success code
      • handleURL

        public org.apache.batik.ext.awt.image.renderable.Filter handleURL​(org.apache.batik.util.ParsedURL url,
                                                                          boolean needRawData)
        Specified by:
        handleURL in interface org.apache.batik.ext.awt.image.spi.URLRegistryEntry
      • handleURL

        public static org.apache.batik.ext.awt.image.renderable.Filter handleURL​(org.apache.batik.util.ParsedURL url)
        Statically handle the URL access.
        Parameters:
        url - URL to access
        Returns:
        Image, or null
      • parseURL

        public org.apache.batik.util.ParsedURLData parseURL​(java.lang.String urlStr)
        Specified by:
        parseURL in interface org.apache.batik.util.ParsedURLProtocolHandler
      • parseURL

        public org.apache.batik.util.ParsedURLData parseURL​(org.apache.batik.util.ParsedURL basepurl,
                                                            java.lang.String urlStr)
        Specified by:
        parseURL in interface org.apache.batik.util.ParsedURLProtocolHandler
      • getProtocolHandled

        public java.lang.String getProtocolHandled()
        Specified by:
        getProtocolHandled in interface org.apache.batik.util.ParsedURLProtocolHandler