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 JDialog
createDownloadIndicatorWindow
(boolean undecorated) void
disposeListener
(DownloadServiceListener listener) Remove a download service listener that was obtained by calling the getDownloadListener method from the shared download info window.int
Return 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.int
Return the desired time in milliseconds between updates.
-
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 interfaceDownloadIndicator
- 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 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:
getListener
in 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:
disposeListener
in interfaceDownloadIndicator
- Parameters:
listener
- the listener that is no longer in use
-