Class DefaultDownloadIndicator

java.lang.Object
net.sourceforge.jnlp.cache.DefaultDownloadIndicator
All Implemented Interfaces:
DownloadIndicator

public class DefaultDownloadIndicator extends Object implements DownloadIndicator
Show the progress of downloads.
  • Constructor Details

    • DefaultDownloadIndicator

      public DefaultDownloadIndicator()
  • Method Details

    • 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, String downloadName, 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 JDialog createDownloadIndicatorWindow(boolean undecorated) throws HeadlessException
      Throws:
      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