|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ProgressListener
Monitor the progress of some lengthly operation. This interface makes no
assumption about the output device. It may be the standard output stream
(see ProgressPrinter implementation),
a window (ProgressWindow) or mails automatically
sent to some address (ProgressMailer).
Additionnaly, this interface provides support for non-fatal warning and
exception reports.
All ProgressListener implementations are multi-thread safe, even the
Swing implemention. ProgressListener can be invoked from
any thread, which never need to be the Swing's thread. This is usefull
for performing lenghtly operation in a background thread. Example:
Note: The lineProgressListener p = newProgressPrinter(); p.setDecription("Loading data"); p.start(); for (int j=0; j<1000; j++) { // ... some process... if ((j & 255) == 0) p.progress(j/10f); } p.complete();
if ((j & 255) == 0)
is used for reducing the amount of calls to progress(float) (only once every 256 steps).
This is not mandatory, but may speed up the process.
ProgressMonitor| Method Summary | |
|---|---|
void |
complete()
Indique que l'op�ration est termin�e. |
void |
dispose()
Lib�re les ressources utilis�es par cet objet. |
void |
exceptionOccurred(java.lang.Throwable exception)
Indique qu'une exception est survenue pendant le traitement de l'op�ration. |
java.lang.String |
getDescription()
Retourne le message d'�crivant l'op�ration en cours. |
void |
progress(float percent)
Indique l'�tat d'avancement de l'op�ration. |
void |
setDescription(java.lang.String description)
Sp�cifie un message qui d�crit l'op�ration en cours. |
void |
started()
Indique que l'op�ration a commenc�e. |
void |
warningOccurred(java.lang.String source,
java.lang.String margin,
java.lang.String warning)
Envoie un message d'avertissement. |
| Method Detail |
|---|
java.lang.String getDescription()
null.
void setDescription(java.lang.String description)
null signifie qu'on ne
souhaite plus afficher de description.
description - DOCUMENT ME!void started()
void progress(float percent)
percent - DOCUMENT ME!void complete()
void dispose()
void warningOccurred(java.lang.String source,
java.lang.String margin,
java.lang.String warning)
source - Cha�ne de caract�re d�crivant la source de
l'avertissement. Il s'agira par exemple du nom du fichier dans
lequel une anomalie a �t� d�tect�e. Peut �tre nul si
la source n'est pas connue.margin - Texte � placer dans la marge de l'avertissement
warning, ou null s'il n'y en a pas. Il
s'agira le plus souvent du num�ro de ligne o� s'est produite
l'erreur dans le fichier source.warning - Message d'avertissement � �crire.void exceptionOccurred(java.lang.Throwable exception)
exception - DOCUMENT ME!
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||