Class DelegatingUserAgent

    • Constructor Detail

      • DelegatingUserAgent

        public DelegatingUserAgent()
        Creates a new instance of NaiveUserAgent with a max image cache of 16 images.
    • Method Detail

      • shrinkImageCache

        public 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.
      • getImageResource

        public ImageResource getImageResource​(String uri)
        Retrieves the image located at the given URI. It's assumed the URI does point to an image--the URI will be accessed (using java.io or java.net), opened, read and then passed into the JDK image-parsing routines. The result is packed up into an ImageResource for later consumption.
        Specified by:
        getImageResource in interface UserAgentCallback
        Overrides:
        getImageResource in class NaiveUserAgent
        Parameters:
        uri - Location of the image source.
        Returns:
        An ImageResource containing the image.
      • resolveURI

        public 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.
        Specified by:
        resolveURI in interface UserAgentCallback
        Overrides:
        resolveURI in class NaiveUserAgent
        Parameters:
        uri - A URI, possibly relative.
        Returns:
        A URI as String, resolved, or null if there was an exception (for example if the URI is malformed).
      • documentLoaded

        public void documentLoaded()
        Description copied from interface: DocumentListener
        Indicates document layout has complete, e.g. document is fully "loaded" for display; this is not a callback for the document source (e.g. XML) being loaded. This method will be called on every layout run (including, for example, after panel resizes).
        Specified by:
        documentLoaded in interface DocumentListener
        Overrides:
        documentLoaded in class NaiveUserAgent
      • onLayoutException

        public void onLayoutException​(Throwable t)
        Description copied from interface: DocumentListener
        Called when document layout failed with an exception. All Throwable 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.
        Specified by:
        onLayoutException in interface DocumentListener
        Overrides:
        onLayoutException in class NaiveUserAgent
      • onRenderException

        public void onRenderException​(Throwable t)
        Description copied from interface: DocumentListener
        Called when document render failed with an exception. All Throwable 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.
        Specified by:
        onRenderException in interface DocumentListener
        Overrides:
        onRenderException in class NaiveUserAgent
      • setRepaintListener

        public void setRepaintListener​(RepaintListener listener)