public class ProgressBarManager extends Object implements ActionListener
| Modifier and Type | Field and Description |
|---|---|
static int |
DELAY_FOR_UPDATE_OF_PROGRESS_BAR
The delay between to updates of the progress bar, in ms.
|
| Constructor and Description |
|---|
ProgressBarManager(UploadPolicy uploadPolicy,
FilePreparationThread filePreparationThread) |
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(ActionEvent arg0)
The only event managed here is the timer event.
|
void |
anotherFileHasBeenSent(UploadFilePacket uploadFilePacket,
UploadFileData uploadFileData)
Called when a new file is uploaded.
|
void |
clearBarContent()
Clean all bar content.
|
long |
getGlobalStartTime() |
long |
getNbUploadedBytes() |
long |
getUploadDuration() |
void |
nbBytesUploaded(long nbBytes,
UploadFileData uploadFileData)
The progressBar is updated each 50ms and each 10% of the target file.
|
void |
setErrorMessage(String errorTexte)
Set an error text, that will be displayed on the progress bar
|
void |
setUploadStatus(UploadFilePacket uploadFilePacket,
UploadFileData uploadFileData,
int uploadStatus) |
void |
uploadIsFinished()
This just stops the timer.
|
void |
uploadIsStarted() |
public static final int DELAY_FOR_UPDATE_OF_PROGRESS_BAR
public ProgressBarManager(UploadPolicy uploadPolicy, FilePreparationThread filePreparationThread)
uploadPolicy - filePreparationThread - public void actionPerformed(ActionEvent arg0)
actionPerformed in interface ActionListenerActionListener.actionPerformed(java.awt.event.ActionEvent)public void anotherFileHasBeenSent(UploadFilePacket uploadFilePacket, UploadFileData uploadFileData) throws JUploadException
uploadFilePacket - uploadFileData - JUploadExceptionFileUploadManagerThread.anotherFileHasBeenSent(wjhk.jupload2.upload.UploadFilePacket,
wjhk.jupload2.upload.UploadFileData)public void clearBarContent()
public long getGlobalStartTime()
public long getNbUploadedBytes()
public long getUploadDuration()
public void nbBytesUploaded(long nbBytes,
UploadFileData uploadFileData)
throws JUploadException
nbBytes - uploadFileData - JUploadExceptionFileUploadManagerThread.nbBytesUploaded(long, UploadFileData)public void setErrorMessage(String errorTexte)
errorTexte - public void setUploadStatus(UploadFilePacket uploadFilePacket, UploadFileData uploadFileData, int uploadStatus) throws JUploadException
uploadFilePacket - uploadFileData - uploadStatus - JUploadExceptionpublic void uploadIsFinished()
public void uploadIsStarted()
throws JUploadException
JUploadExceptionCopyright © 2015. All rights reserved.