public class Progress_Monitor
extends java.lang.Object
Current(String, int)
method to update the status of the task.
The monitor will then fire a change event which will cause any Progress_Monitor
dialogs listening to the monitor to update themselves to reflect the updated
status of the running task.
This class is based on some GPL code written by Santhosh Kumar T. The original code can be found at http://jroller.com/santhosh/entry/show_progress_in_modal_dialog.
Progress_Dialog
,
Progress_Utility
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MILLISECONDS_TO_WAIT
The default wait time before firing the first progress event.
|
static java.lang.String |
DEFAULT_MONITOR_NAME
The default monitor name;
|
static java.lang.String |
ID
Class Identifier
|
Constructor and Description |
---|
Progress_Monitor(int total,
boolean indeterminate)
Create a new Progress_Monitor given the total progress and indeterminate
progress status, with a default wait time of 500 milliseconds.
|
Progress_Monitor(int total,
boolean indeterminate,
int milliSecondsToWait,
java.lang.String name)
Create a new Progress_Monitor given the total progress, indeterminate
progress status, and the time to wait before
|
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(javax.swing.event.ChangeListener listener)
Add an object that will listen to the monitor for status updates.
|
int |
Current()
Get the current progress value.
|
void |
Current(java.lang.String status,
int current)
This method should be called from within the task being monitored to
indicate the progress of the task.
|
boolean |
Indeterminate() |
int |
Milliseconds_To_Wait()
Return the number of milliseconds the monitor will wait before firing the
first change event that will cause a monitor dialog to be shown.
|
java.lang.String |
Name()
Get the name of the monitor.
|
void |
Name(java.lang.String name)
Set the name of the monitor.
|
void |
removeChangeListener(javax.swing.event.ChangeListener listener)
Remove an object from listening to the monitor
|
void |
Start(java.lang.String status)
Begin monitoring the task.
|
java.lang.String |
Status()
A status string indicating giving information about the task being monitored.
|
void |
Status(java.lang.String status) |
int |
Total()
Get the total size of the task.
|
public static final java.lang.String ID
public static final int DEFAULT_MILLISECONDS_TO_WAIT
public static final java.lang.String DEFAULT_MONITOR_NAME
public Progress_Monitor(int total, boolean indeterminate, int milliSecondsToWait, java.lang.String name)
total
- An integer specifying the total scale of progressindeterminate
- A boolean specify if the amount of progress is indeterminatemilliSecondsToWait
- The time to wait before firing the first change event.name
- An identifier for this dialog. The Progress_Dialog may use this
name to identify the task being monitored.public Progress_Monitor(int total, boolean indeterminate)
total
- indeterminate
- public void Name(java.lang.String name)
name
- public java.lang.String Name()
public int Total()
public void Start(java.lang.String status)
status
- A String containing the initial status of the task being
monitored.public int Milliseconds_To_Wait()
public int Current()
public java.lang.String Status()
public void Status(java.lang.String status)
public boolean Indeterminate()
public void Current(java.lang.String status, int current)
status
- A string indicating the status of the taskcurrent
- An integer indicating the progress of the task.public void addChangeListener(javax.swing.event.ChangeListener listener)
listener
- the object that will listen to the monitor for changespublic void removeChangeListener(javax.swing.event.ChangeListener listener)
listener
- Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona