|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.swinglib.components.ProgressMonitor
public class ProgressMonitor
Creates and manages a standardized progress dialog. Any of the public methods on this class (including the constructor) may be executed from any thread; the actual operations are queued for the event thread.
The dialog is displayed by calling show()
, hidden by calling
hide()
. It is not actually created until the first call to
show()
; the constructor merely records information. Nor
is it disposed by calling hide()
; you must explicitly call
dispose()
.
Nested Class Summary | |
---|---|
static class |
ProgressMonitor.Options
Options to control the dialog's appearance. |
Constructor Summary | |
---|---|
ProgressMonitor(JFrame owner,
String title,
String text,
Action action,
ProgressMonitor.Options... options)
Base constructor, allowing customization of the dialog's appearance and behavior. |
|
ProgressMonitor(JFrame owner,
String title,
String text,
ProgressMonitor.Options... options)
Convenience constructor for a dialog that does not have an action button. |
Method Summary | |
---|---|
void |
clearProgress()
Switches the dialog to indeterminate mode. |
void |
dispose()
Disposes the dialog, allowing the JVM to reclaim all resources. |
void |
hide()
Hides the dialog, but does not dispose it; also resets progress data. |
void |
setProgress(int min,
int current,
int max)
Sets the dialog's progress indicator to the given values. |
void |
setStatus(String message)
Sets the status text, if the dialog was constructed with that option. |
ProgressMonitor |
show()
Displays the dialog, constructing it if necessary. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ProgressMonitor(JFrame owner, String title, String text, Action action, ProgressMonitor.Options... options)
show()
.
owner
- The dialog owner; may be null
, in which
case Swing will generate a hidden owner frame.title
- Text to display in the dialog window's title area; may
be null
, in which case the title is left
empty.text
- Text to display in the body of the dialog; usually
gives an overall description of what's happening. May
be null
.action
- If not null
, the dialog will display a
single button that invokes this action (normally used
for a cancel button).options
- Zero or more options controlling the dialog's appearance
and behavior.public ProgressMonitor(JFrame owner, String title, String text, ProgressMonitor.Options... options)
owner
- The dialog owner; may be null
, in which
case Swing will generate a hidden owner frame.title
- Text to display in the dialog window's title area; may
be null
, in which case the title is left
empty.text
- Text to display in the body of the dialog; usually
gives an overall description of what's happening. May
be null
.options
- Zero or more options controlling the dialog's appearance
and behavior.Method Detail |
---|
public ProgressMonitor show()
setProgress(int, int, int)
was called
prior to this method.
public void hide()
public void dispose()
show()
will have to reconstruct it.
public void setProgress(int min, int current, int max)
min
- The minimum progress value.current
- The current progress value; this sets the position
of the dialog's indicator.max
- The maximum progress value.public void setStatus(String message)
public void clearProgress()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |