|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fuin.utils4swing.progress.FileCopyProgressMonitor
public final class FileCopyProgressMonitor
A class to monitor the progress of a copying a list of files using frame.
| Constructor Summary | |
|---|---|
FileCopyProgressMonitor(org.fuin.utils4j.Cancelable cancelable,
String title,
int fileMax)
Constructor with basic arguments. |
|
FileCopyProgressMonitor(org.fuin.utils4j.Cancelable cancelable,
String title,
String transferText,
String srcLabelText,
String destLabelText,
int fileMax)
Constructor with basic arguments. |
|
| Method Summary | |
|---|---|
void |
close()
Close the frame and free all resources. |
org.fuin.utils4j.Cancelable |
getCancelable()
The unit that gets notified when the user presses the "cancel" button - If null the "cancel" button is disabled. |
int |
getCurrentByte()
Returns the byte counter. |
int |
getCurrentFile()
Returns the file counter. |
String |
getDestLabelText()
Returns the text for the "destination" label. |
int |
getFileMax()
Return the total number of files to be copied. |
String |
getSrcLabelText()
Returns the text for the "source" label. |
String |
getTitle()
Returns the title for the panel and frame. |
String |
getTransferText()
Returns the text for the "file transfer" (Example: "Transferring file $N of $M..."). |
boolean |
isCanceled()
Returns if the monitor was canceled. |
static void |
main(String[] args)
Main method to test the monitor. |
void |
open()
Show the monitor dialog.If called outside the EDT this method will switch to the UI thread using SwingUtilities.invokeAndWait(Runnable). |
void |
updateByte(int n)
Updates the current byte number of the file transferred.If called outside the EDT this method will switch to the UI thread using SwingUtilities.invokeLater(Runnable). |
void |
updateFile(String sourceFile,
String destFile,
int currentFile,
int fileSize)
Starts a new file being transferred.If called outside the EDT this method will switch to the UI thread using SwingUtilities.invokeLater(Runnable). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileCopyProgressMonitor(org.fuin.utils4j.Cancelable cancelable,
String title,
int fileMax)
cancelable - Someone to notify if the user pressed the "cancel" button - If
null the "cancel" button will be disabled.title - Title for the panel and frame - If null a default
title will be used.fileMax - Number of files to be copied.
public FileCopyProgressMonitor(org.fuin.utils4j.Cancelable cancelable,
String title,
String transferText,
String srcLabelText,
String destLabelText,
int fileMax)
cancelable - Someone to notify if the user pressed the "cancel" button - If
null the "cancel" button will be disabled.title - Title for the panel and frame - If null a default
title will be used.transferText - Text for the "file transfer" (Example:
"Transferring file $N of $M..."). Can contain two possible
variables: $N = Current file number, $M = Max file count. ) -
If null a default text will be used.srcLabelText - Text for the "source" label -If null a default
text will be used.destLabelText - Text for the "destination" label -If null a
default text will be used.fileMax - Number of files to be copied.| Method Detail |
|---|
public final int getFileMax()
public final String getTransferText()
public final String getTitle()
public final org.fuin.utils4j.Cancelable getCancelable()
null the "cancel" button is disabled.
nullpublic final String getSrcLabelText()
public final String getDestLabelText()
public final int getCurrentByte()
public final int getCurrentFile()
public final void open()
SwingUtilities.invokeAndWait(Runnable).
public final void close()
SwingUtilities.invokeAndWait(Runnable).
public final void updateFile(String sourceFile,
String destFile,
int currentFile,
int fileSize)
SwingUtilities.invokeLater(Runnable).
updateFile in interface FileCopyProgressListenersourceFile - Name and path of the source file.destFile - Name and path of the destination file.currentFile - Number of the current file.fileSize - Size of the file.public final void updateByte(int n)
SwingUtilities.invokeLater(Runnable).
updateByte in interface FileCopyProgressListenern - Byte number.public final boolean isCanceled()
true else false.public static void main(String[] args)
args - Not used.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||