Package elki.visualization.batikutil
Class ThumbnailRegistryEntry
- java.lang.Object
-
- org.apache.batik.ext.awt.image.spi.AbstractRegistryEntry
-
- elki.visualization.batikutil.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ThumbnailRegistryEntry.InternalParsedURLData
URL representation for internal URLs.
-
Field Summary
Fields Modifier and Type Field Description private static int
counter
Object counterprivate 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 typestatic java.lang.String
INTERNAL_PREFIX
ELKI internal thumbnail protocol prefixstatic 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.
-
Constructor Summary
Constructors Constructor Description ThumbnailRegistryEntry()
Constructor.
-
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
-
-
-
-
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
-
-
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 interfaceorg.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 interfaceorg.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 interfaceorg.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 interfaceorg.apache.batik.util.ParsedURLProtocolHandler
-
getProtocolHandled
public java.lang.String getProtocolHandled()
- Specified by:
getProtocolHandled
in interfaceorg.apache.batik.util.ParsedURLProtocolHandler
-
-