public final class SwingProgressMonitor extends Object implements org.jdtaus.core.monitor.TaskListener
TaskListener
displaying progress using a Swing dialog.onTaskEvent(TaskEvent)
Constructor and Description |
---|
SwingProgressMonitor(Component parent)
Creates a new
SwingProgressMonitor instance taking the parent component to use when displaying progress. |
SwingProgressMonitor(Component parent,
int millisToDecideToPopup,
int millisToPopup)
Creates a new
SwingProgressMonitor instance taking the parent component to use when displaying progress
and configuration for how long to wait before showing the progress dialog. |
SwingProgressMonitor(Component parent,
int millisToDecideToPopup,
int millisToPopup,
int minimumTaskDurationMillis)
Creates a new
SwingProgressMonitor instance taking the parent component to use when displaying progress
and configuration for how long to wait before showing the progress dialog and for how long a task is displayed
minimally. |
SwingProgressMonitor(Component parent,
int millisToDecideToPopup,
int millisToPopup,
int minimumTaskDurationMillis,
int columns)
Creates a new
SwingProgressMonitor instance taking the parent component to use when displaying progress
and configuration for how long to wait before showing the progress dialog, for how long a task is displayed
minimally and a number of columns the preferred width of the progress dialog is computed with. |
Modifier and Type | Method and Description |
---|---|
protected void |
finalize()
Finalizes the instance by canceling timers.
|
int |
getColumns()
Gets the number of columns the preferred width of a progress pane is computed with.
|
int |
getMillisToDecideToPopup()
Gets the number of milliseconds to pass before all currently running tasks are checked for theire duration.
|
int |
getMillisToPopup()
Gets the number of milliseconds visibility of the dialog is delayed.
|
int |
getMinimumTaskDuration()
Gets the minimum number of milliseconds to pass before a visible task is set invisible.
|
Component |
getParent()
Gets the parent component for any progress displays.
|
void |
onTaskEvent(org.jdtaus.core.monitor.TaskEvent event)
This method controls a dialog displaying a panel for each task showing the progress of that task optionally
providing a cancel button if the corresponding task is cancelable.
|
void |
setParent(Component parent)
Sets the parent component to be used by any progress displays.
|
public SwingProgressMonitor(Component parent)
SwingProgressMonitor
instance taking the parent component to use when displaying progress.parent
- The parent component to use when displaying progress.NullPointerException
- if parent
is null
.HeadlessException
- if this class is used in an environment not providing a keyboard, display, or mouse.onTaskEvent(TaskEvent)
public SwingProgressMonitor(Component parent, int millisToDecideToPopup, int millisToPopup)
SwingProgressMonitor
instance taking the parent component to use when displaying progress
and configuration for how long to wait before showing the progress dialog.parent
- The parent component to use when displaying progress.millisToDecideToPopup
- The number of milliseconds which have to pass before the duration of any currently
running task is computed.millisToPopup
- The number of milliseconds at least one task has to run before the progress dialog shows up.NullPointerException
- if parent
is null
.HeadlessException
- if this class is used in an environment not providing a keyboard, display, or mouse.onTaskEvent(TaskEvent)
public SwingProgressMonitor(Component parent, int millisToDecideToPopup, int millisToPopup, int minimumTaskDurationMillis)
SwingProgressMonitor
instance taking the parent component to use when displaying progress
and configuration for how long to wait before showing the progress dialog and for how long a task is displayed
minimally.parent
- The parent component to use when displaying progress.millisToDecideToPopup
- The number of milliseconds which have to pass before the duration of any currently
running task is computed.millisToPopup
- The number of milliseconds at least one task has to run before the progress dialog shows up.minimumTaskDurationMillis
- The number of milliseconds a task is held visible, if a task is ended right
after having been shown.NullPointerException
- if parent
is null
.HeadlessException
- if this class is used in an environment not providing a keyboard, display, or mouse.onTaskEvent(TaskEvent)
public SwingProgressMonitor(Component parent, int millisToDecideToPopup, int millisToPopup, int minimumTaskDurationMillis, int columns)
SwingProgressMonitor
instance taking the parent component to use when displaying progress
and configuration for how long to wait before showing the progress dialog, for how long a task is displayed
minimally and a number of columns the preferred width of the progress dialog is computed with.parent
- The parent component to use when displaying progress.millisToDecideToPopup
- The number of milliseconds which have to pass before the duration of any currently
running task is computed.millisToPopup
- The number of milliseconds at least one task has to run before the progress dialog shows up.minimumTaskDurationMillis
- The number of milliseconds a task is held visible, if a task is ended right
after having been shown.columns
- The number of columns the preferred width of the progress dialog is computed with.NullPointerException
- if parent
is null
.HeadlessException
- if this class is used in an environment not providing a keyboard, display, or mouse.onTaskEvent(TaskEvent)
public void onTaskEvent(org.jdtaus.core.monitor.TaskEvent event)
This method controls a dialog displaying a panel for each task showing the progress of that task optionally
providing a cancel button if the corresponding task is cancelable. The dialog will show up only if the operation
performed by at least one task is believed to run longer than specified by property millisToPopup
.
Property millisToDecideToPopup
controls the number of milliseconds to pass before all currently running
tasks are checked for their duration. Properties millisToDecideToPopup
and millisToPopup
are
used in the same way as specified for Swing's ProgressMonitor
. The default for property
millisToDecideToPopup
is 500ms and the default for property millisToPopup
is 2000ms.
onTaskEvent
in interface org.jdtaus.core.monitor.TaskListener
event
- The event send by a Task
.public Component getParent()
public void setParent(Component parent)
parent
- The parent component to be used by any progress displays.NullPointerException
- if parent
is null
.public int getMillisToPopup()
public int getMillisToDecideToPopup()
public int getMinimumTaskDuration()
public int getColumns()
Copyright © 2005-2012 jDTAUS. All Rights Reserved.