Package net.sourceforge.jnlp.cache
Class DefaultDownloadIndicator
java.lang.Object
net.sourceforge.jnlp.cache.DefaultDownloadIndicator
- All Implemented Interfaces:
DownloadIndicator
Show the progress of downloads.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic JDialogcreateDownloadIndicatorWindow(boolean undecorated) voiddisposeListener(DownloadServiceListener listener) Remove a download service listener that was obtained by calling the getDownloadListener method from the shared download info window.intReturn a time in milliseconds to wait for a download to complete before obtaining a listener for the download.getListener(ApplicationInstance app, String downloadName, URL[] resources) Return a download service listener that displays the progress in a shared download info window.intReturn the desired time in milliseconds between updates.
-
Constructor Details
-
DefaultDownloadIndicator
public DefaultDownloadIndicator()
-
-
Method Details
-
getUpdateRate
public int getUpdateRate()Description copied from interface:DownloadIndicatorReturn 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:
getUpdateRatein interfaceDownloadIndicator- Returns:
- the update rate.
-
getInitialDelay
public int getInitialDelay()Description copied from interface:DownloadIndicatorReturn 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:
getInitialDelayin interfaceDownloadIndicator- 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:
getListenerin interfaceDownloadIndicator- Parameters:
app- the downloading application, or null if N/AdownloadName- name identifying the download to the userresources- initial urls to display (not required)- Returns:
- donload service listener attached to this app. instance
-
createDownloadIndicatorWindow
- Throws:
HeadlessException
-
disposeListener
Remove a download service listener that was obtained by calling the getDownloadListener method from the shared download info window.- Specified by:
disposeListenerin interfaceDownloadIndicator- Parameters:
listener- the listener that is no longer in use
-