public class DelegatingUserAgent extends NaiveUserAgent
NaiveUserAgent.DefaultHttpStream, NaiveUserAgent.DefaultHttpStreamFactory, NaiveUserAgent.DefaultUriResolver, NaiveUserAgent.NullCache<T>, NaiveUserAgent.NullFSCache_baseUri, _byteCache, _externalCache, _imageCache, _protocolsStreamFactory, _resolver, _textCache, DEFAULT_URI_RESOLVER| Constructor and Description |
|---|
DelegatingUserAgent()
Creates a new instance of NaiveUserAgent with a max image cache of 16 images.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearImageCache()
Empties the image cache entirely.
|
void |
documentLoaded()
Indicates document layout has complete, e.g.
|
void |
documentStarted()
Indicates document has been requested (e.g.
|
String |
getBaseURL()
Returns the current baseUrl for this class.
|
ImageResource |
getImageResource(String uri)
Retrieves the image located at the given URI.
|
void |
onLayoutException(Throwable t)
Called when document layout failed with an exception.
|
void |
onRenderException(Throwable t)
Called when document render failed with an exception.
|
String |
resolveURI(String uri)
Resolves the URI; if absolute, leaves as is, if relative, returns an absolute URI based on the baseUrl for
the agent.
|
void |
setBaseURL(String uri)
URL relative to which URIs are resolved.
|
void |
setImageResourceLoader(ImageResourceLoader loader) |
void |
setRepaintListener(RepaintListener listener) |
void |
shrinkImageCache()
If the image cache has more items than the limit specified for this class, the least-recently used will
be dropped from cache until it reaches the desired size.
|
getBinaryResource, getCacheReader, getCacheStream, getCacheText, getCSSResource, getDefaultUriResolver, getProtocolFactory, getXMLResource, hasProtocolFactory, isVisited, openReader, openStream, readAll, resolveUri, setExternalByteCache, setExternalCache, setExternalTextCache, setProtocolsStreamFactory, setUriResolverpublic DelegatingUserAgent()
public void setImageResourceLoader(ImageResourceLoader loader)
public void shrinkImageCache()
public void clearImageCache()
clearImageCache in class NaiveUserAgentpublic ImageResource getImageResource(String uri)
getImageResource in interface UserAgentCallbackgetImageResource in class NaiveUserAgenturi - Location of the image source.public void setBaseURL(String uri)
setBaseURL in interface UserAgentCallbacksetBaseURL in class NaiveUserAgenturi - A URI which anchors other, possibly relative URIs.public String resolveURI(String uri)
resolveURI in interface UserAgentCallbackresolveURI in class NaiveUserAgenturi - A URI, possibly relative.public String getBaseURL()
getBaseURL in interface UserAgentCallbackgetBaseURL in class NaiveUserAgentpublic void documentStarted()
DocumentListenerdocumentStarted in interface DocumentListenerdocumentStarted in class NaiveUserAgentpublic void documentLoaded()
DocumentListenerdocumentLoaded in interface DocumentListenerdocumentLoaded in class NaiveUserAgentpublic void onLayoutException(Throwable t)
DocumentListenerThrowable objects thrown (except for
ThreadDeath) during layout and not otherwise handled will
be provided to this method. If a DocumentListener has been
defined an XHTML panel, the listener is entirely responsible for
handling the exception. No other action will be taken.onLayoutException in interface DocumentListeneronLayoutException in class NaiveUserAgentpublic void onRenderException(Throwable t)
DocumentListenerThrowable objects thrown (except for
ThreadDeath) during render and not otherwise handled will
be provided to this method. If a DocumentListener has been
defined an XHTML panel, the listener is entirely responsible for
handling the exception. No other action will be taken.onRenderException in interface DocumentListeneronRenderException in class NaiveUserAgentpublic void setRepaintListener(RepaintListener listener)
Copyright © 2018. All rights reserved.