Package com.openhtmltopdf.java2d
Class Java2DUserAgent
- java.lang.Object
-
- com.openhtmltopdf.swing.NaiveUserAgent
-
- com.openhtmltopdf.java2d.Java2DUserAgent
-
- All Implemented Interfaces:
DocumentListener,UserAgentCallback
public class Java2DUserAgent extends NaiveUserAgent
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openhtmltopdf.swing.NaiveUserAgent
NaiveUserAgent.DataUriFactory, NaiveUserAgent.DefaultAccessController, NaiveUserAgent.DefaultHttpStream, NaiveUserAgent.DefaultHttpStreamFactory, NaiveUserAgent.DefaultUriResolver
-
-
Field Summary
-
Fields inherited from class com.openhtmltopdf.swing.NaiveUserAgent
_accessControllers, _baseUri, _imageCache, _protocolsStreamFactory, _resolver, DEFAULT_URI_RESOLVER
-
-
Constructor Summary
Constructors Constructor Description Java2DUserAgent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImageResourcegetImageResource(String uri, ExternalResourceType type)Retrieves the image located at the given URI.-
Methods inherited from class com.openhtmltopdf.swing.NaiveUserAgent
checkAccessAllowed, clearImageCache, documentLoaded, documentStarted, extractProtocol, getBaseURL, getBinaryResource, getCSSResource, getDefaultUriResolver, getEmbeddedBase64Image, getProtocolFactory, getXMLResource, hasProtocolFactory, isVisited, onLayoutException, onRenderException, openReader, openStream, readAll, resolveUri, resolveURI, setAccessController, setBaseURL, setProtocolsStreamFactory, setUriResolver
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.openhtmltopdf.extend.UserAgentCallback
getBinaryResource, getCSSResource, getImageResource, getXMLResource
-
-
-
-
Method Detail
-
getImageResource
public ImageResource getImageResource(String uri, ExternalResourceType type)
Retrieves the image located at the given URI. It's assumed the URI does point to an image--the URI will be accessed (using the set HttpStreamFactory or URL::openStream), opened, read and then passed into the JDK image-parsing routines. The result is packed up into an ImageResource for later consumption.- Specified by:
getImageResourcein interfaceUserAgentCallback- Specified by:
getImageResourcein classNaiveUserAgent- Parameters:
uri- Location of the image source.- Returns:
- An ImageResource containing the image.
-
-