|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.asprise.util.ui.progress.ProgressDialog
Represents a modal (or non-modal) dialog displaying the progress.
Asprise Progress Monitor Dialog is an improved implementation of Sun's ProgressMonitor (javax.swing.ProgressMonitor). With all the features of Sun's ProgressMonitor, Asprise Progress Monitor Dialog offers the following additional features:
Sample code:
1. import com.asprise.util.ui.progress.ProgressDialog;
2.
3. public class DemoSimple {
4. public static void main(String[] args) throws InterruptedException {
5. final int range = 10;
6. ProgressDialog progressDialog = new ProgressDialog(null, "Progress");
7. progressDialog.beginTask("Number Counting", range, true);
8.
9. for(int i=0; i<range; i++) {
10. if(progressDialog.isCanceled()) {
11. System.out.println("CANCELED.");
12. break;
13. }
14.
15. System.out.println(i + " of " + range);
16. progressDialog.worked(1);
17. Thread.sleep(500);
18. }
19.
20. System.exit(0);
21. }
22. }
For more details, visit http://jack.asprise.net.
ProgressMonitor| Field Summary | |
boolean |
displayPercentageInProgressBar
Displays the percentage in the center of the progress bar. |
boolean |
displayTimeLeft
Displays the estimated remaining time. |
long |
millisToDecideToPopup
the amount of time to wait before deciding whether or not to popup a progress monitor. |
long |
millisToPopup
the amount of time it will take for the popup to appear. |
boolean |
modal
Whether this dialog should be modal. |
Dimension |
preferedSize
The preferened size for the dialog. |
boolean |
showAnimation
Displays file copy animation. |
Component |
topComponent
If desired, attach a component at the top of the dialog. |
| Fields inherited from interface com.asprise.util.ui.progress.TaskProgressMonitor |
INDETERMINATE |
| Constructor Summary | |
ProgressDialog()
Creates a default progress dialog. |
|
ProgressDialog(Component parentComponent)
Creates a progress dialog titled 'Progress'. |
|
ProgressDialog(Component parentComponent,
String title)
Creates a progress dialog. |
|
| Method Summary | |
void |
beginSubTask(String name,
int totalWork)
|
void |
beginTask(String name,
int totalWork,
boolean isCancelable)
|
static void |
execute(Runnable task,
Component parentComponent)
Executes the specified task in a separate thread with a progress dialog. |
void |
finished()
|
boolean |
isCanceled()
|
void |
setCanceled(boolean canceled)
|
void |
setSubTaskName(String name)
|
void |
setTaskName(String name)
|
void |
subFinished()
|
void |
subWorked(int worked)
|
void |
worked(int worked)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public long millisToDecideToPopup
public long millisToPopup
public boolean displayPercentageInProgressBar
public boolean displayTimeLeft
public boolean showAnimation
public Dimension preferedSize
public boolean modal
public Component topComponent
| Constructor Detail |
public ProgressDialog()
public ProgressDialog(Component parentComponent)
parentComponent - the component that this dialog is based on or null for console applications.
public ProgressDialog(Component parentComponent,
String title)
parentComponent - the component that this dialog is based on or null for console applications.title - the title of the dialog| Method Detail |
public static void execute(Runnable task,
Component parentComponent)
task - the task to be performedparentComponent - UI component based on or null for console applications
public void beginTask(String name,
int totalWork,
boolean isCancelable)
beginTask in interface com.asprise.util.ui.progress.TaskProgressMonitorpublic void worked(int worked)
worked in interface com.asprise.util.ui.progress.TaskProgressMonitorpublic void setTaskName(String name)
setTaskName in interface com.asprise.util.ui.progress.TaskProgressMonitorpublic void setCanceled(boolean canceled)
setCanceled in interface com.asprise.util.ui.progress.TaskProgressMonitorpublic boolean isCanceled()
isCanceled in interface com.asprise.util.ui.progress.TaskProgressMonitorpublic void finished()
finished in interface com.asprise.util.ui.progress.TaskProgressMonitor
public void beginSubTask(String name,
int totalWork)
beginSubTask in interface com.asprise.util.ui.progress.ProgressMonitorWithSubTaskpublic void subWorked(int worked)
subWorked in interface com.asprise.util.ui.progress.ProgressMonitorWithSubTaskpublic void setSubTaskName(String name)
setSubTaskName in interface com.asprise.util.ui.progress.ProgressMonitorWithSubTaskpublic void subFinished()
subFinished in interface com.asprise.util.ui.progress.ProgressMonitorWithSubTask
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||