Package net.sourceforge.jnlp.cache
Class DefaultDownloadIndicator
- java.lang.Object
-
- net.sourceforge.jnlp.cache.DefaultDownloadIndicator
-
- All Implemented Interfaces:
DownloadIndicator
public class DefaultDownloadIndicator extends java.lang.Object implements DownloadIndicator
Show the progress of downloads.
-
-
Constructor Summary
Constructors Constructor Description DefaultDownloadIndicator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static javax.swing.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
getInitialDelay()
Return a time in milliseconds to wait for a download to complete before obtaining a listener for the download.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.int
getUpdateRate()
Return the desired time in milliseconds between updates.
-
-
-
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 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, 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 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
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 interfaceDownloadIndicator
- Parameters:
listener
- the listener that is no longer in use
-
-