Class DefaultDownloadIndicator

  • All Implemented Interfaces:
    DownloadIndicator

    public class DefaultDownloadIndicator
    extends java.lang.Object
    implements DownloadIndicator
    Show the progress of downloads.
    • Constructor Detail

      • DefaultDownloadIndicator

        public DefaultDownloadIndicator()
    • Method Detail

      • getUpdateRate

        public int getUpdateRate()
        Description copied from interface: DownloadIndicator
        Return the desired time in milliseconds between updates. Updates are not guarenteed to occur based on this value; for example, they may occur based on the download percent or some other factor.
        Specified by:
        getUpdateRate in interface DownloadIndicator
        Returns:
        the update rate.
      • getInitialDelay

        public int getInitialDelay()
        Description copied from interface: DownloadIndicator
        Return a time in milliseconds to wait for a download to complete before obtaining a listener for the download. This value can be used to skip lengthy operations, such as initializing a GUI, for downloads that complete quickly. The getListener method is not called if the download completes in less time than the returned delay.
        Specified by:
        getInitialDelay in interface DownloadIndicator
        Returns:
        the initial delay before obtaining a listener.
      • getListener

        public DownloadServiceListener getListener​(ApplicationInstance app,
                                                   java.lang.String downloadName,
                                                   java.net.URL[] resources)
        Return a download service listener that displays the progress in a shared download info window.
        Specified by:
        getListener in interface DownloadIndicator
        Parameters:
        app - the downloading application, or null if N/A
        downloadName - name identifying the download to the user
        resources - initial urls to display (not required)
        Returns:
        donload service listener attached to this app. instance
      • createDownloadIndicatorWindow

        public static javax.swing.JDialog createDownloadIndicatorWindow​(boolean undecorated)
                                                                 throws java.awt.HeadlessException
        Throws:
        java.awt.HeadlessException
      • disposeListener

        public void disposeListener​(DownloadServiceListener listener)
        Remove a download service listener that was obtained by calling the getDownloadListener method from the shared download info window.
        Specified by:
        disposeListener in interface DownloadIndicator
        Parameters:
        listener - the listener that is no longer in use