01: /*
02: * %W% %E%
03: *
04: * Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
05: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License version
09: * 2 only, as published by the Free Software Foundation.
10: *
11: * This program is distributed in the hope that it will be useful, but
12: * WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * General Public License version 2 for more details (a copy is
15: * included at /legal/license.txt).
16: *
17: * You should have received a copy of the GNU General Public License
18: * version 2 along with this work; if not, write to the Free Software
19: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA
21: *
22: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
23: * Clara, CA 95054 or visit www.sun.com if you need additional
24: * information or have any questions.
25: */
26: package com.sun.jump.module.download;
27:
28: /**
29: * <code>JUMPDownloadProgressListener</code> allows a component to observe
30: * the download progress. The interface is typically implemented by UI
31: * elements (like a progress bar/gauge) to show the state of the download
32: * progress.
33: */
34: public interface JUMPDownloadProgressListener {
35: /**
36: * Called before the downloading of data is about to start.
37: */
38: public void downloadStarted();
39:
40: /**
41: * Called after the download has been cancelled. The cancellation could
42: * be driven by the user or by the system. If this method is called then
43: * <code>downloadCompleted()</code> will not be invoked.
44: */
45: public void downloadCancelled();
46:
47: /**
48: * Called to indicate that the download has been complete. This indicates
49: * that there was no error in the download process.
50: */
51: public void downloadCompleted();
52:
53: /**
54: * Called as the data gets downloaded. The frequency of the call depends
55: * on the <i>updatePercent</i> argument passed during the registration
56: * of the listener.
57: *
58: * @param percent the percentage of the data that has been downloaded
59: * from the start of the download process. It starts from 0 and
60: * and goes upto 100 typically.
61: */
62: public void dataDownloaded(int percent);
63: }
|