|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.client.databrowser.DBProgressView
Displays the progress of a task.
Observes the DBProgressModel
and displays information about the status of a task. Works for both tasks of indeterminate length and known length. Note that it sets the WAIT cursor for itself and its parent and catches any ActionEvent
to prevent user interaction with the GUI while the task is running, so do not use if it is a background task and you want to allow the user to access the GUI.
DBProgressModel
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE Copyright statement |
private static java.awt.Cursor |
DEFAULT_CURSOR |
private static int |
HEIGHT |
private static boolean |
MODAL |
private static java.awt.event.MouseAdapter |
MOUSEADAPTER |
private javax.swing.JRootPane |
mParentRootPane |
private javax.swing.JProgressBar |
mProgressBar |
private javax.swing.JDialog |
mProgressDialog |
private DBProgressModel |
mProgressModel |
private javax.swing.JLabel |
mSubtaskname |
private javax.swing.JLabel |
mTaskname |
private static java.lang.String |
TITLE |
private static java.awt.Cursor |
WAIT_CURSOR |
private static int |
WIDTH |
Constructor Summary | |
DBProgressView(javax.swing.JDialog parent, java.util.Observable observable) Shows a dialog displaying progress when triggered by DBProgressModel . |
|
DBProgressView(javax.swing.JFrame parent, java.util.Observable observable) Shows a dialog displaying progress when triggered by DBProgressModel . |
Method Summary | |
private void |
finish() Task is finished so reset values and close the dialog |
private void |
initialise(java.util.Observable observable) Initialise the GUI variables and components. |
private void |
setProgress(java.lang.String message) Update the progress dialog with the latest progress |
private void |
start() Display the progress dialog |
static void |
startWaitCursor(javax.swing.JComponent component) Sets the cursor to WAIT_CURSOR and absorbs the mouse clicks for the component |
static void |
stopWaitCursor(javax.swing.JComponent component) Sets the cursor to DEFAULT_CURSOR and returns mouse click handling to normal |
void |
update(java.util.Observable observable, java.lang.Object updatedObject) |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String COPYRIGHT_NOTICE
private static final int WIDTH
private static final int HEIGHT
private static final java.lang.String TITLE
private static final boolean MODAL
private static final java.awt.event.MouseAdapter MOUSEADAPTER
private static final java.awt.Cursor WAIT_CURSOR
private static final java.awt.Cursor DEFAULT_CURSOR
private javax.swing.JRootPane mParentRootPane
private javax.swing.JDialog mProgressDialog
private DBProgressModel mProgressModel
private javax.swing.JLabel mTaskname
private javax.swing.JLabel mSubtaskname
private javax.swing.JProgressBar mProgressBar
Constructor Detail |
public DBProgressView(javax.swing.JFrame parent, java.util.Observable observable)
DBProgressModel
. Will set the WAIT_CURSOR for its parent JFrame and itself while the task is running.
parent
- The parent of this dialogobservable
- The observable passing on info on the tasks progress (usually DBProgressModel
)public DBProgressView(javax.swing.JDialog parent, java.util.Observable observable)
DBProgressModel
. Will set the WAIT_CURSOR for its parent JDialog and itself while the task is running.
parent
- The parent of this dialogobservable
- The observable passing on info on the task's progress (usually DBProgressModel
)Method Detail |
private void initialise(java.util.Observable observable)
public void update(java.util.Observable observable, java.lang.Object updatedObject)
update
in interface java.util.Observer
private void start()
private void setProgress(java.lang.String message)
message
- The subtask informationprivate void finish()
public static void startWaitCursor(javax.swing.JComponent component)
component
- The component for whom the cursor will be changedpublic static void stopWaitCursor(javax.swing.JComponent component)
component
- The component for whom the cursor will be changed
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |